14. Interrupts and events

14.1 Nested vectored interrupt controller (NVIC)

14.1.1 NVIC main 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 the PM0214 programming manual for Cortex-M4 products.

14.1.2 SysTick calibration value register

The SysTick calibration value is set to 9000, which gives a reference time base of 1 ms with the SysTick clock set to 9 MHz (max \( f_{HCLK}/8 \) ).

14.1.3 Interrupt and exception vectors

Table 82 is the vector table for STM32F303xB/C and STM32F358xC devices. Table 83 is the vector table for STM32F303x6/8 and STM32F328x8 devices.

Table 82. STM32F303xB/C/D/E, STM32F358xC and STM32F398xE vector table

PositionPriorityType of priorityAcronymDescriptionAddress
----Reserved0x0000 0000
--3FixedResetReset0x0000 0004
--2FixedNMINon maskable interrupt. The RCC clock security system (CSS) is linked to the NMI vector.0x0000 0008
--1FixedHardFaultAll classes of fault0x0000 000C
-0SettableMemManageMemory management0x0000 0010
-1SettableBusFaultPre-fetch fault, memory access fault0x0000 0014
-2SettableUsageFaultUndefined instruction or illegal state0x0000 0018
----Reserved0x0000 001C -
0x0000 0028

Table 82. STM32F303xB/C/D/E, STM32F358xC and STM32F398xE vector table (continued)

PositionPriorityType of priorityAcronymDescriptionAddress
-3SettableSVCallSystem service call via SWI instruction0x0000 002C
-5SettablePendSVPendable request for system service0x0000 0038
-6SettableSysTickSystem tick timer0x0000 003C
07SettableWWDGWindow watchdog interrupt0x0000 0040
18SettablePVDPVD through EXTI Line16 detection interrupt0x0000 0044
29SettableTAMPER_STAMPTamper and TimeStamp interrupts through EXTI Line190x0000 0048
310SettableRTC_WKUPRTC wakeup timer interrupt through EXTI Line200x0000 004C
411SettableFLASHFlash global interrupt0x0000 0050
512SettableRCCRCC global interrupt0x0000 0054
613SettableEXTI0EXTI Line0 interrupt0x0000 0058
714SettableEXTI1EXTI Line1 interrupt0x0000 005C
815SettableEXTI2_TSEXTI Line2 and Touch sensing interrupts0x0000 0060
916SettableEXTI3EXTI Line30x0000 0064
1017SettableEXTI4EXTI Line40x0000 0068
1118SettableDMA1_Channel1DMA1 channel 1 interrupt0x0000 006C
1219SettableDMA1_Channel2DMA1 channel 2 interrupt0x0000 0070
1320SettableDMA1_Channel3DMA1 channel 3 interrupt0x0000 0074
1421SettableDMA1_Channel4DMA1 channel 4 interrupt0x0000 0078
1522SettableDMA1_Channel5DMA1 channel 5 interrupt0x0000 007C
1623SettableDMA1_Channel6DMA1 channel 6 interrupt0x0000 0080
1724SettableDMA1_Channel7DMA1 channel 7 interrupt0x0000 0084
1825SettableADC1_2ADC1 and ADC2 global interrupt0x0000 0088
19 (1)26SettableUSB_HP/CAN_TXUSB high priority/CAN_TX interrupts0x0000 008C
20 (1)27SettableUSB_LP/CAN_RX0USB low priority/CAN_RX0 interrupts0x0000 0090
2128SettableCAN_RX1CAN_RX1 interrupt0x0000 0094
2229SettableCAN_SCECAN_SCE interrupt0x0000 0098
2330SettableEXTI9_5EXTI Line[9:5] interrupts0x0000 009C
2431SettableTIM1_BRK/TIM15TIM1 break/TIM15 global interrupts0x0000 00A0
2532SettableTIM1_UP/TIM16TIM1 update/TIM16 global interrupts0x0000 00A4
2633SettableTIM1_TRG_COM /TIM17TIM1 trigger and commutation/TIM17 interrupts0x0000 00A8
2734SettableTIM1_CCTIM1 capture compare interrupt0x0000 00AC

Table 82. STM32F303xB/C/D/E, STM32F358xC and STM32F398xE vector table (continued)

