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

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:

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

Block diagram of an I/O port bit structure showing input and output drivers, registers, and protection circuitry.

The diagram illustrates the internal structure of an I/O port bit. It shows the following components and connections:

MSv71192V1

Block diagram of an I/O port bit structure showing input and output drivers, registers, and protection circuitry.

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 bitsI/O configuration(1)
MODEx[1:0]OTxOSPEEDx[1:0]PUPDx[1:0]
010SPEED[1:0]00GP output
01PP + PU
10PP + PD
11Reserved (GP output PP)
100OD
01OD + PU
10OD + PD
11Reserved (GP output OD)

Table 168. Port x bit configurations (continued)

Port x configuration bitsI/O configuration(1)
MODEx[1:0]OTxOSPEEDx[1:0]PUPDx[1:0]
100SPEED[1:0]00AFPP
01PP + PU
10PP + PD
11Reserved (AF PP)
100AF
(open-drain)
OD
01OD + PU
10OD + PD
11Reserved (AF OD)
00xx00GP inputFloating
xx01PU
xx10PD
xx11Reserved (input floating)
11xx00Input/outputAnalog
xx01Analog
xx10Analog + PD
xx11Analog

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

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:

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:

22.3.4 I/O port data registers

Each GPIO port x has two 16-bit memory-mapped data registers:

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 figure below shows the input configuration of the I/O port bit.

Figure 130. Input floating/pull-up/pull-down configurations

Block diagram of Figure 130: Input floating/pull-up/pull-down configurations. Shows Bit set/reset registers, Output data register, Input data register, Output driver (with open switch), Input driver (with Schmitt trigger activated), pull-up/pull-down resistors connected to VDDIOx and VSS via on/off switches, ESD protection, Protection diode, and I/O pin.
Block diagram of Figure 130: Input floating/pull-up/pull-down configurations. Shows Bit set/reset registers, Output data register, Input data register, Output driver (with open switch), Input driver (with Schmitt trigger activated), pull-up/pull-down resistors connected to VDDIOx and VSS via on/off switches, ESD protection, Protection diode, and I/O pin.

22.3.10 Output configuration

When the I/O port is programmed as output, the following happens:

The figure below shows the output configuration of the I/O port bit.

Figure 131. Output configuration

Figure 131: Output configuration diagram. This block diagram shows the internal structure of a GPIO output. On the left, 'Read' and 'Write' signals interact with 'Bit set/reset registers' and an 'Output data register'. The 'Output data register' is connected to an 'Input data register' and an 'Output driver'. The 'Output driver' contains an 'Output control' block and a pair of P-MOS and N-MOS transistors, controlled by 'On/off' signals, to provide 'Push-pull or open-drain' output. The 'Input driver' section includes a 'Trigger' block connected to the 'Input data register'. The physical 'I/O pin' on the right is connected to the output driver and includes 'Pull up' and 'Pull down' resistors (controlled by 'On/off'), 'ESD protection', and a 'Protection diode' to Vss. The diagram is labeled MSv71194V1.
Figure 131: Output configuration diagram. This block diagram shows the internal structure of a GPIO output. On the left, 'Read' and 'Write' signals interact with 'Bit set/reset registers' and an 'Output data register'. The 'Output data register' is connected to an 'Input data register' and an 'Output driver'. The 'Output driver' contains an 'Output control' block and a pair of P-MOS and N-MOS transistors, controlled by 'On/off' signals, to provide 'Push-pull or open-drain' output. The 'Input driver' section includes a 'Trigger' block connected to the 'Input data register'. The physical 'I/O pin' on the right is connected to the output driver and includes 'Pull up' and 'Pull down' resistors (controlled by 'On/off'), 'ESD protection', and a 'Protection diode' to Vss. The diagram is labeled MSv71194V1.

22.3.11 Alternate-function configuration

When the I/O port is programmed as alternate function, the following happens:

The figure below shows the alternate function configuration of the I/O port bit.

Figure 132. Alternate function configuration

