Skip to main content
Senior
November 7, 2025
Question

Set a value in a specific address to be a flag to update a firmware

  • November 7, 2025
  • 2 replies
  • 211 views

So I made a custom bootloader that I use to update the MCU firmware. So I have both the bootloader and the main app in the Flash. What I wanted to do, is to write on a specific address (out of bootloader and application, of course) a kind of a flag that notifies the app when it is necessary to go to the bootloader to update the firmware. Any clue on how to do it? 
I am using a STM32U585, using the B-U585I-IOT02A board. 
Thank you! 

2 replies

Pavel A.
Super User
November 7, 2025

You can write this flag into the internal RAM (SRAM). Data in the SRAM survives restart/reboot of the MCU while power is supplied.

 

Andrew Neil
Super User
November 7, 2025

Basically the same question here: How to store a 1-bit bootloader flag without wasting 1 Flash page.

@j_filipe so does your value need to be volatile, or not?

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.