]> git.gag.com Git - fw/openocd/blobdiff - tcl/target/kl25.cfg
kinetis: Revise CPU un-securing code
[fw/openocd] / tcl / target / kl25.cfg
index c5dda151512f4ad3b1fd92bae89964c491eb9ba6..2ed6b0f17b1957c3dab268f06d96c5adfa029d11 100644 (file)
@@ -38,6 +38,14 @@ swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
 set _TARGETNAME $_CHIPNAME.cpu
 target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_CHIPNAME.cpu
 
+# It is important that "kinetis mdm check_security" is called for
+# 'examine-end' event and not 'eximine-start'. Calling it in 'examine-start'
+# causes "kinetis mdm check_security" to fail the first time openocd
+# calls it when it tries to connect after the CPU has been power-cycled.
+$_CHIPNAME.cpu configure -event examine-end {
+       kinetis mdm check_security
+}
+
 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
 
 set _FLASHNAME $_CHIPNAME.flash