4. I/O operating modes

STM32WL30xx/31xx/33xx devices propose up to 32 programmable I/Os (depending on the package).

Each I/O can be programmed in several modes:

STM32WL30xx/31xx/33xx devices support seven alternate modes called AFx (x = 0 to 6). The configuration of each I/O for those alternate modes is detailed in Table 8, Table 9 and Table 10. Some additional functions are also available see Table 11.

Note: The I/Os features presented in Table 8 and Table 9 are valid only when the associated I/O is programmed as alternate function.

Refer to Section 7: General-purpose I/Os (GPIO) for more details on all configurations.

The number of I/Os available in the STM32WL30xx/31xx/33xx device depends on the package:

Type acronyms correspond to:

Table 8. GPIO alternate options AF0 - AF3(1)

Pin nameAF0 modeAF1 modeAF2 modeAF3 mode
TypeSignalTypeSignalTypeSignalTypeSignal
Port A
PA0(2)I/ODI2C1_SCLIUSART_CTS----
PA1(2)I/ODI2C1_SDAI/OUSART_TXI/OTIM16_BRK--
PA2I/OSWDIOI/OUSART_CKI/OTIM16_CH1OI2S3_MCK
PA3ISWCLKOUSART_RTS_DEOTIM16_CH1NI/OSPI3_SCK/
I2S3_CK
PA4OLCOI/OLPUART_TXOCOMP1_OUT--
PA5OMCOI/OLPUART_RX----
PA6I/ODI2C2_SCLIUSART_CTS----
PA7I/ODI2C2_SDAOLPUART_RTS_DE----
Table 8. GPIO alternate options AF0 - AF3(1) (continued)
Pin nameAF0 modeAF1 modeAF2 modeAF3 mode
TypeSignalTypeSignalTypeSignalTypeSignal
PA8I/ORTC_OUT
/RTC_TAMP1
/RTC_TS
I/OUSART_RXORX_SEQUENCEI/OSPI3_MISO
PA9--I/OUSART_TXORTC_OUTI/OSPI3_NSS/
I2S3_WS
PA10--ILPUART_CTSOTX_SEQUENCEOI2S3_MCK
PA11OMCO--ORX_SEQUENCEI/OSPI3_MOSI/
I2S3_SD
PA12I/OI2C1_SMBAI/OSWDIO--I/OSPI1_NSS
PA13I/ODI2C2_SCLISWCLK--I/OSPI1_SCK
PA14I/ODI2C2_SDA----I/OSPI1_MISO
PA15I/OI2C2_SMBAI/OUSART_RX--I/OSPI1_MOSI
Port B
PB0(3)I/OUSART_RXOLPUART_RTS_DEI/OTIM16_CH1I/OSPI1_NSS
PB1I/OUSART_CKI/OSWDIOOTIM16_CH1NI/OSPI1_SCK
PB2OUSART_RTS_DEISWCLKI/OTIM16_BRKI/OSPI1_MISO
PB3IUSART_CTSI/OLPUART_TX--I/OSPI1_MOSI
PB4--I/OLPUART_TX--I/OSPI3_MISO
PB5--I/OLPUART_RX--I/OSPI3_NSS/
I2S3_WS
PB6(2)I/ODI2C1_SCLI/OLPUART_TXOCOMP1_OUTI/OSPI3_SCK/
I2S3_CK
PB7(2)I/ODI2C1_SDAI/OLPUART_RXORF_ACTIVITYI/OSPI3_MOSI/
I2S3_SD
PB8I/OUSART_CKI/OLPUART_RX--I/OSPI1_MISO
PB9I/OUSART_TXILPUART_CTS--I/OSPI1_MOSI
PB10I/ODI2C1_SDA----I/OSPI1_NSS
PB11I/ODI2C1_SCLOUSART_RTS_DEOLC_ACTIVITYI/OSPI1_SCK
PB12(3)OUSART_RTS_DEILPUART_CTSOLCO--
PB13(4)I/OI2C2_SMBA------
PB14I/OI2C1_SMBAI/OUSART_RXOTX_SEQUENCEOMCO
PB15--I/OUSART_TXOCOMP1_OUT--
  1. 1. The green cells correspond to I/Os available on the VFQFN32 package
    The blue cells correspond to unbonded pads on the VFQFN32 package
    STM32WL30xx devices are only available in the VFQFPN32 package.
  2. 2. This I/O is able to be configured in open-drain.
  3. 3. This I/O is shared with OSC32_OUT (low speed clock oscillator pin).
  4. 4. This I/O is shared with OSC32_IN (low speed clock oscillator pin).