Figure 132: Alternate function configuration diagram. This block diagram shows the internal structure of a GPIO alternate function. It is similar to Figure 131 but includes connections to 'To on-chip peripheral' and 'From on-chip peripheral'. The 'Alternate function input' is connected to the 'Input driver' (Trigger and Input data register). The 'Alternate function output' is connected to the 'Output driver' (Output control and P-MOS/N-MOS transistors). The 'I/O pin' on the right includes 'Pull up', 'Pull down', 'ESD protection', and a 'Protection diode'. The diagram is labeled MSv71195V1.
Figure 132: Alternate function configuration diagram. This block diagram shows the internal structure of a GPIO alternate function. It is similar to Figure 131 but includes connections to 'To on-chip peripheral' and 'From on-chip peripheral'. The 'Alternate function input' is connected to the 'Input driver' (Trigger and Input data register). The 'Alternate function output' is connected to the 'Output driver' (Output control and P-MOS/N-MOS transistors). The 'I/O pin' on the right includes 'Pull up', 'Pull down', 'ESD protection', and a 'Protection diode'. The diagram is labeled MSv71195V1.

22.3.12 Analog configuration

When the I/O port is programmed as analog, the following happens:

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

Block diagram of the programmable analog configuration for an I/O port bit. The diagram shows the internal structure of the I/O pin, including registers, drivers, and protection circuitry.

The diagram illustrates the internal structure of a GPIO pin in analog configuration. It shows the following components and connections:

MSv71196V1

Block diagram of the programmable analog configuration for an I/O port bit. The diagram shows the internal structure of the I/O pin, including registers, drivers, and protection circuitry.

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:

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

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 configurationAlternate-function logicComment
PeripheralAllocated I/O pinInputOutput
SecureSecureI/O dataPeripheral data-
Non-secureOut of reset configuration
SecureNon-secureZeroZero-
Non-secureI/O dataPeripheral data

Table 170 lists the I/O port y secured bits, following the SECy setting in GPIOx_SECCFGR. For each register in the table:

Table 170. GPIO protected bits

Protected bitRegister nameIllegal access to protected bit
MODEy[1:0]GPIOx_MODERRAZ/WI
OTyGPIOx_OTYPER
OSPEEDy[1:0]GPIOx_OSPEEDR
PUPDy[1:0]GPIOx_PUPDR
IDyGPIOx_IDR
ODyGPIOx_ODR
BSy and BRyGPIOx_BSRR
BRyGPIOx_BRR
LCKyGPIOx_LCKR
AFSELy[3:0]GPIOx_AFRH
GPIOx_AFRL
DELAYy[3:0]GPIOx_DELAYRLRAZ/WI
GPIOx_DELAYRH
RETy, INVCLKy, DEy, DELYPATHyGPIOx_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:

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:

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:

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)

