For a Cortex-M7 processor, what is the behavior of the processor if there is no debugger attached and the HardFault handler looks like:
and a BusFault handler looks like:
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 onpage 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.
For me the question is: Why do you let your system run into lock-up? Or potential lock-up. If reset is ok, why not reset the system in the hard fault handler?
I totally agree. I am trying to show some others in my organization that performing a system reset in the hard fault handler SHOULD be done ;)
View all questions in Cortex-M / M-Profile forum