2025-04-07 6:40 PM
I want to write a program for a fresh (first time power applied to it so there is nothing in Flash) STM32G0B1 that executes in RAM, resets the nBOOT_SEL bit in the Option Bytes (to allow DFU Mode to be invoked when Flash has been written).
The reason why I want to execute in RAM is to avoid having to run a program that is loaded in Flash (and resets nBOOT_SEL as discussed above) which is loaded into Flash that requires a power cycle to restart so that DFU Mode can be enabled in the MCU to load the actual product firmware.
This is being done in manufacturing test, so avoiding a power cycle (which takes about a minute due to other hardware in the application) would be of advantage.
Could anybody point me to:
I think the last two links for creating a program that runs in SRAM are probably closest to what I want to do but I'm hoping that there is a crisp explanation that I can follow.
For resetting the nBOOL_SEL bit, I'm going to use the following guide (with standard STM/HAL development tools/libraries):
https://community.st.com/t5/stm32-mcus/how-to-program-stm32-option-bytes-with-the-hal-api/ta-p/49660
Any comments or suggestions are most welcome!
myke