PositionPriorityType of priorityAcronymDescriptionAddress
2835SettableTIM2TIM2 global interrupt0x0000 00B0
2936SettableTIM3TIM3 global interrupt0x0000 00B4
3037SettableTIM4TIM4 global interrupt0x0000 00B8
3138SettableI2C1_EVI2C1 event interrupt & EXTI Line23 interrupt0x0000 00BC
3239SettableI2C1_ERI2C1 error interrupt0x0000 00C0
3340SettableI2C2_EVI2C2 event interrupt & EXTI Line24 interrupt0x0000 00C4
3441SettableI2C2_ERI2C2 error interrupt0x0000 00C8
3542SettableSPI1SPI1 global interrupt0x0000 00CC
3643SettableSPI2SPI2 global interrupt0x0000 00D0
3744SettableUSART1USART1 global interrupt & EXTI Line 250x0000 00D4
3845SettableUSART2USART2 global interrupt & EXTI Line 260x0000 00D8
3946SettableUSART3USART3 global interrupt & EXTI Line 280x0000 00DC
4047SettableEXTI15_10EXTI Line[15:10] interrupts0x0000 00E0
4148SettableRTC_AlarmRTC alarm interrupt0x0000 00E4
42 (1)49SettableUSBWakeUpUSB wakeup from Suspend (EXTI line 18)0x0000 00E8
4350settableTIM8_BRKTIM8 break interrupt0x0000 00EC
4451settableTIM8_UPTIM8 update interrupt0x0000 00F0
4552settableTIM8_TRG_COMTIM8 Trigger and commutation interrupts0x0000 00F4
4653settableTIM8_CCTIM8 capture compare interrupt0x0000 00F8
4754settableADC3ADC3 global interrupt0x0000 00FC
4855SettableFMC (2)FMC global interrupt0x0000 0100
4956-Reserved0x0000 0104
5057-Reserved0x0000 0108
5158SettableSPI3SPI3 global interrupt0x0000 010C
5259SettableUART4UART4 global and EXTI Line 34 interrupts0x0000 0110
5360SettableUART5UART5 global and EXTI Line 35 interrupts0x0000 0114
5461SettableTIM6_DACTIM6 global and DAC1 underrun interrupts.0x0000 0118
5562settableTIM7TIM7 global interrupt0x0000 011C
5663SettableDMA2_Channel1DMA2 channel1 global interrupt0x0000 0120
5764SettableDMA2_Channel2DMA2 channel2 global interrupt0x0000 0124
5865SettableDMA2_Channel3DMA2 channel3 global interrupt0x0000 0128
5966SettableDMA2_Channel4DMA2 channel4 global interrupt0x0000 012C
6067SettableDMA2_Channel5DMA2 channel5 global interrupt0x0000 0130

Table 82. STM32F303xB/C/D/E, STM32F358xC and STM32F398xE vector table (continued)

PositionPriorityType of priorityAcronymDescriptionAddress
6168settableADC4ADC4 global interrupt0x0000 0134
6269-Reserved0x0000 0138
6370-Reserved0x0000 013C
6471SettableCOMP1_2_3COMP1 & COMP2 & COMP3 interrupts combined with EXTI Lines 21, 22 and 29 interrupts.0x0000 0140
6572SettableCOMP4_5_6COMP4 & COMP5 & COMP6 interrupts combined with EXTI Lines 30, 31 and 32 interrupts.0x0000 0144
6673settableCOMP7COMP7 interrupt combined with EXTI Line 33 interrupt0x0000 0148
6774-Reserved0x0000 014C
6875-Reserved0x0000 0150
6976-Reserved0x0000 0154
7077-Reserved0x0000 0158
7178-Reserved0x0000 015C
7279SettableI2C3_EV (2)I2C3 event interrupt0x0000 0160
7380SettableI2C3_ER (2)I2C3 Error interrupt0x0000 0164
7481SettableUSB_HPUSB High priority interrupt0x0000 0168
7582SettableUSB_LPUSB Low priority interrupt0x0000 016C
7683SettableUSB_WakeUp_RMP (see note 1)USB wake up from Suspend and EXTI Line 180x0000 0170
7784settableTIM20_BRK (2)TIM20 Break interrupt0x0000 0174
7885settableTIM20_UP (2)TIM20 Upgrade interrupt0x0000 0178
7986settableTIM20_TRG_COM (2)TIM20 Trigger and Commutation interrupt0x0000 017C
8087settableTIM20_CC (2)TIM20 Capture Compare interrupt0x0000 0180
8188SettableFPUFloating point interrupt0x0000 0184
8289--Reserved0x0000 0188
8390--Reserved0x0000 018C
8491Settable-SPI4 SPI4 global interrupt (2)0x0000 0190

