Greetings,,
what happens if FAULTMASK is set in cortex-m3/m4 and one or more serious fault happened like bus fault, MPU violation, invalid instruction, stack corruption.. etc will the processor enter a lockup? if not what would be the status of the processor? what will happen to the currently executed program/code.. since HardFault handler is not executed to remedy the issue.. if you can elaborate and give as much explanation and details as possible and if you can share some cases and examples it would be very appreciated..
Thank you..
Hello ghaflims,
I am very sorry for the incorrect information.
I have mistaken the word "lower priority" for the "low priority number".
This is the beginning of the all incorrect information.
You may forget all my answer but can I correct myself?
Because the priority of NMI and HardFaults are -2 and -1 respectively, the FAULTMASK can be set during execution in other than NMI or HardFault handler.
This means the FAULTMASK bit can be set at always normal execution.
the purpose of the FAULTMASK should be used to analyze the root cause of the HardFault (how?) (normally it's analysed through generic hard fault handler that dumps fault registers & stacked registers) (Niall Cooling did a great job)
As Joephi Yiu book says, the FAULTMASK can ignore MPU violations or Bus Fault.
However, I think that there would not be any advantages to ignore MPU violations and Bus Fault.
I think that the FAULTMASK bit would be used to prevent further HardFaults in MemMange, Bus Fault, or Usage Fault handler.
This means that it would be to analyze of the root cause not of HardFault but of MemMange, Bus Fault, or Usage Fault.
FAULTMASK bit can only be set in the NMI handler. (that is the confusing part)
I am sorry. It is incorrect.
FAULTMASK bit can be set in other than NMI or HardHault handler.
is the processor architecturally designed to ignore setting FAULTMASK while executing (HardFault/NMI)
It is not correct, either.
can privileged code in thread mode set FAULTMASK (although it's not recommended) or it can only be set in handler mode
If the execution priority number is greater than or equal to 0, in both the thread and handler mode, the FAULTMASK can be set.
Sorry and best regards,
Yasuhiko Koumoto.