What is the behavior for a "BKPT" instruction in a HardFault handler

For a Cortex-M7 processor, what is the behavior of the processor if there is no debugger attached and the HardFault handler looks like:

void HardFault_Handler(void)
{
    __asm("BKPT #0");
}

and a BusFault handler looks like:

void BusFault_Handler(void)
{
   __asm("BKPT #0");
}

and a BusFault occurs?

From the ARM®v7-M Architecture Reference Manual, it states in section C1.5 

"A HardFault exception. If both halting debug and the monitor are disabled, a breakpoint debug event escalates to a HardFault and the processor ignores the other debug events."

So it appears to me the BusFault handler will cause a HardFault because of the "BKPT" instruction.  Then in section C1.5, it states

"If a breakpoint occurs in an NMI or HardFault exception handler when halting debug is disabled, the system locks up with an unrecoverable error. For more information see Unrecoverable exception cases on
page B1-611. The breakpoint can be due to a BKPT instruction or generated by the FPB"

So it appears to me the HardFault handler will cause a system lockup.  

The question is that sometime we see a system lockup (infrequently) and most times we see a system reset?   This is with an NXP i.MX-RT106A processor.

Parents Reply Children
More questions in this forum