1. It is possible to remap the USB interrupts (USB_HP, USB_LP and USB_WKUP) on interrupt lines 74, 75 and 76 respectively by setting the USB_IT_RMP bit in the Section 12.1.1: SYSCFG configuration register 1 (SYSCFG_CFGR1) on page 248 .

2. Available in STM32F303xD/E only.

Table 83. STM32F303x6/8 and STM32F328x8 vector table

PositionPriorityType of priorityAcronymDescriptionAddress
----Reserved0x0000 0000
--3FixedResetReset0x0000 0004
--2FixedNMINon maskable interrupt. The RCC Clock Security System (CSS) is linked to the NMI vector.0x0000 0008
--1FixedHardFaultAll class of fault0x0000 000C
-0SettableMemManageMemory management0x0000 0010
-1SettableBusFaultPre-fetch fault, memory access fault0x0000 0014
-2SettableUsageFaultUndefined instruction or illegal state0x0000 0018
----Reserved0x0000 001C -
0x0000 0028
-3SettableSVCallSystem service call via SWI instruction0x0000 002C
-5SettablePendSVPendable request for system service0x0000 0038
-6SettableSysTickSystem tick timer0x0000 003C
07SettableWWDGWindow Watchdog interrupt0x0000 0040
18SettablePVDPVD through EXTI line 16 detection interrupt0x0000 0044
29SettableTAMPER_STAMPTamper and TimeStamp interrupts through the EXTI line 190x0000 0048
310SettableRTC_WKUPRTC wakeup timer interrupts through the EXTI line 200x0000 004C
411SettableFLASHFlash global interrupt0x0000 0050
512SettableRCCRCC global interrupt0x0000 0054
613SettableEXTI0EXTI Line0 interrupt0x0000 0058
714SettableEXTI1EXTI Line1 interrupt0x0000 005C
815SettableEXTI2_TSEXTI Line2 and Touch sensing interrupts0x0000 0060
916SettableEXTI3EXTI Line30x0000 0064
1017SettableEXTI4EXTI Line40x0000 0068
1118SettableDMA1_Channel1DMA1 channel 1 interrupt0x0000 006C
1219SettableDMA1_Channel2DMA1 channel 2 interrupt0x0000 0070
1320SettableDMA1_Channel3DMA1 channel 3 interrupt0x0000 0074
1421SettableDMA1_Channel4DMA1 channel 4 interrupt0x0000 0078
1522SettableDMA1_Channel5DMA1 channel 5 interrupt0x0000 007C
1623SettableDMA1_Channel6DMA1 channel 6 interrupt0x0000 0080
1724SettableDMA1_Channel7DMA1 channel 7 interrupt0x0000 0084

Table 83. STM32F303x6/8 and STM32F328x8 vector table (continued)

