Allow transports to override the selected target (hla configs unification)
[fw/openocd] / tcl / target / efm32.cfg
1 #
2 # efm32 target
3 #
4
5 source [find target/swj-dp.tcl]
6
7 if { [info exists CHIPNAME] } {
8    set _CHIPNAME $CHIPNAME
9 } else {
10    set _CHIPNAME efm32
11 }
12
13 # Work-area is a space in RAM used for flash programming
14 # By default use 2kB
15 if { [info exists WORKAREASIZE] } {
16    set _WORKAREASIZE $WORKAREASIZE
17 } else {
18    set _WORKAREASIZE 0x800
19 }
20
21 if { [info exists CPUTAPID] } {
22    set _CPUTAPID $CPUTAPID
23 } else {
24    set _CPUTAPID 0x2ba01477
25 }
26
27 swj_newdap $_CHIPNAME cpu -expected-id $_CPUTAPID
28
29 adapter_khz 1000
30
31 set _TARGETNAME $_CHIPNAME.cpu
32 target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME
33
34 $_TARGETNAME configure -work-area-phys 0x10000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
35
36 set _FLASHNAME $_CHIPNAME.flash
37 flash bank $_FLASHNAME efm32 0 0 0 0 $_TARGETNAME
38
39 if {![using_hla]} {
40    # if srst is not fitted use SYSRESETREQ to
41    # perform a soft reset
42    cortex_m reset_config sysresetreq
43 }