-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing low-voltage flashing on STM32F7 parts. (#567)
* fixing low voltage flashing for STM32F7 * Refactoring duplicated code
- Loading branch information
Showing
3 changed files
with
138 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.global start | ||
.syntax unified | ||
|
||
@ r0 = source | ||
@ r1 = target | ||
@ r2 = wordcount | ||
@ r3 = flash_base | ||
@ r4 = temp | ||
|
||
start: | ||
ldr r3, flash_base | ||
next: | ||
cbz r2, done | ||
ldr r4, [r0] | ||
str r4, [r1] | ||
dsb sy | ||
|
||
wait: | ||
ldrh r4, [r3, #0x0e] | ||
tst.w r4, #1 | ||
bne wait | ||
|
||
add r0, #4 | ||
add r1, #4 | ||
sub r2, #1 | ||
b next | ||
done: | ||
bkpt | ||
|
||
.align 2 | ||
|
||
flash_base: | ||
.word 0x40023c00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.global start | ||
.syntax unified | ||
|
||
@ r0 = source | ||
@ r1 = target | ||
@ r2 = wordcount | ||
@ r3 = flash_base | ||
@ r4 = temp | ||
|
||
start: | ||
lsls r2, r2, #2 | ||
ldr r3, flash_base | ||
next: | ||
cbz r2, done | ||
ldrb r4, [r0] | ||
strb r4, [r1] | ||
dsb sy | ||
|
||
wait: | ||
ldrh r4, [r3, #0x0e] | ||
tst.w r4, #1 | ||
bne wait | ||
|
||
add r0, #1 | ||
add r1, #1 | ||
sub r2, #1 | ||
b next | ||
done: | ||
bkpt | ||
|
||
.align 2 | ||
|
||
flash_base: | ||
.word 0x40023c00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters