If a Cortex microcontroller is unresponsive to a debug connection for various reasons, then this trick might help to recover that device for you. All you need is a debug probe from PEMICRO and a utility.
Many NXP Kinetis and other ARM Cortex-M devices and microcontroller have the possibility to disable access to the device (see How (not) to Secure my Microcontroller). But it can happen as well that if you do not pay close attention to the flash protection security bits: you might lock you out from accessing the device. In addition to that it is possible to re-assign or disable the reset pin and functionality (see Using the Reset Button on the Freedom Board as User Button) or playing with the NMI pin (Disabling NMI (Non Maskable Interrupt) Pin). Even worse: you can disable or re-mux the debug pins (maybe because you did not know what you are doing, or you wanted preventing unauthorized access, or you just needed these pins for something).
This all can result in a device not responsive any more to a debug connection, because out of reset you basically have cut the bridges for the debugger to access the device.
So there is a good chance to reclaim access to the device using a debug probe and a utility from P&E:
- Attach the P&E debug probe to the debug header (SWD/JTAG connector)
- Got to https://www.pemicro.com and download the Kinetis Recovery Tool (you need to have a user login):
- Unpack the zip file and start the Kinetis_Recovery_Utility.exe
- Specify the debug probe attached and press START:
- The utility now constantly tries to halt the processor. Constantly power cycle the microcontroller.
- It might take several attempts, but luckily after a few the processor is halted:
- With with the processor halted I can do a start a debug session (e.g. program a ‘good’ binary or read out the memory 🙂 ).
You can run into the that ‘bricked’ situation easily if programming a wrong binary to the microcontroller or if you otherwise mess it up.
With that approach I have been able to recover and re-gain many microcontrollers which otherwise would be considered as ‘lost’ or ‘not accessible any more’.
I hope you find this article useful.
Happy glitching 🙂