0x416c6578

Interrupts

ARM uses a mechanism called the NVIC, or Nested Vector Interrupt Controller.
Boiled down, this means that interrupts can have a priority, meaning higher priority (lower number) interrupts will be handled before lower priority ones if both are received simultaneously.
In ARM, an interrupt is used to describe a type of exception. The exception number is used as the offset in the vector table where “the address of the routine of the exception can be found”. Such an address will be loaded into the PC and run by the processor when an interrupt is received.
As mentioned above, exceptions have a priority number. If two exceptions have the same priority and are received simultaneously, then the one with the lower number will be handled first.
A synchronous exception is fired immediately after some instruction is executed (for example a supervisor call). An asynchronous exception is not fired knowingly, for example an external interrupt. ___ Exceptions can be

There are 15 builtin exceptions in Cortex-M, for example system reset. Another example is the NMI, or non-maskable interrupt, which is triggered if an error happens in other exception handlers. It has the highest priority besides reset. PendSV & SysTick are to do with RTOSes.
The exception number for an external interrupt starts at offset 16 in the vector table. Exceptions are configured with registers in the SCS (System Control Space)


The Interrupt Control and State Register (ICSR) - 0xE000ED04

It provides software control for the NMI, PendSV and SysTick exceptions, as well as (importantly) providing interrupt status information.

The Application Interrupt and Reset Control Register (AIRCR) - 0xE000ED0C

It sets and returns interrupt control data

System Handler Priority Registers (SHRPn) - 0xE000ED18

Interrupt Controller Type Register

The NVIC Interrupt Controller

Sources

https://static.docs.arm.com/ddi0403/eb/DDI0403E_B_armv7m_arm.pdf - B3.2.4 onwards
https://interrupt.memfault.com/blog/arm-cortex-m-exceptions-and-nvic - Largely based off this