Exceptions
ARM DDI 0337G
Copyright © 2005-2008 ARM Limited. All rights reserved.
5-27
Unrestricted Access
Non-Confidential
5.12
Abort model
Four events can generate a fault:
•
An instruction fetch or vector table load bus error.
•
A data access bus error.
•
Internally-detected error such as an undefined instruction or an attempt to change
state with a BX instruction. Fault status registers in the NVIC indicate the causes
of the faults.
•
MPU fault because of privilege violation or unmanaged region.
There are two kinds of fault handler:
•
the fixed-priority Hard Fault
•
the settable-priority local faults.
5.12.1
Hard Fault
Only Reset and NMI can pre-empt the fixed priority Hard Fault. A Hard Fault can
pre-empt any other exception other than Reset NMI or another Hard Fault.
Note
Code that uses FAULTMASK acts as a Hard Fault and so follows the same rules as a
Hard Fault.
Secondary bus faults do not escalate because a pre-empting fault of the same type
cannot pre-empt itself. This means that if a corrupted stack causes a fault, the fault
handler still executes even though the stack pushes for the handler failed. The fault
handler can operate, but the stack contents are corrupted.
5.12.2
Local faults and escalation
Local faults are categorized according to their cause. See Table 5-10 on page 5-28.
When enabled, local fault handlers process all normal faults. However, a local fault
escalates to a Hard Fault when:
•
A local fault handler causes the same kind of fault as the one it is servicing.
•
A local fault handler causes a fault with the same or higher priority.
•
An exception handler causes a fault with the same or higher priority.
•
The local fault is not enabled.