2025-09-23 2:30 AM
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!
2025-09-23 2:50 AM
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
2025-09-23 5:11 AM
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?
2025-09-23 5:52 AM
> 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.
2025-09-23 5:57 AM
You will brick the device and will need to initiate a BOOT0 Reset to start the processor again and repeat the update successfully.
The alternative is to have your own bootloader that lives at 0x08000000 and manages the update deeper in the FLASH.
2025-09-23 6:03 AM
If flash is empty when the chip boots, the chip won't do anything useful. It will sit in a hard fault.
You can change option bytes so that it boots into the bootloader automatically if you want, and change them back after the flash is successful.