Skip to main content
EGi
Associate II
February 26, 2023
Solved

Cube IDE - how to enable only UART Tx or Rx without having Cube complaining?

  • February 26, 2023
  • 2 replies
  • 3736 views

I have a situation where I use all I/O on an STM32L476RG. One of the units only sends UART data, so I want to configure the LPUART for Rx Only to keep the Tx pin free as GPO.

Cube has "Advanced Setting"; I've selected "Receive Only". But unless I enable the transmitter pin, Cube reports an error and refuses to generate code -> so it seems Cube ignores my Advanced Settling? How to get this fixed?

STM32CubeIDE

Version: 1.11.2

Build: 14494_20230119_0724 (UTC)

FW Package = STM32CubeFW_L4_V1.17.2

This topic has been closed for replies.
Best answer by Guenael Cadier

Single Wire (HalfDuplex mode) uses the Tx PIN. Rx PIN remains available, but not Tx.

So, if possible, when using HalfDuplex mode, you could the LPUART1 Rx pin available.

2 replies

christop
ST Employee
February 27, 2023

For LPUART mode, you can select "Single Wire (half-duplex)". This mode uses only 1 GPIO.

Then in Advanced settings, you select "Receive Only".

EGi
EGiAuthor
Associate II
February 27, 2023

I select Mode Single Wire

0693W00000aHl4mQAC.pngThis enables receiver + transmitter in Cube (the pins PB10 and PB11 turn green as expected)..

Data direction is changed to Receive Only.

0693W00000aHl5BQAS.pngChange the UART Tx PB11 Back to reset state (or anything else).

As a result, Cube disables the UART completely.0693W00000aHl5VQAS.png

Guenael Cadier
Guenael CadierBest answer
ST Employee
February 27, 2023

Single Wire (HalfDuplex mode) uses the Tx PIN. Rx PIN remains available, but not Tx.

So, if possible, when using HalfDuplex mode, you could the LPUART1 Rx pin available.

Piranha
Principal III
March 6, 2023

Or use the SWAP bit and then the Rx pin is used for communication and Tx pin is released.