13. Extended interrupt and event controller (EXTI)

The Extended interrupt and event controller (EXTI) manages the CPU and system wake-up through configurable and direct event inputs (lines). It provides wake-up requests to the power control, and generates an interrupt request to the CPU NVIC and events to the CPU event input. For the CPU an additional event generation block (EVG) is needed to generate the CPU event signal.

The EXTI wake-up requests allow the system to be woken up from Stop modes.

The interrupt request and event request generation can also be used in Run modes.

The EXTI also includes the EXTI I/O port mux.

13.1 EXTI main features

The EXTI main features are the following:

13.2 EXTI block diagram

The EXTI consists of a register block accessed via an AHB interface, the event input trigger block, the masking block, and EXTI mux as shown in Figure 26 .

The register block contains all the EXTI registers.

The event input trigger block provides an event input edge trigger logic.

The masking block provides the event input distribution to the different wake-up, interrupt and event outputs, and the masking of these.

The EXTI mux provides the I/O port selection on to the EXTI event signal.

Figure 26. EXTI block diagram

EXTI block diagram showing internal components like Registers, EXTI mux, Event Trigger, and Masking, and their connections to GPIO, Peripherals, CPU, and PWR blocks. It also shows external connections like AHB interface, hclk, and various event signals.

The diagram illustrates the internal architecture of the EXTI block. On the left, external blocks 'GPIO' and 'Peripherals' are connected. 'GPIO' connects via 'IOPort' to an 'EXTI mux'. 'Peripherals' connect via 'Wakeup' (Configurable event(15:0)) and 'Interrupt' (Direct event(x) or configurable event(y)) signals to an 'Event Trigger'. The 'Event Trigger' sends 'events' to a 'Masking' block. The 'Masking' block connects to a 'Pulse' block within an 'EVG' (Event Generator) unit. The 'EVG' unit also receives 'c_evt_rst' and 'c_fclk' signals and outputs 'c_event' and 'rxev' signals to a 'CPU' block. The 'CPU' block also receives 'it_exti_per(y)*' signals. The 'Registers' block is connected to an 'AHB interface' and 'hclk' signal, and it interfaces with the 'EXTI mux', 'Event Trigger', and 'Masking' block. The 'Registers' block also outputs 'exti[15:0]' to an external 'To interconnect' block, and 'sys_wakeup' and 'c_wakeup' signals to a 'PWR' (Power) block. A note at the bottom left states: '* it_exti_per(y) are only available for configurable events (y)'. The diagram is labeled 'MS44733V2' at the bottom right.

EXTI block diagram showing internal components like Registers, EXTI mux, Event Trigger, and Masking, and their connections to GPIO, Peripherals, CPU, and PWR blocks. It also shows external connections like AHB interface, hclk, and various event signals.

Table 62. EXTI signal overview

Signal nameI/ODescription
AHB interfaceI/OEXTI register bus interface. When one event is configured to allow security, the AHB interface support secure accesses
hclkIAHB bus clock and EXTI system clock
Configurable event(y)IAsynchronous wake-up events from peripherals that do not have an associated interrupt and flag in the peripheral
Direct event(x)ISynchronous and asynchronous wake-up events from peripherals having an associated interrupt and flag in the peripheral
IOPort(n)IGPIO ports[15:0]
exti[15:0]OEXTI output port to trigger other IPs
it_exti_per (y)OInterrupts to the CPU associated with configurable event (y)
c_evt_extiOHigh-level sensitive event output for CPU synchronous to hclk
c_evt_rstIAsynchronous reset input to clear c_evt_exti
sys_wakeupOAsynchronous system wake-up request to PWR for ck_sys and hclk
c_wakeupOWake-up request to PWR for CPU, synchronous to hclk

Table 63. EVG pin overview

Pin nameI/ODescription
c_fclkICPU free-running clock
c_evt_inIHigh-level sensitive event input from EXTI, asynchronous to CPU clock
c_eventOEvent pulse, synchronous to CPU clock
c_evt_rstOEvent reset signal, synchronous to CPU clock

13.2.1 EXTI connections between peripherals and CPU

The peripherals able to generate wake-up or interrupt events when the system is in Stop mode are connected to the EXTI.

The EXTI configurable event interrupts are connected to the NVIC(a) of the CPU.

The dedicated EXTI/EVG CPU event is connected to the CPU rxev input.

The EXTI CPU wake-up signals are connected to the PWR block, and are used to wake up the system and CPU sub-system bus clocks.

13.3 EXTI functional description

Depending on the EXTI line type and wake-up target(s), different logic implementations are used. The applicable features and control or status registers are:

Table 64. EXTI event input configurations and register control

Event input typeLogic implementationEXTI_RTSR1EXTI_FTSR1EXTI_SWIER1EXTI_R/FPR1EXTI_IMRxEXTI_EM Rx
ConfigurableConfigurable event input wake-up logicxxxxxx
DirectDirect event input wake-up logic----xx

