19. Nested vectored interrupt controller (NVIC)
19.1 NVIC features
The NVIC includes the following features:
- • up to 140 maskable interrupt channels for STM32H7xxx (not including the 10 interrupt lines of Cortex®-M7 with FPU)
- • 16 programmable priority levels (4 bits of interrupt priority are 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, which enables low latency interrupt processing and efficient processing of late-arriving interrupts.
All interrupts, including the core exceptions, are managed by the NVIC.
For more information on exceptions and NVIC programming, refer to PM0253 programming manual for Cortex®-M7.
19.1.1 SysTick calibration value register
The SysTick calibration value (SYST_CALIB) is fixed to 0x3E8. It provides a reference timebase of 1 ms based when the SysTick clock frequency is 1 MHz. To match the 1 ms timebase whatever the application frequency, the SysTick reload value must be programmed as follows in the SYST_RVR register:
- • If the SysTick clock source is the 100 MHz CPU clock (HCLK):
- • If the SysTick clock source is an external clock:
where \( F_{\text{HCLK}} \) refers to the AHB frequency expressed in MHz.
For example, to achieve a timebase of 1 ms when the SysTick clock source is the 100 MHz HCLK:
19.1.2 Interrupt and exception vectors
The exception vectors connected to the NVIC are the following: reset, NMI, HardFault, MemManage, Bus Fault, UsageFault, SVCall, DebugMonitor, PendSV, SysTick.
Table 142. NVIC (1)
| NVIC position | Priority | Type of priority | Acronym | Description | Address offset |
|---|---|---|---|---|---|
| - | - | - | Reserved | 0x0000 0000 | |
| - | -3 | fixed | Reset | Reset | 0x0000 0004 |
| - | -2 | fixed | NMI | Non maskable interrupt. The RCC Clock Security System (HSE CSS) is linked to the NMI vector. | 0x0000 0008 |
| - | -1 | fixed | HardFault | All class of fault | 0x0000 000C |
| - | 0 | fixed | MemManage | Memory management | 0x0000 0010 |
| - | 1 | settable | BusFault | Pre-fetch fault, memory access fault | 0x0000 0014 |
| - | 2 | settable | UsageFault | Undefined instruction or illegal state | 0x0000 0018 |
| - | - | - | - | Reserved | 0x0000 001C - 0x0000 002B |
| - | 3 | settable | SVCall | System service call via SWI instruction | 0x0000 002C |
| - | 4 | settable | Debug Monitor | Debug Monitor | 0x0000 0030 |
| - | - | - | - | Reserved | 0x0000 0034 |
| - | 5 | settable | PendSV | Pendable request for system service | 0x0000 0038 |
| - | 6 | settable | Systick | System tick timer | 0x0000 003C |
| 0 | 7 | settable | PVD_AVD | PVD and AVD through the EXTI line | 0x0000 0040 |
| - | - | - | - | Reserved | 0x0000 0044 |
| 2 | 9 | settable | DTS | DTS global interrupt | 0x0000 0048 |
| 3 | 10 | settable | IWDG | Independent watchdog interrupt | 0x0000 004C |
| 4 | 11 | settable | WWDG | Window watchdog interrupt | 0x0000 0050 |
| 5 | 12 | settable | RCC | RCC global interrupt | 0x0000 0054 |
| 6 | 13 | - | - | - | 0x0000 0058 |
| 7 | 14 | - | - | - | 0x0000 005C |
| 8 | 15 | settable | FLASH | Flash memory interface | 0x0000 0060 |
| NVIC position | Priority | Type of priority | Acronym | Description | Address offset |
|---|---|---|---|---|---|
| 9 | 16 | settable | ECC_FPU | ECC/FPU/ All flag from exec | 0x0000 0064 |
| 10 | 17 | settable | FPU | FPU safety Flag | 0x0000 0068 |
| - | - | - | - | Reserved | 0x0000 006C |
| - | - | - | - | Reserved | 0x0000 0070 |
| 13 | 20 | settable | TAMP | RTC tamper and timestamp interrupts through the EXTI line | 0x0000 0074 |
| - | - | - | - | Reserved (product secure) | 0x0000 0078 |
| - | - | - | - | Reserved (product secure) | 0x0000 007C |
| 16 | 23 | settable | EXTI0 | EXTI Line 0 interrupt through the EXTI line | 0x0000 0080 |
| 17 | 24 | settable | EXTI1 | EXTI Line 1 interrupt through the EXTI line | 0x0000 0084 |
| 18 | 25 | settable | EXTI2 | EXTI Line 2 interrupt through the EXTI line | 0x0000 0088 |
| 19 | 26 | settable | EXTI3 | EXTI Line 3 interrupt through the EXTI line | 0x0000 008C |
| 20 | 27 | settable | EXTI4 | EXTI Line 4 interrupt through the EXTI line | 0x0000 0090 |
| 21 | 28 | settable | EXTI5 | EXTI Line 5 interrupt through the EXTI line | 0x0000 0094 |
| 22 | 29 | settable | EXTI6 | EXTI Line 6 interrupt through the EXTI line | 0x0000 0098 |
| 23 | 30 | settable | EXTI7 | EXTI Line 7 interrupt through the EXTI line | 0x0000 009C |
| 24 | 31 | settable | EXTI8 | EXTI Line 8 interrupt through the EXTI line | 0x0000 00A0 |
| 25 | 32 | settable | EXTI9 | EXTI Line 9 interrupt through the EXTI line | 0x0000 00A4 |
| 26 | 33 | settable | EXTI10 | EXTI Line 10 interrupt through the EXTI line | 0x0000 00A8 |
| 27 | 34 | settable | EXTI11 | EXTI Line 11 interrupt through the EXTI line | 0x0000 00AC |
| 28 | 35 | settable | EXTI12 | EXTI Line 12 interrupt through the EXTI line | 0x0000 00B0 |
| 29 | 36 | settable | EXTI13 | EXTI Line 13 interrupt through the EXTI line | 0x0000 00B4 |
| 30 | 37 | settable | EXTI14 | EXTI Line 14 interrupt through the EXTI line | 0x0000 00B8 |
| 31 | 38 | settable | EXTI15 | EXTI Line 15 interrupt through the EXTI line | 0x0000 00BC |
| 32 | 39 | settable | RTC | RTC wake-up and Alarm interrupt through the EXTI line | 0x0000 00C0 |
| 33 | 40 | settable | SAES | SAES global interrupt | 0x0000 00C4 |
| 34 | 41 | settable | AES | AES global interrupt | 0x0000 00C8 |
| 35 | 42 | settable | PKA | PKA global interrupt | 0x0000 00CC |
| NVIC position | Priority | Type of priority | Acronym | Description | Address offset |
|---|---|---|---|---|---|
| 36 | 43 | settable | HASH | HASH global interrupt | 0x0000 00D0 |
| 37 | 44 | settable | RNG | RNG global interrupt | 0x0000 00D4 |
| 38 | 45 | settable | ADC1_2 | ADC1/2 global interrupt | 0x0000 00D8 |
| 39 | 46 | settable | GPDMA1_CH0 | GPDMA1 channel 0 interrupt | 0x0000 00DC |
| 40 | 47 | settable | GPDMA1_CH1 | GPDMA1 channel 1 interrupt | 0x0000 00E0 |
| 41 | 48 | settable | GPDMA1_CH2 | GPDMA1 channel 2 interrupt | 0x0000 00E4 |
| 42 | 49 | settable | GPDMA1_CH3 | GPDMA1 channel 3 interrupt | 0x0000 00E8 |
| 43 | 50 | settable | GPDMA1_CH4 | GPDMA1 channel 4 interrupt | 0x0000 00EC |
| 44 | 51 | settable | GPDMA1_CH5 | GPDMA1 channel 5 interrupt | 0x0000 00F0 |
| 45 | 52 | settable | GPDMA1_CH6 | GPDMA1 channel 6 interrupt | 0x0000 00F4 |
| 46 | 53 | settable | GPDMA1_CH7 | GPDMA1 channel 7 interrupt | 0x0000 00F8 |
| 47 | 54 | settable | TIM1_BRK | TIM1 Break interrupt (tim_brk_err_ierr_it) | 0x0000 00FC |
| 48 | 55 | settable | TIM1_UP | TIM1 Update interrupt (tim_upd_it) | 0x0000 0100 |
| 49 | 56 | settable | TIM1_TRG_COM | TIM1 Trigger and Commutation interrupts (tim_trg_com_dir_idx_it) | 0x0000 0104 |
| 50 | 57 | settable | TIM1_CC | TIM1 Capture Compare interrupt (tim_cc_it) | 0x0000 0108 |
| 51 | 58 | settable | TIM2 | TIM2 global interrupt | 0x0000 010C |
| 52 | 59 | settable | TIM3 | TIM3 global interrupt | 0x0000 0110 |
| 53 | 60 | settable | TIM4 | TIM4 global interrupt | 0x0000 0114 |
| 54 | 61 | settable | TIM5 | TIM5 global interrupt | 0x0000 0118 |
| 55 | 62 | settable | TIM6 | TIM6 global interrupt | 0x0000 011C |
| 56 | 63 | settable | TIM7 | TIM7 global interrupt | 0x0000 0120 |
| 57 | 64 | settable | TIM9 | TIM9 global interrupt | 0x0000 0124 |
| 58 | 65 | settable | SPI1 | SPI1 global interrupt | 0x0000 0128 |
| 59 | 66 | settable | SPI2 | SPI2 global interrupt | 0x0000 012C |
| 60 | 67 | settable | SPI3 | SPI3 global interrupt | 0x0000 0130 |
| 61 | 68 | settable | SPI4 | SPI4 global interrupt | 0x0000 0134 |
| 62 | 69 | settable | SPI5 | SPI5 global interrupt | 0x0000 0138 |
| 63 | 70 | settable | SPI6 | SPI6 global interrupt | 0x0000 013C |
| NVIC position | Priority | Type of priority | Acronym | Description | Address offset |
|---|---|---|---|---|---|
| 64 | 71 | settable | HPDMA1_CH0 | HPDMA1 channel 0 interrupt | 0x0000 0140 |
| 65 | 72 | settable | HPDMA1_CH1 | HPDMA1 channel 1 interrupt | 0x0000 0144 |
| 66 | 73 | settable | HPDMA1_CH2 | HPDMA1 channel 2 interrupt | 0x0000 0148 |
| 67 | 74 | settable | HPDMA1_CH3 | HPDMA1 channel 3 interrupt | 0x0000 014C |
| 68 | 75 | settable | HPDMA1_CH4 | HPDMA1 channel 4 interrupt | 0x0000 0150 |
| 69 | 76 | settable | HPDMA1_CH5 | HPDMA1 channel 5 interrupt | 0x0000 0154 |
| 70 | 77 | settable | HPDMA1_CH6 | HPDMA1 channel 6 interrupt | 0x0000 0158 |
| 71 | 78 | settable | HPDMA1_CH7 | HPDMA1 channel 7 interrupt | 0x0000 015C |
| 72 | 79 | settable | SAI1_A | SAI1 global interrupt A | 0x0000 0160 |
| 73 | 80 | settable | SAI1_B | SAI1 global interrupt B | 0x0000 0164 |
| 74 | 81 | settable | SAI2_A | SAI2 global interrupt A | 0x0000 0168 |
| 75 | 82 | settable | SAI2_B | SAI2 global interrupt B | 0x0000 016C |
| 76 | 83 | settable | I2C1_EV | I2C1 event interrupt | 0x0000 0170 |
| 77 | 84 | settable | I2C1_ER | I2C1 error interrupt | 0x0000 0174 |
| 78 | 85 | settable | I2C2_EV | I2C2 event interrupt | 0x0000 0178 |
| 79 | 86 | settable | I2C2_ER | I2C2 error interrupt | 0x0000 017C |
| 80 | 87 | settable | I2C3_EV | I2C3 event interrupt | 0x0000 0180 |
| 81 | 88 | settable | I2C3_ER | I2C3 error interrupt | 0x0000 0184 |
| 82 | 89 | settable | USART1 | USART1 global interrupt | 0x0000 0188 |
| 83 | 90 | settable | USART2 | USART2 global interrupt | 0x0000 018C |
| 84 | 91 | settable | USART3 | USART3 global interrupt | 0x0000 0190 |
| 85 | 92 | settable | UART4 | UART4 global interrupt | 0x0000 0194 |
| 86 | 93 | settable | UART5 | UART5 global interrupt | 0x0000 0198 |
| 87 | 94 | settable | UART7 | UART7 global interrupt | 0x0000 019C |
| 88 | 95 | settable | UART8 | UART8 global interrupt | 0x0000 01A0 |
| 89 | 96 | settable | I3C1_EV | I3C1 event interrupt | 0x0000 01A4 |
| 90 | 97 | settable | I3C1_ER | I3C1 error interrupt | 0x0000 01A8 |
| 91 | 98 | settable | OTG_HS | USB OTG HS global interrupt | 0x0000 01AC |
| 92 | 99 | settable | ETH | Ethernet global interrupt | 0x0000 01B0 |
| NVIC position | Priority | Type of priority | Acronym | Description | Address offset |
|---|---|---|---|---|---|
| 93 | 100 | settable | CORDIC | CORDIC interrupt | 0x0000 01B4 |
| 94 | 101 | settable | GFXTIM | GFXTIM global interrupt | 0x0000 01B8 |
| 95 | 102 | settable | DCMIPP | DCMI global interrupt | 0x0000 01BC |
| 96 | 103 | settable | LTDC | LCD global interrupt | 0x0000 01C0 |
| 97 | 104 | settable | LTDC_ER | LCD error interrupt | 0x0000 01C4 |
| 98 | 105 | settable | DMA2D | DMA2D global interrupt | 0x0000 01C8 |
| 99 | 106 | settable | JPEG | JPEG global interrupt | 0x0000 01CC |
| 100 | 107 | settable | GFXTMMU | GFXTMMU global interrupt | 0x0000 01D0 |
| 101 | 108 | settable | I3C1_WKUP | I3C wake-up Interrupt through EXTI line | 0x0000 01D4 |
| 102 | 109 | settable | MCE1 | MCE1 global interrupt | 0x0000 01D8 |
| 103 | 110 | settable | MCE2 | MCE2 global interrupt | 0x0000 01DC |
| 104 | 111 | settable | MCE3 | MCE3 global interrupt | 0x0000 01E0 |
| 105 | 112 | settable | OSPI1 | OSPI1 / HSPI1 global interrupt | 0x0000 01E4 |
| 106 | 113 | settable | OSPI2 | OSPI2 global interrupt | 0x0000 01E8 |
| 107 | 114 | settable | FMC | FMC global interrupt | 0x0000 01EC |
| 108 | 115 | settable | SDMMC1 | SDMMC1 global interrupt | 0x0000 01F0 |
| 109 | 116 | settable | SDMMC2 | SDMMC2 global interrupt | 0x0000 01F4 |
| - | - | - | - | Reserved | 0x0000 01F8 |
| - | - | - | - | Reserved | 0x0000 01FC |
| 112 | 119 | settable | OTG_FS | USB OTG FS global interrupt | 0x0000 0200 |
| 113 | 120 | settable | TIM12 | TIM12 global interrupt | 0x0000 0204 |
| 114 | 121 | settable | TIM13 | TIM13 global interrupt | 0x0000 0208 |
| 115 | 122 | settable | TIM14 | TIM14 global interrupt | 0x0000 020C |
| 116 | 123 | settable | TIM15 | TIM15 global interrupt | 0x0000 0210 |
| 117 | 124 | settable | TIM16 | TIM16 global interrupt | 0x0000 0214 |
| 118 | 125 | settable | TIM17 | TIM17 global interrupt | 0x0000 0218 |
| 119 | 126 | settable | LPTIM1 | LPTIM1 global interrupt | 0x0000 021C |
| 120 | 127 | settable | LPTIM2 | LPTIM2 global interrupt | 0x0000 0220 |
| 121 | 128 | settable | LPTIM3 | LPTIM3 global interrupt | 0x0000 0224 |
| NVIC position | Priority | Type of priority | Acronym | Description | Address offset |
|---|---|---|---|---|---|
| 122 | 129 | settable | LPTIM4 | LPTIM4 global interrupt | 0x0000 0228 |
| 123 | 130 | settable | LPTIM5 | LPTIM5 global interrupt | 0x0000 022C |
| 124 | 131 | settable | SPDIF_RX | SPDIFRX global interrupt | 0x0000 0230 |
| 125 | 132 | settable | MDOIS | MDOIS global interrupt | 0x0000 0234 |
| 126 | 133 | settable | ADF1_FLT0 | ADF1 filter 0 global interrupt | 0x0000 0238 |
| 127 | 134 | settable | CRS | CRS global interrupt | 0x0000 023C |
| 128 | 135 | settable | UCPD1 | UCPD global interrupt | 0x0000 0240 |
| 129 | 136 | settable | CEC | CEC global interrupt | 0x0000 0244 |
| 130 | 137 | settable | PSSI | PSSI global interrupt | 0x0000 0248 |
| 131 | 138 | settable | LPUART1 | LPUART1 global interrupt | 0x0000 024C |
| 132 | 139 | settable | WAKEUP_PIN | Interrupt for 4 wake-up pins (1, 2, 3, 4) through EXTI line | 0x0000 0250 |
| 133 | 140 | settable | GPDMA1_CH8 | GPDMA1 channel 8 interrupt | 0x0000 0254 |
| 134 | 141 | settable | GPDMA1_CH9 | GPDMA1 channel 9 interrupt | 0x0000 0258 |
| 135 | 142 | settable | GPDMA1_CH10 | GPDMA1 channel 10 interrupt | 0x0000 025C |
| 136 | 143 | settable | GPDMA1_CH11 | GPDMA1 channel 11 interrupt | 0x0000 0260 |
| 137 | 144 | settable | GPDMA1_CH12 | GPDMA1 channel 12 interrupt | 0x0000 0264 |
| 138 | 145 | settable | GPDMA1_CH13 | GPDMA1 channel 13 interrupt | 0x0000 0268 |
| 139 | 146 | settable | GPDMA1_CH14 | GPDMA1 channel 14 interrupt | 0x0000 026C |
| 140 | 147 | settable | GPDMA1_CH15 | GPDMA1 channel 15 interrupt | 0x0000 0270 |
| 141 | 148 | settable | HPDMA1_CH8 | HPDMA1 channel 8 interrupt | 0x0000 0274 |
| 142 | 149 | settable | HPDMA1_CH9 | HPDMA1 channel 9 interrupt | 0x0000 0278 |
| 143 | 150 | settable | HPDMA1_CH10 | HPDMA1 channel 10 interrupt | 0x0000 027C |
| 144 | 151 | settable | HPDMA1_CH11 | HPDMA1 channel 11 interrupt | 0x0000 0280 |
| 145 | 152 | settable | HPDMA1_CH12 | HPDMA1 channel 12 interrupt | 0x0000 0284 |
| 146 | 153 | settable | HPDMA1_CH13 | HPDMA1 channel 13 interrupt | 0x0000 0288 |
| 147 | 154 | settable | HPDMA1_CH14 | HPDMA1 channel 14 interrupt | 0x0000 028C |
| 148 | 155 | settable | HPDMA1_CH15 | HPDMA1 channel 15 interrupt | 0x0000 0290 |
| 149 | 156 | settable | GPU2D | GPU2D global interrupt | 0x0000 0294 |
| NVIC position | Priority | Type of priority | Acronym | Description | Address offset |
|---|---|---|---|---|---|
| 150 | 157 | settable | GPU2D_ER | GPU2D error interrupt | 0x0000 0298 |
| 151 | 158 | settable | TCACHE | GPU cache interrupt | 0x0000 029C |
| 152 | 159 | settable | FDCAN1_IT0 | FDCAN1 interrupt 0 | 0x0000 02A0 |
| 153 | 160 | settable | FDCAN1_IT1 | FDCAN1 interrupt 1 | 0x0000 02A4 |
| 154 | 161 | settable | FDCAN2_IT0 | FDCAN2 interrupt 0 | 0x0000 02A8 |
| 155 | 162 | settable | FDCAN2_IT1 | FDCAN2 interrupt 1 | 0x0000 02AC |
1. When different signals are connected to the same NVIC interrupt line, they are OR-ed.