SWCU193A April 2023 – August 2024 CC2340R2 , CC2340R5 , CC2340R5-Q1
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:
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. Bits[31:4] of an EXC_RETURN value are 0xFFFFFFF.
When the processor loads a value matching this pattern to the PC it detects that the operation is a not a normal branch operation and, instead, that the exception is complete. Therefore, it starts the exception return sequence. Bits[3:0] of the EXC_RETURN value indicate the required return stack and processor mode, as shown in Table 4-3.
EXC_RETURN | Description |
---|---|
0xFFFFFFF1 |
Return to Handler mode. Exception return gets state from the main stack. Execution uses MSP after return. |
0xFFFFFFF9 |
Return to Thread mode. Exception return gets state from MSP. Execution uses MSP after return. |
0xFFFFFFFD |
Return to Thread mode. Exception return gets state from PSP. Execution uses PSP after return. |
All other values | Reserved |