12. Extended interrupt and event controller (EXTI)

The Extended interrupt and event controller (EXTI) manages the CPU and system wakeup through configurable and direct event inputs (lines). It provides wakeup 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 wakeup 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.

12.1 EXTI main features

The EXTI main features are the following:

12.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 22 .

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 wakeup, 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 22. EXTI block diagram

EXTI block diagram showing connections to GPIO, Peripherals, Registers, Event Trigger, Masking, PWR, and CPU. It includes signals like AHB interface, hclk, IOPort, Configurable event(15:0), Direct event(x), Interrupt, exti[15:0], sys_wakeup, c_wakeup, it_exti_per(y)*, c_evt_exti, c_evt_rst, Pulse, EVG, c_event, c_fclk, and rxev.

The diagram illustrates the internal architecture of the EXTI block. On the left, external components include GPIO (connected via IOPort), Peripherals (connected via Wakeup, Direct event(x), and Interrupt signals), and an AHB interface (connected to Registers). The central part of the block contains Registers, an EXTI mux, an Event Trigger, and a Masking unit. The EXTI mux receives inputs from GPIO IOPort and Configurable event(15:0), and its output goes to the Event Trigger. Peripherals provide Direct event(x) and Interrupt signals to the Event Trigger. The Event Trigger's output goes to the Masking unit. The Masking unit has several output signals: exti[15:0] (To interconnect), sys_wakeup, c_wakeup, it_exti_per(y)*, c_evt_exti, and c_evt_rst. The c_evt_exti signal goes to a Pulse block, which also receives c_evt_rst. The Pulse block's output, c_event, goes to the CPU via the rxev signal. The CPU also receives c_fclk from an EVG block. The EVG block receives c_fclk from the CPU and provides c_event and c_evt_rst to the CPU. The PWR block receives sys_wakeup and c_wakeup signals. A note at the bottom left states: "* it_exti_per(y) are only available for configurable events (y)". The code MS44733V2 is at the bottom right.

EXTI block diagram showing connections to GPIO, Peripherals, Registers, Event Trigger, Masking, PWR, and CPU. It includes signals like AHB interface, hclk, IOPort, Configurable event(15:0), Direct event(x), Interrupt, exti[15:0], sys_wakeup, c_wakeup, it_exti_per(y)*, c_evt_exti, c_evt_rst, Pulse, EVG, c_event, c_fclk, and rxev.

Table 46. 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 wakeup events from peripherals that do not have an associated interrupt and flag in the peripheral
Direct event(x)ISynchronous and asynchronous wakeup 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 wakeup request to PWR for ck_sys and hclk
c_wakeupOWakeup request to PWR for CPU, synchronous to hclk

Table 47. 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

12.2.1 EXTI connections between peripherals and CPU

The peripherals able to generate wakeup 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 wakeup signals are connected to the PWR block, and are used to wake up the system and CPU sub-system bus clocks.

12.3 EXTI functional description

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

Table 48. EXTI event input configurations and register control

Event input typeLogic implementationEXTI_RTSR1EXTI_FTSR1EXTI_SWIER1EXTI_R/FPR1EXTI_IMR1EXTI_EMR1
ConfigurableConfigurable event input wakeup logicxxxxxx
DirectDirect event input wakeup logic----xx

12.3.1 EXTI configurable event input wakeup

Figure 23 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 wakeup event.

Figure 23. Configurable event trigger logic CPU wakeup

Figure 23: Configurable event trigger logic CPU wakeup. This block diagram illustrates the internal logic of the EXTI for configurable events. On the left, an 'AHB interface' and 'hclk' clock are connected to a 'Peripheral interface' block. This block contains several registers: 'Falling trigger selection register', 'Rising trigger selection register', 'Software interrupt event register', 'CPU Event mask register', 'CPU Interrupt mask register', and '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'). These signals are then processed by a series of AND and OR gates. The 'Software interrupt event register' and 'CPU Event mask register' are used to filter these signals. The output of the logic is 'CPU Event(y)', which is OR-ed with 'Other CPU Events(x,y)' to produce 'it_exti_per(y)'. This signal is also processed by an 'EVG' (Event Generator) block containing a 'CPU Rising Edge detect Pulse generator' (reset by 'c_evt_rst') to produce 'c_event'. Another path from the logic goes through a 'Sync' block to produce 'c_wakeup', which is OR-ed with 'Other Wakeups' to produce 'sys_wakeup'. The 'EVG' block also receives 'ck_fclk_c' and 'c_evt_exti' as inputs. The diagram is labeled 'EXTI' at the bottom left and 'MS46537V1' at the bottom right.
Figure 23: Configurable event trigger logic CPU wakeup. This block diagram illustrates the internal logic of the EXTI for configurable events. On the left, an 'AHB interface' and 'hclk' clock are connected to a 'Peripheral interface' block. This block contains several registers: 'Falling trigger selection register', 'Rising trigger selection register', 'Software interrupt event register', 'CPU Event mask register', 'CPU Interrupt mask register', and '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'). These signals are then processed by a series of AND and OR gates. The 'Software interrupt event register' and 'CPU Event mask register' are used to filter these signals. The output of the logic is 'CPU Event(y)', which is OR-ed with 'Other CPU Events(x,y)' to produce 'it_exti_per(y)'. This signal is also processed by an 'EVG' (Event Generator) block containing a 'CPU Rising Edge detect Pulse generator' (reset by 'c_evt_rst') to produce 'c_event'. Another path from the logic goes through a 'Sync' block to produce 'c_wakeup', which is OR-ed with 'Other Wakeups' to produce 'sys_wakeup'. The 'EVG' block also receives 'ck_fclk_c' and 'c_evt_exti' as inputs. The diagram 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 wakeup 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.

