From 09b40ca7bcb8e30df0cf374946327f858771f456 Mon Sep 17 00:00:00 2001 From: xp Date: Sat, 25 Apr 2020 20:37:26 +0800 Subject: [PATCH] update --- flashloaders/stm32f4lv.s | 24 ++++++++++++------------ flashloaders/stm32f7lv.o | Bin 0 -> 792 bytes flashloaders/stm32f7lv.s | 24 ++++++++++++------------ 3 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 flashloaders/stm32f7lv.o diff --git a/flashloaders/stm32f4lv.s b/flashloaders/stm32f4lv.s index 92f70fa..c338b98 100644 --- a/flashloaders/stm32f4lv.s +++ b/flashloaders/stm32f4lv.s @@ -7,19 +7,19 @@ mycopy: ldr r10, flash_off_sr add r10, r10, r12 -myloop: - # copy 1 byte each time and 4 times as one group - ldrb r3, [r0] - ldrb r4, [r0, #1] - ldrb r5, [r0, #2] - ldrb r6, [r0, #3] - strb r3, [r1] - strb r4, [r1, #1] - strb r5, [r1, #2] - strb r6, [r1, #3] + # original r2 indicates the count of 4 bytes need to copy, + # but we can only copy one byte each time. + # as we have no flash larger than 1GB, we do a little trick here. + ldr r3, =4 + mul r2, r2, r3 - add r0, r0, #4 - add r1, r1, #4 +myloop: + # copy 1 byte + ldrb r3, [r0] + strb r3, [r1] + + add r0, r0, #1 + add r1, r1, #1 # wait if FLASH_SR == 1 mywait: diff --git a/flashloaders/stm32f7lv.o b/flashloaders/stm32f7lv.o new file mode 100644 index 0000000000000000000000000000000000000000..f71d5e6366b415ff04a5340db3c4e011bef88b53 GIT binary patch literal 792 zcmah{y-EW?5dQWqQG-8;T56*P3_%ZtfPyI^sFfk$3&cHhA%TQDaw{g4kD$Gc_!t)I zBgD>5@BzeV6SQ$Acbi-aabV{AX7}5<*_*vQJU$XaK$}1YqYQWnl6Y<)$Y2VScJ542RLe&berkQfu3RXob3Cs3+vm#hbw~drkAnZ%L@4FE z7DCPt3;7Bm>&!4$A!^_~wsrC;^8a)jfyN^k7}w)jXw&r=qf@@7yi3mg@@%=k6nTPN cf0HOq>EIrd&~!b1Z&BS1ZH(SSa7RA!3p%Ax&;S4c literal 0 HcmV?d00001 diff --git a/flashloaders/stm32f7lv.s b/flashloaders/stm32f7lv.s index 013b56f..55c9add 100644 --- a/flashloaders/stm32f7lv.s +++ b/flashloaders/stm32f7lv.s @@ -7,19 +7,19 @@ mycopy: ldr r10, flash_off_sr add r10, r10, r12 -myloop: - # copy 1 byte each time and 4 times as one group - ldrb r3, [r0] - ldrb r4, [r0, #1] - ldrb r5, [r0, #2] - ldrb r6, [r0, #3] - strb r3, [r1] - strb r4, [r1, #1] - strb r5, [r1, #2] - strb r6, [r1, #3] + # original r2 indicates the count of 4 bytes need to copy, + # but we can only copy one byte each time. + # as we have no flash larger than 1GB, we do a little trick here. + ldr r3, =4 + mul r2, r2, r3 - add r0, r0, #4 - add r1, r1, #4 +myloop: + # copy 1 byte + ldrb r3, [r0] + strb r3, [r1] + + add r0, r0, #1 + add r1, r1, #1 # memory barrier dsb sy