Memory
Register
Address A
A+1
lsbyte
msbyte
A+2
A+3
0
7
B0
B1
B3
B2
31
24 23
16 15
8 7
0
B0
B1
B2
B3
Exception Model
65
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Cortex-M4F Processor
Figure 1-4. Data Storage
1.5
Exception Model
The processor and the Nested Vectored Interrupt Controller (NVIC) prioritize and handle all exceptions.
When handling exceptions:
•
All exceptions are handled in Handler mode.
•
Processor state is automatically stored to the stack on an exception, and automatically restored from
the stack at the end of the Interrupt Service Routine (ISR).
•
The vector is fetched in parallel to the state saving, enabling efficient interrupt entry.
•
The processor supports tail-chaining that enables back-to-back interrupts without the overhead of state
saving and restoration.
Software can choose only to enable a subset of the configured number of interrupts, and can choose how
many bits of the configured priorities to use.
Internally, the highest user-programmable priority (0) is treated as fourth priority, after a Reset, Non-
Maskable Interrupt (NMI), and a Hard Fault, in that order. 0 is the default priority for all the programmable
priorities.
NOTE:
Vector table entries are compatible with interworking between Arm and Thumb instructions.
This causes bit [0] of the vector value to load into the Execution Program Status register
(EPSR) T-bit on exception entry. All populated vectors in the vector table entries must have
bit [0] set. Creating a table entry with bit [0] clear generates an INVSTATE fault on the first
instruction of the handler corresponding to this vector.
NOTE:
After a write to clear an interrupt source, it may take several processor cycles for the NVIC to
see the interrupt source deassert. Thus if the interrupt clear is done as the last action in an
interrupt handler, it is possible for the interrupt handler to complete while the NVIC sees the
interrupt as still asserted, causing the interrupt handler to be re-entered errantly. This
situation can be avoided by either clearing the interrupt source at the beginning of the
interrupt handler or by performing a read or write after the write to clear the interrupt source
(and flush the write buffer).
See
for more information on exceptions and interrupts.