12.3.2 EXTI direct event input wakeup

Figure 24 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 wakeup event. The peripheral synchronous interrupt, associated with the direct wakeup 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 24. Direct event trigger logic CPU wakeup

Figure 24: Direct event trigger logic CPU wakeup block diagram. The diagram shows the logic for generating CPU events and wakeups from EXTI direct events. Inputs include AHB interface (hclk), Direct Event input(x), and hclk. The logic consists of a Delay block, an Asynchronous Rising Edge detect circuit, a Falling Edge detect Pulse generator, and a 'Same circuit for Configurable and Direct events' block containing a Rising Edge detect. Outputs include CPU Event(x), Other CPU Events(x,y), CPU Wakeup(x), Other CPU Wakeups, c_evt_rst, c_evt_exti, c_wakeup, sys_wakeup, and c_event. The EVG (CPU Rising Edge detect Pulse generator) is also shown.

The diagram illustrates the internal logic of the EXTI direct event trigger. It starts with 'Direct Event input(x)' entering a 'Delay' block and an 'Asynchronous Rising Edge detect circuit'. The 'Delay' block output goes to an AND gate, which also receives inputs from 'CPU Interrupt mask register' and 'CPU Event mask register' via a 'Peripheral interface'. The output of this AND gate is 'CPU Event(x)'. The 'Asynchronous Rising Edge detect circuit' output goes to an OR gate, which also receives 'Other CPU Events(x,y)'. The output of this OR gate is 'CPU Wakeup(x)'. Both 'CPU Event(x)' and 'CPU Wakeup(x)' enter a 'Same circuit for Configurable and Direct events' block. 'CPU Event(x)' goes through a 'Rising Edge detect' block to produce 'c_evt_rst'. 'CPU Wakeup(x)' goes through a 'Synch' block to produce 'c_wakeup'. 'Other CPU Events(x,y)' and 'Other CPU Wakeups' are combined in an OR gate to produce 'sys_wakeup'. 'c_evt_rst' and 'c_evt_exti' (from an EVG block) enter a 'CPU Rising Edge detect Pulse generator' to produce the final 'c_event' output. Clock signals 'hclk' and 'ck_fclk_c' are shown throughout the diagram.

Figure 24: Direct event trigger logic CPU wakeup block diagram. The diagram shows the logic for generating CPU events and wakeups from EXTI direct events. Inputs include AHB interface (hclk), Direct Event input(x), and hclk. The logic consists of a Delay block, an Asynchronous Rising Edge detect circuit, a Falling Edge detect Pulse generator, and a 'Same circuit for Configurable and Direct events' block containing a Rising Edge detect. Outputs include CPU Event(x), Other CPU Events(x,y), CPU Wakeup(x), Other CPU Wakeups, c_evt_rst, c_evt_exti, c_wakeup, sys_wakeup, and c_event. The EVG (CPU Rising Edge detect Pulse generator) is also shown.

12.3.3 EXTI mux

The EXTI mux allows selecting GPIOs as interrupts and wakeup. 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 25. EXTI GPIO mux

Figure 25: EXTI GPIO mux block diagram. It shows three multiplexers for EXTI0, EXTI1, and EXTI15. Each multiplexer selects between multiple GPIO pins (e.g., PA0, PB0, PC0, Px0 for EXTI0) based on configuration registers (EXTI_EXTICR1.EXTI0, EXTI_EXTICR1.EXTI1, EXTI_EXTICR4.EXTI15). The outputs are labeled EXTI0, EXTI1, and EXTI15.

