cancel
Showing results for 
Search instead for 
Did you mean: 

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

EGi
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

4 REPLIES 4
christop
ST Employee

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
Associate III

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

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.

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