cancel
Showing results for 
Search instead for 
Did you mean: 

UART Transmit only? or how do i reliably remove UART configuration from the RX pin?

Carlos Diaz R.
Associate III

Hi,

I'm using a UART for "printf" debugging so it's only transmitting, it never receive, so i'm not using the RX pin for anything so i would like to know if:

  • Is reliable to set the RX pin to perform another function?
  • If so, can i do it directly on CubeMX? I tried but when i set the RX pin to another function the configuration of the uart on the left pannel gets deactivated.
  • I guess is it possible to do it, i only should place a function to reconfigure the RX pin to another function just after the PERIPHERAL_Init section, but the UART driver will be still working?
  • Have you tried something similar?

Regards :beaming_face_with_smiling_eyes:

6 REPLIES 6
Pavel A.
Evangelist III

In CubeMX, check the options of the UART, whether it supports TX only mode. If so, you can reuse the pin. Obviously, do not attempt to call RX related HAL or LL functions then.

-- pa

Unfortunately not specifying which STM32 is being used, but lets assume it is not an F1 series.

On any of the recent designs the USART_RX doesn't get to an external pin unless you select it on a pin mux, and the pin will remain free for any of the other mux options for that pin, including as a GPIO.

The smart design would perhaps provide some option to get an input for debugging (ie normally an LED, with an accessible test point), but it is up to you. Consider also the ability to use the System Loader, and USART1 or USART3 for low cost factory programming, or field recovery, absent a JTAG/SWD pod.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Carlos Diaz R.
Associate III

Hi,

@Pavel A.​ , no, it does not support TX only mode, i will check other UARTs to see if any support it, thanks for the help.

@Community member​ , sorry, i thought i specified the MCU which in fact is a STM32F103Rx, when i enable the UART peripheral on the left panel both RX and TX pins get green, when i want to configure the RX pin as any other function the UART peripheral gets disabled, so i guess based on your comment that you're referring to newer MCUs. Thanks for the suggestion about the bootloader,i almost forgot about it.

Regards.

The F1 parts move/remap pins in blocks. You're unlikely to be able to use the pin for a peripheral, but could use is as a GPIO input or output for your own purposes, ie button or LED. You can disable receive at the USART level to the pin is ignored.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Carlos Diaz R.
Associate III

Hi @Community member​ , i will try it on a toy project and report back when i got something useful.

Regards.

KPN1
Associate II

Old thread, I know - has anyone come up with a workable solution here?

I am porting code for a STM32F030C8T6 from another compiler. The Rx pin of USART 1 was used for a pin interrupt input. So the chip is not the limitation here. However I can't seem to disconnect the Rx pin in the STM32CubeMX, even though the USART is set to transmit only. I can't change the hardware setup here, so I need to find a way to make this work.

Any help greatly appreciated!