STM32G4 DualBoot example not working
Hi,
I'm trying to get the dual bank image swap feature of the STM32G4 to work, so far without success.
I tried first on my own board by following the (very sparse) information in the reference manual. However every time I set the BFB2 bit in software and reboot afterwards, the code in bank 2 doesn't seem to execute at all (and yes, address 0x08040000 is pointing to a valid RAM location for the stackpointer)
I finally decided to just try the example code from the firmware package (see https://github.com/STMicroelectronics/STM32CubeG4/tree/master/Projects/NUCLEO-G474RE/Examples/FLASH/FLASH_DualBoot) on my Nucleo G474RE eval board, just to verify the feature is actually working. However it seems to me that even this example program is not working!
Maybe I am doing something wrong here and someone can help me.
So here are my steps:
- Compile example program with "FLASH_BANK2" define active
- Flash binary to address offset 0x08040000 using ST-LINK
- Compile example program with "FLASH_BANK1" define active
- Flash binary to address offset 0x08000000 using ST-LINK (no erase)
- Verify that the flash content actually contains the two programs at the desired address offsets
- Make sure the BFB2 bit in the option bytes is cleared
- Re-power the eval-board
- I see the LED2 blinking --> correct
- Push the "user button" B1
- See no LED blinking anymore --> wrong (I should see LED2 being on)
Could someone verify this behavior?
Attached you can find screenshots of the flash content and option bytes set.