The diagram shows three separate multiplexers for EXTI0, EXTI1, and EXTI15. Each multiplexer has multiple input lines representing different GPIO pins. For EXTI0, the inputs are PA0, PB0, PC0, and Px0. For EXTI1, the inputs are PA1, PB1, PC1, and Px1. For EXTI15, the inputs are PA15, PB15, PC15, and Px15. Each multiplexer is controlled by a configuration register: EXTI_EXTICR1.EXTI0 for EXTI0, EXTI_EXTICR1.EXTI1 for EXTI1, and EXTI_EXTICR4.EXTI15 for EXTI15. The output of each multiplexer is labeled EXTI0, EXTI1, and EXTI15 respectively. A dashed line connects the output of the EXTI1 multiplexer to the input of the EXTI15 multiplexer.

Figure 25: EXTI GPIO mux block diagram. It shows three multiplexers for EXTI0, EXTI1, and EXTI15. Each multiplexer selects between multiple GPIO pins (e.g., PA0, PB0, PC0, Px0 for EXTI0) based on configuration registers (EXTI_EXTICR1.EXTI0, EXTI_EXTICR1.EXTI1, EXTI_EXTICR4.EXTI15). The outputs are labeled EXTI0, EXTI1, and EXTI15.

The EXTIs 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 49. EXTI line connections

EXTI lineLine sourceLine type
0-15GPIOConfigurable
16Reserved-
17Reserved-
18Reserved-
19RTCDirect
20Reserved-
21TAMPDirect
22I2C2 wakeupDirect
23I2C1 wakeupDirect
24USART3 wakeupDirect
25USART1 wakeupDirect
26USART2 wakeupDirect
27Reserved-
28Reserved-
29Reserved-
30Reserved-
31LSE_CSSDirect
32Reserved-
33Reserved-

12.4 EXTI functional behavior

The direct event inputs are enabled in the respective peripheral generating the wakeup 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 wakeup is conditioned by the CPU interrupt mask and CPU event mask.

Table 50. 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 wakeup
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.
  1. 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.

12.5 EXTI registers

The EXTI register map is divided in the following sections:

Table 51. 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.

12.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.Res.Res.Res.Res.Res.
1514131211109876543210
RT15RT14RT13RT12RT11RT10RT9RT8RT7RT6RT5RT4RT3RT2RT1RT0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

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

Each bit enables/disables the rising edge trigger for the event and interrupt on the corresponding line.
0: Disable
1: Enable

  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.

12.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.Res.Res.Res.Res.Res.
1514131211109876543210
FT15FT14FT13FT12FT11FT10FT9FT8FT7FT6FT5FT4FT3FT2FT1FT0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

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

Each bit enables/disables the falling edge trigger for the event and interrupt on the corresponding line.
0: Disable
1: Enable

  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.