PositionPriorityType of priorityAcronymDescriptionAddress
1825SettableADC1_2ADC1 and ADC2 global interrupt0x0000 0088
1926SettableCAN_TXCAN_TX interrupts0x0000 008C
2027SettableCAN_RX0CAN_RX0 interrupts0x0000 0090
2128SettableCAN_RX1CAN_RX1 interrupt0x0000 0094
2229SettableCAN_SCECAN_SCE interrupt0x0000 0098
2330SettableEXTI9_5EXTI Line[9:5] interrupts0x0000 009C
2431SettableTIM1_BRK/TIM15TIM1 break/TIM15 global interrupts0x0000 00A0
2532SettableTIM1_UP/TIM16TIM1 update/TIM16 global interrupts0x0000 00A4
2633SettableTIM1_TRG_COM
/TIM17
TIM1 trigger and commutation/TIM17
interrupts
0x0000 00A8
2734SettableTIM1_CCTIM1 capture compare interrupt0x0000 00AC
2835SettableTIM2TIM2 global interrupt0x0000 00B0
2936settableTIM3TIM3 global interrupt0x0000 00B4
3037-Reserved0x0000 00B8
3138SettableI2C1_EVI2C1 event interrupt & EXTI Line23 interrupt0x0000 00BC
3239SettableI2C1_ERI2C1 error interrupt0x0000 00C0
3340-Reserved0x0000 00C4
3441-Reserved0x0000 00C8
3542-SPI1SPI1 global interrupt0x0000 00CC
3643-Reserved0x0000 00D0
3744SettableUSART1USART1 global interrupt & EXTI Line 250x0000 00D4
3845SettableUSART2USART2 global interrupt & EXTI Line 260x0000 00D8
3946SettableUSART3USART3 global interrupt & EXTI Line 280x0000 00DC
4047SettableEXTI15_10EXTI Line[15:10] interrupts0x0000 00E0
4148SettableRTC_AlarmRTC alarm interrupt0x0000 00E4
4249-Reserved0x0000 00E8
4350-Reserved0x0000 00EC
4451-Reserved0x0000 00F0
4552-Reserved0x0000 00F4
4653-Reserved0x0000 00F8
4754-Reserved0x0000 00FC
4855-Reserved0x0000 0100
4956-Reserved0x0000 0104

Table 83. STM32F303x6/8 and STM32F328x8 vector table (continued)

PositionPriorityType of priorityAcronymDescriptionAddress
5057-Reserved0x0000 0108
5158-Reserved0x0000 010C
5259-Reserved0x0000 0110
5360-Reserved0x0000 0114
5461SettableTIM6_DAC1TIM6 global and DAC1 underrun interrupts0x0000 0118
5562settableTIM7_DAC2TIM7 global and DAC2 underrun interrupt0x0000 011C
5663-Reserved0x0000 0120
5764-Reserved0x0000 0124
5865-Reserved0x0000 0128
5966-Reserved0x0000 012C
6067-Reserved0x0000 0130
6168-Reserved0x0000 0134
6269-Reserved0x0000 0138
6370-Reserved0x0000 013C
6471SettableCOMP2COMP2 interrupt combined with EXTI Lines 22 interrupt.0x0000 0140
6572SettableCOMP4_6COMP4 & COMP6 interrupts combined with EXTI Lines 30 and 32 interrupts respectively.0x0000 0144
6673-Reserved0x0000 0148
6774-Reserved0x0000 014C
6875-Reserved0x0000 0150
6976-Reserved0x0000 0154
7077-Reserved0x0000 0158
7178-Reserved0x0000 015C
7279-Reserved0x0000 0160
7380-Reserved0x0000 0164
7481-Reserved0x0000 0168
7582-Reserved0x0000 016C
7683-Reserved0x0000 0170
7784-Reserved0x0000 0174
7885-Reserved0x0000 0178
7986-Reserved0x0000 017C

Table 83. STM32F303x6/8 and STM32F328x8 vector table (continued)

PositionPriorityType of priorityAcronymDescriptionAddress
8087-Reserved0x0000 0180
8188SettableFPUFloating point interrupt0x0000 0184

14.2 Extended interrupts and events controller (EXTI)

The extended interrupts and events controller (EXTI) manages the external and internal asynchronous events/interrupts and generates the event request to the CPU/Interrupt Controller and a wake-up request to the Power Manager.

The EXTI allows the management of up to 36 external/internal event line (28 external event lines and 8 internal event lines).

The active edge of each external interrupt line can be chosen independently, whilst for internal interrupt the active edge is always the rising one. An interrupt could be left pending: in case of an external one, a status register is instantiated and indicates the source of the interrupt; an event is always a simple pulse and it is used for triggering the core wake-up. For internal interrupts, the pending status is assured by the generating peripheral, so no need for a specific flag. Each input line can be masked independently for interrupt or event generation, in addition, the internal lines are sampled only in STOP mode. This controller allows also to emulate the (only) external events by software, multiplexed with the corresponding hardware event line, by writing to a dedicated register.

