diff options
Diffstat (limited to 'tcl')
-rw-r--r-- | tcl/target/kl25.cfg | 8 | ||||
-rw-r--r-- | tcl/target/kl25z_hla.cfg | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tcl/target/kl25.cfg b/tcl/target/kl25.cfg index c5dda15..2ed6b0f 100644 --- a/tcl/target/kl25.cfg +++ b/tcl/target/kl25.cfg @@ -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 diff --git a/tcl/target/kl25z_hla.cfg b/tcl/target/kl25z_hla.cfg index 218a28d..3e561f1 100644 --- a/tcl/target/kl25z_hla.cfg +++ b/tcl/target/kl25z_hla.cfg @@ -24,6 +24,14 @@ hla newtap $_CHIPNAME cpu -expected-id $_CPUTAPID set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME hla_target -chain-position $_TARGETNAME +# 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 flash bank pflash kinetis 0x00000000 0x20000 0 4 $_TARGETNAME |