Boot from Bank 2: nSWAP_BANK vs. BFB2
I am trying to implement a "dual bank field upgrade" with a STM32G0B1CEU6 as described in AN4767, chapter 2.4 (for a STM32L0). As far as I know the STM32G4 also has this functionality, not 100% identically implemented but with the same intention. Seen here in the STM32G4 datasheet:
FLASH_OPTR
Bit20 BFB2:Dual-bankboot
0: Dual-bank boot disable
1: Dual-bank boot enable
But the STMG0B1, although a dual bank device might not. But I find in the STM32G0 datasheet the following:
FLASH_OPTR
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
In the memory map (table 11 of RM0444) there is nothing about this flag, also I can't find any other information.
Well, in the datasheet of the STM32H7 a flag SWAP_BANK is described quite well (table 19 RM0433), and seems to behave in the sense of BFB2: "The embedded Flash memory bank 1 and bank 2 can be swapped in the memory map [...]".
My questions:
- Is nSWAP_BANK comparable to BFB2? Or with the implementation of SWAP_BANK in STM32H7? And not just checking if code is present?
- If the answer to the first question is yes: why is this not described in the datasheet? If the answer is "No": Why on earth is the flag called the same as in STM32H7...?
-Can I implement the desired function with the STM32G0B1CEU6 with reasonable effort? So: "Program writes a new version in other bank and boots from there". Would I have to solve all address problems myself, which BFB2 (STM32G0) or SWAP_BANK (STM32H7) takes care of?
Thanks a lot,
Chris
