summaryrefslogtreecommitdiff
path: root/contrib/loaders
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/loaders')
-rw-r--r--contrib/loaders/flash/stm32x.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/loaders/flash/stm32x.S b/contrib/loaders/flash/stm32x.S
index 7269e799..01494b86 100644
--- a/contrib/loaders/flash/stm32x.S
+++ b/contrib/loaders/flash/stm32x.S
@@ -29,8 +29,8 @@
r0 - source address
r1 - target address
r2 - count (halfword-16bit)
- r3 - result
- r4 - temp
+ r3 - sector offet in : result out
+ r4 - flash base
*/
#define STM32_FLASH_CR_OFFSET 0x10 /* offset of CR register in FLASH struct */
@@ -38,6 +38,7 @@
write:
ldr r4, STM32_FLASH_BASE
+ add r4, r3 /* add offset 0x00 for sector 0 : 0x40 for sector 1 */
write_half_word:
movs r3, #0x01
str r3, [r4, #STM32_FLASH_CR_OFFSET] /* PG (bit0) == 1 => flash programming enabled */