tcl/target/stm32f0x: Allow overriding the Flash bank size
Copy & paste from another stm32 target. Change-Id: I0f6cbcec974ce70c23c1850526354106caee1172 Signed-off-by: Dominik Peklo <dom.peklo@gmail.com> Reviewed-on: http://openocd.zylin.com/4575 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
This commit is contained in:
parent
c04a59286e
commit
1eeb547abc
|
@ -22,6 +22,14 @@ if { [info exists WORKAREASIZE] } {
|
||||||
set _WORKAREASIZE 0x1000
|
set _WORKAREASIZE 0x1000
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Allow overriding the Flash bank size
|
||||||
|
if { [info exists FLASH_SIZE] } {
|
||||||
|
set _FLASH_SIZE $FLASH_SIZE
|
||||||
|
} else {
|
||||||
|
# autodetect size
|
||||||
|
set _FLASH_SIZE 0
|
||||||
|
}
|
||||||
|
|
||||||
#jtag scan chain
|
#jtag scan chain
|
||||||
if { [info exists CPUTAPID] } {
|
if { [info exists CPUTAPID] } {
|
||||||
set _CPUTAPID $CPUTAPID
|
set _CPUTAPID $CPUTAPID
|
||||||
|
@ -41,7 +49,7 @@ $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE
|
||||||
|
|
||||||
# flash size will be probed
|
# flash size will be probed
|
||||||
set _FLASHNAME $_CHIPNAME.flash
|
set _FLASHNAME $_CHIPNAME.flash
|
||||||
flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME
|
flash bank $_FLASHNAME stm32f1x 0x08000000 $_FLASH_SIZE 0 0 $_TARGETNAME
|
||||||
|
|
||||||
# adapter speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
|
# adapter speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
|
||||||
adapter_khz 1000
|
adapter_khz 1000
|
||||||
|
|
Loading…
Reference in New Issue