IPSR:
Interrupt Program Status Register
The IPSR contains the exception type number of the current Interrupt Service Routine (ISR).
See the register summary in Table 2-2 on page 2-3 for its attributes. The bit assignments are:
Table 2-5 IPSR bit assignments
Bits Name Function
[31:9] - Reserved
[8:0] ISR_NUMBER This is the number of the current exception:
0 = Thread mode
1 = Reserved
2 = NMI
3 = HardFault
4 = MemManage
5 = BusFault
6 = UsageFault
7-10 = Reserved
11 = SVCall
12 = Reserved for Debug
13 = Reserved
14 = PendSV
15 = SysTick
16 = IRQ0.
.
.
.
n+15 = IRQ(n-1)a
see Exception types on page 2-21 for more information.
a. The number of interrupts, n, is implementation-defined, in the range 1-240.
The stacked PC may or may not provide useful info about the cause.