13.3.1 EXTI configurable event input wake-up

Figure 27 is a detailed representation of the logic associated with configurable event inputs which wake up the CPU sub-system bus clocks and generated an EXTI pending flag and interrupt to the CPU and or a CPU wake-up event.

Figure 27. Configurable event trigger logic CPU wake-up

Figure 27: Configurable event trigger logic CPU wake-up. This block diagram shows the internal logic of the EXTI. On the left, an 'AHB interface' and 'hclk' signal are connected to a 'Peripheral interface' block. This block contains 'Falling trigger selection register', 'Rising trigger selection register', 'Software interrupt event register', 'CPU Event mask register', 'CPU Interrupt mask register', and a 'Pending request register'. A 'Configurable Event input(y)' enters from the left and is processed by an 'Asynchronous Edge detection circuit' which is reset by 'rst'. The output of this circuit goes through a 'Delay' block and a 'Rising Edge detect Pulse generator' (also reset by 'rst'). The pulse generator's output is ANDed with the 'CPU Event mask register' output to produce 'CPU Event(y)'. This signal is OR-ed with 'Other CPU Events(x,y)' to produce a signal that enters a 'Rising Edge detect' block (reset by 'rst'). This block also receives 'hclk' and produces 'c_evt_rst', 'c_evt_exti', and 'c_event' signals. The 'c_event' signal goes to an 'EVG' block which has 'ck_fclk_c' input and produces 'it_exti_per(y)'. The 'c_evt_exti' signal is OR-ed with 'Other CPU Wakeups' and 'CPU Wakeup(y)' signals, then passed through a 'Sync' block (reset by 'hclk') to produce 'c_wakeup' and 'sys_wakeup' signals. The 'Pending request register' is connected to the 'CPU Event(y)' signal and the 'hclk' signal. The entire logic is labeled 'EXTI' at the bottom left and 'MS46537V1' at the bottom right.
Figure 27: Configurable event trigger logic CPU wake-up. This block diagram shows the internal logic of the EXTI. On the left, an 'AHB interface' and 'hclk' signal are connected to a 'Peripheral interface' block. This block contains 'Falling trigger selection register', 'Rising trigger selection register', 'Software interrupt event register', 'CPU Event mask register', 'CPU Interrupt mask register', and a 'Pending request register'. A 'Configurable Event input(y)' enters from the left and is processed by an 'Asynchronous Edge detection circuit' which is reset by 'rst'. The output of this circuit goes through a 'Delay' block and a 'Rising Edge detect Pulse generator' (also reset by 'rst'). The pulse generator's output is ANDed with the 'CPU Event mask register' output to produce 'CPU Event(y)'. This signal is OR-ed with 'Other CPU Events(x,y)' to produce a signal that enters a 'Rising Edge detect' block (reset by 'rst'). This block also receives 'hclk' and produces 'c_evt_rst', 'c_evt_exti', and 'c_event' signals. The 'c_event' signal goes to an 'EVG' block which has 'ck_fclk_c' input and produces 'it_exti_per(y)'. The 'c_evt_exti' signal is OR-ed with 'Other CPU Wakeups' and 'CPU Wakeup(y)' signals, then passed through a 'Sync' block (reset by 'hclk') to produce 'c_wakeup' and 'sys_wakeup' signals. The 'Pending request register' is connected to the 'CPU Event(y)' signal and the 'hclk' signal. The entire logic is labeled 'EXTI' at the bottom left and 'MS46537V1' at the bottom right.

The software interrupt event register allows triggering configurable events by software, writing the corresponding register bit, irrespective of the edge selection setting.

The rising edge and falling edge selection registers allow to enable and select the configurable event active trigger edge or both edges.

The CPU has its dedicated interrupt mask register and a dedicated event mask registers. The enabled event allows generating an event on the CPU. All events for a CPU are OR-ed together into a single CPU event signal. The event pending registers (EXTI_RPR1 and EXTI_FPR1) is not set for an unmasked CPU event.

The configurable events have unique interrupt pending request registers, shared by the CPU. The pending register is only set for an unmasked interrupt. Each configurable event provides a common interrupt to the CPU. The configurable event interrupts need to be acknowledged by software in the EXTI_RPR1 and/or EXTI_FPR1 registers.

When a CPU interrupt or CPU event is enabled, the asynchronous edge detection circuit is reset by the clocked delay and rising edge detect pulse generator. This guarantees the wake-up of the EXTI hclk clock before the asynchronous edge detection circuit is reset.

Note: A detected configurable event interrupt pending request can be cleared by the CPU. The system cannot enter low-power modes as long as an interrupt pending request is active.

13.3.2 EXTI direct event input wake-up

Figure 28 is a detailed representation of the logic associated with direct event inputs waking up the system.

