18.2.12 Exception Handlers

An exception table is defined by the compiler. For devices based on Arm Cortex-M cores, that table will contain the initial stack pointer and program start address (e.g. the Reset_Handler() function address) as well as the interrupt service routine (ISR) vector. A similar table is created when using Cortex-A devices, only the stack pointer is not defined. This table is placed in the .vectors section.

The device-specific start-up code defines a default vector table exception_table, as well as a default ISR named Dummy_Handler(). When using Cortex-M devices, all pointers in exception_table apart from the Reset_Handler(), are initialized to point to Dummy_Handler(), which simply enters an infinite loop. Not all handlers default to Dummy_Handler() when using Cortex-A devices, and additionally, the FIQ and IRQ interrupt handlers might have device-specific implementations. For devices supporting the Thumb-2 instruction set, a software breakpoint instruction will be inserted before the infinite loop when __DEBUG is defined.

The symbols exeception_table, Reset_Handler() and Dummy_Handler() may be redefined by user code to provide custom implementations.