14.2.1 Main features

The EXTI main features are the following:

14.2.2 Block diagram

The extended interrupt/event block diagram is shown in the following figure.

Figure 50. External interrupt/event block diagram

Figure 50. External interrupt/event block diagram. The diagram shows the internal architecture of an external interrupt/event controller. At the top, an 'AMBA APB bus' connects to a 'Peripheral interface'. Below this, five 28-bit wide registers are shown: 'Pending request register', 'Interrupt mask register', 'Software interrupt event register', 'Rising trigger selection register', and 'Falling trigger selection register'. These registers are connected to a 'PCLK' clock and to the 'AMBA APB bus'. The 'Pending request register' and 'Interrupt mask register' are connected to a 2-input AND gate. The output of this AND gate is connected to a 2-input OR gate. The 'Software interrupt event register' is also connected to this OR gate. The 'Rising trigger selection register' and 'Falling trigger selection register' are connected to an 'Edge detect circuit'. The output of the 'Edge detect circuit' is connected to an 'Input line' and to another 2-input OR gate. The output of this second OR gate is connected to a 'Pulse generator'. The output of the 'Pulse generator' is connected to a 2-input AND gate. The output of this AND gate is connected to the 'Event mask register'. The output of the 'Event mask register' is connected to the 2-input OR gate. The output of the 2-input OR gate is connected to the 'To NVIC interrupt controller'. The diagram is labeled 'MS30250V1' in the bottom right corner.
Figure 50. External interrupt/event block diagram. The diagram shows the internal architecture of an external interrupt/event controller. At the top, an 'AMBA APB bus' connects to a 'Peripheral interface'. Below this, five 28-bit wide registers are shown: 'Pending request register', 'Interrupt mask register', 'Software interrupt event register', 'Rising trigger selection register', and 'Falling trigger selection register'. These registers are connected to a 'PCLK' clock and to the 'AMBA APB bus'. The 'Pending request register' and 'Interrupt mask register' are connected to a 2-input AND gate. The output of this AND gate is connected to a 2-input OR gate. The 'Software interrupt event register' is also connected to this OR gate. The 'Rising trigger selection register' and 'Falling trigger selection register' are connected to an 'Edge detect circuit'. The output of the 'Edge detect circuit' is connected to an 'Input line' and to another 2-input OR gate. The output of this second OR gate is connected to a 'Pulse generator'. The output of the 'Pulse generator' is connected to a 2-input AND gate. The output of this AND gate is connected to the 'Event mask register'. The output of the 'Event mask register' is connected to the 2-input OR gate. The output of the 2-input OR gate is connected to the 'To NVIC interrupt controller'. The diagram is labeled 'MS30250V1' in the bottom right corner.

14.2.3 Wake-up event management

STM32F3xx devices are able to handle external or internal events to wake up the core (WFE). The wake-up event can be generated either by:

14.2.4 Asynchronous Internal Interrupts

Some communication peripherals (UART, I2C) are able to generate events when the system is in run mode and also when the system is in stop mode allowing to wake up the system from stop mode.

To accomplish this, the peripheral is asked to generate both a synchronized (to the system clock, for example, APB clock) and an asynchronous version of the event.

14.2.5 Functional description

For the external interrupt lines, to generate the interrupt, the interrupt line should be configured and enabled. This is done by programming the two trigger registers with the desired edge detection and by enabling the interrupt request by writing a '1' to the corresponding bit in the interrupt mask register. When the selected edge occurs on the external interrupt line, an interrupt request is generated. The pending bit corresponding to the interrupt line is also set. This request is reset by writing a 1 in the pending register.

For the internal interrupt lines, the active edge is always the rising edge. The interrupt is enabled by default in the interrupt mask register and there is no corresponding pending bit in the pending register.

To generate the event, the event line should be configured and enabled. This is done by programming the two trigger registers with the desired edge detection and by enabling the event request by writing a '1' to the corresponding bit in the event mask register. When the selected edge occurs on the event line, an event pulse is generated. The pending bit corresponding to the event line is not set.

For the external lines, an interrupt/event request can also be generated by software by writing a 1 in the software interrupt/event register.

