Exception Model
69
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Cortex-M4F Processor
1.5.5 Exception Priorities
As
shows, all exceptions have an associated priority. A smaller number for the priority value
indicates a higher priority level. All exceptions have configurable priorities except Reset, Hard fault, and
NMI. If software does not configure any priorities, then all exceptions with a configurable priority have a
priority of 0. For information about configuring exception priorities, see the SHPR1 and IPRn registers.
NOTE:
Configurable priority values for the MSP432P4xx series implementation are in the range of 0
to 7.
This means that the Reset, Hard fault, and NMI exceptions, with fixed negative priority values, always
have higher priority than any other exception.
For example, assigning a priority value of 5 to IRQ[0] and a priority value of 4 to IRQ[1] means that IRQ[1]
has higher priority than IRQ[0]. If both IRQ[1] and IRQ[0] are asserted, IRQ[1] is processed before IRQ[0].
If multiple pending exceptions have the same priority, the pending exception with the lowest exception
number takes precedence. For example, if both IRQ[0] and IRQ[1] are pending and have the same
priority, then IRQ[0] is processed before IRQ[1].
When the processor is executing an exception handler, the exception handler is preempted if a higher
priority exception occurs. If an exception occurs with the same priority as the exception being handled, the
handler is not preempted, irrespective of the exception number. However, the status of the new interrupt
changes to pending.
1.5.6 Interrupt Priority Grouping
To increase priority control in systems with interrupts, the NVIC supports priority grouping. This grouping
divides each interrupt priority register entry into two fields:
•
An upper field that defines the group priority
•
A lower field that defines a subpriority within the group
Only the group priority determines preemption of interrupt exceptions. When the processor is executing an
interrupt exception handler, another interrupt with the same group priority as the interrupt being handled
does not preempt the handler.
If multiple pending interrupts have the same group priority, the subpriority field determines the order in
which they are processed. If multiple pending interrupts have the same group priority and subpriority, the
interrupt with the lowest IRQ number is processed first.
For information about splitting the interrupt priority fields into group priority and subpriority, see the
Application Interrupt and Reset Control (AIRCR) register.
1.5.7 Level and Pulse Interrupts
The processor supports both level and pulse interrupts. A level interrupt is held asserted until it is cleared
by the ISR accessing the device. A pulse interrupt is a variant of an edge model.
For level interrupts, if the signal is not deasserted before the return from the interrupt routine, the interrupt
again enters the pending state and re-activates. This is particularly useful for FIFO and buffer-based
devices because it ensures that they drain either by a single ISR or by repeated invocations, with no extra
work. This means that the device holds the signal in assert until the device is empty.
A pulse interrupt can be reasserted during the ISR so that the interrupt can be in the pending state and
active at the same time. If another pulse arrives while the interrupt is still pending, the interrupt remains
pending and the ISR runs only once.
Pulse interrupts are mostly used for external signals and for rate or repeat signals.