Skip to main content
Paul1
Senior III
October 18, 2021
Solved

[Resolved] UART Receive Only

  • October 18, 2021
  • 3 replies
  • 1528 views

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.
Best answer by Piranha

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
October 19, 2021

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

Paul1
Paul1Author
Senior III
October 26, 2021

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
November 7, 2021

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.