flash: EFM32 flash implementation
[openocd.git] / tcl / target / efm32_stlink.cfg
blob9ef4845a6067c0ca685480f6d7b4d7e2f117d319
2 # efm32 stlink pseudo target
5 if { [info exists CHIPNAME] } {
6    set _CHIPNAME $CHIPNAME
7 } else {
8    set _CHIPNAME efm32
11 # Work-area is a space in RAM used for flash programming
12 # By default use 16kB
13 if { [info exists WORKAREASIZE] } {
14    set _WORKAREASIZE $WORKAREASIZE
15 } else {
16    set _WORKAREASIZE 0x4000
19 if { [info exists CPUTAPID] } {
20    set _CPUTAPID $CPUTAPID
21 } else {
22    set _CPUTAPID 0x2ba01477
25 # EFM32 MCUs only support SW interface
26 set _TRANSPORT hla_swd
28 transport select $_TRANSPORT
30 hla newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
32 set _TARGETNAME $_CHIPNAME.cpu
33 target create $_TARGETNAME hla_target -chain-position $_TARGETNAME
35 $_TARGETNAME configure -work-area-phys 0x10000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
37 set _FLASHNAME $_CHIPNAME.flash
38 flash bank $_FLASHNAME efm32 0 0 0 0 $_TARGETNAME