The direct events do not have an associated EXTI interrupt. The EXTI only wakes up the system and CPU sub-system clocks and may generate a CPU wake-up event. The peripheral synchronous interrupt, associated with the direct wake-up event wakes up the CPU.

The EXTI direct event is able to generate a CPU event. This CPU event wakes up the CPU. The CPU event may occur before the interrupt flag of the associated peripheral is set.

Figure 28. Direct event trigger logic CPU wake-up

Figure 28: Direct event trigger logic CPU wake-up. This block diagram illustrates the logic for generating CPU events and wake-ups from direct event inputs. On the left, an 'AHB interface' provides 'hclk' to a 'Peripheral interface' block containing 'CPU Interrupt mask register' and 'CPU Event mask register'. 'Direct Event input(x)' signals enter the 'EXTI' block. One path goes through a 'Delay' block and then an AND gate. Another path goes through an 'Asynchronous Rising Edge detect circuit' (with 'rst' input) and then an OR gate. A third path goes through a 'Falling Edge detect Pulse generator' (with 'hclk' input) and then an OR gate. The outputs of these gates are combined with signals from the 'CPU Event mask register' and 'CPU Interrupt mask register' to produce 'CPU Event(x)' and 'CPU Wakeup(x)' signals. These signals are then processed by a 'Rising Edge detect' block (with 'hclk' and 'rst' inputs) to produce 'c_evt_rst' and 'c_evt_exti' signals. The 'c_evt_rst' signal is sent to an 'EVG' block containing a 'CPU Rising Edge detect Pulse generator' (with 'ck_folk_c' input) to produce a 'c_event' signal. The 'c_evt_exti' signal is sent to a 'Synch' block (with 'hclk' input) to produce a 'c_wakeup' signal. The 'c_wakeup' signal is also processed by an OR gate with 'Other CPU Wakeups' and 'Other Wakeups' signals to produce a 'sys_wakeup' signal. The diagram is labeled 'MS46536V1' in the bottom right corner.
Figure 28: Direct event trigger logic CPU wake-up. This block diagram illustrates the logic for generating CPU events and wake-ups from direct event inputs. On the left, an 'AHB interface' provides 'hclk' to a 'Peripheral interface' block containing 'CPU Interrupt mask register' and 'CPU Event mask register'. 'Direct Event input(x)' signals enter the 'EXTI' block. One path goes through a 'Delay' block and then an AND gate. Another path goes through an 'Asynchronous Rising Edge detect circuit' (with 'rst' input) and then an OR gate. A third path goes through a 'Falling Edge detect Pulse generator' (with 'hclk' input) and then an OR gate. The outputs of these gates are combined with signals from the 'CPU Event mask register' and 'CPU Interrupt mask register' to produce 'CPU Event(x)' and 'CPU Wakeup(x)' signals. These signals are then processed by a 'Rising Edge detect' block (with 'hclk' and 'rst' inputs) to produce 'c_evt_rst' and 'c_evt_exti' signals. The 'c_evt_rst' signal is sent to an 'EVG' block containing a 'CPU Rising Edge detect Pulse generator' (with 'ck_folk_c' input) to produce a 'c_event' signal. The 'c_evt_exti' signal is sent to a 'Synch' block (with 'hclk' input) to produce a 'c_wakeup' signal. The 'c_wakeup' signal is also processed by an OR gate with 'Other CPU Wakeups' and 'Other Wakeups' signals to produce a 'sys_wakeup' signal. The diagram is labeled 'MS46536V1' in the bottom right corner.

13.3.3 EXTI mux

The EXTI mux allows selecting GPIOs as interrupts and wake-up. The GPIOs are connected via 16 EXTI mux lines to the first 16 EXTI events as configurable event. The selection of GPIO port as EXTI mux output is controlled through the EXTI external interrupt selection register (EXTI_EXTICRx) register.

Figure 29. EXTI GPIO mux

Diagram of EXTI GPIO mux showing three multiplexers for EXTI lines 10, 11, and 115. Each multiplexer selects between multiple GPIO pins (e.g., PA0, PB0, PC0, Px0 for EXTI10) and outputs the selected signal (EXTI10, EXTI11, EXTI115).

The diagram illustrates the EXTI GPIO multiplexers. It shows three separate multiplexers, each associated with a specific EXTI line. The first multiplexer, labeled EXTI_EXTICR1.EXTI10, selects between various GPIO pins (PA0, PB0, PC0, ..., Px0) to output the EXTI10 signal. The second multiplexer, labeled EXTI_EXTICR1.EXTI11, selects between pins (PA1, PB1, PC1, ..., Px1) to output the EXTI11 signal. The third multiplexer, labeled EXTI_EXTICR4.EXTI115, selects between pins (PA15, PB15, PC15, ..., Px15) to output the EXTI115 signal. Ellipses indicate additional pins and lines between the shown examples. A reference code MS44726V2 is present in the bottom right corner.

