2021-12-30 05:26 AM
This is the same problem described in this thread, except the proposed solution does not fix the issue: https://community.st.com/s/question/0D50X0000CEqc1SSQR/dual-boot-on-the-stm32g4-not-quite-working-boot-from-second-bank-fails?t=1591957302322
Basically, I can't get the STM32G483VE to boot from flash bank 2, despite my stack pointer being correct. The bootloader always falls back to flash bank 1.
What works:
What doesn't work:
Other details:
My test program does a ping pong between both flash banks:
All of these steps work, except FB_MODE is never set at boot because the bootloader is always falling back to flash bank 1. There does not seem to be any reason for the bootloader to reject the stack pointer.
Note: I'm not using STM32Cube, my firmware is custom and runs on a custom board.