22. General-purpose I/Os (GPIO)
22.1 GPIO introduction
Each general-purpose I/O port has four 32-bit configuration registers (GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR, and GPIOx_PUPDR), two 32-bit data registers (GPIOx_IDR and GPIOx_ODR), one 16-bit reset register (GPIOx_BRR), and one 32-bit set/reset register (GPIOx_BSRR).
All GPIOs have one 32-bit locking register (GPIOx_LCKR), two couple of 32-bit advanced configuration registers (GPIOx_DELAYRL/H, GPIOx_ADVCFGRL/H), and two 32-bit alternate function selection registers (GPIOx_AFRH and GPIOx_AFRL).
The access can be restricted to each GPIO configuration bit to secure-only and/or privileged-only. These configuration bits can also be allocated to a specific CPU.
22.2 GPIO main features
- • Multiple choice of configurations per I/O port:
- – Input configuration in floating, pull-up/down, or analog state
- – Analog configuration (output buffer and Schmitt trigger inputs disabled)
- – Output configuration, or alternate function configuration, in push-pull or open-drain state, with pull-up or pull-down activated
- • Data present on the I/O pin sampled to GPIOx_IDR register (input configuration), or to the peripheral (alternate-function configuration)
- • Output buffer on the I/O pin driven by GPIOx_ODR register (output configuration) or by the peripheral (alternate-function configuration)
- • I/O data output atomic read/modify through GPIOx_ BSRR and GPIOx_BRR registers
- • Speed selection for each I/O (GPIOx_OSPEEDR)
- • Lock mechanism (GPIOx_LCKR) to selectively freeze the I/O port configurations
- • Highly-flexible pin multiplexing allowing the use of I/O pins as GPIOs, or as one of several possible peripheral function
- • Programmable delay to either the input path or the output path (GPIOx_DELAYR)
- • Double-edge selection, clock inversion, and optional retime (GPIOx_ADVCFGR)
- • Possibility to restrict each I/O control to secure-only, privileged-only, or to a specific CPU (using its compartment information)
22.3 GPIO functional description
Subject to the specific hardware characteristics of each I/O port listed in the datasheet, each port bit of the GPIO ports can be individually configured by software in several modes:
- • input floating
- • input pull-up
- • input-pull-down
- • analog
- • output-open-drain with pull-up or pull-down capability
- • output-push-pull with pull-up or pull-down capability
- • alternate-function push-pull with pull-up or pull-down capability
- • alternate-function open-drain with pull-up or pull-down capability
Each I/O port bit is freely programmable. GPIO registers must be accessed as 32-bit words, half-words, or bytes. GPIOx_BSRR and GPIOx_BRR allow atomic read/modify accesses to any of GPIOx_ODR. There is then no risk of an IRQ occurring between the read and the modify access.
The figure below shows the basic structure of a standard I/O port bit. Table 168 gives the possible port bit configurations.
Figure 129. Basic structure of an I/O port bit

The diagram illustrates the internal structure of an I/O port bit. It shows the following components and connections:
- Input Path: The I/O pin is connected to an input driver. The input driver output goes to an input data register. The input data register output goes to a trigger. The trigger output goes to an on/off switch. The on/off switch output goes to an alternate function input. The alternate function input output goes to an on-chip peripheral. The on-chip peripheral output goes to a read/write register. The read/write register output goes to a read/write register. The read/write register output goes to a read/write register. The read/write register output goes to a read/write register.
- Output Path: The I/O pin is connected to an output driver. The output driver output goes to an output control. The output control output goes to a P-MOS transistor and an N-MOS transistor. The P-MOS transistor output goes to VDDIOx. The N-MOS transistor output goes to VSS. The P-MOS and N-MOS transistors are connected to a push-pull, open-drain, or disabled output driver. The output driver output goes to an alternate function output. The alternate function output output goes to an on-chip peripheral. The on-chip peripheral output goes to a read/write register. The read/write register output goes to a read/write register. The read/write register output goes to a read/write register. The read/write register output goes to a read/write register.
- Protection Circuitry: The I/O pin is connected to an ESD protection circuit. The ESD protection circuit output goes to a protection diode. The protection diode output goes to VSS.
- Registers: The diagram shows an input data register, an output data register, a bit set/reset register, and a read/write register.
- Control Signals: The diagram shows an on/off switch, a trigger, and a read/write register.
MSv71192V1
I/Os can be used at 1.8 V typ. or 3.3 V typ. (default), by selecting the VDDIOxRSEL range in PWR_CR1.
A 1.8 V I/O supply voltage and 1.8 V IO levels, with a 3.3 V I/O range setting is allowed, but results in degraded I/O performances.
A 3.3V I/O supply voltage or 3.3 V I/O levels, with a 1.8 V I/O range setting is not allowed, and may permanently damage the I/O.
Table 168. Port x bit configurations
| Port x configuration bits | I/O configuration(1) | ||||
|---|---|---|---|---|---|
| MODEx[1:0] | OTx | OSPEEDx[1:0] | PUPDx[1:0] | ||
| 01 | 0 | SPEED[1:0] | 0 | 0 | GP output |
| 0 | 1 | PP + PU | |||
| 1 | 0 | PP + PD | |||
| 1 | 1 | Reserved (GP output PP) | |||
| 1 | 0 | 0 | OD | ||
| 0 | 1 | OD + PU | |||
| 1 | 0 | OD + PD | |||
| 1 | 1 | Reserved (GP output OD) | |||
Table 168. Port x bit configurations (continued)
| Port x configuration bits | I/O configuration(1) | |||||
|---|---|---|---|---|---|---|
| MODEx[1:0] | OTx | OSPEEDx[1:0] | PUPDx[1:0] | |||
| 10 | 0 | SPEED[1:0] | 0 | 0 | AF | PP |
| 0 | 1 | PP + PU | ||||
| 1 | 0 | PP + PD | ||||
| 1 | 1 | Reserved (AF PP) | ||||
| 1 | 0 | 0 | AF (open-drain) | OD | ||
| 0 | 1 | OD + PU | ||||
| 1 | 0 | OD + PD | ||||
| 1 | 1 | Reserved (AF OD) | ||||
| 00 | x | x | 0 | 0 | GP input | Floating |
| x | x | 0 | 1 | PU | ||
| x | x | 1 | 0 | PD | ||
| x | x | 1 | 1 | Reserved (input floating) | ||
| 11 | x | x | 0 | 0 | Input/output | Analog |
| x | x | 0 | 1 | Analog | ||
| x | x | 1 | 0 | Analog + PD | ||
| x | x | 1 | 1 | Analog | ||
1. GP = general-purpose, PP = push-pull, PU = pull-up, PD = pull-down, OD = open-drain, AF = alternate function.
22.3.1 General-purpose I/O (GPIO)
During and just after a reset, alternate functions are not active, and all I/O ports are configured in analog mode, as defined through GPIOx_MODER.
When the pin is configured as output, the value written to GPIOx_ODR is output on the I/O pin. The output driver can be used in push-pull or open-drain mode (only the low level is driven, the high level is Hi-Z).
GPIOx_IDR captures the data present on the I/O pin at every AHB clock cycle.
All GPIO pins have weak internal pull-up and pull-down resistors, that can be activated or not depending on GPIOx_PUPDR value.
22.3.2 I/O pin alternate-function multiplexer and mapping
The I/O pins are connected to on-board peripherals/modules through a multiplexer that allows only one peripheral alternate function (AF) connected to an I/O pin at a time. This avoids any conflict between peripherals available on the same I/O pin.
Each I/O pin has a multiplexer with up to 16 alternate function inputs (AF0 to AF15), that can be configured through GPIOx_AFRL (for pin 0 to 7) and GPIOx_AFRH (for pin 8 to 15):
- During and just after reset, AFs are not active, and all I/O ports are configured in analog mode (through GPIOx_MODER). When active, AF0 is selected by default.
- • Specific AF assignments for each I/O pin are detailed in the device datasheet.
This flexible I/O multiplexing architecture is used to optimize the number of peripherals available in smaller packages.
To use an I/O in a given configuration, the user must proceed as follows:
- • GPIO modes: configure the desired I/O as output, input, or analog in GPIOx_MODER.
- • Peripheral alternate function:
- – For a given peripheral function, use the device datasheet “Alternate functions” table to identify the AF to use with a given I/O. One of GPIOx_AFRL or GPIOx_AFRH must be used.
- – Configure the desired I/O as an AF in GPIOx_MODER. Select also the type, pull-up/pull-down, and output speed via GPIOx_OTYPER, GPIOx_PUPDR, and GPIOx_OSPEEDR respectively.
- • Cortex-M33 alternate function (EVENTOUT)
- – The Cortex-M33 output EVENTOUT signal can be used by configuring the I/O pin to output at AF15. An event can be signaled through the configured pin after executing SEV instruction.
- – EVENTOUT signal can be used internally as a trigger for some peripherals (see Section 24: Peripheral interconnects).
- • Additional functions:
- – In the device datasheet, the “Additional functions” table lists peripheral functions that directly select/enable its allocated I/O port(s). Typical peripherals are RTC, TAMP, PWR (WKUPx pins), or RCC (oscillator pins). These functions have priority over the configuration in standard GPIO registers.
- – For ADC peripherals, configure the desired I/O in analog mode in GPIOx_MODER and configure the required function in ADC registers.
- – As described in the device datasheet “Additional functions”, some pins/balls are directly connected to ANA0 and ANA1 ADC analog inputs.
22.3.3 I/O port control registers
Each GPIO port x has four 32-bit memory-mapped control registers to configure up to 16 I/Os:
- • GPIOx_MODER is used to select the I/O mode (input, output, AF, analog).
- • GPIOx_OTYPER and GPIOx_OSPEEDR are respectively used to select the output type (push-pull or open-drain) and the speed.
- • GPIOx_PUPDR is used to select the pull-up/pull-down whatever the I/O direction.
22.3.4 I/O port data registers
Each GPIO port x has two 16-bit memory-mapped data registers:
- • GPIOx_ODR read/writable register stores the data to be output per I/O.
- • GPIOx_IDR read-only register stores the data input through each I/O.
22.3.5 I/O data bitwise handling
GPIOx_BSRR allows the application to set and reset each individual bit in GPIOx_ODR. GPIOx_BSRR has twice the size of GPIOx_ODR.
To each bit in GPIOx_ODR, correspond two control bits in GPIOx_BSRR: BS(i) and BR(i). When written to 1, BS(i) sets the corresponding ODR(i) bit. When written to 1, BR(i) resets the ODR(i) corresponding bit.
Writing any bit to 0 in GPIOx_BSRR does not have any effect on the corresponding bit in GPIOx_ODR. If there is an attempt to both set and reset a bit in GPIOx_BSRR, the set action takes priority.
Using GPIOx_BSRR to change the values of individual bits in GPIOx_ODR is a “one-shot” effect that does not lock GPIOx_ODR bits (they can always be accessed directly). GPIOx_BSRR provides a way of performing atomic-bitwise handling.
The software does not need to disable interrupts when programming GPIOx_ODR at bit level: one or more bits can be modified in a single-atomic AHB write access.
22.3.6 GPIO locking mechanism
GPIO control registers can be frozen by applying a specific write sequence to GPIOx_LCKR: each GPIOx_LCKR bit freezes the corresponding bit in GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR, GPIOx_PUPDR, GPIOx_DELAYRL/H, GPIOx_ADVCFGR/L/H, and GPIOx_AFRL/H.
To write GPIOx_LCKR, a specific write/read sequence must be applied. When the right lock sequence is applied to the bit 16 in this register, LCKR[15:0] value is used to lock the I/O configuration (during the write sequence, LCKR[15:0] value must be the same). When the lock sequence is applied to a port bit, the port bit value can no longer be modified until next device or peripheral reset. Each GPIOx_LCKR bit freezes the corresponding bit in control registers (GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR, GPIOx_PUPDR, GPIOx_DELAYRL/H, GPIOx_ADVCFGR/L/H, and GPIOx_AFRL/H).
The lock sequence can only be performed using a 32-bit word access to GPIOx_LCKR, due to the fact that GPIOx_LCKR bit 16 must be set at the same time as the [15:0] bits.
Note: The lock sequence aborts in the event of an AHB bus error (see Section 22.4 introduction), or insufficient access rights (see Section 22.3.15 to Section 22.3.17).
The lock sequence automatically suspends when accessing a different register from GPIOx_LCKR. It resumes with the next access to GPIOx_LCKR.
22.3.7 I/O alternate-function input/output
GPIOx_AFRL and GPIOx_AFRH registers are used to select one of the AF inputs/outputs available for each I/O. With these registers, the user can connect an AF to some other pin as required by the application.
This means that a number of possible peripheral functions are multiplexed on each GPIO using the GPIOx_AFRL and GPIOx_AFRH. The application can thus select any one of the possible functions for each I/O. The AF-selection signal being common to the AF input and AF output, a single channel is selected for the AF input/output of a given I/O.
To know which functions are multiplexed on each GPIO pin, refer to the device datasheet.
22.3.8 External interrupt/wake-up lines
All ports have an external interrupt capability. To use external interrupt lines, the port can be configured in input, output, or alternate-function mode (the port must not be configured
in analog mode). Refer to Section 29: Extended interrupts and event controller (EXTI) for more details.
22.3.9 Input configuration
When the I/O port is programmed as input, the following happens:
- • The output buffer is disabled.
- • The Schmitt trigger input is activated.
- • Pull-up and pull-down resistors are activated depending on GPIOx_PUPDR value.
- • Data present on the I/O pin are sampled into the input data register every AHB clock cycle.
- • A read access to the input data register provides the I/O state.
The figure below shows the input configuration of the I/O port bit.
Figure 130. Input floating/pull-up/pull-down configurations