Diagram of EXTI GPIO mux showing three multiplexers for EXTI lines 10, 11, and 115. Each multiplexer selects between multiple GPIO pins (e.g., PA0, PB0, PC0, Px0 for EXTI10) and outputs the selected signal (EXTI10, EXTI11, EXTI115).

The EXTI mux outputs are available as output signals from the EXTI, to trigger other functional blocks. The EXTI mux outputs are available independently of mask setting through the EXTI_IMR and EXTI_EMR registers.

The EXTI lines (event inputs) are connected as shown in the following table.

Table 65. EXTI line connections

EXTI lineLine sourceLine type
0-15GPIOConfigurable
16PVD outputConfigurable
17COMP1 outputConfigurable
18COMP2 outputConfigurable
19RTCDirect
20COMP3 outputConfigurable
21TAMPDirect
22I2C2 wake-upDirect
23I2C1 wake-upDirect
24USART3 wake-upDirect
25USART1 wake-upDirect
26USART2 wake-upDirect
27CEC wake-upDirect
28LPUART1 wake-upDirect
29LPTIM1Direct
30LPTIM2Direct
31LSE_CSSDirect
32UCPD1 wake-upDirect
33UCPD2 wake-upDirect
34V DDIO2 monitoringConfigurable

Table 65. EXTI line connections (continued)

EXTI lineLine sourceLine type
35LPUART2 wake-upDirect
36USB wake-upDirect

13.4 EXTI functional behavior

The direct event inputs are enabled in the respective peripheral generating the wake-up event. The configurable events are enabled by enabling at least one of the trigger edges.

Once an event input is enabled, the generation of a CPU wake-up is conditioned by the CPU interrupt mask and CPU event mask.

Table 66. Masking functionality

CPU interrupt enable
EXTI_IMR.IMn
CPU event enable
EXTI_EMR.EMn
Configurable
event inputs
EXTI_RPR.RPIFn
EXTI_FPR.FPIFn
exti(n)
interrupt (1)
CPU
event
CPU wake-up
00NoMaskedMaskedMasked
1NoMaskedYesYes
10Status latchedYesMaskedYes (2)
1Status latchedYesYesYes
  1. 1. The single exti(n) interrupt goes to the CPU. If no interrupt is required for CPU, the exti(n) interrupt must be masked in the CPU NVIC.
  2. 2. Only if CPU interrupt is enabled in EXTI_IMR.IMn.

For configurable event inputs, upon an edge on the event input, an event request is generated if that edge (rising or/and falling) is enabled. When the associated CPU interrupt is unmasked, the corresponding RPIFn and/or FPIFn bit is/are set in the EXTI_RPR or/and EXTI_FPR register, waking up the CPU subsystem and activating CPU interrupt signal. The RPIFn and/or FPIFn pending bit is cleared by writing 1 to it, which clears the CPU interrupt request.

For direct event inputs, when enabled in the associated peripheral, an event request is generated on the rising edge only. There is no corresponding CPU pending bit in the EXTI. When the associated CPU interrupt is unmasked, the corresponding CPU subsystem is woken up. The CPU is woken up (interrupted) by the peripheral synchronous interrupt.

The CPU event must be unmasked to generate an event. Upon an enabled edge occurring on an event input, a CPU event pulse is generated. There is no event pending bit.

For the configurable event inputs, the software can generate an event request by setting the corresponding bit of the software interrupt/event register EXTI_SWIER1, which has the effect of a rising edge on the event input. The pending rising edge event flag is set in the EXTI_RPR1 register, irrespective of the EXTI_RTSR1 register setting.

13.5 EXTI registers

The EXTI register map is divided in the following sections:

Table 67. EXTI register map sections

AddressDescription
0x000 - 0x01CGeneral configurable event [31:0] configuration
0x060 - 0x06CEXTI I/O port multiplexer
0x080 - 0x0BCCPU input event configuration

All the registers can be accessed with word (32-bit), half-word (16-bit) and byte (8-bit) access.

13.5.1 EXTI rising trigger selection register (EXTI_RTSR1)

Address offset: 0x000

Reset value: 0x0000 0000

Contains only register bits for configurable events.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RT20Res.RT18RT17RT16
rwrwrwrw
1514131211109876543210
RT15RT14RT13RT12RT11RT10RT9RT8RT7RT6RT5RT4RT3RT2RT1RT0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bit 20 RT20 : Rising trigger event configuration bit of configurable line 20 (1)

This bit enables/disables the rising edge trigger for the event and interrupt on the corresponding line.

0: Disable

1: Enable

The RT20 bit is only available in STM32G0B1xx and STM32G0C1xx. It is reserved in all the other devices.

Bit 19 Reserved, must be kept at reset value.