12.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.Res.Res.Res.Res.Res.
1514131211109876543210
SWI15SWI14SWI13SWI12SWI11SWI10SWI9SWI8SWI7SWI6SWI5SWI4SWI3SWI2SWI1SWI0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bits 15:0 SWI x : Software rising edge event trigger on line x ( x = 15 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. The 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

12.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.Res.Res.Res.Res.Res.
1514131211109876543210
RPIF15RPIF14RPIF13RPIF12RPIF11RPIF10RPIF9RPIF8RPIF7RPIF6RPIF5RPIF4RPIF3RPIF2RPIF1RPIF0
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

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

Bits 15:0 RPIF x : Rising edge event pending for configurable line x ( x = 15 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

12.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.Res.Res.Res.Res.Res.
1514131211109876543210
FPIF15FPIF14FPIF13FPIF12FPIF11FPIF10FPIF9FPIF8FPIF7FPIF6FPIF5FPIF4FPIF3FPIF2FPIF1FPIF0
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

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

Bits 15:0 FPFx : Falling edge event pending for configurable line x (x = 15 to 0)

Each bit is set upon a falling 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 falling edge trigger request occurred

1: Falling edge trigger request occurred

12.5.6 EXTI external interrupt selection register (EXTI_EXTICRx)

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

Reset value: 0x0000 0000

EXTIm fields contain only the number of bits in line with the nb_ioport configuration.

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: reserved

0x05: PF[m+3] pin

Others 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: reserved

0x05: PF[m+2] pin

Others 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: reserved

0x05: PF[m+1] pin

Others 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: reserved

0x05: PF[m] pin

Others reserved

12.5.7 EXTI CPU wakeup with interrupt mask register (EXTI_IMR1)

Address offset: 0x080 (EXTI_IMR1)

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
IM31Res.Res.Res.Res.IM26IM25IM24IM23IM22IM21Res.IM19Res.Res.Res.
rwrwrwrwrwrwrwrw
1514131211109876543210
IM15IM14IM13IM12IM11IM10IM9IM8IM7IM6IM5IM4IM3IM2IM1IM0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 IM31 : CPU wakeup with interrupt mask on line 31

Setting/clearing this bit unmask/mask the CPU wakeup with interrupt, by an event on the corresponding line.

0: wakeup with interrupt masked

1: wakeup with interrupt unmasked

Bits 30:27 Reserved, must be kept at reset value.

Bits 26:21 IMx : CPU wakeup with interrupt mask on line x ( \( x = 26 \) to 21)

Setting/clearing each bit unmask/mask the CPU wakeup with interrupt, by an event on the corresponding line.

0: wakeup with interrupt masked

1: wakeup with interrupt unmasked

The IM24 and IM22 bits are only available in STM32G0B0xx. They are reserved in STM32G030xx as well as STM32G050xx as well as STM32G070xx.

Bit 20 Reserved, must be kept at reset value.

Bit 19 IM19 : CPU wakeup with interrupt mask on line 19

Setting/clearing this bit unmask/masks the CPU wakeup with interrupt, by an event on the corresponding line.

0: wakeup with interrupt masked

1: wakeup with interrupt unmasked

Bits 18:16 Reserved, must be kept at reset value.

Bits 15:0 IMx : CPU wakeup with interrupt mask on line x (x = 15 to 0)

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

0: wakeup with interrupt masked

1: wakeup with interrupt unmasked

12.5.8 EXTI CPU wakeup with event mask register (EXTI_EMR1)

Address offset: 0x084 (EXTI_EMR1)

Reset value: 0x0000 0000

31302928272625242322212019181716
EM31Res.Res.Res.Res.EM26EM25EM24EM23EM22EM21Res.EM19Res.Res.Res.
rwrwrwrwrwrwrwrw
1514131211109876543210
EM15EM14EM13EM12EM11EM10EM9EM8EM7EM6EM5EM4EM3EM2EM1EM0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 EM31 CPU wakeup with event generation mask on line 31

Setting/clearing this bit unmask/masks the CPU wakeup with event generation on the corresponding line.

0: wakeup with event generation masked

1: wakeup with event generation unmasked

Bit 30:27 Reserved, must be kept at reset value.

Bits 26:21 EMx : CPU wakeup with event generation mask on line x (x = 26 to 21)

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

0: wakeup with event generation masked

1: wakeup with event generation unmasked

The EM24 and EM22 bits are only available in STM32G0B0xx. They are reserved in STM32G030xx as well as STM32G050xx as well as STM32G070xx.

Bit 20 Reserved, must be kept at reset value.

Bit 19 EM19 CPU wakeup with event generation mask on line 19

Setting/clearing this bit unmasks/masks the CPU wakeup with event generation on the corresponding line.
0: wakeup with event generation masked
1: wakeup with event generation unmasked

Bits 18:16 Reserved, must be kept at reset value.

Bits 15:0 EMx : CPU wakeup with event generation mask on line x ( x = 15 to 0)

Setting/clearing each bit unmasks/masks the CPU wakeup with event generation on the corresponding line.
0: wakeup with event generation masked
1: wakeup with event generation unmasked

12.5.9 EXTI register map

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

Table 52. EXTI controller register map and reset values

OffsetRegister313029282726252423222120191817161514131211109876543210
0x000EXTI_RTSR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RT[15:0]
Reset value0000000000000000
0x004EXTI_FTSR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FT[15:0]
Reset value0000000000000000
0x008EXTI_SWIER1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWI[15:0]
Reset value0000000000000000
0x00CEXTI_RPR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RPIF[15:0]
Reset value0000000000000000
0x010EXTI_FPR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FPIF[16:0]
Reset value0000000000000000
0x014-0x05CReservedRes.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
0x06CEXTI_EXTICR4EXTI15[7:0]EXTI14[7:0]EXTI13[7:0]EXTI12[7:0]
Reset value00000000000000000000000000000000
0x070-0x07CReservedRes.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.

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

OffsetRegister313029282726252423222120191817161514131211109876543210
0x080EXTI_IMR1IM31Res.Res.Res.Res.IM26IM25IM24IM23IM22IM21Res.IM19Res.Res.Res.IM[15:0]
Reset value111111110000000000000000
0x084EXTI_EMR1EM31Res.Res.Res.Res.EM26EM25EM24EM23EM22EM21Res.EM19Res.Res.Res.EM[15:0]
Reset value00000000000000000000000
0x088-0x08CReservedRes.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.

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