Skip to main content
Graduate II
September 23, 2025
Question

STM32 MCU flashing flow

  • September 23, 2025
  • 1 reply
  • 749 views

Hi,

I’m working on a project with an STM32G491 board and need to document our firmware-upgrade process.

  • Current setup:
    Initial flashing is done with ST-Link/CubeProgrammer.
    Later updates come from an embedded Linux device that runs a custom binary to flash the MCU over UART/I²C.

We already have a basic document that covers the application side, but we’d like to add a brief section explaining the MCU-side flashing flow.

Does anyone have a flowchart or reference diagram showing the STM32 flashing process—either using CubeProgrammer (ST-Link) or via UART/I²C bootloader—that we could include or adapt?

Thanks!

 

    This topic has been closed for replies.

    1 reply

    ST Employee
    September 23, 2025

    Hi @abhijith_raj ,

    Here is the bootloader flowchart that is executed on the STM32 when programming the device with UART/I2C bootloader on STM32G491xx/4A1xx devices.
    The can find it in the application note AN2606: Introduction to system memory boot mode on STM32 MCUs section 51.2, I hope that might help you.



    Best regards,
    Aime

    Graduate II
    September 23, 2025

    Hi @Aime ,
    I have another question. Currently, we are flashing the MCU firmware application at address 0x08000000.
    As I understand it, the process first erases the flash and then writes the new firmware to that address. What happens if a power failure occurs after the flash is erased? Since the STM32G491 doesn’t support dual-bank flash, how is this situation handled?

    Explorer
    September 23, 2025

    > What happens if a power failure occurs after the flash is erased?

    You will be left with an uncomplete or corrupted application image that will most likely crash.
    As remedy you have to repeat the process, i.e. start into the system bootloader, erase, and flash again.