summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSpencer Oliver <ntfreak@users.sourceforge.net>2010-12-22 17:18:14 +0000
committerSpencer Oliver <ntfreak@users.sourceforge.net>2010-12-23 12:11:13 +0000
commit83e5aaf577ef86c767f22044e1a8dcc4d136597f (patch)
tree12c1a1a8b1c3ac28c4c1161a1a197feedb30f4bd /contrib
parent921f40f62a76426294ad2841a8b5da8b919bf10f (diff)
downloadopenocd+libswd-83e5aaf577ef86c767f22044e1a8dcc4d136597f.tar.gz
openocd+libswd-83e5aaf577ef86c767f22044e1a8dcc4d136597f.tar.bz2
openocd+libswd-83e5aaf577ef86c767f22044e1a8dcc4d136597f.tar.xz
openocd+libswd-83e5aaf577ef86c767f22044e1a8dcc4d136597f.zip
stm32: add dual flash bank support
This patch adds the initial dual flash bank support for devices such as the stm32xl family. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Diffstat (limited to 'contrib')
-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 */