Note: The interrupts or events associated to the internal lines can be triggered only when the system is in STOP mode. If the system is still running, no interrupt/event is generated.

Hardware interrupt selection

To configure a line as interrupt source, use the following procedure:

Hardware event selection

To configure a line as event source, use the following procedure:

Software interrupt/event selection

Any of the external lines can be configured as software interrupt/event lines. The following is the procedure to generate a software interrupt.

14.2.6 External and internal interrupt/event line mapping

36 interrupt/event lines are available: 8 lines are internal (including the reserved ones); the remaining 28 lines are external.

The GPIOs are connected to the 16 external interrupt/event lines in the following manner:

Figure 51. External interrupt/event GPIO mapping

Diagram showing the mapping of GPIO pins to external interrupt lines (EXTI0 to EXTI15) via multiplexers controlled by SYSCFG_EXTICR registers.

The diagram illustrates the mapping of GPIO pins to external interrupt lines. It consists of three multiplexer blocks, each controlled by a specific register bit field:

Vertical ellipses between the EXTI1 and EXTI15 blocks indicate that the same pattern repeats for the remaining interrupt lines (EXTI2 through EXTI14). Each multiplexer has a single output line labeled with its corresponding EXTI number (e.g., EXTI0, EXTI1, EXTI15).

MS35561V1

Diagram showing the mapping of GPIO pins to external interrupt lines (EXTI0 to EXTI15) via multiplexers controlled by SYSCFG_EXTICR registers.

The remaining lines are connected as follows:

Note: EXTI lines 23, 24, 25, 26, 27, 28, 34 and 35 are internal.

14.3 EXTI registers

Refer to Section 2.2 for a list of abbreviations used in register descriptions.

The peripheral registers have to be accessed by words (32-bit).

14.3.1 Interrupt mask register (EXTI_IMR1)

Address offset: 0x00

Reset value: 0x1F80 0000 (Refer to the note below)

31302928272625242322212019181716
MR31MR30MR29MR28MR27MR26MR25MR24MR23MR22MR21MR20MR19MR18MR17MR16
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

1514131211109876543210
MR15MR14MR13MR12MR11MR10MR9MR8MR7MR6MR5MR4MR3MR2MR1MR0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 MRx : Interrupt Mask on external/internal line x

0: Interrupt request from Line x is masked

1: Interrupt request from Line x is not masked

Note: The reset value for the internal lines (23, 24, 25, 26, 27 and 28) is set to '1' to enable the interrupt by default.

14.3.2 Event mask register (EXTI_EMR1)

Address offset: 0x04

Reset value: 0x0000 0000

31302928272625242322212019181716
MR31MR30MR29MR28MR27MR26MR25MR24MR23MR22MR21MR20MR19MR18MR17MR16
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

1514131211109876543210
MR15MR14MR13MR12MR11MR10MR9MR8MR7MR6MR5MR4MR3MR2MR1MR0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 MRx : Event Mask on external/internal line x

0: Event request from Line x is masked

1: Event request from Line x is not masked

14.3.3 Rising trigger selection register (EXTI_RTSR1)

Address offset: 0x08

Reset value: 0x0000 0000

31302928272625242322212019181716
TR31TR30TR29Res.Res.Res.Res.Res.Res.TR22TR21TR20TR19TR18TR17TR16
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TR15TR14TR13TR12TR11TR10TR9TR8TR7TR6TR5TR4TR3TR2TR1TR0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:29 TRx : Rising trigger event configuration bit of line x (x = 31 to 29)

0: Rising trigger disabled (for Event and Interrupt) for input line

1: Rising trigger enabled (for Event and Interrupt) for input line.

Bits 28:23 Reserved, must be kept at reset value.

Bits 22:0 TRx : Rising trigger event configuration bit of line x (x = 22 to 0)

0: Rising trigger disabled (for Event and Interrupt) for input line

1: Rising trigger enabled (for Event and Interrupt) for input line.

Note: The external wake-up lines are edge-triggered. No glitches must be generated on these lines. If a rising edge on an external interrupt line occurs during a write operation in the EXTI_RTSR register, the pending bit is not set.

Rising and falling edge triggers can be set for the same interrupt line. In this case, both generate a trigger condition.

