20. Nested vectored interrupt controllers (NVIC1 and NVIC2)

20.1 NVIC features

Both CPU1 (Cortex ® -M7) and CPU2 (Cortex ® -M4) cores have their own nested vector interrupt controller (respectively NVIC1 and NVIC2). The NVIC includes the following features:

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 and PM0214 programming manuals for Cortex ® -M7 and for Cortex ® -M4, respectively.

20.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:

\[ \text{reload value} = (F_{\text{HCLK}} \times \text{SYST\_CALIB}) - 1 \]

\[ \text{reload value} = ((F_{\text{HCLK}} / 8) \times \text{SYST\_CALIB}) - 1 \]

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:

\[ \text{reload value} = (100 \times \text{SYST\_CALIB}) - 1 = 0x1869F \]

20.1.2 Interrupt and exception vectors

Each CPU has its own exceptions connected to its Nested vectored interrupt controller (NVIC): reset, NMI, HardFault, MemManage, Bus Fault, UsageFault, SVCall, DebugMonitor, PendSV, SysTick.

Each CPU also has its own Floating Point Unit (FPU) interrupt connected to its Nested Vectored Interrupt Controller (NVIC), in position 81.

The Window Watchdog 1 (WWDG1) interrupt is connected to the CPU1 NVIC (NVIC1) position 0, while Window Watchdog 2 (WWDG2) interrupt is connected to the CPU2 NVIC (NVIC2) position 0.

The Window Watchdog 1 (WWDG1) reset output signal is connected to the CPU2 NVIC (NVIC2) position 143 via the Extended Interrupt and Event Controller (EXTI). Similarly, the Window Watchdog 2 (WWDG2) reset output signal is connected to the CPU1 NVIC (NVIC1) position 143 via the Extended Interrupt and Event Controller (EXTI).

Refer to Section 47: System window watchdog (WWDG) and Section 48: Independent watchdog (IWDG) for the description of watchdog interrupts and reset.

Hardware Semaphore (HSEM) interrupt line 0 is connected to the CPU1 NVIC (NVIC1) position 125, while Hardware Semaphore (HSEM) interrupt line 1 is connected to the CPU2 NVIC (NVIC2) position 126.

The CPU2 hold interrupt is connected to the CPU1 NVIC (NVIC1) position 148. Similarly, the CPU1 hold interrupt is connected to the CPU2 NVIC (NVIC2) position 148. Refer to Power control (PWR) for the description of the CPU hold mechanism.

All other interrupt lines coming from peripherals are connected in a symmetrical way on both NVIC1 and NVIC2.

Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1)

SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
-----Reserved0x0000 0000
--3-Reset-Reset0x0000 0004
--2-NMI-Non maskable interrupt. The RCC Clock Security System (CSS) is linked to the NMI vector.0x0000 0008
--1-HardFault-All classes of fault0x0000 000C
-0-MemManage-Memory management0x0000 0010
-1-BusFault-Prefetch fault, memory access fault0x0000 0014
-2-UsageFault-Undefined instruction or illegal state0x0000 0018
-----Reserved0x0000 001C-
0x0000 002B
-3-SVCall-System service call via SWI instruction0x0000 002C
-4-DebugMonitor-Debug monitor0x0000 0030
-----Reserved0x0000 0034
-5-PendSV-Pendable request for system service0x0000 0038
-6-Systick-System tick timer0x0000 003C
Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1) (continued)
SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
wwdg1_it70WWDG1-Window Watchdog interrupt0x0000 0040
wwdg2_it-WWDG20
exti_pwr_pvd_wkup81PVD_PVM1PVD through EXTI line detection interrupt0x0000 0044
exti_tamp_rtc_wkup92RTC_TAMP_STAMP
_CSS_LSE
2RTC tamper, timestamp0x0000 0048
lsecss_rcc_itCSS LSE
exti_wkup_rtc_wkup103RTC_WKUP3RTC Wakeup interrupt through the EXTI line0x0000 004C
flash_it114FLASH4Flash memory global interrupt0x0000 0050
rcc_it125RCC5RCC global interrupt0x0000 0054
exti_exti0_wkup136EXTI06EXTI Line 0 interrupt0x0000 0058
exti_exti1_wkup147EXTI17EXTI Line 1 interrupt0x0000 005C
exti_exti2_wkup158EXTI28EXTI Line 2 interrupt0x0000 0060
exti_exti3_wkup169EXTI39EXTI Line 3 interrupt0x0000 0064
exti_exti4_wkup1710EXTI410EXTI Line 4 interrupt0x0000 0068
dma1_it01811DMA_STR011DMA1 Stream0 global interrupt0x0000 006C
dma1_it11912DMA_STR112DMA1 Stream1 global interrupt0x0000 0070
dma1_it22013DMA_STR213DMA1 Stream2 global interrupt0x0000 0074
dma1_it32114DMA_STR314DMA1 Stream3 global interrupt0x0000 0078
dma1_it42215DMA_STR415DMA1 Stream4 global interrupt0x0000 007C
dma1_it52316DMA_STR516DMA1 Stream5 global interrupt0x0000 0080
dma1_it62417DMA_STR617DMA1 Stream6 global interrupt0x0000 0084
adc1_it2518ADC1_218ADC1 and ADC2 global interrupt0x0000 0088
adc2_it
ttfdcan_intr0_it2619FDCAN1_IT019FDCAN1 Interrupt 00x0000 008C
fdcan_intr0_it2720FDCAN2_IT020FDCAN2 Interrupt 00x0000 0090
ttfdcan_intr1_it2821FDCAN1_IT121FDCAN1 Interrupt 10x0000 0094
fdcan_intr1_it2922FDCAN2_IT122FDCAN2 Interrupt 10x0000 0098
Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1) (continued)
SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
exti_exti5_wkup3023EXTI9_523EXTI Line[9:5] interrupts0x 0000 009C
exti_exti6_wkup
exti_exti7_wkup
exti_exti8_wkup
exti_exti9_wkup
tim1_brk_it3124TIM1_BRK24TIM1 break interrupt0x0000 00A0
tim1_upd_it3225TIM1_UP25TIM1 update interrupt0x0000 00A4
tim1_trg_it3326TIM1_TRG_COM26TIM1 trigger and commutation interrupts0x0000 00A8
tim1_cc_it3427TIM_CC27TIM1 capture / compare interrupt0x0000 00AC
tim2_it3528TIM228TIM2 global interrupt0x0000 00B0
tim3_it3629TIM329TIM3 global interrupt0x0000 00B4
tim4_it3730TIM430TIM4 global interrupt0x0000 00B8
i2c1_ev_it3831I2C1_EV31I2C1 event interrupt0x0000 00BC
exti_i2c1_ev_wkup
i2c1_err_it3932I2C1_ER32I2C1 error interrupt0x0000 00C0
i2c2_ev_it4033I2C2_EV33I2C2 event interrupt0x0000 00C4
exti_i2c2_ev_wkup
i2c2_err_it4134I2C2_ER34I2C2 error interrupt0x0000 00C8
spi1_it4235SPI135SPI1 global interrupt0x0000 00CC
exti_spi1_it
spi2_it4336SPI236SPI2 global interrupt0x0000 00D0
exti_spi2_it
usart1_gbl_it4437USART137USART1 global interrupt0x0000 00D4
exti_usart1_wkup
usart2_gbl_it4538USART238USART2 global interrupt0x0000 00D8
exti_usart2_wkup
usart3_gbl_it4639USART339USART3 global interrupt0x0000 00DC
exti_usart3_wkup
Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1) (continued)
SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
exti_exti10_it4740EXTI15_1040EXTI Line[15:10] interrupts0x0000 00E0
exti_exti11_wkup
exti_exti12_wkup
exti_exti13_wkup
exti_exti14_wkup
exti_exti15_wkup
exti_rtc_al4841RTC_ALARM41RTC alarms (A and B) through EXTI Line interrupts0x0000 00E4
-4942-42-0x0000 00E8
tim8_brk_it5043TIM8_BRK_TIM1243TIM8 break and TIM12 global interrupts0x0000 00EC
tim12_gbl_it
tim8_upd_it5144TIM8_UP_TIM1344TIM8 update and TIM13 global interrupts0x0000 00F0
tim13_gbl_it
tim8_trg_it5245TIM8_TRG_COM_TIM1445TIM8 trigger /commutation and TIM14 global interrupts0x0000 00F4
tim14_gbl_it
tim8_cc_it5346TIM8_CC46TIM8 capture / compare interrupts0x0000 00F8
dma1_it75447DMA1_STR747DMA1 Stream7 global interrupt0x0000 00FC
fmc_gbl_it5548FMC48FMC global interrupt0x0000 0100
sdmmc1_it5649SDMMC149SDMMC global interrupt0x0000 0104
tim5_gbl_it5750TIM550TIM5 global interrupt0x0000 0108
spi3_it5851SPI351SPI3 global interrupt0x0000 010C
exti_spi3_wkup
uart4_gbl_it5952UART452UART4 global interrupt0x0000 0110
exti_uart4_wkup
uart5_gbl_it6053UART553UART5 global interrupt0x0000 0114
exti_uart5_wkup
tim6_gbl_it6154TIM6_DAC54TIM6 global interrupt0x0000 0118
dac_unr_itDAC underrun error interrupt
tim7_gbl_it6255TIM755TIM7 global interrupt0x0000 011C
dma2_it06356DMA2_STR056DMA2 Stream0 interrupt0x0000 0120
dma2_it16457DMA2_STR157DMA2 Stream1 interrupt0x0000 0124
dma2_it26558DMA2_STR258DMA2 Stream2 interrupt0x0000 0128
Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1) (continued)
SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
dma2_it36659DMA2_STR359DMA2 Stream3 interrupt0x0000 012C
dma2_it46760DMA2_STR460DMA2 Stream4 interrupt0x0000 0130
eth_sbd_intr_it6861ETH61Ethernet global interrupt0x0000 0134
exti_eth_wkup6962ETH_WKUP62Ethernet wakeup through EXTI line interrupt0x0000 0138
fdcan_cal_it7063FDCAN_CAL63FDCAN calibration interrupts0x0000 013C
cm7_sev_it71--64Arm® Cortex®-M7 Send even interrupt0x0000 0140
cm4_sev_it7265--Arm® Cortex®-M4 Send even interrupt0x0000 0144
NC7366-66-0x0000 0148
NC7467-67-0x0000 014C
dma2_it57568DMA2_STR568DMA2 Stream5 interrupt0x0000 0150
dma2_it67669DMA2_STR669DMA2 Stream6 interrupt0x0000 0154
dma2_it77770DMA2_STR770DMA2 Stream7 interrupt0x0000 0158
usart6_gbl_it7871USART671USART6 global interrupt0x0000 015C
exti_usart6_wkupUSART6 wakeup interrupt
i2c3_ev_it7972I2C3_EV72I2C3 event interrupt0x0000 0160
exti_i2c3_ev_wkup
i2c3_err_it8073I2C3_ER73I2C3 error interrupt0x0000 0164
usb1_out_it8174OTG_HS_EP1_OUT74OTG_HS out global interrupt0x0000 0168
usb1_in_it8275OTG_HS_EP1_IN75OTG_HS in global interrupt0x0000 016C
exti_usb1_wkup8376OTG_HS_WKUP76OTG_HS wakeup interrupt0x0000 0170
usb1_gbl_it8477OTG_HS77OTG_HS global interrupt0x0000 0174
dcmi_it8578DCMI78DCMI global interrupt0x0000 0178
cryp_it8679CRYP79CRYP global interrupt0x0000 017C
hash_rng_it8780HASH_RNG80HASH and RNG global interrupt0x0000 0180
cpu1_fpu_it8881FPU-CPU1 FPU0x0000 0184
cpu2_fpu_it-FPU81CPU2 FPU
uart7_gbl_it8982UART782UART7 global interrupt0x0000 0188
exti_uart7_wkup
uart8_gbl_it9083UART883UART8 global interrupt0x0000 018C
exti_uart8_wkup
Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1) (continued)
SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
spi4_it9184SPI484SPI4 global interrupt0x0000 0190
exti_spi4_wkup
spi5_it9285SPI585SPI5 global interrupt0x0000 0194
exti_spi5_wkup
spi6_it9386SPI686SPI6 global interrupt0x0000 0198
exti_spi6_wkup
sai1_glb_it9487SAI187SAI1 global interrupt0x0000 019C
ltdc_it9588LTDC88LCD-TFT global interrupt0x0000 01A0
ltdc_err_it9689LTDC_ER89LCD-TFT error interrupt0x0000 01A4
dma2d_gbl_it9790DMA2D90DMA2D global interrupt0x0000 01A8
sai2_gbl_it9891SAI291SAI2 global interrupt0x0000 01AC
quadspi_it9992QUADSPI92QuadSPI global interrupt0x0000 01B0
lptim1_it10093LPTIM193LPTIM1 global interrupt0x0000 01B4
exti_lptim_wkup
cec_it10194CEC94HDMI-CEC global interrupt0x0000 01B8
exti_cec_it
i2c4_ev_it10295I2C4_EV95I2C4 event interrupt0x0000 01BC
exti_i2c4_ev_it
i2c4_err_it10396I2C4_ER96I2C4 error interrupt0x0000 01C0
spdifrx_it10497SPDIF97SPDIFRX global interrupt0x0000 01C4
usb2_out_it10598OTG_FS_EP1_OUT98OTG_FS out global interrupt0x0000 01C8
usb2_in_it10699OTG_FS_EP1_IN99OTG_FS in global interrupt0x0000 01CC
exti_usb2_wkup107100OTG_FS_WKUP100OTG_FS wakeup0x0000 01D0
usb2_gbl_it108101OTG_FS101OTG_FS global interrupt0x0000 01D4
dmamux1_ovr_it109102DMAMUX1_OV102DMAMUX1 overrun interrupt0x0000 01D8
hrtim1_mst_it110103HRTIM1_MST103HRTIM1 master timer interrupt0x0000 01DC
hrtim1_tima_it111104HRTIM1_TIMA104HRTIM1 timer A interrupt0x0000 01E0
hrtim1_timb_it112105HRTIM1_TIMB105HRTIM1 timer B interrupt0x0000 01E4
hrtim1_timc_it113106HRTIM1_TIMC106HRTIM1 timer C interrupt0x0000 01E8
hrtim1_timd_it114107HRTIM1_TIMD107HRTIM1 timer D interrupt0x0000 01EC
hrtim1_time_it115108HRTIM1_TIME108HRTIM1 timer E interrupt0x0000 01F0
hrtim1_fault_it116109HRTIM1_FLT109HRTIM1 fault interrupt0x0000 01F4
dfsdm1_it0117110DFSDM1_FLT0110DFSDM1 filter 0 interrupt0x0000 01F8
Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1) (continued)
SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
dfsdm1_it1118111DFSDM1_FLT1111DFSDM1 filter 1 interrupt0x0000 01FC
dfsdm1_it2119112DFSDM1_FLT2112DFSDM1 filter 2 interrupt0x0000 0200
dfsdm1_it3120113DFSDM1_FLT3113DFSDM1 filter 3 interrupt0x0000 0204
sai3_gbl_it121114SAI3114SAI3 global interrupt0x0000 0208
swpmi_gbl_it122115SWPMI1115SWPMI global interrupt0x0000 020C
exti_swpmi_wupSWPMI wakeup
tim15_gbl_it123116TIM15116TIM15 global interrupt0x0000 0210
tim16_gbl_it124117TIM16117TIM16 global interrupt0x0000 0214
tim17_gbl_it125118TIM17118TIM17 global interrupt0x0000 0218
exti_mdios_wkup126119MDIOS_WKUP119MDIOS wakeup0x0000 021C
mdios_it127120MDIOS120MDIOS global interrupt0x0000 0220
jpeg_it128121JPEG121JPEG global interrupt0x0000 0224
mdma_it129122MDMA122MDMA0x0000 0228
dsi_it130123DSI123DSI Host global interrupt0x0000 022C
exti_dsi_wkupDSI_WKUPDSI Host wakeup interrupt
sdmmc2_it131124SDMMC2124SDMMC global interrupt0x0000 0230
hsem1_it132125HSEM0-HSEM global interrupt 10x0000 0234
hsem2_it133-HSEM1126HSEM global interrupt 20x0000 0238
adc3_it134127ADC3127ADC3 global interrupt0x0000 023C
dmamux2_ovr_it135128DMAMUX2_OVR128DMAMUX2 overrun interrupt0x0000 0240
bdma_ch0_it136129BDMA_CH0129BDMA channel 0 interrupt0x0000 0244
bdma_ch1_it137130BDMA_CH1130BDMA channel 1 interrupt0x0000 0248
bdma_ch2_it138131BDMA_CH2131BDMA channel 2 interrupt0x0000 024C
bdma_ch3_it139132BDMA_CH3132BDMA channel 3 interrupt0x0000 0250
bdma_ch4_it140133BDMA_CH4133BDMA channel 4 interrupt0x0000 0254
bdma_ch5_it141134BDMA_CH5134BDMA channel 5 interrupt0x0000 0258
bdma_ch6_it142135BDMA_CH6135BDMA channel 6 interrupt0x0000 025C
bdma_ch7_it143136BDMA_CH7136BDMA channel 7 interrupt0x0000 0260
comp_gbl_it144137COMP137COMP1 and COMP2 global interrupt0x0000 0264
exti_comp1_wkup
exti_comp2_wkup
lptim2_it145138LPTIM2138LPTIM2 timer interrupt0x0000 0268
exti_lptim2_wkup
Table 149. NVIC1 (CPU1) and NVIC2 (CPU2) (1) (continued)
SignalPriorityNVIC1 positionAcronymNVIC2 positionDescriptionAddress offset
lptim3_it146139LPTIM3139LPTIM2 timer interrupt0x0000 026C
exti_lptim3_wkup
lptim4_it147140LPTIM4140LPTIM2 timer interrupt0x0000 0270
exti_lptim4_wkup
lptim5_it148141LPTIM5141LPTIM2 timer interrupt0x0000 0274
exti_lptim5_wkup
lpuart_gbl_it149142LPUART142LPUART global interrupt0x0000 0278
exti_lpuart_rx_it
exti_lpuart_tx_it
exti_d2_wwdg_wkup150143WWDG2_RST-Window Watchdog interrupt0x0000 027C
exti_d1_wwdg_wkup-WWDG1_RST143Window Watchdog interrupt
crs_it151144CRS144Clock Recovery System global interrupt0x0000 0280
ramecc1_it152145ECC145ECC diagnostic global interrupt for RAM D10x0000 0284
ramecc2_itECC diagnostic global interrupt for RAM D2
ramecc3_itECC diagnostic global interrupt for RAM D3
sai4_glb_it153146SAI4146SAI4 global interrupt0x0000 0288
cpu1hold_it155148HOLD_CORE (CPU1_HOLD)-CPU1 hold0x0000 0290
cpu2hold_it-HOLD_CORE (CPU2_HOLD)148CPU2 hold
exti_wkup1_wkup156149WKUP149WKUP0 to WKUP5 pins0x0000 0294
exti_wkup2_wkup
exti_wkup3_wkup
exti_wkup4_wkup
exti_wkup5_wkup
exti_wkup6_wkup

1. When different signals are connected to the same NVIC interrupt line, they are OR-ed.