cancel
Showing results for 
Search instead for 
Did you mean: 

[Resolved] UART Receive Only

Paul1
Lead

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

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

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.

View solution in original post

3 REPLIES 3
S.Ma
Principal

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

Paul1
Lead

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
Chief II

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.