2020-06-15 05:08 AM
Hi,
I am developing an application with stm32g4 using the dual bank feature for firmware upgrades. To check if an upgrade was successful, I need to check the currently active bank.
I can read the option bytes and get the BFB2 bit. But: if the firmware on bank X was not correct and was rejected by the system bootloader, the system bootloader does not boot bank X, instead it boots bank Y. But it does not toggle the BFB2 bit, leading to a state where BFB2 indicates bank X but actually bank Y runs.
Is there a way to query the actually active bank?
2020-06-15 08:25 PM
Check SYSCFG_MEMRMP / MEM_MODE
Mark the images when you write them into different banks
2020-06-17 09:14 AM
Please follow this discussion
2021-02-13 10:03 AM
Did you managed to query the active bank? I followed the related discussion, and it solves issues related to the bank switching on boot, which is very useful, but nothing about how to check in wich bank are you running after boot. My code is going to erase a bank and flash a new firmware, then switchover, but I need to know what bank to erase in the first place. Isn't is this the expected behaviour for dual bank?