Processor modes and stacks
The various processor modes need separate stacks. Knowing the names of the linker blocks for these can be necessary in some cases, for example when making settings on the Stack page of the IDE Options dialog box.
The Arm 7/9/11, Cortex-A, and Cortex-R devices support five exception modes which are entered when different exceptions occur. Each exception mode has its own stack to avoid corrupting the System/User mode stack.
Note
64-bit Arm cores and Cortex-M do not have individual exception stacks. By default, all exception stacks are placed in the CSTACK section.
The table shows default stack block names for the various stacks, but you can define your own names. Be aware, however, that the stack checking features that you can set on the Stack page of the IDE Options dialog box only work if the stack blocks are using these default names.
Processor mode | Default stack block name | Description |
|---|---|---|
Supervisor | Operation system stack for Arm 7/9/11, Cortex-A, and Cortex-R. | |
IRQ | Stack for general-purpose (IRQ) interrupt handlers for Arm 7/9/11, Cortex-A, and Cortex-R. | |
FIQ | Stack for high-speed (FIQ) interrupt handlers for Arm 7/9/11, Cortex-A, and Cortex-R. | |
Undefined | Stack for undefined instruction interrupts for Arm 7/9/11, Cortex-A, and Cortex-R. Supports software emulation of hardware coprocessors and instruction set extensions. | |
Abort | Stack for instruction fetch and data access memory abort interrupt handlers for Arm 7/9/11, Cortex-A, and Cortex-R. | |
User | Stack for User mode. | |
Monitor | Stack for context switching between Secure and Non-Secure states. | |
Hypervisor | Stack for access to facilities for virtualization. |
For each processor mode where a stack is needed, a separate stack pointer must be initialized in your startup code, and section placement should be done in the linker configuration file. The IRQ and FIQ stacks are the only exception stacks which are preconfigured in the supplied cstartup.s and lnkarm.icf files, but other exception stacks can easily be added.
Caution
To view any of these stacks in the Stack window available in the IDE, the default block names must be used instead of user-defined block names.