PM0215 The STM32 Cortex-M0 processor
Doc ID 022979 Rev 1 27/91
If another higher priority exception occurs during exception entry, the processor starts
executing the exception handler for this exception and does not change the pending status
of the earlier exception. This is the late arrival case.
Exception return
Exception return occurs when the processor is in Handler mode and executes one of the
following instructions to load the EXC_RETURN value into the PC:
● a POP instruction that loads the PC
● a BX instruction using any register.
EXC_RETURN is the value loaded into 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 Tabl e 13 .
Table 13. Exception return behavior
EXC_RETURN[31:0] 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