3 if { [info exists CHIPNAME] } {
4 set _CHIPNAME $CHIPNAME
9 # Work-area is a space in RAM used for flash programming
11 if { [info exists WORKAREASIZE] } {
12 set _WORKAREASIZE $WORKAREASIZE
14 set _WORKAREASIZE 0x4000
17 if { [info exists CPUTAPID ] } {
18 set _CPUTAPID $CPUTAPID
20 set _CPUTAPID 0x1ba01477
23 transport select stlink_swd
25 stlink newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
27 set _TARGETNAME $_CHIPNAME.cpu
28 target create $_TARGETNAME stm32_stlink -chain-position $_TARGETNAME -rtos auto
30 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
32 # flash size will be probed
33 set _FLASHNAME $_CHIPNAME.flash
34 flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME