| |||
| Home > Handling Processor Exceptions > ARMv6-M and ARMv7-M profiles > Types of exception | |||
Table 6.2 shows the different types of exceptions recognized by the microcontroller profiles. When an exception occurs simultaneously, they are handled in a fixed order of priority. Each exception is handled in turn before returning to the original application.
Table 6.2. Exception types in priority order
| Position | Exception | Priority | Disable | Description |
|---|---|---|---|---|
| 1 | Reset | -3 | No | |
| 2 | NMI | -2 | No | Non-Maskable Interrupt (NMI) |
| 3 | HardFault | -1 | No | All faults not covered by other exceptions |
| 4 | MemManage | configurable | Can be | Memory protection errors (ARMv7-M only) |
| 5 | BusFault | configurable | Can be | Other memory faults (ARMv7-M only) |
| 6 | UsageFault | configurable | Can be | Instruction execution faults other than memory faults (ARMv7-M only) |
| 7-10 | Reserved | - | - | |
| 11 | SVCall | configurable | Can be | Synchronous SVC call caused by execution of SVC instruction |
| 12 | Debug Monitor | configurable | Can be | Synchronous debug event (ARMv7-M only) |
| 13 | Reserved | - | - | |
| 14 | PendSV | configurable | Can be | Asynchronous SVC call |
| 15 | SysTick | configurable | Can be | System timer tick |
| 16 and above | External Interrupt | configurable | Can be | External interrupt |
Exceptions with a lower priority number have a higher priority status. For example, if a processor is in Handler mode, an exception is taken if it has a lower priority number than the exception currently being handled. Any exception with the same priority number or higher is pended.
When an exception handler terminates:
If there are no exceptions pending, the processor returns to Thread mode, and execution returns to the application program.
If there are any exceptions pending, execution passes to the handler of the pending exception with the lowest priority number. If there are two pending exceptions with the same lowest priority number, the exception with the lowest exception number is handled first.