31302928272625242322212019181716
MODE15[1:0]MODE14[1:0]MODE13[1:0]MODE12[1:0]MODE11[1:0]MODE10[1:0]MODE9[1:0]MODE8[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
MODE7[1:0]MODE6[1:0]MODE5[1:0]MODE4[1:0]MODE3[1:0]MODE2[1:0]MODE1[1:0]MODE0[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
OT15OT14OT13OT12OT11OT10OT9OT8OT7OT6OT5OT4OT3OT2OT1OT0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
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]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
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]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
PUPD15[1:0]PUPD14[1:0]PUPD13[1:0]PUPD12[1:0]PUPD11[1:0]PUPD10[1:0]PUPD9[1:0]PUPD8[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
PUPD7[1:0]PUPD6[1:0]PUPD5[1:0]PUPD4[1:0]PUPD3[1:0]PUPD2[1:0]PUPD1[1:0]PUPD0[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
ID15ID14ID13ID12ID11ID10ID9ID8ID7ID6ID5ID4ID3ID2ID1ID0
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
OD15OD14OD13OD12OD11OD10OD9OD8OD7OD6OD5OD4OD3OD2OD1OD0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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.7column_2Bits 15:0ODy:column_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15column_16
31302928272625242322212019181716
BR15 BR14 BR13 BR12BR11BR10BR9BR8BR7BR6BR5BR4BR3BR2BR1BR0
wwwwwwwwwwwwwwww
1514131211109876543210
BS15BS14BS13BS12BS11BS10BS9BS8BS7BS6BS5BS4BS3BS2BS1BS0
wwwwwwwwwwwwwwww
Bits 31:16BRy: Port x reset I/O pin y (y = 15 to 0)
Bits 15:0BS[15:0]:Port x set I/O pin y (y = 15 to 0)
RM0506 Rev 21209/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.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LCKK
rw
1514131211109876543210
LCK15LCK14LCK13LCK12LCK11LCK10LCK9LCK8LCK7LCK6LCK5LCK4LCK3LCK2LCK1LCK0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
AFSEL7[3:0]AFSEL6[3:0]AFSEL5[3:0]AFSEL4[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
AFSEL3[3:0]AFSEL2[3:0]AFSEL1[3:0]AFSEL0[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
AFSEL15[3:0]AFSEL14[3:0]AFSEL13[3:0]AFSEL12[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
AFSEL11[3:0]AFSEL10[3:0]AFSEL9[3:0]AFSEL8[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
BR15BR14BR13BR12BR11BR10BR9BR8BR7BR6BR5BR4BR3BR2BR1BR0
wwwwwwwwwwwwwwww

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.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
SEC15SEC14SEC13SEC12SEC11SEC10SEC9SEC8SEC7SEC6SEC5SEC4SEC3SEC2SEC1SEC0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
PRIV15PRIV14PRIV13PRIV12PRIV11PRIV10PRIV9PRIV8PRIV7PRIV6PRIV5PRIV4PRIV3PRIV2PRIV1PRIV0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
RLOCK 15RLOCK 14RLOCK 13RLOCK 12RLOCK 11RLOCK 10RLOCK 9RLOCK 8RLOCK 7RLOCK 6RLOCK 5RLOCK 4RLOCK 3RLOCK 2RLOCK 1RLOCK 0
rsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrs

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

31302928272625242322212019181716
DLY7[3:0]DLY6[3:0]DLY5[3:0]DLY4[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
DLY3[3:0]DLY2[3:0]DLY1[3:0]DLY0[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
ST logo
ST logo

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

31302928272625242322212019181716
DLY15[3:0]DLY14[3:0]DLY13[3:0]DLY12[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
DLY11[3:0]DLY10[3:0]DLY9[3:0]DLY8[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
RET7INV CLK7DE7DLY PATH7RET6INV CLK6DE6DLY PATH6RET5INV CLK5DE5DLY PATH5RET4INV CLK4DE4DLY PATH4
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
RET3INV CLK3DE3DLY PATH3RET2INV CLK2DE2DLY PATH2RET1INV CLK1DE1DLY PATH1RET0INV CLK0DE0DLY PATH0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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)

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

31302928272625242322212019181716
RET15INV CLK15DE15DLY PATH 15RET14INV CLK14DE14DLY PATH 14RET13INV CLK13DE13DLY PATH1 3RET12INV CLK12DE12DLY PATH1 2
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
RET11INV CLK11DE11DLY PATH1 1RET10INV CLK10DE10DLY PATH1 0RET9INV CLK9DE9DLY PATH9RET8INV CLK8DE8DLY PATH8
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31, 27, 23, 19, 15, 11, 7, 3 RETy: Data retiming selection y (y = 15 to 8)

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.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SEMW
LC3
SEMW
LC2
SEMW
LC1
SEMW
LC0
rwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SCID[1:0]Res.Res.SEM_E
N
CFEN
rwrwrwrw

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.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SEMCID[1:0]Res.Res.Res.SEM_MUTEX
rrrw

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

31302928272625242322212019181716
Res.Res.Res.Res.PRIV_CFG[3:0]OR_CFG[3:0]SEC_CFG[3:0]
rrrrrrrrrrrr
1514131211109876543210
LOCK_CFG[3:0]SPEED_CFG[3:0]AFSIZE_CFG[3:0]AHB_IOP[3:0]
rrrrrrrrrrrrrrrr

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

Bits 27:24 PRIV_CFG[3:0]: Privilege mechanism activation

Bits 23:20 OR_CFG[3:0]: Option register configuration

Bits 19:16 SEC_CFG[3:0]: Security activation

Bits 15:12 LOCK_CFG[3:0]: Lock mechanism activation

Bits 11:8 SPEED_CFG[3:0]: Number of speed lines for each I/O

Bits 7:4 AFSIZE_CFG[3:0]: Number of AF available for each I/O

Bits 3:0 AHB_IOP[3:0]: Bus interface selection

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)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
EN_IO[15:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
FAST_AF_IO15[3:0]FAST_AF_IO14[3:0]FAST_AF_IO13[3:0]FAST_AF_IO12[3:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
FAST_AF_IO11[3:0]FAST_AF_IO10[3:0]FAST_AF_IO9[3:0]FAST_AF_IO8[3:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
FAST_AF_IO7[3:0]FAST_AF_IO6[3:0]FAST_AF_IO5[3:0]FAST_AF_IO4[3:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
FAST_AF_IO3[3:0]FAST_AF_IO2[3:0]FAST_AF_IO1[3:0]FAST_AF_IO0[3:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
MODER_RES[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
MODER_RES[15:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
PUPDR_RES[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
PUPDR_RES[15:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
OSPEED_RES[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
OSPEED_RES[15:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
OTYPER_RES[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
ODR_RES[15:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
AFRL_RES[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
AFRL_RES[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 AFRL_RES[31:0] : AF register low reset value

22.4.30 GPIO port x hardware configuration register 2 (GPIOx_HWCFGR2)
(x = A to I, Z)

Address offset: 0x3EC

Reset value: 0x0000 0000

31302928272625242322212019181716
AFRH_RES[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
AFRH_RES[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 AFRH_RES[31:0] : AF register high reset value

22.4.31 GPIO port x hardware configuration register 1 (GPIOx_HWCFGR1)
(x = A to I, Z)

Address offset: 0x3F0

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
OR_RES[15:0]
rrrrrrrrrrrrrrrr

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

Bits 15:0 OR_RES[15:0] : Option register reset value

22.4.32 GPIO port x version register (GPIOx_VERR) (x = A to I, Z)

Address offset: 0x3F4

Reset value: 0x0000 0010

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.MAJREV[3:0]MINREV[3:0]
rrrrrrrr

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

31302928272625242322212019181716
IPID[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
IPID[15:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
SID[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
SID[15:0]
rrrrrrrrrrrrrrrr
Bits 31:0 SID[31:0] : Size identifier

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

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x000GPIOx_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)11111111111111111111111111111111
Reset value (B port)111111111111111001111110011111100
Reset value (C port)000011111111111111111111111111111
Reset value (F port)110011111111111111111111111111111
Reset value (G port)111111111111111111001111111111111
Reset value (H port)000011111111111111001111000000000
Reset value (I port)000000000000001100111111000011111
Reset value (Z port)000000000000000000000000110011111
0x004GPIOx_OTYPER
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OT15OT14OT13OT12OT11OT10OT9OT8OT7OT6OT5OT4OT3OT2OT1OT0
Reset value0000000000000000
0x008GPIOx_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 value00000000000000000000000000000000
0x00CGPIOx_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 value00000000000000000000000000000000
0x010GPIOx_IDR
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ID15ID14ID13ID12ID11ID10ID9ID8ID7ID6ID5ID4ID3ID2ID1ID0
Reset valuexxxxxxxxxxxxxxxx
0x014GPIOx_ODR
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OD15OD14OD13OD12OD11OD10OD9OD8OD7OD6OD5OD4OD3OD2OD1OD0
Reset value0000000000000000
0x018GPIOx_BSRR
(x = A to I, Z)
BR15BR14BR13BR12BR11BR10BR9BR8BR7BR6BR5BR4BR3BR2BR1BR0BS15BS14BS13BS12BS11BS10BS9BS8BS7BS6BS5BS4BS3BS2BS1BS0
Reset value000000000000000000000000000000000
0x01CGPIOx_LCKR
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LCKKLCK15LCK14LCK13LCK12LCK11LCK10LCK9LCK8LCK7LCK6LCK5LCK4LCK3LCK2LCK1LCK0
Reset value00000000000000000
0x020GPIOx_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 value00000000000000000000000000000000
0x024GPIOx_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 value00000000000000000000000000000000
0x028GPIOx_BRR
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.BR15BR14BR13BR12BR11BR10BR9BR8BR7BR6BR5BR4BR3BR2BR1BR0
Reset value0000000000000000
0x02CReservedReserved

Table 171. GPIO register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x030GPIOx_SECCFGR
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SEC15SEC14SEC13SEC12SEC11SEC10SEC9SEC8SEC7SEC6SEC5SEC4SEC3SEC2SEC1SEC0
Reset value1111111111111111
0x034GPIOx_PRIVCFGR
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PRIV15PRIV14PRIV13PRIV12PRIV11PRIV10PRIV9PRIV8PRIV7PRIV6PRIV5PRIV4PRIV3PRIV2PRIV1PRIV0
Reset value0000000000000000
0x038GPIOx_RCFGLOCKR
(x = A to I, Z)
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RLOCK15RLOCK14RLOCK13RLOCK12RLOCK11RLOCK10RLOCK9RLOCK8RLOCK7RLOCK6RLOCK5RLOCK4RLOCK3RLOCK2RLOCK1RLOCK0
Reset value0000000000000000
0x03CReservedReserved
0x040GPIOx_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 value00000000000000000000000000000000
0x044GPIOx_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 value00000000000000000000000000000000
0x048GPIOx_ADVCFGRL
(x = A to K, Z)
RET7INVCLK7DE7DLYPATH7RET6INVCLK6DE6DLYPATH6RET5INVCLK5DE5DLYPATH5RET4INVCLK4DE4DLYPATH4RET3INVCLK3DE3DLYPATH3RET2INVCLK2DE2DLYPATH2RET1INVCLK1DE1DLYPATH1RET0INVCLK0DE0DLYPATH0
Reset value00000000000000000000000000000000
0x04CGPIOx_ADVCFGRH
(x = A to K, Z)
RET15INVCLK15DE15DLYPATH15RET14INVCLK14DE14DLYPATH14RET13INVCLK13DE13DLYPATH13RET12INVCLK12DE12DLYPATH12RET11INVCLK11DE11DLYPATH11RET10INVCLK10DE10DLYPATH10RET9INVCLK9DE9DLYPATH9RET8INVCLK8DE8DLYPATH8
Reset value00000000000000000000000000000000
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.SEMWLC3SEMWLC2SEMWLC1SEMWLC0Res.Res.Res.Res.Res.Res.Res.Res.SCID[1:0]SEM_ENCFEN
Reset value00000000
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 value000
0xCC-0x3C4ReservedReserved
0x3C8GPIOx_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 value0001000000010001001001000000
0x3CCGPIOx_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)1111111111111111
Reset value (B port)1111111011101110
Reset value (C port)1111111111111111
Reset value (F port)1011111111111111
Reset value (G port)1111111101111111
Reset value (H port)0011111101100111
Reset value (I port)0000000101100111
Reset value (Z port)0000000000010111

Table 171. GPIO register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x3D0GPIOx_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 value11111111111111111111111111111111
0x3D4GPIOx_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 value11111111111111111111111111111111
0x3D8GPIOx_HWCFGR7
(x = A to I, Z)
MODR_RES[31:0]
Reset value11111111111111111111111111111111
0x3DCGPIOx_HWCFGR6
(x = A to I, Z)
PUPDR_RES[31:0]
Reset value00000000000000000000000000000000
0x3E0GPIOx_HWCFGR5
(x = A to I, Z)
OSPEED_RES[31:0]
Reset value00000000000000000000000000000000
0x3E4GPIOx_HWCFGR4
(x = A to I, Z)
OTYPER_RES[15:0]ODR_RES[15:0]
Reset value00000000000000000000000000000000
0x3E8GPIOx_HWCFGR3
(x = A to I, Z)
AFRL_RES[31:0]
Reset value00000000000000000000000000000000
0x3ECGPIOx_HWCFGR2
(x = A to I, Z)
AFRH_RES[31:0]
Reset value00000000000000000000000000000000
0x3F0GPIOx_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----------------0000000000000000
0x3F4GPIO_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------------------------00010000
0x3F8GPIO_IPIDR
(x = A to I, Z)
IPID[31:16]IPID[15:0]
Reset value00000000000011110000000000000100
0x3FCGPIO_SIDR
(x = A to I, Z)
SID[31:16]SID[15:0]
Reset value10100011110001011101110100000001

Refer to Section 2.4 for the register boundary addresses.