2 # stm32 stlink pseudo target
5 if { [info exists CHIPNAME] } {
6 set _CHIPNAME $CHIPNAME
11 # Work-area is a space in RAM used for flash programming
12 # By default use 4kB (as found on some STM32F100s)
13 if { [info exists WORKAREASIZE] } {
14 set _WORKAREASIZE $WORKAREASIZE
16 set _WORKAREASIZE 0x1000
19 if { [info exists CPUTAPID] } {
20 set _CPUTAPID $CPUTAPID
22 # this is the SW-DP tap id not the jtag tap id
23 set _CPUTAPID 0x1ba01477
26 if { [info exists TRANSPORT] } {
27 set _TRANSPORT $TRANSPORT
28 if { $TRANSPORT == "hla_jtag" } {
29 if { [info exists CPUTAPID] == 0 } {
30 # jtag requires us to use the jtag tap id
31 set _CPUTAPID 0x3ba00477
35 set _TRANSPORT hla_swd
38 # add deprecated transport name check
39 if { $_TRANSPORT == "stlink_swd" } {
40 set _TRANSPORT "hla_swd"
41 echo "DEPRECATED! use 'hla_swd' transport not 'stlink_swd'"
44 if { $_TRANSPORT == "stlink_jtag" } {
45 set _TRANSPORT "hla_jtag"
46 echo "DEPRECATED! use 'hla_jtag' transport not 'stlink_jtag'"
48 # end deprecated checks
51 # possibles value are hla_swd or hla_jtag
53 transport select $_TRANSPORT
55 hla newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
57 set _TARGETNAME $_CHIPNAME.cpu
58 target create $_TARGETNAME hla_target -chain-position $_TARGETNAME
60 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0