Mass Erase through SWD without access to reset

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Mass Erase through SWD without access to reset

1,990 次查看
guylejeune
Contributor III

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:

  • Using the procedure from AN4835, it works from times to times (1x50) ;
  • using a PEMICRO programming device achieves it ;
  • This thread mentions it is possible, however without describing the steps to do so.

So I would like to achieve this in a deterministic ways. 

Using the procedure of AN4835, I endup most of the time with

  • CTRL [FMEIP] bit set indefinitely
  • STAT [FMEACK] is not acknowledge even though MEEN = 1

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 ?

标签 (1)
0 项奖励
回复
2 回复数

1,585 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

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

1,585 次查看
guylejeune
Contributor III

Ok, I understand why it gave me the false impression it was possible.

Thanks for the information !

0 项奖励
回复