Skip to main content
Visitor II
July 2, 2025
Question

Problems configuring a UART

  • July 2, 2025
  • 2 replies
  • 419 views

IMG_0193.jpeg

I'm using the STM32F405RGT6 board in a controller project.

I wanted to use PA0 as PWM and PA1 as RX. For some reason, when configuring the .ioc, even though I configure UART4 as receiver only, it doesn't allow me to use PA0 as PWM.

Is there any other way to configure this in the code?

2 replies

STTwo-32
Technical Moderator
July 2, 2025

Hello @Maria-e-Elisa and welcome to the ST Community.

This option is not possible throw CubeMX. So, if you want to configure the TX pin for another function, you can create your project on your own (without CubeMX code generation). Or create a basic code that Keeps the TX pin active. And on the generated code, made the modifications you need to change the TX pin functionality. Also, you can set the USART to use only one pin (the TX pin for TX and RX) by setting the mode to single wire half duplex mode. 

Best Regards.

STTwo-32

Andrew Neil
Super User
July 2, 2025

@Maria-e-Elisa wrote:

 the STM32F405RGT6 board 


What STM32F405RGT6  board, exactly?

See: How to write your question to maximize your chances to find a solution.

STM32F405RGT6 is just a chip part number - it doesn't identify a board.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.