c29adbdd632c18fef594db04c5891b6e04a3db19
[fw/openocd] / tcl / target / nrf52.cfg
1 #
2 # Nordic nRF52 series: ARM Cortex-M4 @ 64 MHz
3 #
4
5 source [find target/swj-dp.tcl]
6
7 if { [info exists CHIPNAME] } {
8         set _CHIPNAME $CHIPNAME
9 } else {
10         set _CHIPNAME nrf52
11 }
12
13 # Work-area is a space in RAM used for flash programming
14 # By default use 16kB
15 if { [info exists WORKAREASIZE] } {
16    set _WORKAREASIZE $WORKAREASIZE
17 } else {
18    set _WORKAREASIZE 0x4000
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 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
29
30 set _TARGETNAME $_CHIPNAME.cpu
31 target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
32
33 adapter_khz 1000
34
35 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
36
37 if { ![using_hla] } {
38         cortex_m reset_config sysresetreq
39 }
40
41 flash bank $_CHIPNAME.flash nrf5 0x00000000 0 1 1 $_TARGETNAME
42 flash bank $_CHIPNAME.uicr nrf5 0x10001000 0 1 1 $_TARGETNAME