14.3.4 Falling trigger selection register (EXTI_FTSR1)

Address offset: 0x0C

Reset value: 0x0000 0000

31302928272625242322212019181716
TR31TR30TR29Res.Res.Res.Res.Res.Res.TR22TR21TR20TR19TR18TR17TR16
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TR15TR14TR13TR12TR11TR10TR9TR8TR7TR6TR5TR4TR3TR2TR1TR0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:29 TRx : Falling trigger event configuration bit of line x (x = 31 to 29)

0: Falling trigger disabled (for Event and Interrupt) for input line

1: Falling trigger enabled (for Event and Interrupt) for input line.

Bits 28:23 Reserved, must be kept at reset value.

Bits 22:0 TRx : Falling trigger event configuration bit of line x (x = 22 to 0)

0: Falling trigger disabled (for Event and Interrupt) for input line

1: Falling trigger enabled (for Event and Interrupt) for input line.

Note: The external wake-up lines are edge-triggered. No glitches must be generated on these lines. If a falling edge on an external interrupt line occurs during a write operation to the EXTI_FTSR register, the pending bit is not set.

Rising and falling edge triggers can be set for the same interrupt line. In this case, both generate a trigger condition.

14.3.5 Software interrupt event register (EXTI_SWIER1)

Address offset: 0x10

Reset value: 0x0000 0000

31302928272625242322212019181716
SWIER 31SWIER 30SWIER 29Res.Res.Res.Res.Res.Res.SWIER 22SWIER 21SWIER 20SWIER 19SWIER 18SWIER 17SWIER 16
rwrwrwrwrwrwrwrwrwrw

1514131211109876543210
SWIER 15SWIER 14SWIER 13SWIER 12SWIER 11SWIER 10SWIER 9SWIER 8SWIER 7SWIER 6SWIER 5SWIER 4SWIER 3SWIER 2SWIER 1SWIER 0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31: 29 SWIERx : Software interrupt on line x (x = 31 to 29)

If the interrupt is enabled on this line in the EXTI_IMR, writing a '1' to this bit when it is at '0' sets the corresponding pending bit in EXTI_PR resulting in an interrupt request generation.

This bit is cleared by clearing the corresponding bit in the EXTI_PR register (by writing a '1' into the bit).

Bits 22:0 SWIERx : Software interrupt on line x (x = 22 to 0)

If the interrupt is enabled on this line in the EXTI_IMR, writing a '1' to this bit when it is at '0' sets the corresponding pending bit in EXTI_PR resulting in an interrupt request generation.

This bit is cleared by clearing the corresponding bit of EXTI_PR (by writing a '1' into the bit).

14.3.6 Pending register (EXTI_PR1)

Address offset: 0x14

Reset value: 0x0000 0000

31302928272625242322212019181716
PR31PR30PR29Res.Res.Res.Res.Res.Res.PR22PR21PR20PR19PR18PR17PR16
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

1514131211109876543210
PR15PR14PR13PR12PR11PR10PR9PR8PR7PR6PR5PR4PR3PR2PR1PR0
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

Bits 31:29 PRx : Pending bit on line x (x = 31 to 29)

0: No trigger request occurred

1: Selected trigger request occurred

This bit is set when the selected edge event arrives on the external interrupt line.

This bit is cleared by writing a '1' to the bit.

Bits 28:23 Reserved, must be kept at reset value.

Bits 22:0 PRx : Pending bit on line x (x = 22 to 0)

0: No trigger request occurred

1: Selected trigger request occurred

This bit is set when the selected edge event arrives on the external interrupt line.

This bit is cleared by writing a '1' to the bit.

14.3.7 Interrupt mask register (EXTI_IMR2)

Address offset: 0x20

Reset value: 0xFFFF FFFC (See note below)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MR35MR34MR33MR32
rwrwrwrw

Bits 31:4 Reserved, must be kept at reset value

Bits 3:0 MRx : Interrupt mask on external/internal line x, x = 32..35

0: Interrupt request from Line x is masked

1: Interrupt request from Line x is not masked

Note: The reset value for the internal lines (34 and 35) and reserved lines is set to '1'.

