Skip to main content
Associate III
June 18, 2025
Solved

Nucleo F746ZG: How to use USART1 with PA10 and PA9 pins?

  • June 18, 2025
  • 5 replies
  • 1022 views

Hello, I am using an STM32 Nucleo F746ZG board.

I need to make an application where one board can transmit some firmware over to the second board via UART, and the second board will use it's default bootloader to read and flash that firmware.

However, according to documentation I read here: https://www.st.com/resource/en/application_note/an2606-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf, on page 212, it mentions that the bootloader can only use USART1 or USART3. I cannot use USART3, since I am already using that as a VCP for debugging printf messages. Thus, I have to use USART1. However, the problem is that the USART1 pins, PA10 and PA9 pins it requires me to use, are already being used here:

is45_0-1750215016048.png

The PA10 pin is being used as USB_OTG_FS_ID, and the PA9 pin is being used as USB_OTG_FS_VBUS. From what I read online, I think these pins are important if I want the STM32 to communicate with my laptop right? If so, then how am I expected to use USART1 to flash firmware when my board is running the default bootloader?

I feel like I am missing something, since the default bootloader would not give USART1 as an option if there wasn't any way to use it.

I would greatly appreciate any help. Thank you!

Best answer by Andrew Neil

@is45 wrote:

I think these pins are important if I want the STM32 to communicate with my laptop right?


As the names suggest, those pins are used by the USB function within the STM32F7 chip.

Note that this is entirely separate from the VCP connection via the ST-Link.

If you won't be using the USB function within the STM32F7 chip, then you should be able to use those pins for UART.

Check the board's User Manual and schematics for details ...

 


@is45 wrote:

I cannot use USART3, since I am already using that as a VCP for debugging printf messages. !


Could you not switch that to a different U(S)ART?

Or use ITM; eg,

https://community.st.com/t5/stm32-mcus/using-the-itm-console-for-printf-redirects-and-lwip-debug/ta-p/723472

 

Or, as @KnarfB said, use a custom bootloader - then you can choose any interface on any pins you like

5 replies

KnarfB
Super User
June 18, 2025

I think these pins are important if I want the STM32 to communicate with my laptop right?

Sometimes connecting only DP and DN is sufficient, depends on the use case. See  

Introduction to USB hardware and PCB guidelines using STM32 MCUs - Application note

 

You may adapt the ST provided bootloader middleware to use whatever pins you prefer: STMicroelectronics/stm32-mw-openbl: Provides the Open Bootloader library, part of the STM32Cube MCU Component "middleware", for all STM32xx series.

But this takes extra Flash space and development efforts. Maybe a simpler home grown update protocol is sufficient for you.

Maybe you can use DFU firmware update via that USB connection? 

hth

KnarfB

 

Andrew Neil
Andrew NeilBest answer
Super User
June 18, 2025

@is45 wrote:

I think these pins are important if I want the STM32 to communicate with my laptop right?


As the names suggest, those pins are used by the USB function within the STM32F7 chip.

Note that this is entirely separate from the VCP connection via the ST-Link.

If you won't be using the USB function within the STM32F7 chip, then you should be able to use those pins for UART.

Check the board's User Manual and schematics for details ...

 


@is45 wrote:

I cannot use USART3, since I am already using that as a VCP for debugging printf messages. !


Could you not switch that to a different U(S)ART?

Or use ITM; eg,

https://community.st.com/t5/stm32-mcus/using-the-itm-console-for-printf-redirects-and-lwip-debug/ta-p/723472

 

Or, as @KnarfB said, use a custom bootloader - then you can choose any interface on any pins you like

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.
Ozone
Principal
June 18, 2025

> Check the board's User Manual and schematics for details ...

Exactly.

There are life examples of other ST eval boards that have large electrolytic caps connected to VBUS, and thus are unusable for UART without modifications.

TDK
Super User
June 18, 2025

Click on the pin and select Reset State. Then you can assign them to USART1.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Andrew Neil
Super User
June 18, 2025

@TDK wrote:

Click on the pin and select Reset State. Then you can assign them to USART1.


@is45  But you'd need to check (UM & Schematics) that there's nothing on the board which would obstruct using them as UART pins - eg, as @Ozone said, capacitors ...

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.
Andrew Neil
Super User
June 18, 2025

@is45 wrote:

I feel like I am missing something, since the default bootloader would not give USART1 as an option if there wasn't any way to use it.


You're missing that this is just a result of the design choices made in the Nucleo board - it's not a limitation of the chip itself.

The Nucleo board has an ST-Link built in - so there's little demand to use the UART bootloader.

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.
is45Author
Associate III
June 19, 2025

Thanks everyone for the help!