Appendix B

Exception Type Quick Reference

B.1. Exception Types

The exception types and corresponding control registers are listed in Table B.1:

Table B.1

Exception types and associated enable control registers

Exception typeNamePriority (word address)Enable
1Reset3Always
2NMI2Always
3HardFault1Always
11SVCallProgrammable (0xE000ED1C, byte 3)Always
14PendSVProgrammable (0xE000ED20, byte 2)Always
15SYSTICKProgrammable (0xE000ED20, byte 3)SYSTICK Control and Status Register (SysTick->CTRL)
16Interrupt #0Programmable (0xE000E400, byte 0)NVIC SETENA0
(0xE000E100, bit 0)
17Interrupt #1Programmable (0xE000E400, byte 1)NVIC SETENA0
(0xE000E100, bit 1)
18Interrupt #2Programmable (0xE000E400, byte 2)NVIC SETENA0
(0xE000E100, bit 2)
19Interrupt #3Programmable (0xE000E400, byte 3)NVIC SETENA0
(0xE000E100, bit 3)
20Interrupt #4Programmable (0xE000E404, byte 0)NVIC SETENA0
(0xE000E100, bit 4)
21Interrupt #5Programmable (0xE000E404, byte 1)NVIC SETENA0
(0xE000E100, bit 5)
2231Interrupt
#6–#31
Programmable (0xE000E404–0xE000E41C)NVIC SETENA0
(0xE000E100, bit 6–bit 31)

image

B.2. Stack Frame Layout (Stack Contents After Exception Stacking)

Table B.2 describes the layout of a stack frame in the stack memory after an exception stacking sequence is carried out. This information is useful for extracting stacked data within the exception handler.

Table B.2

Stack frame layout after exception stacking

AddressData
(N+36)(Previous stacked data)
(N+32)(Previous stacked data/padding)
(N+28)Stacked xPSR
(N+24)Stacked PC (return address)
(N+20)Stacked LR
(N+16)Stacked R12
(N+12)Stacked R3
(N+8)Stacked R2
(N+4)Stacked R1
New SP (N) ->Stacked R0
Depending on the Stack Pointer (SP) value before the exception has taken place, the previous SP can be either the new SP value plus 32 or the new SP value plus 36: If the previous SP was aligned to a double-word aligned address boundary, then the previous SP is new SP + 32. Otherwise, a padding word would be allocated before stacking and therefore the previous SP is new SP + 36.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.202.54