Skip to main content
Paul1
Senior III
Oct 18, 2021 7:39 PM UTC
Solved

[Resolved] UART Receive Only

We need some receive only UART/USART on STM32H7/STM32F7.

In MX I can select Half Duplex, but that seems to only disable Rx pin.

Even when I select [Data direction = Rx Only] still shows only Tx pin.

Even when I select [TX and Rx pins swapping = enable] still shows only Tx pin.

Is this only a bug in MX?

Is there a limitation in STM32H7/STM32F7?

How can I free the Uart Tx pins for other assignments?

Paul

This topic has been closed for replies.
Piranha
PiranhaBest answer
Principal III
Nov 7, 2021 12:18 AM UTC

And just to complete the information... If the USART_CR3_HDSEL and USART_CR2_SWAP are both set, then the half-duplex Tx/Rx is done on Rx pin and Tx pin is free for other use. Also, to avoid the effects of internal Tx-Rx loopback, I implemented switching between Tx and Rx modes by enabling/disabling the USART_CR1_TE and USART_CR1_RE bits accordingly.

3 replies

S.Ma
Principal
Oct 19, 2021 12:31 AM UTC

Have you tried full duplex without specifying TX pin? As long as it works....

Paul1
Paul1Author
Senior III
Oct 26, 2021 3:10 PM UTC

Just posting results so this item can be closed.

  • UART Half Duplex works for RxOnly
  • When in HalfDuplex don't Tx before Rx handling enabled (Rx Interrupt Callback enabled), else the internal connection of Tx-Rx will loopback Tx onto Rx and cause overflow, blocking Rx Interrupt till issue cleared.
  • Rx pin free for other use, Tx pin used for both Tx/Rx or Rx only

Paul

Piranha
PiranhaBest answer
Principal III
Nov 7, 2021 12:18 AM UTC

And just to complete the information... If the USART_CR3_HDSEL and USART_CR2_SWAP are both set, then the half-duplex Tx/Rx is done on Rx pin and Tx pin is free for other use. Also, to avoid the effects of internal Tx-Rx loopback, I implemented switching between Tx and Rx modes by enabling/disabling the USART_CR1_TE and USART_CR1_RE bits accordingly.