14.3.8 Event mask register (EXTI_EMR2)

Address offset: 0x24

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MR35MR34MR33MR32
rwrwrwrw

Bits 31:4 Reserved, must be kept at reset value

Bits 3:0 MRx : Event mask on external/internal line x, x = 32..35

0: Event request from Line x is masked

1: Event request from Line x is not masked

14.3.9 Rising trigger selection register (EXTI_RTSR2)

Address offset: 0x28

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TR33TR32
rwrw

Bits 31:2 Reserved, must be kept at reset value.

Bits 1:0 TRx : Rising trigger event configuration bit of line x (x = 32, 33)

0: Rising trigger disabled (for Event and Interrupt) for input line

1: Rising trigger enabled (for Event and Interrupt) for input line.

Note: The external wake-up lines are edge-triggered. No glitches must be generated on these lines. If a rising edge on an external interrupt line occurs during a write operation to the EXTI_RTSR register, the pending bit is not set.

Rising and falling edge triggers can be set for the same interrupt line. In this case, both generate a trigger condition.

14.3.10 Falling trigger selection register (EXTI_FTSR2)

Address offset: 0x2C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TR33TR32
rwrw

Bits 31:2 Reserved, must be kept at reset value.

Bits 1:0 TRx : Falling trigger event configuration bit of line x (x = 32, 33)

0: Falling trigger disabled (for Event and Interrupt) for input line

1: Falling trigger enabled (for Event and Interrupt) for input line.

Note: The external wake-up lines are edge-triggered. No glitches must be generated on these lines. If a falling edge on an external interrupt line occurs during a write operation to the EXTI_FTSR register, the pending bit is not set.

Rising and falling edge triggers can be set for the same interrupt line. In this case, both generate a trigger condition.

14.3.11 Software interrupt event register (EXTI_SWIER2)

Address offset: 0x30

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWIER
33
SWIER
32
rwrw

Bits 31:2 Reserved, must be kept at reset value.

Bits 1:0 SWIERx : Software interrupt on line x (x = 32, 33)

If the interrupt is enabled on this line in the EXTI_IMR , writing a '1' to this bit when it is at '0' sets the corresponding pending bit in EXTI_PR resulting in an interrupt request generation.

This bit is cleared by clearing the corresponding bit of EXTI_PR (by writing a '1' to the bit).

14.3.12 Pending register (EXTI_PR2)

Address offset: 0x34

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PR33PR32
rc_w1rc_w1

Bits 31:2 Reserved, must be kept at reset value.

Bits 1:0 PRx : Pending bit on line x (x = 32,33)

0: No trigger request occurred

1: Selected trigger request occurred

This bit is set when the selected edge event arrives on the external interrupt line.

This bit is cleared by writing a '1' into the bit.

14.3.13 EXTI register map

Table 84. External interrupt/event controller register map and reset values

OffsetRegister313029282726252423222120191817161514131211109876543210
0x00EXTI_IMR1MR[31:0]
Reset value00011111100000000000000000000
0x04EXTI_EMR1MR[31:0]
Reset value0000000000000000000000000000000
0x08EXTI_RTSR1TR[31:29]Res.Res.Res.Res.Res.Res.TR[22:0]
Reset value0000000000000000000000000
0x0CEXTI_FTSR1TR[31:29]Res.Res.Res.Res.Res.Res.TR[22:0]
Reset value0000000000000000000000000
0x10EXTI_SWIER1SWIER[31:29]Res.Res.Res.Res.Res.Res.SWIER[22:0]
Reset value0000000000000000000000000
0x14EXTI_PR1PR[31:29]Res.Res.Res.Res.Res.Res.PR[22:0]
Reset value0000000000000000000000000
0x20EXTI_IMR2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MR35MR34MR33MR32
Reset value1100
0x24EXTI_EMR2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MR35MR34MR33MR32
Reset value0000
0x28EXTI_RTSR2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TR33TR32
Reset value00
0x2CEXTI_FTSR2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TR33TR32
Reset value00
0x30EXTI_SWIER2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWIER33SWIER32
Reset value00
0x34EXTI_PR2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PR33PR32
Reset value00
Refer to Section 3.2 on page 53 for the register boundary addresses.