AnsweredAssumed Answered

Software reset causes system freeze but BKPT causes correct reset

Question asked by chris_f on Mar 26, 2015
Latest reply on Mar 27, 2015 by chris_f

I have some diagnostic code that writes flash when a problem is detected then tries to reset the system on a K10 device.

 

If I do a SW reset with the following, the system hangs:

unsigned int i;

asm(" CPSID i"); //DisableInterrupts;

asm(" DSB ");

i = SCB_AIRCR;

i &= 0x0000ffff;

SCB_AIRCR = (i | 0x05FA0004);

asm(" DSB ");

asm (" NOP ");

while(1){};

 

If, instead, I use a BKPT 0xFF, the system resets fine (when not connected to a debugger of course).

 

I can use the BKPT approach for production code but would like to understand why the SW reset could cause the hang?

Outcomes