How can I detect the active flash bank on stm32g4? BFB2 bit is not conclusive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-06-15 5: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?
- Labels:
-
Flash
-
STM32G4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-06-15 8:25 PM
Check SYSCFG_MEMRMP / MEM_MODE
Mark the images when you write them into different banks
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-06-17 9:14 AM
Please follow this discussion
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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?