Bits 18:0 RTx : Rising trigger event configuration bit of configurable line x (x = 18 to 0) (1)

Each bit enables/disables the rising edge trigger for the event and interrupt on the corresponding line.

0: Disable

1: Enable

The RT18 and RT17 bits are reserved in STM32G031xx and STM32G041xx.

  1. 1. The configurable lines are edge triggered, no glitch must be generated on these inputs.
    If a rising edge on the configurable line occurs during writing of the register, the associated pending bit is not set.
    Rising edge trigger can be set for a line with falling edge trigger enabled. In this case, both edges generate a trigger.

13.5.2 EXTI falling trigger selection register 1 (EXTI_FTSR1)

Address offset: 0x004

Reset value: 0x0000 0000

Contains only register bits for configurable events.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FT20Res.FT18FT17FT16
rwrwrwrw
1514131211109876543210
FT15FT14FT13FT12FT11FT10FT9FT8FT7FT6FT5FT4FT3FT2FT1FT0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bit 20 FT20 : Falling trigger event configuration bit of configurable line 20 (1) .

This bit enables/disables the falling edge trigger for the event and interrupt on the corresponding line.
0: Disable
1: Enable
The FT20 bit is only available in STM32G0B1xx and STM32G0C1xx. It is reserved in all the other devices.

Bit 19 Reserved, must be kept at reset value.

Bits 18:0 FTx : Falling trigger event configuration bit of configurable line x (x = 18 to 0) (1) .

Each bit enables/disables the falling edge trigger for the event and interrupt on the corresponding line.
0: Disable
1: Enable
The FT18 and FT17 bits are reserved in STM32G031xx and STM32G041xx.

  1. 1. The configurable lines are edge triggered, no glitch must be generated on these inputs.
    If a falling edge on the configurable line occurs during writing of the register, the associated pending bit is not set.
    Falling edge trigger can be set for a line with rising edge trigger enabled. In this case, both edges generate a trigger.

13.5.3 EXTI software interrupt event register 1 (EXTI_SWIER1)

Address offset: 0x008

Reset value: 0x0000 0000

Contains only register bits for configurable events.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWI 20Res.SWI 18SWI 17SWI 16
rwrwrwrw
1514131211109876543210
SWI 15SWI 14SWI 13SWI 12SWI 11SWI 10SWI9SWI8SWI7SWI6SWI5SWI4SWI3SWI2SWI1SWI0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bit 20 SWI20 : Software rising edge event trigger on line 20.

Setting this bit by software triggers a rising edge event on the corresponding line, resulting in an interrupt, independently of EXTI_RTSR1 and EXTI_FTSR1 settings. This bit is automatically cleared by hardware. Reading this bit always returns 0.

0: No effect

1: Rising edge event generated on the corresponding line, followed by an interrupt

The SWI20 bit is only available in STM32G0B1xx and STM32G0C1xx. It is reserved in all the other devices.

Bit 19 Reserved, must be kept at reset value.

Bits 18:0 SWIx : Software rising edge event trigger on line x (x = 18 to 0)

Setting of any bit by software triggers a rising edge event on the corresponding line x, resulting in an interrupt, independently of EXTI_RTSR1 and EXTI_FTSR1 settings. These bits are automatically cleared by HW. Reading of any bit always returns 0.

0: No effect

1: Rising edge event generated on the corresponding line, followed by an interrupt

The SWI18 and SWI17 bits are reserved in STM32G031xx and STM32G041xx.

13.5.4 EXTI rising edge pending register 1 (EXTI_RPR1)

Address offset: 0x00C

Reset value: 0x0000 0000

Contains only register bits for configurable events.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RPIF20Res.RPIF18RPIF17RPIF16
rc_w1rc_w1rc_w1rc_w1
1514131211109876543210
RPIF15RPIF14RPIF13RPIF12RPIF11RPIF10RPIF9RPIF8RPIF7RPIF6RPIF5RPIF4RPIF3RPIF2RPIF1RPIF0
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

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

Bit 20 RPIF20 : Rising edge event pending for configurable line 20.

This bit is set upon a rising edge event generated by hardware or by software (through the EXTI_SWIER1 register) on the corresponding line. This bit is cleared by writing 1 into it.

0: No rising edge trigger request occurred

1: Rising edge trigger request occurred

The RPIF20 bit is only available in STM32G0B1xx and STM32G0C1xx. It is reserved in all the other devices.

Bit 19 Reserved, must be kept at reset value.

Bits 18:0 RPIFx : Rising edge event pending for configurable line x (x = 18 to 0)

Each bit is set upon a rising edge event generated by hardware or by software (through the EXTI_SWIER1 register) on the corresponding line. Each bit is cleared by writing 1 into it.

0: No rising edge trigger request occurred

1: Rising edge trigger request occurred

The RPIF18 and RPIF17 bits are reserved in STM32G031xx and STM32G041xx.

