Skip to content

Commit bc3c07b

Browse files
nattgrisborneoa
authored andcommitted
stm32f3x: Allow overriding the flash bank size
Same mechanism as in stm32f1x.cfg reused here. Change-Id: I81f02feb2b655e8259341b22180f3a8b82e28d05 Signed-off-by: Andreas Fritiofson <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/7438 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
1 parent 6e67f14 commit bc3c07b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tcl/target/stm32f3x.cfg

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ if { [info exists WORKAREASIZE] } {
2424
set _WORKAREASIZE 0x4000
2525
}
2626

27+
# Allow overriding the Flash bank size
28+
if { [info exists FLASH_SIZE] } {
29+
set _FLASH_SIZE $FLASH_SIZE
30+
} else {
31+
# autodetect size
32+
set _FLASH_SIZE 0
33+
}
34+
2735
# JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
2836
#
2937
# Since we may be running of an RC oscilator, we crank down the speed a
@@ -63,7 +71,7 @@ target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap
6371
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
6472

6573
set _FLASHNAME $_CHIPNAME.flash
66-
flash bank $_FLASHNAME stm32f1x 0 0 0 0 $_TARGETNAME
74+
flash bank $_FLASHNAME stm32f1x 0 $_FLASH_SIZE 0 0 $_TARGETNAME
6775

6876
reset_config srst_nogate
6977

0 commit comments

Comments
 (0)