22.3.10 Output configuration
When the I/O port is programmed as output, the following happens:
- • The output buffer is enabled:
- – Open-drain mode: a zero in the output register activates the N-MOS. A one in the output register leaves the port in Hi-Z (the P-MOS is never activated).
- – Push-pull mode: a zero in the output register activates the N-MOS. A one in the output register activates the P-MOS.
- • The Schmitt trigger input is activated.
- • Pull-up and pull-down resistors are activated depending on GPIOx_PUPDR value.
- • Data present on the I/O pin are sampled into the input data register every AHB clock cycle.
- • A read access to the input data register gets the I/O state.
- • A read access to the output data register gets the last written value.
The figure below shows the output configuration of the I/O port bit.
Figure 131. Output configuration

22.3.11 Alternate-function configuration
When the I/O port is programmed as alternate function, the following happens:
- • The output buffer can be configured in open-drain or push-pull mode.
- • The output buffer is driven by signals coming from the peripheral (transmitter enable and data).
- • The Schmitt trigger input is activated.
- • Weak pull-up and pull-down resistors are activated or not depending on GPIOx_PUPDR value.
- • Data present on the I/O pin are sampled into the input data register every AHB clock cycle.
- • A read access to the input data register gets the I/O state.
The figure below shows the alternate function configuration of the I/O port bit.
Figure 132. Alternate function configuration

22.3.12 Analog configuration
When the I/O port is programmed as analog, the following happens:
- • The output buffer is disabled.
- • The Schmitt trigger input is deactivated, providing zero consumption for every analog value of the I/O pin. The output of the Schmitt trigger is forced to a constant value (0).
- • The weak pull-up resistor is disabled by hardware. The weak pull-down resistor is activated or not depending on GPIOx_PUPDR value.
- • Read access to the input data register gets the value 0.
- • The analog switch to the analog peripheral must be closed by control from the analog peripheral.
Caution: The ADC is 1.8 V only. Check the datasheet for allowed voltage on ADC input pins to avoid permanent damage to the ADC.
The figure below shows the programmable, analog-input configuration of the I/O port bits.
Figure 133. Programmable analog configuration