13.5.5 EXTI falling edge pending register 1 (EXTI_FPR1)

Address offset: 0x010

Reset value: 0x0000 0000

Contains only register bits for configurable events.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FPIF20Res.FPIF18FPIF17FPIF16
rc_w1rc_w1rc_w1rc_w1
1514131211109876543210
FPIF15FPIF14FPIF13FPIF12FPIF11FPIF10FPIF9FPIF8FPIF7FPIF6FPIF5FPIF4FPIF3FPIF2FPIF1FPIF0
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

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

Bit 20 FPIF20 : Falling edge event pending for configurable line 20.

This bit is set upon a falling edge event generated by hardware on the corresponding line.
This bit is cleared by writing 1 into it.
0: No falling edge trigger request occurred
1: Falling edge trigger request occurred
The FPIF20 bit is only available in STM32G0B1xx and STM32G0C1xx. It is reserved in all the other devices.

Bit 19 Reserved, must be kept at reset value.

Bits 18:0 FPIFx : Falling edge event pending for configurable line x (x = 18 to 0)

Each bit is set upon a falling edge event generated by hardware on the corresponding line.
Each bit is cleared by writing 1 into it.
0: No falling edge trigger request occurred
1: Falling edge trigger request occurred
The FPIF18 and FPIF17 bits are reserved in STM32G031xx and STM32G041xx.

13.5.6 EXTI rising trigger selection register 2 (EXTI_RTSR2)

Address offset: 0x028

Reset value: 0x0000 0000

Contains only register bits for configurable events.

This register is not available in STM32G031xx and STM32G041xx, and in STM32G051xx and STM32G061xx.

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.RT34Res.Res.
rw

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

Bit 2 RT34 : Rising trigger event configuration bit of configurable line 34 (1)

This bit enables/disables the rising edge trigger for the event and interrupt on line 34.

0: Disable

1: Enable

This bit is only available in STM32G0B1xx and STM32G0C1xx. Reserved in all the other devices.

Bits 1:0 Reserved, must be kept at reset value.

  1. 1. The configurable lines are edge triggered, no glitch must be generated on these inputs.
    If a rising edge on the configurable line occurs during writing of the register, the associated pending bit is not set.
    Rising edge trigger can be set for a line with falling edge trigger enabled. In this case, both edges generate a trigger.

13.5.7 EXTI falling trigger selection register 2 (EXTI_FTSR2)

Address offset: 0x02C

Reset value: 0x0000 0000

Contains only register bits for configurable events.

This register is not available in STM32G031xx and STM32G041xx, and in STM32G051xx and STM32G061xx.

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.FT34Res.Res.
r/w

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

Bit 2 FT34 : Falling trigger event configuration bit of configurable line 34 (1) .

This bit enables/disables the falling edge trigger for the event and interrupt on the corresponding line.

0: Disable

1: Enable

This bit is only available in STM32G0B1xx and STM32G0C1xx. Reserved in all the other devices.

Bits 1:0 Reserved, must be kept at reset value.

  1. 1. The configurable lines are edge triggered, no glitch must be generated on these inputs.
    If a falling edge on the configurable line occurs during writing of the register, the associated pending bit is not set.
    Falling edge trigger can be set for a line with rising edge trigger enabled. In this case, both edges generate a trigger.

13.5.8 EXTI software interrupt event register 2 (EXTI_SWIER2)

Address offset: 0x030

Reset value: 0x0000 0000

Contains only register bits for configurable events.

This register is not available in STM32G031xx and STM32G041xx, and in STM32G051xx and STM32G061xx.

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.SWI34Res.Res.
nw

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

Bit 2 SWI34 : Software rising edge event trigger on line 34

Setting this bit by software triggers a rising edge event on the line 34, resulting in an interrupt, independently of EXTI_RTSR2 and EXTI_FTSR2 settings. This bit is automatically cleared by hardware. Reading this bit always returns 0.

0: No effect

1: Rising edge event generated on the line 34, followed by an interrupt

This bit is only available in STM32G0B1xx and STM32G0C1xx. Reserved in all the other devices.

Bits 1:0 Reserved, must be kept at reset value.

13.5.9 EXTI rising edge pending register 2 (EXTI_RPR2)

Address offset: 0x034

Reset value: 0x0000 0000

Contains only register bits for configurable events.

This register is not available in STM32G031xx and STM32G041xx, and in STM32G051xx and STM32G061xx.

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.RPIF34Res.Res.
rc_w1

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

Bit 2 RPIF34 : Rising edge event pending for configurable line 34

This bit is set upon a rising edge event generated by hardware or by software (through the EXTI_SWIER2 register) on line 34. This bit is cleared by writing 1 into it.

0: No rising edge trigger request occurred

1: Rising edge trigger request occurred

This bit is only available in STM32G0B1xx and STM32G0C1xx. Reserved in all the other devices.

