]> git.gag.com Git - fw/stlink/blob - stm32f4lv.s
f60ee8797d5a326719580fa93d5d3c8a543ed151
[fw/stlink] / stm32f4lv.s
1 .global start
2 .syntax unified
3
4 @ r0 = source
5 @ r1 = target
6 @ r2 = wordcount
7 @ r3 = flash_base
8 @ r4 = temp
9
10 start:
11     lsls    r2, r2, #2
12     ldr     r3, flash_base
13 next:
14     cbz     r2, done
15     ldrb    r4, [r0]
16     strb    r4, [r1]
17
18 wait:
19     ldrh    r4, [r3, #0x0e]
20     tst.w   r4, #1
21     bne     wait
22
23     add     r0, #1
24     add     r1, #1
25     sub     r2, #1
26     b       next
27 done:
28     bkpt
29
30 .align 2
31
32 flash_base:
33         .word 0x40023c00