19. Nested vectored interrupt controller (NVIC)
19.1 NVIC main features
- • 162 maskable interrupt channels (not including the 16 Cortex-M33 with FPU interrupt lines)
- • 16 programmable priority levels (four bits of interrupt priority used)
- • Low-latency exception and interrupt handling
- • Power management control
- • Implementation of system control registers
The NVIC and the processor core interface are closely coupled, enabling low-latency interrupt processing and efficient processing of late arriving interrupts.
The NVIC registers are banked across secure and nonsecure states.
All interrupts, including the core exceptions, are managed by the NVIC.
19.2 SysTick calibration value register
The Cortex-M33 with TrustZone mainline security extension embeds two SysTick timers.
When TrustZone is activated, the following SysTick timers are available:
- • SysTick, secure instance
- • SysTick, nonsecure instance
When TrustZone is disabled, only one SysTick timer is available.
The SysTick timer calibration value (STCALIB) is 0x3E8. It gives a reference time base of 1 ms based on a SysTick clock frequency of 1 MHz. To match the 1 ms time base for an application running at a given frequency, the SysTick reload value must be programmed as follows in the SYST_RVR register:
- • When SysTick clock source is CPU, clock HCLK reload value = (HCLK × STCALIB)-1
- • When SysTick clock source is external, clock (HCLK/8) reload value = ((HCLK/8) × STCALIB)-1
The HCLK refers to the AHB frequency value in MHz.
Example: SysTick clock source is CPU clock HCLK of 100 MHz, to match a time base of 1 ms: SysTick reload value = (100 × STCALIB)-1 = 0x1869F.
19.3 Interrupt and exception vectors
The mapping is defined in Table 166. Gray rows indicate vectors without specific position.
Table 166. Interrupt vector mapping
| Position | Priority | Type of priority | Acronym | Description | Address |
|---|---|---|---|---|---|
| - | - | - | - | Reserved | 0x0000 0000 |
| - | -4 | Fixed | Reset | Reset | 0x0000 0004 |
| - | -2 | Fixed | NMI | Nonmaskable interrupt. The RCC clock security system (CSS) is linked to the NMI vector. | 0x0000 0008 |
| - | -3 or -1 | Fixed | Secure HardFault | Secure HardFault | 0x0000 000C |
| - | -1 | Fixed | Nonsecure HardFault | Nonsecure HardFault, all classes of fault | 0x0000 000C |
| - | 0 | Settable | MemManage | Memory management | 0x0000 0010 |
| - | 1 | Settable | BusFault | Prefetch fault, memory access fault | 0x0000 0014 |
| - | 2 | Settable | UsageFault | Undefined instruction or illegal state | 0x0000 0018 |
| - | 3 | Settable | SecureFault | SecureFault | 0x0000 001C |
| - | - | - | - | Reserved | 0x0000 0020 - 0x0000 0028 |
| - | 4 | - | SVC | System service call via SWI instruction | 0x0000 002C |
| - | 5 | - | Debug Monitor | Monitor | 0x0000 0030 |
| - | - | - | - | Reserved | 0x0000 0034 |
| - | 6 | Settable | PendSV | Pendable request for system service | 0x0000 0038 |
| - | 7 | Settable | SysTick | System tick timer | 0x0000 003C |
| 0 | 8 | Settable | WWDG | Window watchdog interrupt | 0x0000 0040 |
| 1 | 9 | Settable | PVD_AVD_UVM_IO2VM | Power voltage monitor, analog voltage monitor, UVM, and IO2VM voltage monitors | 0x0000 0044 |
| 2 | 10 | Settable | RTC | RTC global nonsecure interrupts | 0x0000 0048 |
| 3 | 11 | Settable | RTC_S | RTC global secure interrupts | 0x0000 004C |
| 4 | 12 | Settable | TAMP | Tamper global interrupts | 0x0000 0050 |
| 5 | 13 | Settable | RAMCFG | RAM configuration global interrupt | 0x0000 0054 |
| 6 | 14 | Settable | FLASH | Flash nonsecure global interrupt | 0x0000 0058 |
| 7 | 15 | Settable | FLASH_S | Flash secure global interrupt | 0x0000 005C |
| 8 | 16 | Settable | GTZC | GTZC global interrupt | 0x0000 0060 |
| 9 | 17 | Settable | RCC | RCC nonsecure global interrupt | 0x0000 0064 |
| 10 | 18 | Settable | RCC_S | RCC secure global interrupt | 0x0000 0068 |
| 11 | 19 | Settable | EXTI0 | EXTI line0 interrupt | 0x0000 006C |
| 12 | 20 | Settable | EXTI1 | EXTI line1 interrupt | 0x0000 0070 |
Table 166. Interrupt vector mapping (continued)
| Position | Priority | Type of priority | Acronym | Description | Address |
|---|---|---|---|---|---|
| 13 | 21 | Settable | EXTI2 | EXTI line2 interrupt | 0x0000 0074 |
| 14 | 22 | Settable | EXTI3 | EXTI line3 interrupt | 0x0000 0078 |
| 15 | 23 | Settable | EXTI4 | EXTI line4 interrupt | 0x0000 007C |
| 16 | 24 | Settable | EXTI5 | EXTI line5 interrupt | 0x0000 0080 |
| 17 | 25 | Settable | EXTI6 | EXTI line6 interrupt | 0x0000 0084 |
| 18 | 26 | Settable | EXTI7 | EXTI line7 interrupt | 0x0000 0088 |
| 19 | 27 | Settable | EXTI8 | EXTI line8 interrupt | 0x0000 008C |
| 20 | 28 | Settable | EXTI9 | EXTI line9 interrupt | 0x0000 0090 |
| 21 | 29 | Settable | EXTI10 | EXTI line10 interrupt | 0x0000 0094 |
| 22 | 30 | Settable | EXTI11 | EXTI line11 interrupt | 0x0000 0098 |
| 23 | 31 | Settable | EXTI12 | EXTI line12 interrupt | 0x0000 009C |
| 24 | 32 | Settable | EXTI13 | EXTI line13 interrupt | 0x0000 00A0 |
| 25 | 33 | Settable | EXTI14 | EXTI line14 interrupt | 0x0000 00A4 |
| 26 | 34 | Settable | EXTI15 | EXTI line15 interrupt | 0x0000 00A8 |
| 27 | 35 | Settable | GPDMA1_CH0 | GPDMA1 channel 0 global interrupt | 0x0000 00AC |
| 28 | 36 | Settable | GPDMA1_CH1 | GPDMA1 channel 1 global interrupt | 0x0000 00B0 |
| 29 | 37 | Settable | GPDMA1_CH2 | GPDMA1 channel 2 global interrupt | 0x0000 00B4 |
| 30 | 38 | Settable | GPDMA1_CH3 | GPDMA1 channel 3 global interrupt | 0x0000 00B8 |
| 31 | 39 | Settable | GPDMA1_CH4 | GPDMA1 channel 4 global interrupt | 0x0000 00BC |
| 32 | 40 | Settable | GPDMA1_CH5 | GPDMA1 channel 5 global interrupt | 0x0000 00C0 |
| 33 | 41 | Settable | GPDMA1_CH6 | GPDMA1 channel 6 global interrupt | 0x0000 00C4 |
| 34 | 42 | Settable | GPDMA1_CH7 | GPDMA1 channel 7 global interrupt | 0x0000 00C8 |
| 35 | 43 | Settable | IWDG | Independent watchdog interrupt | 0x0000 00CC |
| 36 | 44 | Settable | SAES | Secure AES | 0x0000 00D0 |
| 37 | 45 | Settable | ADC | ADC global interrupt | 0x0000 00D4 |
| 38 | 46 | Settable | DAC1 | DAC1 global interrupt | 0x0000 00D8 |
| 39 | 47 | Settable | FDCAN1_IT0 | FDCAN1 Interrupt 0 | 0x0000 00DC |
| 40 | 48 | Settable | FDCAN1_IT1 | FDCAN1 Interrupt 1 | 0x0000 00E0 |
| 41 | 49 | Settable | TIM1_BRK/TIM1_TERR/ TIM1_IERR | TIM1 break/TIM1 transition error/ TIM1 index error | 0x0000 00E4 |
| 42 | 50 | Settable | TIM1_UP | TIM1 update | 0x0000 00E8 |
| 43 | 51 | Settable | TIM1_TRG_COM/ TIM1_DIR/TIM1_IDX | TIM1 trigger and commutation/ TIM1 direction change interrupt/TIM1 index | 0x0000 00EC |
| 44 | 52 | Settable | TIM1_CC | TIM1 capture compare interrupt | 0x0000 00F0 |
Table 166. Interrupt vector mapping (continued)
| Position | Priority | Type of priority | Acronym | Description | Address |
|---|---|---|---|---|---|
| 45 | 53 | Settable | TIM2 | TIM2 global interrupt | 0x0000 00F4 |
| 46 | 54 | Settable | TIM3 | TIM3 global interrupt | 0x0000 00F8 |
| 47 | 55 | Settable | TIM4 | TIM4 global interrupt | 0x0000 00FC |
| 48 | 56 | Settable | TIM5 | TIM5 global interrupt | 0x0000 0100 |
| 49 | 57 | Settable | TIM6 | TIM6 global interrupt | 0x0000 0104 |
| 50 | 58 | Settable | TIM7 | TIM7 global interrupt | 0x0000 0108 |
| 51 | 59 | Settable | I2C1_EV | I2C1 event interrupt | 0x0000 010C |
| 52 | 60 | Settable | I2C1_ER | I2C1 error interrupt | 0x0000 0110 |
| 53 | 61 | Settable | I2C2_EV | I2C2 event interrupt | 0x0000 0114 |
| 54 | 62 | Settable | I2C2_ER | I2C2 error interrupt | 0x0000 0118 |
| 55 | 63 | Settable | SPI1 | SPI1 global interrupt | 0x0000 011C |
| 56 | 64 | Settable | SPI2 | SPI2 global interrupt | 0x0000 0120 |
| 57 | 65 | Settable | SPI3 | SPI3 global interrupt | 0x0000 0124 |
| 58 | 66 | Settable | USART1 | USART1 global interrupt | 0x0000 0128 |
| 59 | 67 | Settable | USART2 | USART2 global interrupt | 0x0000 012C |
| 60 | 68 | Settable | USART3 | USART3 global interrupt | 0x0000 0130 |
| 61 | 69 | Settable | UART4 | UART4 global interrupt | 0x0000 0134 |
| 62 | 70 | Settable | UART5 | UART5 global interrupt | 0x0000 0138 |
| 63 | 71 | Settable | LPUART1 | LPUART1 global interrupt OR LPUART1 wake-up OR LPUART1 T wake-up through EXTI line | 0x0000 013C |
| 64 | 72 | Settable | LPTIM1 OR LPTIM1_AIT | LPTIM1 global interrupt OR LPTIM1 AIT through EXTI line | 0x0000 0140 |
| 65 | 73 | Settable | TIM8_BRK/TIM8_TERR/ TIM8_IERR | TIM8 break interrupt/TIM8 transition error/ TIM8 index error | 0x0000 0144 |
| 66 | 74 | Settable | TIM8_UP | TIM8 update interrupt | 0x0000 0148 |
| 67 | 75 | Settable | TIM8_TRG_COM/ TIM8_DIR/TIM8_IDX | TIM8 trigger and commutation interrupt/ TIM8 direction change interrupt/TIM8 index | 0x0000 014C |
| 68 | 76 | Settable | TIM8_CC | TIM8 capture compare interrupt | 0x0000 0150 |
| 69 | 77 | Settable | ADC2 | ADC2 global interrupt | 0x0000 0154 |
| 70 | 78 | Settable | LPTIM2 OR LPTIM2_AIT | LPTIM2 global interrupt OR LPTimer2 AIT through EXTI line | 0x0000 0158 |
| 71 | 79 | Settable | TIM15 | TIM15 global interrupt | 0x0000 015C |
| 72 | 80 | Settable | TIM16 | TIM16 global interrupt | 0x0000 0160 |
| 73 | 81 | Settable | TIM17 | TIM17 global interrupt | 0x0000 0164 |
| 74 | 82 | Settable | USB_FS | USB OTG_FS global interrupt | 0x0000 0168 |
| Position | Priority | Type of priority | Acronym | Description | Address |
|---|---|---|---|---|---|
| 75 | 83 | Settable | CRS | CRS global interrupt | 0x0000 016C |
| 76 | 84 | Settable | UCPD1 | UCPD1 global interrupt | 0x0000 0170 |
| 77 | 85 | Settable | FMC | FMC global interrupt | 0x0000 0174 |
| 78 | 86 | Settable | OCTOSPI1 | OCTOSPI1 global interrupt | 0x0000 0178 |
| 79 | 87 | Settable | SDMMC1 | SDMMC1 global interrupt | 0x0000 017C |
| 80 | 88 | Settable | I2C3_EV | I2C3 event interrupt | 0x0000 0180 |
| 81 | 89 | Settable | I2C3_ER | I2C3 error interrupt | 0x0000 0184 |
| 82 | 90 | Settable | SPI4 | SPI4 global interrupt | 0x0000 0188 |
| 83 | 91 | Settable | SPI5 | SPI5 global interrupt | 0x0000 018C |
| 84 | 92 | Settable | SPI6 | SPI6 global interrupt | 0x0000 0190 |
| 85 | 93 | Settable | USART6 | USART6 global interrupt | 0x0000 0194 |
| 86 | 94 | Settable | USART10 | USART10 global interrupt | 0x0000 0198 |
| 87 | 95 | Settable | USART11 | USART11 global interrupt | 0x0000 019C |
| 88 | 96 | Settable | SAI1 | SAI1 global interrupt | 0x0000 01A0 |
| 89 | 97 | Settable | SAI2 | SAI2 global interrupt | 0x0000 01A4 |
| 90 | 98 | Settable | GPDMA2_CH0 | GPDMA2 channel0 global interrupt | 0x0000 01A8 |
| 91 | 99 | Settable | GPDMA2_CH1 | GPDMA2 channel1 global interrupt | 0x0000 01AC |
| 92 | 100 | Settable | GPDMA2_CH2 | GPDMA2 channel2 global interrupt | 0x0000 01B0 |
| 93 | 101 | Settable | GPDMA2_CH3 | GPDMA2 channe3 global interrupt | 0x0000 01B4 |
| 94 | 102 | Settable | GPDMA2_CH4 | GPDMA2 channel4 global interrupt | 0x0000 01B8 |
| 95 | 103 | Settable | GPDMA2_CH5 | GPDMA2 channel5 global interrupt | 0x0000 01BC |
| 96 | 104 | Settable | GPDMA2_CH6 | GPDMA2 channel6 global interrupt | 0x0000 01C0 |
| 97 | 105 | Settable | GPDMA2_CH7 | GPDMA2 channel7 global interrupt | 0x0000 01C4 |
| 98 | 106 | Settable | UART7 | UART7 global interrupt | 0x0000 01C8 |
| 99 | 107 | Settable | UART8 | UART8 global interrupt | 0x0000 01CC |
| 100 | 108 | Settable | UART9 | UART9 global interrupt | 0x0000 01D0 |
| 101 | 109 | Settable | UART12 | UART12 global interrupt | 0x0000 01D4 |
| 102 | 110 | Settable | SDMMC2 | SDMMC2 global interrupt | 0x0000 01D8 |
| 103 | 111 | Settable | FPU | Floating point interrupt | 0x0000 01DC |
| 104 | 112 | Settable | ICACHE | Instruction cache global interrupt | 0x0000 01E0 |
| 105 | 113 | Settable | DCACHE | Data cache global interrupt | 0x0000 01E4 |
| 106 | 114 | Settable | ETH | Ethernet interrupt | 0x0000 01E8 |
| 107 | 115 | Settable | ETH_WKUP | ETHERNET wake-up interrupt through EXTI line | 0x0000 01EC |
Table 166. Interrupt vector mapping (continued)
| Position | Priority | Type of priority | Acronym | Description | Address |
|---|---|---|---|---|---|
| 108 | 116 | Settable | DCMI_PSSI | DCMI/PSSI global interrupt | 0x0000 01F0 |
| 109 | 117 | Settable | FDCAN2_IT0 | FDCAN2 Interrupt 0 | 0x0000 01F4 |
| 110 | 118 | Settable | FDCAN2_IT1 | FDCAN2 Interrupt 1 | 0x0000 01F8 |
| 111 | 119 | Settable | CORDIC | CORDIC interrupt | 0x0000 01FC |
| 112 | 120 | Settable | FMAC | FMAC interrupt | 0x0000 0200 |
| 113 | 121 | Settable | DTS OR DTS_WKUP | DTS interrupt OR DTS AIT through EXTI line | 0x0000 0204 |
| 114 | 122 | Settable | RNG | RNG global interrupt | 0x0000 0208 |
| 115 | 123 | Settable | OTFDEC1 | OTFDEC1 secure global interrupt | 0x0000 020C |
| 116 | 124 | Settable | AES | AES global interrupt | 0x0000 0210 |
| 117 | 125 | Settable | HASH | HASH interrupt | 0x0000 0214 |
| 118 | 126 | Settable | PKA | PKA global interrupt | 0x0000 0218 |
| 119 | 127 | Settable | CEC | HDMI-CEC global interrupt | 0x0000 021C |
| 120 | 128 | Settable | TIM12 | TIM12 global interrupt | 0x0000 0220 |
| 121 | 129 | Settable | TIM13 | TIM13 global interrupt | 0x0000 0224 |
| 122 | 130 | Settable | TIM14 | TIM14 global interrupt | 0x0000 0228 |
| 123 | 131 | Settable | I3C1_EV | I3C1 event interrupt | 0x0000 022C |
| 124 | 132 | Settable | I3C1_ER | I3C1 error interrupt | 0x0000 0230 |
| 125 | 133 | Settable | I2C4_EV | I2C4 event interrupt | 0x0000 0234 |
| 126 | 134 | Settable | I2C4_ER | I2C4 error interrupt | 0x0000 0238 |
| 127 | 135 | Settable | LPTIM3 OR LPTIM3_AIT | LPTIM3 global interrupt OR LPTIM3 AIT through EXTI line | 0x0000 023C |
| 128 | 136 | Settable | LPTIM4 OR LPTIM4_AIT | LPTIM4 global interrupt OR LPTIM4 AIT through EXTI line | 0x0000 0240 |
| 129 | 137 | Settable | LPTIM5 OR LPTIM5_AIT | LPTIM5 global interrupt OR LPTIM5 AIT through EXTI line | 0x0000 0244 |
| 130 | 138 | Settable | LPTIM6 OR LPTIM6_AIT | LPTIM6 global interrupt OR LPTIM6 AIT through EXTI line | 0x0000 0248 |
| 131 | 139 | Settable | I3C2_EV | I3C2 event interrupt | 0x0000 024C |
| 132 | 140 | Settable | I3C2_ER | I3C2 error interrupt | 0x0000 0250 |
| 133 | 141 | Settable | COMP | Comparator global interrupt | 0x0000 0254 |
| 134 | 142 | Settable | DMA2D | DMA2D interrupt | 0x0000 0258 |
| 135 | 143 | Settable | JPEG | JPEG interrupt | 0x0000 025C |
| 136 | 144 | Settable | GPDMA1_CH8 | GPDMA1 channel 8 global interrupt | 0x0000 0260 |
| 137 | 145 | Settable | GPDMA1_CH9 | GPDMA1 channel 9 global interrupt | 0x0000 0264 |
Table 166. Interrupt vector mapping (continued)
| Position | Priority | Type of priority | Acronym | Description | Address |
|---|---|---|---|---|---|
| 138 | 146 | Settable | GPDMA1_CH10 | GPDMA1 channel 10 global interrupt | 0x0000 0268 |
| 139 | 147 | Settable | GPDMA1_CH11 | GPDMA1 channel 11 global interrupt | 0x0000 026C |
| 140 | 148 | Settable | GPDMA2_CH8 | GPDMA2 channel 8 global interrupt | 0x0000 0270 |
| 141 | 149 | Settable | GPDMA2_CH9 | GPDMA2 channel 9 global interrupt | 0x0000 0274 |
| 142 | 150 | Settable | GPDMA2_CH10 | GPDMA2 channel 10 global interrupt | 0x0000 0278 |
| 143 | 151 | Settable | GPDMA2_CH11 | GPDMA2 channel 11 global interrupt | 0x0000 027C |
| 144 | 152 | Settable | GFXTIM | GFXTIM interrupt | 0x0000 0280 |
| 145 | 153 | Settable | LCD_IRQ | LCD interrupt | 0x0000 0284 |
| 146 | 154 | Settable | LCD_GBL_ERROR | LCD global error | 0x0000 0288 |
| 147 | 155 | Settable | PLAY1 | PLA global nonsecure interrupt | 0x0000 028C |
| 148 | 156 | Settable | PLAY1_S | PLA global secure interrupt | 0x0000 0290 |
| 149 | 157 | Settable | ADC3 | ADC3 global interrupt | 0x0000 0294 |
| 150 | 158 | Settable | OCTOSPI2 | OCTOSPI2 global interrupt | 0x0000 0298 |
| 151 | 159 | Settable | OTFDEC2 | OTFDEC2 secure global interrupt | 0x0000 029C |
| 152 | 160 | Settable | FDCAN3_IT0 | FDCAN3 Interrupt 0 | 0x0000 02A0 |
| 153 | 161 | Settable | FDCAN3_IT1 | FDCAN3 Interrupt 1 | 0x0000 02A4 |
| 154 | 162 | Settable | MDF1_FLT0 | MDF1 Filter 0 global interrupt | 0x0000 02A8 |
| 155 | 163 | Settable | MDF1_FLT1 | MDF1 Filter 1 global interrupt | 0x0000 02AC |
| 156 | 164 | Settable | MDF1_FLT2 | MDF1 Filter 2 global interrupt | 0x0000 02B0 |
| 157 | 165 | Settable | MDF1_FLT3 | MDF1 Filter 3 global interrupt | 0x0000 02B4 |
| 158 | 166 | Settable | MDF1_FLT4 | MDF1 Filter 4 global interrupt | 0x0000 02B8 |
| 159 | 167 | Settable | MDF1_FLT5 | MDF1 Filter 5 global interrupt | 0x0000 02BC |
| 160 | 168 | Settable | ADF1 | ADF1 interrupt | 0x0000 02C0 |
| 161 | 169 | Settable | OTG_HS | USB OTG HS global interrupt | 0x0000 02C4 |