SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
Exception return occurs when the processor is in Handler mode and execution of one of the following instructions attempts to set the PC to an EXC_RETURN value:
A POP or LDM instruction that loads the PC
An LDR instruction that loads the PC
A BX instruction using any register
The processor saves an EXC_RETURN value to the LR on exception entry. The exception mechanism relies on this value to detect when the processor has completed an exception handler. When the processor loads a value matching this pattern to the PC it detects that the operation is not a normal branch operation and, instead, that the exception is complete. As a result, it starts the exception return sequence. Bits[6:0] of the EXC_RETURN value indicate the required return stack, processor mode, Security state, and stack frame as shown in Table 5-4.
|
Bits |
Name |
Function |
|---|---|---|
| [31:24] | PREFIX |
Indicates that this is an EXC_RETURN value. This field reads as 0b11111111 |
| [23:7] |
- |
Reserved, RES1. |
| [6] |
S |
Indicates whether registers have been pushed to a Secure or Non-secure stack. 0: Non-secure
stack used |
| [5] | DCRS |
Indicates whether the default stacking rules apply, or whether the called registers are already on the stack. 0:Stacking of the
called saved registers is skipped |
| [4] | FType |
In a PE with the Main and Floating-point Extensions: 0: The PE
allocated space on the stack for FP context In a PE without the Floating-point Extension, this bit is Reserved, RES1 |
| [3] | Mode |
Indicates the mode that was stacked from. 0: Handler mode |
| [2] | SPSEL |
Indicates which stack contains the exception stack frame. 0: Main stack
pointer |
| [1] |
- |
Reserved, RES0 |
| [0] | ES |
Indicates the Security state the exception was taken to. 0: Non-secure |