Bits 1:0 Reserved, must be kept at reset value.

13.5.10 EXTI falling edge pending register 2 (EXTI_FPR2)

Address offset: 0x038

Reset value: 0x0000 0000

Contains only register bits for configurable events.

This register is not available in STM32G031xx and STM32G041xx, and in STM32G051xx and STM32G061xx.

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.FP1F34Res.Res.
rc_w1

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

Bit 2 FP1F34 : Falling edge event pending for configurable line 34

This bit is set upon a falling edge event generated by hardware on the line 34. This bit is cleared by writing 1 into it.

0: No falling edge trigger request occurred

1: Falling edge trigger request occurred

This bit is only available in STM32G0B1xx and STM32G0C1xx. Reserved in all the other devices.

Bits 1:0 Reserved, must be kept at reset value.

13.5.11 EXTI external interrupt selection register (EXTI_EXTICRx)

Address offset: 0x060 + 0x4 * (x - 1), (x = 1 to 4)

Reset value: 0x0000 0000

31302928272625242322212019181716
EXTIm+3[7:0]EXTIm+2[7:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
EXTIm+1[7:0]EXTIm[7:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:24 EXTIm+3[7:0] : EXTIm+3 GPIO port selection (m = 4 * (x - 1))

These bits are written by software to select the source input for EXTIm+3 external interrupt.

0x00: PA[m+3] pin

0x01: PB[m+3] pin

0x02: PC[m+3] pin

0x03: PD[m+3] pin

0x04: PE[m+3] pin

0x05: PF[m+3] pin

Other: Reserved

Bits 23:16 EXTIm+2[7:0] : EXTIm+2 GPIO port selection ( \( m = 4 * (x - 1) \) )

These bits are written by software to select the source input for EXTIm+2 external interrupt.

0x00: PA[m+2] pin
0x01: PB[m+2] pin
0x02: PC[m+2] pin
0x03: PD[m+2] pin
0x04: PE[m+2] pin
0x05: PF[m+2] pin
Other: Reserved

Bits 15:8 EXTIm+1[7:0] : EXTIm+1 GPIO port selection ( \( m = 4 * (x - 1) \) )

These bits are written by software to select the source input for EXTIm+1 external interrupt.

0x00: PA[m+1] pin
0x01: PB[m+1] pin
0x02: PC[m+1] pin
0x03: PD[m+1] pin
0x04: PE[m+1] pin
0x05: PF[m+1] pin
Other: Reserved

Bits 7:0 EXTIm[7:0] : EXTIm GPIO port selection ( \( m = 4 * (x - 1) \) )

These bits are written by software to select the source input for EXTIm external interrupt.

0x00: PA[m] pin
0x01: PB[m] pin
0x02: PC[m] pin
0x03: PD[m] pin
0x04: PE[m] pin
0x05: PF[m] pin
Other: Reserved

13.5.12 EXTI CPU wake-up with interrupt mask register (EXTI_IMR1)

Address offset: 0x080

Reset value: 0xFFF8 0000

Contains register bits for configurable events and direct events.

The reset value is set such as to, by default, enable interrupt from direct lines, and disable interrupt from configurable lines.

31302928272625242322212019181716
IM31IM30IM29IM28IM27IM26IM25IM24IM23IM22IM21IM20IM19IM18IM17IM16
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
IM15IM14IM13IM12IM11IM10IM9IM8IM7IM6IM5IM4IM3IM2IM1IM0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 IMx : CPU wake-up with interrupt mask on line x (x = 31 to 0)

Setting/clearing each bit unmask/masks the CPU wake-up with interrupt, by an event on the corresponding line.

0: wake-up with interrupt masked

1: wake-up with interrupt unmasked

The IM24, IM22 and IM20 bits are only available in STM32G0B1xx and STM32G0C1xx.

They are reserved in all the other devices.

The IM27 bit is only available in STM32G071xx and STM32G081xx, and in STM32G0B1xx and STM32G0C1xx. It is reserved in all the other devices.

The IM18 and IM17 bits are reserved in STM32G031xx and STM32G041xx.

13.5.13 EXTI CPU wake-up with event mask register (EXTI_EMR1)

Address offset: 0x084

Reset value: 0x0000 0000

31302928272625242322212019181716
EM31EM30EM29EM28EM27EM26EM25EM24EM23EM22EM21EM20EM19EM18EM17EM16
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
EM15EM14EM13EM12EM11EM10EM9EM8EM7EM6EM5EM4EM3EM2EM1EM0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 EMx : CPU wake-up with event generation mask on line x (x = 31 to 0)

Setting/clearing each bit unmask/masks the CPU wake-up with event generation on the corresponding line.

0: wake-up with event generation masked

1: wake-up with event generation unmasked

The EM24, EM22 and EM20 bits are only available in STM32G0B1xx and STM32G0C1xx.

They are reserved in all other devices.

The EM27 bit is only available in STM32G071xx and STM32G081xx, and STM32G0B1xx and STM32G0C1xx. It is reserved in all the other devices.

The EM18 and EM17 bits are reserved in STM32G031xx and STM32G041xx.

13.5.14 EXTI CPU wake-up with interrupt mask register (EXTI_IMR2)

Address offset: 0x090 (EXTI_IMR2)

Reset value: 0x0x0000 001B

Contains register bits for configurable events and direct events.

The reset value is set such as to, by default, enable interrupt from direct lines, and disable interrupt from configurable lines.

This register is not available in STM32G031xx and STM32G041xx, and in STM32G051xx and STM32G061xx.

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.IM36IM35IM34IM33IM32
rwrwrwrwrw

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

Bits 4:0 IMx : CPU wake-up with interrupt mask on line x (x = 36 to 32)

Setting/clearing this bit un.masks/masks the CPU wake-up with interrupt, by an event on the corresponding line.

0: wake-up with interrupt request from Line x is masked

1: wake-up with interrupt request from Line x is unmasked

The IM36, IM35, and IM34 bits are only available in STM32G0B1xx and STM32G0C1xx.

They are reserved in STM32G071xx and STM32G081xx.

13.5.15 EXTI CPU wake-up with event mask register (EXTI_EMR2)

Address offset: 0x094

Reset value: 0x0000 0000

Contains register bits for configurable events and direct events.

The reset value is set such as to, by default, enable interrupt from direct lines, and disable interrupt from configurable lines.

This register is not available in STM32G031xx and STM32G041xx, and in STM32G051xx and STM32G061xx.

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.EM36EM35EM34EM33EM32
rwrwrwrwrw

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

Bits 4:0 EMx : CPU wake-up with event generation mask on line x (x = 36 to 32)

Setting/clearing each bit un.masks/masks the CPU wake-up with event generation on the corresponding line.

0: wake-up with event generation masked

1: wake-up with event generation unmasked

The EM36, EM35, and EM34 bits are only available in STM32G0B1xx and STM32G0C1xx.

They are reserved in STM32G071xx and STM32G081xx.

13.5.16 EXTI register map

The following table gives the EXTI register map and the reset values.

Table 68. EXTI controller register map and reset values

OffsetRegister313029282726252423222120191817161514131211109876543210
0x000EXTI_RTSR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RT20Res.RT[18:0]
Reset value00000000000000000000
0x004EXTI_FTSR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FT20Res.FT[18:0]
Reset value00000000000000000000
0x008EXTI_SWIER1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWI20Res.SWI[18:0]
Reset value00000000000000000000
0x00CEXTI_RPR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RPIF20Res.RPIF[18:0]
Reset value00000000000000000000
0x010EXTI_FPR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FPIF20Res.FPIF[16:0]
Res.
Reset value00000000000000000000
0x014-
0x024
ReservedRes.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.Res.Res.
0x028EXTI_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.RT34Res.Res.
Reset value0
0x02CEXTI_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.FT34Res.Res.
Reset value0
0x030EXTI_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.SWI34Res.Res.
Reset value0
0x034EXTI_RPR2Res.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.RPIF34Res.Res.
Reset value0
0x038EXTI_FPR2Res.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.FPIF34Res.Res.
Reset value0
0x038-
0x05C
ReservedRes.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.Res.Res.
0x060EXTI_EXTICR1EXTI3[7:0]EXTI2[7:0]EXTI1[7:0]EXTI0[7:0]
Reset value00000000000000000000000000000000
0x064EXTI_EXTICR2EXTI7[7:0]EXTI6[7:0]EXTI5[7:0]EXTI4[7:0]
Reset value00000000000000000000000000000000
0x068EXTI_EXTICR3EXTI11[7:0]EXTI10[7:0]EXTI9[7:0]EXTI8[7:0]
Reset value00000000000000000000000000000000

Table 68. EXTI controller register map and reset values (continued)

OffsetRegister313029282726252423222120191817161514131211109876543210
0x06CEXTI_EXTICR4EXTI15[7:0]EXTI14[7:0]EXTI13[7:0]EXTI12[7:0]
Reset value00000000000000000000000000000000
0x070-
0x07C
ReservedResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
0x080EXTI_IMR1IM[31:0]
Reset value1111111111000000000000000000
0x084EXTI_EMR1EM[31:0]
Reset value0000000000000000000000000000000
0x088-
0x08C
ReservedResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
0x090EXTI_IMR2ResResResResResResResResResResResResResResResResResResResResResResResResResResResResIM36IM35IM34IM33
Reset value1111
0x094EXTI_EMR2ResResResResResResResResResResResResResResResResResResResResResResResResResResResResEM36EM35EM34EM33
Reset value0000

Refer to Section 2.2 on page 60 for the register boundary addresses.