2023-01-19 11:29 PM
I am missing a description how the dual bank boot is implemented in mentioned devices.
From what I found the information is missing in AN2606.
Another question is how do I securely detect from which bank my FW is currently running (or rather which bank was mapped to 0x08000000).
2023-01-20 12:50 AM
Hello @Tobias Schüürhuis and welcome to the Community :),
The Dual bank feature is supported in STM32G0B01 MCU devices.
For more explanation, please refer to FLASH memory organization Section and FLASH option byte description Section in RM0444.
Concerning the second question, you can refer to RM0444 and precisely table10 and table 11 to define which bank are you used.
For example bank1 has been mapped to 0x08000000.
For more details you can refer to the RM0444.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Thankyou for your contribution in STCommunity.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-01-20 01:22 AM
Hello @KDJEM.1 and thank you for the fast response!
I read through the descriptions in RM0444 but I am still wondering how the bank swap mechanism works on this device.
Until now I thought that depending on the selection for the flash empty check (nSWAP_BANK bit) the banks are physically swapped after reset if there is valid data at the first address of the target bank.
That would imply that I can have bank1 or bank2 mapped to address 0x08000000 depending on my configuration and the following empty check?
best regards
Tobias
2023-02-03 02:40 AM
Hi, I got it working in the meantime but am still confused by the nBANK_SWAP bit definition.
Is it possible that the mapping description for the bit in RM0444 as well as the STM32CubeProgrammer is wrong?
At least the first answer in this post states that it is not
Bit20 nSWAP_BANK:Empty check boot configuration
This bit selects the bank that is the subject of empty check upon boot.
0: Bank 1
1: Bank 2
but rather
Note that:
nSWAP_BANK = 1 ==> BANK1 is mapped at 0x0800_0000
nSWAP_BANK = 0 ==> BANK2 is mapped at 0x0800_0000
best regards
Tobias