I'm using the following code to do a simple counter-based delay/wait for ARM:
.thumb_func
dowait:
ldr r7,=0x200000
dowaitloop:
sub r7,#1
bne dowaitloop
bx lr
I got this function from dwelch's blinker01 mbed_samples, which works fine in other led-blinking-type sample programs. However the program I'm currently working on needs to have .syntax unified
at the top because I'm using Thumb-2 instructions (e.g. ITTEE).
I suspect ".syntax unified" is the issue because I took the known-working blinker01 example and added .syntax unified
and it no longer worked when I uploaded to my board.
While I don't have all the gdb stuff figured out yet to prove it, the function seems to not be counting / delaying.
Is there a different way to re-write this "delay" function to work with unified / Thumb-2 syntax?