AnsweredAssumed Answered

[k20d50m]: secured device needs unlocked

Question asked by Hui Shao on Dec 9, 2014
Latest reply on Dec 10, 2014 by Hui Shao



Secured MCUs can't be JTAG'd anymore.


My debugging environment:

IAR 7.20 and I-jet debugger


Two MCUs got secured by different ways accidentally. For first one, when I tried to erased partitioned EEPROM using "Erase All Blocks Command (0x44)" from my firmware code, the device is secured and I can't JTAG it anymore. For second one, when I followed application notes AN4695.pdf and changed my linker file, the device got secured eventually after a few times of successful downloading.


What I did:

I followed, but don't know how to change FSEC to 0xFE without JTAG access.

I tried Kinetis_unlock_swd.bat that is part of IAR, but got:

C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\bin\jet\bin>Kinetis_unlock_swd.bat

C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\bin\jet\bin>SigFlashCmd.exe -cpu M3SWD -nocpu -flash Kinet
SigFlashCmd Version 1.24 (C) Signum Systems Corp. 2006-2014
SigFlashCmd.exe -cpu M3SWD -nocpu -flash Kinetis,massErase
Starting ...
OK - Connected to the emulator ...
OK - Emulation configured using C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\bin\jet\bin\M3SWD.par file
OK - Connected to the CPU ...

ERROR: Cannot get initial CPU status: Unsupported SCS CPUID 0x20202020.

ERROR: Cannot get initial CPU status: Unsupported SCS CPUID 0x20202020.
The device is secure. Debug access to the system is locked.
The device can be unlocked by mass erase.
Waiting for mass erase to finish ...
Mass erase finished.
Mass Erase operation was successful
OK - Flash programming finished ...
OK - Exiting ...
OK - Done


I also tried Project->Download->Erase memory for IAR GUI, it doesn't help at all.


Seems like the threads in community are suggesting to use J-Link. Is there a solution with I-jet to revive the secured MCUs?