2 # NXP (former Freescale) Kinetis KL series devices
3 # Also used for Cortex-M0+ equipped members of KVx and KE1xZ series
6 source [find target/swj-dp.tcl]
8 if { [info exists CHIPNAME] } {
9 set _CHIPNAME $CHIPNAME
14 # Work-area is a space in RAM used for flash programming
16 if { [info exists WORKAREASIZE] } {
17 set _WORKAREASIZE $WORKAREASIZE
19 set _WORKAREASIZE 0x1000
22 if { [info exists CPUTAPID] } {
23 set _CPUTAPID $CPUTAPID
25 set _CPUTAPID 0x0bc11477
28 swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
30 set _TARGETNAME $_CHIPNAME.cpu
31 target create $_TARGETNAME cortex_m -chain-position $_CHIPNAME.cpu
33 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
35 set _FLASHNAME $_CHIPNAME.pflash
36 flash bank $_FLASHNAME kinetis 0 0 0 0 $_TARGETNAME
39 # Table 5-1. Clock Summary of KL25 Sub-Family Reference Manual
40 # specifies up to 1MHz for VLPR mode.
43 reset_config srst_nogate
46 # Detect secured MCU or boot lock-up in RESET/WDOG loop
47 $_CHIPNAME.cpu configure -event examine-start {
48 kinetis mdm check_security
51 # if srst is not fitted use SYSRESETREQ to
52 # perform a soft reset
53 cortex_m reset_config sysresetreq
56 # Table 5-1. Clock Summary of KL25 Sub-Family Reference Manual
57 # specifies up to 24MHz for run mode; Table 17 of Sub-Family Data
58 # Sheet rev4 lists 25MHz as the maximum frequency.
59 # Uncoment only if VLPR mode is not used
60 #$_TARGETNAME configure -event reset-init {