Table 9. GPIO alternate options AF4 - AF6(1)
Pin nameAF4 modeAF5 modeAF6 mode
TypeSignalTypeSignalTypeSignal
Port A
PA0(2)I/OTIM2_CH3--OLCD_SEG12 / LCD_COM4
PA1(2)I/OTIM2_CH4--OLCD_SEG0
PA2I/OTIM2_CH1I/OSWDIOOLCD_SEG1
PA3I/OTIM2_CH2ISWCLKOLCD_SEG2
PA4I/OTIM2_CH1----
PA5I/OTIM2_CH2--OLCD_SEG9
PA6I/OTIM2_CH1----
PA7I/OTIM2_CH2----
PA8I/OTIM2_CH3--OLCD_COM0
PA9I/OTIM2_CH4--OLCD_SEG3
PA10ISUBG_TX_DATA--OLCD_SEG4
PA11OSUBG_TX_CLOCK--OLCD_SEG5
PA12I/OTIM2_CH1----
PA13ITIM2_ETR--OLCD_SEG10
PA14----OLCD_SEG11
PA15------
Table 9. GPIO alternate options AF4 - AF6(1) (continued)
Pin nameAF4 modeAF5 modeAF6 mode
TypeSignalTypeSignalTypeSignal
Port B
PB0OANTENNA_SWITCH--OLCD_COM1
PB1OSUBG_RX_DATA--OLCD_SEG6
PB2OSUBG_RX_CLOCK--OLCD_SEG7
PB3I/OTIM2_CH4--OLCD_SEG8
PB4----OLCD_SEG13 /
LCD_COM5
PB5----OLCD_SEG14 /
LCD_COM6
PB6
(2)
I/OTIM2_CH3--OLCD_SEG15 /
LCD_COM7
PB7
(2)
ITIM2_ETR--OLCD_COM2
PB8I/OTIM2_CH4----
PB9------
PB10I/OTIM2_CH2----
PB11I/OTIM2_CH1----
PB12(3)I/OTIM2_CH3----
PB13(4)I/OTIM2_CH4----
PB14ITIM2_ETR--OLCD_COM3
PB15----I/OLCD_VLCD
  1. 1. The green cells correspond to I/Os available on the VFQFN32 package
    The blue cells correspond to not bonded pads on the VFQFN32 package
    STM32WL30xx devices are only available in the VFQFPN32 package.
  2. 2. This I/O is able to be configured in open-drain.
  3. 3. This I/O is shared with OSC32_OUT (low speed clock oscillator pin).
  4. 4. This I/O is shared with OSC32_IN (low speed clock oscillator pin).

Note:

  1. 1. Comparator, DAC, I2C2, LCSC, LCD, LPAWUR are available only on STM32WL33xx devices.
  2. 2. ADC, temperature sensor, I2C1, SPI1, I2S are available only on STM32WL31xx/33xx devices.

Concerning the ADC block present in STM32WL31xx/33xx devices.

Concerning the comparator present in the STM32WL33xx device:

Note: The ADC/Comp features on those pins are available if the associated pin is configured in analog mode (see Section 7: General-purpose I/Os (GPIO) for more details).

Table 10 shows the mapping associated to analog configuration (for pins able to support analog mode).

Table 10. I/O Analog feature mapping(1) (2)

Pin nameAnalog featureParallel Analog featurePin nameAnalog featureParallel Analog feature
Port APort B
PA0N/A-PB0ADC_VINM1COMP1_INN1
PA1N/A-PB1ADC_VINP1COMP1_INP/LCSCOUT1
PA2ADC_VINM2-PB2ADC_VINM0COMP1_INP/LCSCOUT3
PA3ADC_VINP2-PB3ADC_VINP0COMP1_INN2
PA4N/A-PB4ADC_VINM3VCMBUFF
PA5N/A-PB5ADC_VINP3N/A
PA6N/A-PB6N/AN/A
PA7N/A-PB7N/AN/A
PA8N/A-PB8N/AN/A
PA9N/A-PB9N/AN/A
PA10N/A-PB10N/AN/A
PA11N/A-PB11N/A
PA12N/A-PB12-SXTALO(3)
PA13COMP1_INN0DACOUT_GPIOPB13-SXTALI(3)
PA14COMP1_INPLCSCOUT2PB14-PVD VIN(4)
PA15N/A-PB15-N/A
  1. 1. N/A means Not Applicable as the associated I/O does not support analog option.
  2. 2. The green cells correspond to I/Os available on VFQFN32 package
    The blue cells correspond to not bonded pads on VFQFN32 package
    STM32WL30xx devices are only available in the VFQFPN32 package.
  3. 3. The parallel analog feature is obtained by setting the RCC_CR.LSEON bit in the RCC registers. Then the PB12 and PB13 are forced by hardware to manage the LSE through SXTALO/SXTALI whatever the selected mode in the associated GPIO_MODERx register, but if APC is set is necessary to disable PUB12/PUB13/PDB12/PDB13 in PWR registers.
  4. 4. The selection between ATB1 and PVD is done through a register in the SYSCFG block (see 8.2.11: I/O analog switch control register (GPIO_SWA_CTRL) for details).
Table 11. I/O Additional function mapping(1)
Pin nameFunctionPin nameFunction
Port APort B
PA0-PB0-
PA1-PB1LCSCOUT1
PA2-PB2LCSCOUT3
PA3-PB3-
PA4-PB4-
PA5-PB5-
PA6-PB6-
PA7-PB7-
PA8-PB8-
PA9-PB9-
PA10LCOPB10-
PA11-PB11-
PA12-PB12SXTALO(2)
PA13-PB13SXTALI(2)
PA14LCSCOUT2PB14-
PA15-PB15-
  1. 1. The green cells correspond to I/Os available on VFQFN32 package
    The blue cells correspond to not bonded pads on VFQFN32 package
    STM32WL30xx devices are only available in the VFQFPN32 package.
  2. 2. The parallel analog feature is obtained by setting the RCC_CR.LSEON bit in the RCC registers. Then the PB12 and PB13 are forced by hardware to manage the LSE through SXTALO/SXTALI whatever the selected mode in the associated GPIO_MODERx register, but if APC is set is necessary to disable PUB12/PUB13/PDB12/PDB13 in PWR registers.