Hello,
using a MK22, I face situations where the device is secured while it still can be mass-erased.
I have to recover through SWD commands, the boards used don't provide access to reset pin (which is connected to a pull-up).
I know it is possible to recover this situation:
So I would like to achieve this in a deterministic ways.
Using the procedure of AN4835, I endup most of the time with
What additional steps are required ?
As pointed out by other users, the procedure described in AN4835 states
It is important to ensure that the processor doesn't receive a new reset or execute any code that could interfere with the operation of the mass erase command while the mass erase is in progress. To avoid this, keep the processor in reset by keeping RESET asserted or keeping the System Reset Request set during the mass erase.
But, according to the Ref Manual of my chip, System Reset Request bit of MDM-AP Control Register is unavailable in secure mode.
So what extra steps are required for this procedure ?
Hi guylejeune
This is not possible to do, if SWD have not access to the reset pin, it cannot get hold the device, Jlink and PEmicro tools both have access to the reset pin, that why in that post and with PEMicro can do the mass erase. In the AN4358 application note they mentioned that you nee to keep the processor in reset, this has to be done with the pin or with the System Reset Request (when it is not secured). It works for you sometimes because the target is constantly resetting if you have not code to execute, so, sometimes you catch your devices in reset state.
For further information please check the following links:
How (not) to Secure my Microcontroller | MCU on Eclipse
Communication error while accessing MDM-AP
Hope this information helps you
Have a great day,
Jorge Alcala
Ok, I understand why it gave me the false impression it was possible.
Thanks for the information !