Skip to main content
Graduate II
June 9, 2025
Solved

stm32 flashing via uart

  • June 9, 2025
  • 2 replies
  • 451 views

Hi,
I'm working on a project using an STM32G series MCU alongside a processor. The processor runs an application that handles firmware flashing for the STM32.

We’re planning to implement firmware upgrades over I2C or UART. However, due to hardware limitations, the I2C line we selected does not support bootloader flashing. So, we're now considering UART for the firmware upgrade.

The current schematic only provides access to the MCU's RX pin—its TX pin is not connected. Can we connect the processor's TX pin to the MCU's RX pin and still perform the firmware upgrade using the STM32 bootloader? Will this unidirectional connection be enough?

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    You need both Tx and Rx pins as there are commands from the host and acknowledge and responses from the STM32 using that Tx pin.

    mALLEm_0-1749456415856.png

    In that case if the Tx is not available you need to implement your own bootloader.

    2 replies

    Super User
    June 9, 2025

    The system boot UART protocol is inherently bidirectional. See AN3155 Application note and

     How to utilize STM32 system (ROM) bootloader comma... - STMicroelectronics Community.

    You may however implement your own custom bootloader in flash. This could use any interface you like.

    If you must opt for that single UART pin, consider a 1 pin half-duplex protocol or the optional RX/TX pin swapping capability of many STM32 UARTs.

    You may start your boot loader from scratch, check STMicroelectronics/stm32-mw-openbl: Provides the Open Bootloader library, part of the STM32Cube MCU Component "middleware", for all STM32xx series.

    or 3rd party options.

    KnarfB

    mƎALLEmAnswer
    Technical Moderator
    June 9, 2025

    Hello,

    You need both Tx and Rx pins as there are commands from the host and acknowledge and responses from the STM32 using that Tx pin.

    mALLEm_0-1749456415856.png

    In that case if the Tx is not available you need to implement your own bootloader.