2015-11-17 04:59:15 -06:00
|
|
|
#
|
|
|
|
# Nordic nRF52 series: ARM Cortex-M4 @ 64 MHz
|
|
|
|
#
|
|
|
|
|
|
|
|
source [find target/swj-dp.tcl]
|
|
|
|
|
|
|
|
if { [info exists CHIPNAME] } {
|
|
|
|
set _CHIPNAME $CHIPNAME
|
|
|
|
} else {
|
|
|
|
set _CHIPNAME nrf52
|
|
|
|
}
|
|
|
|
|
2017-08-31 15:34:16 -05:00
|
|
|
# Work-area is a space in RAM used for flash programming
|
|
|
|
# By default use 16kB
|
|
|
|
if { [info exists WORKAREASIZE] } {
|
|
|
|
set _WORKAREASIZE $WORKAREASIZE
|
|
|
|
} else {
|
|
|
|
set _WORKAREASIZE 0x4000
|
|
|
|
}
|
|
|
|
|
2015-11-17 04:59:15 -06:00
|
|
|
if { [info exists CPUTAPID] } {
|
|
|
|
set _CPUTAPID $CPUTAPID
|
|
|
|
} else {
|
|
|
|
set _CPUTAPID 0x2ba01477
|
|
|
|
}
|
|
|
|
|
|
|
|
swj_newdap $_CHIPNAME cpu -expected-id $_CPUTAPID
|
2018-03-23 15:17:29 -05:00
|
|
|
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
|
2015-11-17 04:59:15 -06:00
|
|
|
|
|
|
|
set _TARGETNAME $_CHIPNAME.cpu
|
2018-03-23 15:17:29 -05:00
|
|
|
target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
|
2015-11-17 04:59:15 -06:00
|
|
|
|
2019-08-23 08:51:00 -05:00
|
|
|
adapter speed 1000
|
2017-08-31 15:34:16 -05:00
|
|
|
|
|
|
|
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
|
2015-11-17 04:59:15 -06:00
|
|
|
|
|
|
|
if { ![using_hla] } {
|
|
|
|
cortex_m reset_config sysresetreq
|
|
|
|
}
|
2017-08-31 15:34:16 -05:00
|
|
|
|
|
|
|
flash bank $_CHIPNAME.flash nrf5 0x00000000 0 1 1 $_TARGETNAME
|
|
|
|
flash bank $_CHIPNAME.uicr nrf5 0x10001000 0 1 1 $_TARGETNAME
|