The diagram illustrates the internal structure of a GPIO pin in analog configuration. It shows the following components and connections:
- Registers:
- Bit set/reset registers: Receives a 'Write' signal and controls the 'Output data register'.
- Output data register: Performs 'Read/write' operations and controls the 'Output driver'.
- Input data register: Performs 'Read' operations and is connected to the 'Input driver'.
- Drivers:
- Output driver: Controlled by the output data register, it connects to the I/O pin via an analog switch.
- Input driver: Controlled by the input data register, it connects to the I/O pin via an analog switch. It includes an 'On/off' control and a 'Trigger' (Schmitt trigger) that is deactivated in analog mode.
- External I/O Pin Circuitry:
- The I/O pin is connected to the internal drivers through an analog switch.
- External protection includes ESD protection and a Protection diode connected to VSS.
- An On/off switch and a Pull down resistor are also shown on the external pin path.
- Internal Connection: An analog path labeled 'Analog' leads 'To on-chip peripheral'.
MSv71196V1
22.3.13 GPIO pins used in VSW domain
The GPIO functionality is lost when the core supply domain is powered off. The pins are then set in analog input mode, unless one of the following conditions is met:
- • The GPIO configuration is bypassed by an additional function which stays powered: for example debug, PWR (WKUP only), RTC, TAMP, or RCC (LSE only). For more information, refer to the relevant sections in this reference manual and datasheet.
- • The GPIO bank stays powered (for example GPIOZ). Refer to the power supply list of GPIO table in the datasheet for the list of GPIO pins in VSW domain.
22.3.14 Advanced I/O configurations
I/O compensation cell
The I/O commutation slew rate (tfall/trise) can be adapted by software depending on PVT (process, voltage, and temperature) conditions, in order to reduce the I/O noise on power supply. Refer to Section 23: System configuration controller (SYSCFG) for more details.
I/O path configurable delay
A delay programmed in GPIOx_DELAYRL/H can be applied to either input or output path, based on DLYPATH in GPIOx_ADVCFGR/L.
I/O data double-edge selection
Input and output data can be managed as single- or double-edge, according to DE in GPIOx_ADVCFGR/L.
I/O data retiming
When RET is set in GPIOx_ADVCFGR/L, input and output data are retimed to either rising or falling clock edge, depending on INVCLK value.
22.3.15 I/O pin isolation using TrustZone
As TrustZone-aware peripheral, each I/O pin of GPIO port x can be individually configured as secure through GPIOx_SECCFGR. After reset, all GPIO ports are secure.
I/Os connected to peripheral functions can be conditioned by the peripheral security configuration (see Section 5.4: Resource isolation framework (RIF) for more details):
- peripherals for which the I/O pin selection is done through GPIOx_AFRL/H
If the peripheral is configured as secure, it cannot be connected to a non-secure I/O pin. If this is not respected, the input data to the secure peripheral is forced to zero (I/O input pin value ignored), and the output pin value is forced to zero. Any secure information leak through non-secure I/Os is then avoided. TrustZone-aware logic around GPIO ports is summarized in Table 169. - peripherals (like ADC) that embed AFs that directly select/enable its allocated I/O ports using analog switches
if the I/O is secure, this analog switch cannot be controlled by a non-secure peripheral. If the peripheral is configured as non-secure and the I/O is secure, the switch remains open. This prevents the redirection of secure data to a non-secure peripheral or I/O through analog path. Refer to Section 5: System security for the list of peripherals using this security. - I/Os that do not have an hardware protection linked to TrustZone (see Section 5: System security)
The listed signals (input and/or outputs) are not blocked when the I/O is set as secure. The associated peripheral is non secure. For each of these I/Os, the secure application must decide if a potential effect on data integrity or confidentiality is critical or not.
Refer to the 'pin definition' table in the device datasheet for more information about peripheral AFs (first above bullet) and additional-function mapping (last two bullets).
Table 169. Secure AF between peripherals and allocated I/Os
| Security configuration | Alternate-function logic | Comment | ||
|---|---|---|---|---|
| Peripheral | Allocated I/O pin | Input | Output | |
| Secure | Secure | I/O data | Peripheral data | - |
| Non-secure | Out of reset configuration | |||
| Secure | Non-secure | Zero | Zero | - |
| Non-secure | I/O data | Peripheral data | ||
Table 170 lists the I/O port y secured bits, following the SECy setting in GPIOx_SECCFGR. For each register in the table:
- • When a bit is secure, read and write operations are only allowed by a secure access. Non-secure read or write accesses on secure bits are RAZ/WI, with no illegal access event generated.
- • When a bit is non-secure, there is no TrustZone restriction. Read and write operations are allowed by both secure and non-secure accesses.
Table 170. GPIO protected bits
| Protected bit | Register name | Illegal access to protected bit |
|---|---|---|
| MODEy[1:0] | GPIOx_MODER | RAZ/WI |
| OTy | GPIOx_OTYPER | |
| OSPEEDy[1:0] | GPIOx_OSPEEDR | |
| PUPDy[1:0] | GPIOx_PUPDR | |
| IDy | GPIOx_IDR | |
| ODy | GPIOx_ODR | |
| BSy and BRy | GPIOx_BSRR | |
| BRy | GPIOx_BRR | |
| LCKy | GPIOx_LCKR | |
| AFSELy[3:0] | GPIOx_AFRH | |
| GPIOx_AFRL | ||
| DELAYy[3:0] | GPIOx_DELAYRL | RAZ/WI |
| GPIOx_DELAYRH | ||
| RETy, INVCLKy, DEy, DELYPATHy | GPIOx_ADVCFGRl | |
| GPIOx_ADVCFGRH |
Note: GPIOx_SECCFGR is readable by any application, and writable by only secure privileged applications.
Each bit in GPIOx_SECCFGR is write locked until the next device reset when setting the corresponding bit in GPIOx_RCFGLOCKR.
22.3.16 I/O pin isolation using privilege
As RIF-aware peripheral, each I/O pin of GPIO port x can be individually configured as privileged through GPIOx_PRIVCFGR . After reset, all GPIO registers can be read and written by privileged and unprivileged accesses, if the security is enough and the CPU is allowed.
Table 170 in the previous section lists the I/O port y protected bits, following PRIVy setting in GPIOx_PRIVCFGR. For each register in the table:
- • When a bit is privileged, read and write operations are only allowed by a privileged access. Unprivileged read or write accesses on privileged bits are RAZ/WI, with no illegal access event generated.
- • When a bit is unprivileged, there is no privilege restriction. Read and write operations are allowed by both privileged and unprivileged accesses.
Note: GPIOx_PRIVCFGR is readable by any application, writable by only privileged applications. Each bit in GPIOx_PRIVCFGR is write locked until the next device reset, when setting the corresponding bit in GPIOx_RCFGLOCKR.
22.3.17 I/O pin isolation using compartments
As RIF-aware peripheral, when the compartment-based filtering is active (CFEN = 1), each I/O pin y of GPIO port x can be individually configured as controlled by a unique CPU using one of the following techniques:
- • A trusted-domain application keeps SEM_EN cleared, and sets the authorized compartment with SCID[1:0] in GPIOx_CIDCFGRy.
- • A trusted-domain application sets SEM_EN, and sets compartments that are authorized to take the I/O pin y, by setting the corresponding SEMWLCm bits in GPIOx_CIDCFGRy. Each CPU, white-listed this way, is authorized to take SEM_MUTEX in GPIOx_SEMCRy to have the exclusive ownership on the I/O pin until this CPU clears SEM_MUTEX.
Table 170 in Section 22.3.15 details the I/O port y protected bits following the isolation to a compartment using GPIOx_CIDCFGRy and GPIOx_SEMCRy. For each register in the table:
- • For bits with compartment filtering activated: read and write operations are only allowed to the CPU with the correct compartment ID (CID), if secure and privilege of the access are enough. Other CPUs read configuration bits as zero, and writes are ignored. There is no illegal access event generated.
- • For bits with compartment filtering deactivated: no restriction. Read and write operations are allowed by any CPU, if secure and privilege of the access are enough.
Note: GPIOx_CIDCFGR and GPIOx_SEMCR are readable by any application. GPIOx_CIDCFGR is writable only by the trusted-domain CPU.
GPIOx_CIDCFGRy is write locked until the next device reset, when setting RLOCKy in GPIOx_RCFGLOCKR.
For more information on RIF, compartment ID (CID) and trusted domain application, refer to Section 5.4: Resource isolation framework (RIF).
22.4 GPIO registers
These registers are accessible through 32-bit word, half-word, or byte single access. Double-word and instruction-fetch accesses trigger an AHB bus error. Byte or half-word writes to GPIOx_LCKR are silently ignored (no bus error).
For any DDCID access to registers, the security and privileged policy applies like any other CIDs. Compartment filtering policy also applies to DDCID access if the debug domain is deactivated (DDEN = 0). When the debug domain is activated (DDEN = 1), the DDCID access goes through regardless of any CID filtering policy.
22.4.1 GPIO port x mode register (GPIOx_MODER) (x = A to I, Z)
Address offset: 0x000
Reset value: 0xFFFF FFFF (A, D, E port)
Reset value: 0xFFFC FCFC (B port)
Reset value: 0x0FFF FFFF (C port)
Reset value: 0xCFFF FFFF (F port)
Reset value: 0xFFFF CFFF (G port)
Reset value: 0x0FFF CF00 (H port)
Reset value: 0x0003 3F0F (I port)
Reset value: 0x0000 00CF (Z port)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| MODE15[1:0] | MODE14[1:0] | MODE13[1:0] | MODE12[1:0] | MODE11[1:0] | MODE10[1:0] | MODE9[1:0] | MODE8[1:0] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| MODE7[1:0] | MODE6[1:0] | MODE5[1:0] | MODE4[1:0] | MODE3[1:0] | MODE2[1:0] | MODE1[1:0] | MODE0[1:0] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 MODEy[1:0]: Port x configuration I/O pin y (y = 15 to 0)
These bits are written by software to configure the I/O mode.
00: General-purpose input mode
01: General-purpose output mode
10: Alternate-function mode (refer to device datasheet for available options)
11: Analog mode (reset state)
Successful read or write to MODEy must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1, it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.2 GPIO port x output type register (GPIOx_OTYPER) (x = A to I, Z)
Address offset: 0x004
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| OT15 | OT14 | OT13 | OT12 | OT11 | OT10 | OT9 | OT8 | OT7 | OT6 | OT5 | OT4 | OT3 | OT2 | OT1 | OT0 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 OTy: Port x configuration I/O pin y (y = 15 to 0)
These bits are written by software to configure the I/O output type.
0: Output push-pull (reset state)
1: Output open-drain
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bit, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.3 GPIO port x output speed register (GPIOx_OSPEEDR) (x = A to I, Z)
Address offset: 0x008
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| OSPEED15[1:0] | OSPEED14[1:0] | OSPEED13[1:0] | OSPEED12[1:0] | OSPEED11[1:0] | OSPEED10[1:0] | OSPEED9[1:0] | OSPEED8[1:0] | OSPEED7[1:0] | OSPEED6[1:0] | OSPEED5[1:0] | OSPEED4[1:0] | OSPEED3[1:0] | OSPEED2[1:0] | OSPEED1[1:0] | OSPEED0[1:0] |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| OSPEED15[1:0] | OSPEED14[1:0] | OSPEED13[1:0] | OSPEED12[1:0] | OSPEED11[1:0] | OSPEED10[1:0] | OSPEED9[1:0] | OSPEED8[1:0] | OSPEED7[1:0] | OSPEED6[1:0] | OSPEED5[1:0] | OSPEED4[1:0] | OSPEED3[1:0] | OSPEED2[1:0] | OSPEED1[1:0] | OSPEED0[1:0] |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 OSPEEDy[1:0]: Port x configuration I/O pin y (y = 15 to 0)
These bits are written by software to configure the I/O output speed.
00: Low speed
01: Medium speed
10: High speed
11: Very-high speed
Note: Refer to the device datasheet for frequency specifications, power supply, and load conditions for each speed.
Successful read or write to the bitfield OSPEEDy must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.4 GPIO port pull-up/pull-down register (GPIOx_PUPDR)
(x = A to I, Z)
Address offset: 0x00C
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PUPD15[1:0] | PUPD14[1:0] | PUPD13[1:0] | PUPD12[1:0] | PUPD11[1:0] | PUPD10[1:0] | PUPD9[1:0] | PUPD8[1:0] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| PUPD7[1:0] | PUPD6[1:0] | PUPD5[1:0] | PUPD4[1:0] | PUPD3[1:0] | PUPD2[1:0] | PUPD1[1:0] | PUPD0[1:0] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 PUPDy[1:0]: Port x configuration I/O pin y (y = 15 to 0)
These bits are written by software to configure the I/O pull-up or pull-down
00: No pull-up, pull-down
01: Pull-up
10: Pull-down
11: Reserved
Successful read or write to the bitfield PUPDy must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.5 GPIO port x input data register (GPIOx_IDR) (x = A to I, Z)
Address offset: 0x010
Reset value: 0x0000 XXXX
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| ID15 | ID14 | ID13 | ID12 | ID11 | ID10 | ID9 | ID8 | ID7 | ID6 | ID5 | ID4 | ID3 | ID2 | ID1 | ID0 |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 IDy: Port x input data I/O pin y (y = 15 to 0)
These bits are read-only. They contain the input value of the corresponding I/O port.
Successful read to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read, if privilege and security of the access is sufficient. Illegal read returns zero.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.6 GPIO port x output data register (GPIOx_ODR) (x = A to I, Z)
Address offset: 0x014
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| OD15 | OD14 | OD13 | OD12 | OD11 | OD10 | OD9 | OD8 | OD7 | OD6 | OD5 | OD4 | OD3 | OD2 | OD1 | OD0 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 ODy: Port x output data I/O pin y (y = 15 to 0)
These bits can be read and written by software.
Note: For atomic bit set/reset, the OD bits can be individually set and/or reset by writing to GPIOx_BSRR or GPIOx_BRR.
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bit, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.7 GPIO port x bit set/reset register (GPIOx_BSRR) (x = A to I, Z)
Address offset: 0x018
Reset value: 0x0000 0000
| RM0506 22.4.7 | column_2 | Bits 15:0 | ODy: | column_5 | column_6 | column_7 | column_8 | column_9 | column_10 | column_11 | column_12 | column_13 | column_14 | column_15 | column_16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| BR15 BR14 BR13 BR12 | BR11 | BR10 | BR9 | BR8 | BR7 | BR6 | BR5 | BR4 | BR3 | BR2 | BR1 | BR0 | |||
| w | w | w | w | w | w | w | w | w | w | w | w | w | w | w | w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| BS15 | BS14 | BS13 | BS12 | BS11 | BS10 | BS9 | BS8 | BS7 | BS6 | BS5 | BS4 | BS3 | BS2 | BS1 | BS0 |
| w | w | w | w | w | w | w | w | w | w | w | w | w | w | w | w |
| Bits 31:16 | BRy: Port x reset I/O pin y (y = 15 to 0) | ||||||||||||||
| Bits 15:0 | BS[15:0]: | Port x set I/O pin y (y = 15 to 0) | |||||||||||||
| RM0506 Rev 2 | 1209/ | 4831 |
Bits 31:16 BRy: Port x reset I/O pin y (y = 15 to 0)
These bits are write-only. A read to these bits returns the value 0x0000.
0: No action on the corresponding ODx bit
1: Resets the corresponding ODx bit
Note: If both BSx and BRx are set, BSx has priority.
Successful write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can write to this bit, if privilege and security of the access is sufficient. Illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
Bits 15:0 BS[15:0]: Port x set I/O pin y (y = 15 to 0)
These bits are write-only. A read to these bits returns the value 0x0000.
0: No action on the corresponding ODx bit
1: Sets the corresponding ODx bit
Successful write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can write to this bit, if privilege and security of the access is sufficient. Illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.8 GPIO port x configuration lock register (GPIOx_LCKR) (x = A to I, Z)
Address offset: 0x01C
Reset value: 0x0000 0000
This register is used to lock the configuration of the port bits when a correct write sequence is applied to bit 16 (LCKK). The value of bits [15:0] is used to lock the GPIO configuration. During the lock sequence, LCKR[15:0] value can change, but only stable bits are set (for example: if LCKR[15:0] = 0x3 during the first two writes but LCKR[15:0] = 0x2 for the third write, then only LCK1 is set).
Note: Only word access (32-bit long) is allowed during this locking sequence. Byte or half-word writes are silently ignored (no bus error, no abort to lock sequence).
When the lock sequence has been applied on a port bit, this port bit value can no longer be modified until the next device or peripheral reset. Each lock bit freezes a specific configuration register (control and alternate-function registers).
See Section 22.3.6 for details.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | LCKK |
| rw | |||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| LCK15 | LCK14 | LCK13 | LCK12 | LCK11 | LCK10 | LCK9 | LCK8 | LCK7 | LCK6 | LCK5 | LCK4 | LCK3 | LCK2 | LCK1 | LCK0 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:17 Reserved, must be kept at reset value.
Bit 16 LCKK: Lock key
This bit can be read any time. It can only be modified using the lock key write sequence.
0: Port configuration lock key not active
1: Port configuration lock key active. This register is locked until the next device or peripheral reset.
LOCK key write sequence:
WR LCKR[16] = 1 + LCKR[15:0]
WR LCKR[16] = 0 + LCKR[15:0]
WR LCKR[16] = 1 + LCKR[15:0]
RD LCKR
RD LCKR[16] = 1 (this read operation is optional but it confirms that the lock is active.)
Note: During the lock key write sequence, LCK[15:0] value must not change.
Any error in the lock sequence aborts the lock.
After the first lock sequence on any bit of the port, any read access on LCKK returns one until the next device or peripheral reset.
Bits 15:0 LCKy: Port x lock I/O pin y (y = 15 to 0)
These bits are read/write but can only be written when LCKK = 0.
0: Port configuration not locked
1: Port configuration locked
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bit, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.9 GPIO port x alternate function low register (GPIOx_AFRL)
(x = A to I, Z)
Address offset: 0x020
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AFSEL7[3:0] | AFSEL6[3:0] | AFSEL5[3:0] | AFSEL4[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| AFSEL3[3:0] | AFSEL2[3:0] | AFSEL1[3:0] | AFSEL0[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 AFSELY[3:0]: Alternate function selection for port x I/O pin y (y = 7 to 0)
These bits are written by software to configure alternate function I/Os.
0000: AF0
0001: AF1
0010: AF2
0011: AF3
0100: AF4
0101: AF5
0110: AF6
0111: AF7
1000: AF8
1001: AF9
1010: AF10
1011: AF11
1100: AF12
1101: AF13
1110: AF14
1111: AF15
Successful read or write to the bitfield AFSELY must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.10 GPIO port x alternate function high register (GPIOx_AFRH)
(x = A to I, Z)
Address offset: 0x024
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AFSEL15[3:0] | AFSEL14[3:0] | AFSEL13[3:0] | AFSEL12[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| AFSEL11[3:0] | AFSEL10[3:0] | AFSEL9[3:0] | AFSEL8[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 AFSELY[3:0]: Alternate function selection for port x I/O pin y (y = 15 to 8)
These bits are written by software to configure alternate function I/Os. See GPIOx_AFRL register for details.
Successful read or write to the bitfield AFSELY must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.11 GPIO port x bit reset register (GPIOx_BRR) (x = A to I, Z)
Address offset: 0x028
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| BR15 | BR14 | BR13 | BR12 | BR11 | BR10 | BR9 | BR8 | BR7 | BR6 | BR5 | BR4 | BR3 | BR2 | BR1 | BR0 |
| w | w | w | w | w | w | w | w | w | w | w | w | w | w | w | w |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 BRy: Port x reset I/O pin y (y = 15 to 0)
These bits are write-only. A read to these bits returns the value 0x0000.
0: No action on the corresponding ODx bit
1: Reset the corresponding ODx bit
Successful write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can write to this bit, if privilege and security of the access is sufficient. Illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.12 GPIO port x secure configuration register (GPIOx_SECCFGR)
(x = A to I, Z)
Address offset: 0x030
Reset value: 0x0000 FFFF
This register is used to configure a selected I/O as secure. Non-secure or unprivileged writes to this register are ignored, while any read is allowed.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SEC15 | SEC14 | SEC13 | SEC12 | SEC11 | SEC10 | SEC9 | SEC8 | SEC7 | SEC6 | SEC5 | SEC4 | SEC3 | SEC2 | SEC1 | SEC0 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 SECy: I/O pin y of Port x security configuration (y = 15 to 0)
0: The I/O pin y is non-secure. Secure access is also possible.
1: The I/O pin y is secure. Refer to Table 170 for all corresponding secured bits.
If compartment filtering for this I/O pin is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (resp any compartment) can write this bit, if privilege and security of the access is sufficient.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGR.
If SEM_EN = 1 it is equal to SEMCID if SEM_MUTEX = 1 in GPIOx_SEMCR. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
If RLOCKy bit is set in GPIOx_RCFGLOCKR write to this bit is ignored.
22.4.13 GPIO port x privileged configuration register (GPIOx_PRIVCFGR)
(x = A to I, Z)
Address offset: 0x034
Reset value: 0x0000 0000
Unprivileged writes to this register are ignored, while any read is allowed.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| PRIV15 | PRIV14 | PRIV13 | PRIV12 | PRIV11 | PRIV10 | PRIV9 | PRIV8 | PRIV7 | PRIV6 | PRIV5 | PRIV4 | PRIV3 | PRIV2 | PRIV1 | PRIV0 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 PRIVy: I/O pin y of port x privilege configuration (y = 15 to 0)
0: The I/O pin y is unprivileged. Privileged access is also possible.
1: The I/O pin y is privileged only. Refer to Table 170 for all corresponding protected bits.
If corresponding SECy is set in GPIOx_SECCFGR, this bit can only be written by a secure privileged application.
If compartment filtering for this I/O pin is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (resp any compartment) can write this bit, if privilege and security of the access is sufficient.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGR.
If SEM_EN = 1 it is equal to SEMCID if SEM_MUTEX = 1 in GPIOx_SEMCR. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
If RLOCKy bit is set in GPIOx_RCFGLOCKR write to this bit is ignored.
22.4.14 GPIO port x resource configuration lock register (GPIOx_RCFGLOCKR) (x = A to I, Z)
Address offset: 0x038
Reset value: 0x0000 0000
Secure privileged write access only. Write only by trusted domain CID.
Any read access is allowed on this register.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RLOCK 15 | RLOCK 14 | RLOCK 13 | RLOCK 12 | RLOCK 11 | RLOCK 10 | RLOCK 9 | RLOCK 8 | RLOCK 7 | RLOCK 6 | RLOCK 5 | RLOCK 4 | RLOCK 3 | RLOCK 2 | RLOCK 1 | RLOCK 0 |
| rs | rs | rs | rs | rs | rs | rs | rs | rs | rs | rs | rs | rs | rs | rs | rs |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 RLOCKy: I/O pin y of port x resource lock (y = 15 to 0)
This bit is set to lock this I/O resource. It is cleared by default and once set it cannot be cleared until GPIOx peripheral is reset.
0: Bits SECy in GPIOx_SECCFGR and PRIVy in GPIOx_PRIVCFGR are writable. GPIOx_CIDCFGRy is also writable.
1: Writes to bits SECy in GPIOx_SECCFGR and PRIVy in GPIOx_PRIVCFGR are ignored. Writes to GPIOx_CIDCFGRy are also ignored.
22.4.15 GPIO port x delay low register (GPIOx_DELAYRL) (x = A to I, Z)
Address offset: 0x040
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DLY7[3:0] | DLY6[3:0] | DLY5[3:0] | DLY4[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| DLY3[3:0] | DLY2[3:0] | DLY1[3:0] | DLY0[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |

Bits 31:0 DLYy[3:0]: Port x IO pin y delay setup (y = 7 to 0)
Configure delay applied to either the input path (data IN from pad) or the output path (data OUT to pad), depending on the value of the corresponding DLYPATHy in GPIOx_ADVCFGRL.
0000: no delay
0001: delay 0.3 ns
0010: delay 0.5 ns
0011: delay 0.75 ns
0100: delay 1.0 ns
0101: delay 1.25 ns
0110: delay 1.5 ns
0111: delay 1.75 ns
1000: delay 2.0 ns
1001: delay 2.25 ns
1010: delay 2.5 ns
1011: delay 2.75 ns
1100: delay 3.0 ns
1101: delay 3.25 ns
1110 to 1111: delay 3.25 ns (maximum)
Successful read or write to the bitfield DLYy must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.16 GPIO port x delay high register (GPIOx_DELAYRH) (x = A to I, Z)
Address offset: 0x044
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DLY15[3:0] | DLY14[3:0] | DLY13[3:0] | DLY12[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| DLY11[3:0] | DLY10[3:0] | DLY9[3:0] | DLY8[3:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 DLYy[3:0]: Port x IO pin y delay setup (y = 15 to 8)
Configure delay on input or output data related to WC prior to retiming.
See GPIOx_DELAYRL for details.
22.4.17 GPIO port x advanced configuration low register (GPIOx_ADVCFGRl)
(x = A to I, Z)
Address offset: 0x048
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| RET7 | INV CLK7 | DE7 | DLY PATH7 | RET6 | INV CLK6 | DE6 | DLY PATH6 | RET5 | INV CLK5 | DE5 | DLY PATH5 | RET4 | INV CLK4 | DE4 | DLY PATH4 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RET3 | INV CLK3 | DE3 | DLY PATH3 | RET2 | INV CLK2 | DE2 | DLY PATH2 | RET1 | INV CLK1 | DE1 | DLY PATH1 | RET0 | INV CLK0 | DE0 | DLY PATH0 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31, 27, 23, 19, RETy: Data retiming selection y (y = 7 to 0)
15, 11, 7, 3 0: Input and output data are not synchronized or retimed on clock edges.
1: Input and output data are retimed to either rising or falling clock edge depending on value of INVCLKy.
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
Bits 30, 26, 22, 18, INVCLKy: Clock inversion selection y (y = 7 to 0)
14, 10, 6, 2 0: I/O clocks are not inverted. Input and output data are retimed to rising clock edge.
1: I/O clocks are inverted. Input and output data are retimed to falling clock edge.
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
Bits 29, 25, 21, 17, DEy: Input/Output data double edge selection y (y = 7 to 0)
13, 9, 5, 1 0: Input and output data is single-edge (changing on rising or falling clock edge, but not both)
1: Input and output data is double-edge (changing on both rising and falling clock edges)
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
Bits 28, 24, 20, 16, 12, 8, 4, 0 DLYPATHy: Controls which path contains the configurable delay, input or output y (y = 7 to 0)
- 0: Delay is switched into the output path, while the input path is set as pass through.
- 1: Delay is switched into the input path, while the output path is set as pass through.
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.18 GPIO port x advanced configuration high register (GPIOx_ADVCFGRH) (x = A to I, Z)
Address offset: 0x04C
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| RET15 | INV CLK15 | DE15 | DLY PATH 15 | RET14 | INV CLK14 | DE14 | DLY PATH 14 | RET13 | INV CLK13 | DE13 | DLY PATH1 3 | RET12 | INV CLK12 | DE12 | DLY PATH1 2 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RET11 | INV CLK11 | DE11 | DLY PATH1 1 | RET10 | INV CLK10 | DE10 | DLY PATH1 0 | RET9 | INV CLK9 | DE9 | DLY PATH9 | RET8 | INV CLK8 | DE8 | DLY PATH8 |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31, 27, 23, 19, 15, 11, 7, 3 RETy: Data retiming selection y (y = 15 to 8)
- 0: Input and output data are not synchronized or retimed on clock edges.
- 1: Input and output data are retimed to either rising or falling clock edge depending on value of INVCLKy.
Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
- Bits 30, 26, 22, 18, 14, 10, 6, 2 INVCLKy: Clock inversion selection y (y = 15 to 8)
- 0: I/O clocks are not inverted. Input and output data are retimed to rising clock edge.
- 1: I/O clocks are inverted. Input and output data are retimed to falling clock edge.
- Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
- If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
- Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
- If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
- Bits 29, 25, 21, 17, 13, 9, 5, 1 DEy: Input/Output data double edge selection y (y = 15 to 8)
- 0: Input and output data is single-edge (changing on rising or falling clock edge, but not both)
- 1: Input and output data is double-edge (changing on both rising and falling clock edges)
- Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
- If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
- Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
- If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
- Bits 28, 24, 20, 16, 12, 8, 4, 0 DLYPATHy: Controls which path contains the configurable delay, input or output y (y = 15 to 8)
- 0: Delay is switched into the output path, while the input path is set as pass through.
- 1: Delay is switched into the input path, while the output path is set as pass through.
- Successful read or write to this bit must be secure if SECy is set in GPIOx_SECCFGR, and must be privileged if PRIVy is set in GPIOx_PRIVCFGR.
- If compartment filtering for this I/O pin y is enabled (respectively disabled) using CFEN bit in GPIOx_CIDCFGRy, only an authorized compartment (respectively any compartment) can read or write this bitfield, if privilege and security of the access is sufficient. Illegal read returns zero and illegal write is ignored.
- Authorized compartment is defined as SCID if SEM_EN = 0 in GPIOx_CIDCFGRy.
- If SEM_EN = 1 it is defined as SEMCID, if SEM_MUTEX = 1 in GPIOx_SEMCRy. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.
22.4.19 GPIO port x CID configuration register for I/O pin y (GPIOx_CIDCFGRy) (x = A to I, Z)
Address offset: 0x050 + 0x8 * y (y = 0 to 15)
Reset value: 0x0000 0000
Secure privileged write access only. Write only by trusted domain CID.
Any read access is allowed on this register. Any write is ignored if RLOCKy is set in GPIOx_RCFGLOCKR register.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | SEMW LC3 | SEMW LC2 | SEMW LC1 | SEMW LC0 |
| rw | rw | rw | rw | ||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | SCID[1:0] | Res. | Res. | SEM_E N | CFEN | |
| rw | rw | rw | rw | ||||||||||||
Bits 31:20 Reserved, must be kept at reset value.
Bits 19:16 SEMWLCz: Semaphore white list for compartment z (z = 3 to 0)
0: Application running in compartment z cannot get access to the I/O pin y through semaphore SEM_Mutex.
1: Application running in compartment z can get access to the I/O pin y through semaphore SEM_Mutex.
Each bit is not taken into account by GPIOx when semaphore is disabled (SEM_EN = 0), or compartment filtering is off (CFEN = 0) for this I/O pin.
Bits 15:6 Reserved, must be kept at reset value.
Bits 5:4 SCID[1:0]: Static CID
Trusted domain application uses this bitfield to statically define which compartment has access to the I/O pin y when SEM_EN = 0.
This CID is not taken into account by GPIOx when semaphore is enabled (SEM_EN = 1) or compartment filtering is off (CFEN=0) for this I/O pin.
Bits 3:2 Reserved, must be kept at reset value.
Bit 1 SEM_EN: Semaphore enable
0: Access to I/O pin y is granted only if CID of the access equals to SCID.
1: Access to I/O pin y is granted only if SEM_Mutex = 1 and CID of the access equals to SEMCID in GPIOx_SEMCR.
This bit is not taken into account by GPIOx if compartment filtering is off (CFEN = 0) for this I/O pin. When this bit is cleared from 1 by trusted domain application SEM_Mutex is cleared to zero by GPIOx.
Bit 0 CFEN: CID filtering enable
0: Compartment-based filtering defined in GPIOx_CIDCFGR, and optionally GPIOx_SEMCR is disabled for I/O pin y.
1: Compartment-based filtering defined in GPIOx_CIDCFGR, and optionally GPIOx_SEMCR is enabled for I/O pin y.
For any CFEN value access controls to I/O pin y defined in GPIOx_PRIVCFGR and GPIOx_SECCFGR always apply. When this bit is cleared from 1 by trusted domain application SEM_Mutex is cleared to zero by GPIOx.
22.4.20 GPIO port x semaphore control register for I/O pin y (GPIOx_SEMCRy) (x = A to I, Z)
Address offset: 0x054+0x8*y (y = 0 to 15)
Reset value: 0x0000 0000
If compartment filtering is disabled (CFEN = 0) or semaphore is disabled (SEM_EN = 0) in GPIOx_CIDCFGRy, any write to this register is ignored.
Privileged-only write if PRIVy is set in GPIOx_PRIVCFGR. Secure-only write if SECy is set in GPIOx_SECCFGR.
If compartment filtering is enabled and semaphore is enabled (CFEN and SEM_EN set in GPIOx_CIDCFGRy), only an authorized compartment can write to this register. For this register, the authorized compartment is equal to SEMCID if SEM_MUTEX = 1, else it is defined by the CID white list (SEMWLCm) in GPIOx_CIDCFGRy. There is no authorized compartment if semaphore is disabled (SEM_EN = 0).
Any read access is allowed to this register.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | SEMCID[1:0] | Res. | Res. | Res. | SEM_MUTEX | |
| r | r | rw | |||||||||||||
Bits 31:6 Reserved, must be kept at reset value.
Bits 5:4 SEMCID[1:0]: Semaphore current CID
When SEM_EN and CFEN are set in GPIOx_CIDCFGRy, this read-only bitfield is updated with the CID value of the latest successful acquisition of GPIOx_SEMCRy semaphore (SEM_MUTEX = 1). In all other cases SEMCID stays unchanged.
Bits 3:1 Reserved, must be kept at reset value.
Bit 0 SEM_MUTEX: Semaphore mutex
White listed application can set semaphore bit to get exclusive access to the I/O pin y configuration when SEM_EN is set in GPIOx_CIDCFGRy (writes are ignored otherwise).
Read 0: Semaphore is free to take
Read 1: Semaphore is taken
Write 0: Release semaphore
Write 1: Acquire semaphore
When SEM_MUTEX = 0, only applications belonging to white-listed compartments (defined with SEMWLCm bits in GPIOx_CIDCFGRy) can acquire this semaphore.
When SEM_MUTEX = 1, only applications belonging to compartment SEMCID can release this semaphore.
This bit is cleared when CFEN or SEM_EN are cleared from 1 by trusted domain application in GPIOx_CIDCFGRy.
22.4.21 GPIO port x hardware configuration register 11 (GPIOx_HWCFGR11)
(x = A to I, Z)
Address offset: 0x3C8
Reset value: 0x0101 1240
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | PRIV_CFG[3:0] | OR_CFG[3:0] | SEC_CFG[3:0] | |||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | ||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| LOCK_CFG[3:0] | SPEED_CFG[3:0] | AFSIZE_CFG[3:0] | AHB_IOP[3:0] | ||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:28 Reserved, must be kept at reset value.
Bits 27:24 PRIV_CFG[3:0]: Privilege mechanism activation
- 0: Non active
- 1: Active
Bits 23:20 OR_CFG[3:0]: Option register configuration
- 0: Non active
- 1: Active
Bits 19:16 SEC_CFG[3:0]: Security activation
- 0: Non active
- 1: Active
Bits 15:12 LOCK_CFG[3:0]: Lock mechanism activation
- 0: Non active
- 1: Active
Bits 11:8 SPEED_CFG[3:0]: Number of speed lines for each I/O
- 1: One line
- 2: Two lines
Bits 7:4 AFSIZE_CFG[3:0]: Number of AF available for each I/O
- Accepted value: 1 to 4
- 1: One AF/IO
- 2: Four AF/IO
- 3: Eight AF/IO
- 4: Sixteen AF/IO
Bits 3:0 AHB_IOP[3:0]: Bus interface selection
- 0: AHB
- 1: IOP
22.4.22 GPIO port x hardware configuration register 10 (GPIOx_HWCFGR10)
(x = A to I, Z)
Address offset: 0x3CC
Reset value: 0x0000 FFFF (A, D, E port)
Reset value: 0x0000 FEEE (B port)
Reset value: 0x0000 FFFF (C port)
Reset value: 0x0000 BFFF (F port)
Reset value: 0x0000 FFBF (G port)
Reset value: 0x0000 3FB3 (H port)
Reset value: 0x0000 0173 (I port)
Reset value: 0x0000 000B (Z port)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| EN_IO[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 EN_IO[15:0]: Presence granularity, each bit indicate the I/O presence
0: I/O not present
1: I/O present
22.4.23 GPIO port x hardware configuration register 9 (GPIOx_HWCFGR9)
(x = A to I, Z)
Address offset: 0x3D0
Reset value: 0xFFFF FFFF
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| FAST_AF_IO15[3:0] | FAST_AF_IO14[3:0] | FAST_AF_IO13[3:0] | FAST_AF_IO12[3:0] | ||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| FAST_AF_IO11[3:0] | FAST_AF_IO10[3:0] | FAST_AF_IO9[3:0] | FAST_AF_IO8[3:0] | ||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:28 FAST_AF_IO15[3:0]: Indicate which is the fastest AF for I/O15 (0 to F)
Bits 27:24 FAST_AF_IO14[3:0]: Indicate which is the fastest AF for I/O14 (0 to F)
Bits 23:20 FAST_AF_IO13[3:0]: Indicate which is the fastest AF for I/O13 (0 to F)
Bits 19:16 FAST_AF_IO12[3:0]: Indicate which is the fastest AF for I/O12 (0 to F)
Bits 15:12 FAST_AF_IO11[3:0]: Indicate which is the fastest AF for I/O11 (0 to F)
Bits 11:8 FAST_AF_IO10[3:0]: Indicate which is the fastest AF for I/O10 (0 to F)
Bits 7:4 FAST_AF_IO9[3:0]: Indicate which is the fastest AF for I/O9 (0 to F)
Bits 3:0 FAST_AF_IO8[3:0]: Indicate which is the fastest AF for I/O8 (0 to F)
22.4.24 GPIO port x hardware configuration register 8 (GPIOx_HWCFGR8)
(x = A to I, Z)
Address offset: 0x3D4
Reset value: 0xFFFF FFFF
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| FAST_AF_IO7[3:0] | FAST_AF_IO6[3:0] | FAST_AF_IO5[3:0] | FAST_AF_IO4[3:0] | ||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| FAST_AF_IO3[3:0] | FAST_AF_IO2[3:0] | FAST_AF_IO1[3:0] | FAST_AF_IO0[3:0] | ||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:28 FAST_AF_IO7[3:0]: Indicate which is the fastest AF for I/O7 (0 to F)
Bits 27:24 FAST_AF_IO6[3:0]: Indicate which is the fastest AF for I/O6 (0 to F)
Bits 23:20 FAST_AF_IO5[3:0]: Indicate which is the fastest AF for I/O5 (0 to F)
Bits 19:16 FAST_AF_IO4[3:0]: Indicate which is the fastest AF for I/O4 (0 to F)
Bits 15:12 FAST_AF_IO3[3:0]: Indicate which is the fastest AF for I/O3 (0 to F)
Bits 11:8 FAST_AF_IO2[3:0]: Indicate which is the fastest AF for I/O2 (0 to F)
Bits 7:4 FAST_AF_IO1[3:0]: Indicate which is the fastest AF for I/O1 (0 to F)
Bits 3:0 FAST_AF_IO0[3:0]: Indicate which is the fastest AF for I/O0 (0 to F)
22.4.25 GPIO port x hardware configuration register 7 (GPIOx_HWCFGR7)
(x = A to I, Z)
Address offset: 0x3D8
Reset value: 0xFFFF FFFF
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| MODER_RES[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| MODER_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 MODER_RES[31:0]: MODER register reset value
Valid for bits that are enabled (GPIOx_MODER reset value = MODER_RES[31:0] & GPIOx_HWCFGR10[31:0]).
22.4.26 GPIO port x hardware configuration register 6 (GPIOx_HWCFGR6)
(x = A to I, Z)
Address offset: 0x3DC
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| PUPDR_RES[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| PUPDR_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 PUPDR_RES[31:0]: Pull-up/pull-down register reset value
22.4.27 GPIO port x hardware configuration register 5 (GPIOx_HWCFGR5)
(x = A to I, Z)
Address offset: 0x3E0
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| OSPEED_RES[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| OSPEED_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 OSPEED_RES[31:0]: OSPEED register reset value
22.4.28 GPIO port x hardware configuration register 4 (GPIOx_HWCFGR4)
(x = A to I, Z)
Address offset: 0x3E4
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| OTYPER_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| ODR_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 OTYPER_RES[15:0]: Output type register reset value
Bits 15:0 ODR_RES[15:0]: Output data register reset value
22.4.29 GPIO port x hardware configuration register 3 (GPIOx_HWCFGR3)
(x = A to I, Z)
Address offset: 0x3E8
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| AFRL_RES[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| AFRL_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
22.4.30 GPIO port x hardware configuration register 2 (GPIOx_HWCFGR2)
(x = A to I, Z)
Address offset: 0x3EC
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| AFRH_RES[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| AFRH_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
22.4.31 GPIO port x hardware configuration register 1 (GPIOx_HWCFGR1)
(x = A to I, Z)
Address offset: 0x3F0
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| OR_RES[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 OR_RES[15:0] : Option register reset value22.4.32 GPIO port x version register (GPIOx_VERR) (x = A to I, Z)
Address offset: 0x3F4
Reset value: 0x0000 0010
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MAJREV[3:0] | MINREV[3:0] | ||||||
| r | r | r | r | r | r | r | r | ||||||||
Bits 31:8 Reserved, must be kept at reset value.
Bits 7:4 MAJREV[3:0]: GPIO major revision
Major revision is 1.
Bits 3:0 MINREV[3:0]: GPIO minor revision
Minor revision is 0.
22.4.33 GPIO port x identification register (GPIOx_IPIDR) (x = A to I, Z)
Address offset: 0x3F8
Reset value: 0x000F 0004
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| IPID[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| IPID[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 IPID[31:0]: GPIO identifier
22.4.34 GPIO port x size identification register (GPIOx_SIDR) (x = A to I, Z)
Address offset: 0x3FC
Reset value: 0xA3C5 DD01
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| SID[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SID[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits [31:8] = 0xA3C5DD (fixed code)
Bits [7:0] = 0x01 (1-Kbyte address decoding)
22.4.35 GPIO register map
Table 171. GPIO register map and reset values
| Offset | Register name | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x000 | GPIOx_MODER (x = A to I, Z) | MODE15 [1:0] | MODE14 [1:0] | MODE13 [1:0] | MODE12 [1:0] | MODE11 [1:0] | MODE10 [1:0] | MODE9 [1:0] | MODE8 [1:0] | MODE7 [1:0] | MODE6 [1:0] | MODE5 [1:0] | MODE4 [1:0] | MODE3 [1:0] | MODE2 [1:0] | MODE1 [1:0] | MODE0 [1:0] | ||||||||||||||||
| Reset value (A, D, E port) | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| Reset value (B port) | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
| Reset value (C port) | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| Reset value (F port) | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| Reset value (G port) | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| Reset value (H port) | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Reset value (I port) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
| Reset value (Z port) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
| 0x004 | GPIOx_OTYPER (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | OT15 | OT14 | OT13 | OT12 | OT11 | OT10 | OT9 | OT8 | OT7 | OT6 | OT5 | OT4 | OT3 | OT2 | OT1 | OT0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x008 | GPIOx_OSPEEDR (x = A to I, Z) | OSPEED15 [1:0] | OSPEED14 [1:0] | OSPEED13 [1:0] | OSPEED12 [1:0] | OSPEED11 [1:0] | OSPEED10 [1:0] | OSPEED9 [1:0] | OSPEED8 [1:0] | OSPEED7 [1:0] | OSPEED6 [1:0] | OSPEED5 [1:0] | OSPEED4 [1:0] | OSPEED3 [1:0] | OSPEED2 [1:0] | OSPEED1 [1:0] | OSPEED0 [1:0] | ||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x00C | GPIOx_PUPDR (x = A to I, Z) | PUPD15 [1:0] | PUPD14 [1:0] | PUPD13 [1:0] | PUPD12 [1:0] | PUPD11 [1:0] | PUPD10 [1:0] | PUPD9 [1:0] | PUPD8 [1:0] | PUPD7 [1:0] | PUPD6 [1:0] | PUPD5 [1:0] | PUPD4 [1:0] | PUPD3 [1:0] | PUPD2 [1:0] | PUPD1 [1:0] | PUPD0 [1:0] | ||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x010 | GPIOx_IDR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | ID15 | ID14 | ID13 | ID12 | ID11 | ID10 | ID9 | ID8 | ID7 | ID6 | ID5 | ID4 | ID3 | ID2 | ID1 | ID0 |
| Reset value | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |||||||||||||||||
| 0x014 | GPIOx_ODR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | OD15 | OD14 | OD13 | OD12 | OD11 | OD10 | OD9 | OD8 | OD7 | OD6 | OD5 | OD4 | OD3 | OD2 | OD1 | OD0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x018 | GPIOx_BSRR (x = A to I, Z) | BR15 | BR14 | BR13 | BR12 | BR11 | BR10 | BR9 | BR8 | BR7 | BR6 | BR5 | BR4 | BR3 | BR2 | BR1 | BR0 | BS15 | BS14 | BS13 | BS12 | BS11 | BS10 | BS9 | BS8 | BS7 | BS6 | BS5 | BS4 | BS3 | BS2 | BS1 | BS0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0x01C | GPIOx_LCKR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | LCKK | LCK15 | LCK14 | LCK13 | LCK12 | LCK11 | LCK10 | LCK9 | LCK8 | LCK7 | LCK6 | LCK5 | LCK4 | LCK3 | LCK2 | LCK1 | LCK0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||
| 0x020 | GPIOx_AFRL (x = A to I, Z) | AFRL7[3:0] | AFRL6[3:0] | AFRL5[3:0] | AFRL4[3:0] | AFRL3[3:0] | AFRL2[3:0] | AFRL1[3:0] | AFRL0[3:0] | ||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x024 | GPIOx_AFRH (x = A to I, Z) | AFRH15[3:0] | AFRH14[3:0] | AFRH13[3:0] | AFRH12[3:0] | AFRH11[3:0] | AFRH10[3:0] | AFRH9[3:0] | AFRH8[3:0] | ||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x028 | GPIOx_BRR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | BR15 | BR14 | BR13 | BR12 | BR11 | BR10 | BR9 | BR8 | BR7 | BR6 | BR5 | BR4 | BR3 | BR2 | BR1 | BR0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x02C | Reserved | Reserved | |||||||||||||||||||||||||||||||
Table 171. GPIO register map and reset values (continued)
| Offset | Register name | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x030 | GPIOx_SECCFGR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | SEC15 | SEC14 | SEC13 | SEC12 | SEC11 | SEC10 | SEC9 | SEC8 | SEC7 | SEC6 | SEC5 | SEC4 | SEC3 | SEC2 | SEC1 | SEC0 |
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |||||||||||||||||
| 0x034 | GPIOx_PRIVCFGR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | PRIV15 | PRIV14 | PRIV13 | PRIV12 | PRIV11 | PRIV10 | PRIV9 | PRIV8 | PRIV7 | PRIV6 | PRIV5 | PRIV4 | PRIV3 | PRIV2 | PRIV1 | PRIV0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x038 | GPIOx_RCFGLOCKR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | RLOCK15 | RLOCK14 | RLOCK13 | RLOCK12 | RLOCK11 | RLOCK10 | RLOCK9 | RLOCK8 | RLOCK7 | RLOCK6 | RLOCK5 | RLOCK4 | RLOCK3 | RLOCK2 | RLOCK1 | RLOCK0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x03C | Reserved | Reserved | |||||||||||||||||||||||||||||||
| 0x040 | GPIOx_DELAYRL (x = A to I, Z) | DLY7[3:0] | DLY6[3:0] | DLY5[3:0] | DLY4[3:0] | DLY3[3:0] | DLY2[3:0] | DLY1[3:0] | DLY0[3:0] | ||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x044 | GPIOx_DELAYRH (x = A to I, Z) | DLY15 [3:0] | DLY14 [3:0] | DLY13 [3:0] | DLY12 [3:0] | DLY11 [3:0] | DLY10 [3:0] | DLY9[3:0] | DLY8[3:0] | ||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x048 | GPIOx_ADVCFGRL (x = A to K, Z) | RET7 | INVCLK7 | DE7 | DLYPATH7 | RET6 | INVCLK6 | DE6 | DLYPATH6 | RET5 | INVCLK5 | DE5 | DLYPATH5 | RET4 | INVCLK4 | DE4 | DLYPATH4 | RET3 | INVCLK3 | DE3 | DLYPATH3 | RET2 | INVCLK2 | DE2 | DLYPATH2 | RET1 | INVCLK1 | DE1 | DLYPATH1 | RET0 | INVCLK0 | DE0 | DLYPATH0 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x04C | GPIOx_ADVCFGRH (x = A to K, Z) | RET15 | INVCLK15 | DE15 | DLYPATH15 | RET14 | INVCLK14 | DE14 | DLYPATH14 | RET13 | INVCLK13 | DE13 | DLYPATH13 | RET12 | INVCLK12 | DE12 | DLYPATH12 | RET11 | INVCLK11 | DE11 | DLYPATH11 | RET10 | INVCLK10 | DE10 | DLYPATH10 | RET9 | INVCLK9 | DE9 | DLYPATH9 | RET8 | INVCLK8 | DE8 | DLYPATH8 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x050 + 0x8 * y (y=0 to 15) | GPIOx_CIDCFGRy (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | SEMWLC3 | SEMWLC2 | SEMWLC1 | SEMWLC0 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | SCID[1:0] | SEM_EN | CFEN | |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||||||||||
| 0x054 + 0x8 * y (y=0 to 15) | GPIOx_SEMCRy (x = A to I, Z) | 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. | SEMCID[1:0] | Res. | SEM_MUTEX | |
| Reset value | 0 | 0 | 0 | ||||||||||||||||||||||||||||||
| 0xCC-0x3C4 | Reserved | Reserved | |||||||||||||||||||||||||||||||
| 0x3C8 | GPIOx_HWCFGR11 (x = A to I, Z) | Res. | Res. | Res. | Res. | PRIV_CFG [3:0] | OR_CFG [3:0] | SEC_CFG [3:0] | LOCK_CFG [3:0] | SPEED_CFG [3:0] | AFSIZE_CFG [3:0] | AHB_IOP [3:0] | |||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |||||
| 0x3CC | GPIOx_HWCFGR10 (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | EN_IO[15:0] | |||||||||||||||
| Reset value (A, D, E port) | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |||||||||||||||||
| Reset value (B port) | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | |||||||||||||||||
| Reset value (C port) | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |||||||||||||||||
| Reset value (F port) | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |||||||||||||||||
| Reset value (G port) | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |||||||||||||||||
| Reset value (H port) | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||
| Reset value (I port) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||
| Reset value (Z port) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | |||||||||||||||||
Table 171. GPIO register map and reset values (continued)
| Offset | Register name | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x3D0 | GPIOx_HWCFGR9 (x = A to I, Z) | FAST_AF _IO15[3:0] | FAST_AF _IO14[3:0] | FAST_AF _IO13[3:0] | FAST_AF _IO12[3:0] | FAST_AF _IO11[3:0] | FAST_AF _IO10 [3:0] | FAST_AF _IO9 [3:0] | FAST_AF _IO8[3:0] | ||||||||||||||||||||||||
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 0x3D4 | GPIOx_HWCFGR8 (x = A to I, Z) | FAST_AF _IO7[3:0] | FAST_AF _IO6[3:0] | FAST_AF _IO5[3:0] | FAST_AF _IO4[3:0] | FAST_AF _IO3[3:0] | FAST_AF _IO2[3:0] | FAST_AF _IO1[3:] | FAST_AF _IO0[3:0] | ||||||||||||||||||||||||
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 0x3D8 | GPIOx_HWCFGR7 (x = A to I, Z) | MODR_RES[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 0x3DC | GPIOx_HWCFGR6 (x = A to I, Z) | PUPDR_RES[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x3E0 | GPIOx_HWCFGR5 (x = A to I, Z) | OSPEED_RES[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x3E4 | GPIOx_HWCFGR4 (x = A to I, Z) | OTYPER_RES[15:0] | ODR_RES[15:0] | ||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x3E8 | GPIOx_HWCFGR3 (x = A to I, Z) | AFRL_RES[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x3EC | GPIOx_HWCFGR2 (x = A to I, Z) | AFRH_RES[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x3F0 | GPIOx_HWCFGR1 (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | OR_RES[15:0] | |||||||||||||||
| Reset value | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x3F4 | GPIO_VERR (x = A to I, Z) | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MAJREV [3:0] | MINREV [3:0] | ||||||
| Reset value | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | |
| 0x3F8 | GPIO_IPIDR (x = A to I, Z) | IPID[31:16] | IPID[15:0] | ||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | |
| 0x3FC | GPIO_SIDR (x = A to I, Z) | SID[31:16] | SID[15:0] | ||||||||||||||||||||||||||||||
| Reset value | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
Refer to Section 2.4 for the register boundary addresses.