Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: flash: stm32g0: dual bank handling
This commit fixes dual bank flash handling on stm32g0 targets. In contrast to other Series (G4, L5) the flash page size does not change in single bank configuration (2KiB in both configurations). nSWAP_BANK: While the reference manual(RM) only documents: "This bit selects the bank that is the subject of empty check upon boot" as expected, this behaves similar to BFB2 on G4 and SWAP_BANK on L5. It has been observed that this bit swaps the address mapping of bank1 and bank2, regardless of DUAL_BANK bit being set or not. As documented in the RM the nSWAP_BANK bit is ignored when the BOOT_LOOK bit is set. This applies to the empty check as well as the address mapping. On this Series FLASH_CR_BKER must be set in single-bank as well as dual-bank configuration for erase operations on bank2 regardless of the swap status. On a G0B1RE (dev-id: 0x467) I could not observe a difference between DUAL_BANK flash option bit set and not. It this may be different on 256KiB Flash targets. The HAL indicates that "FLASH_SALES_TYPE_0" only uses a single bank if OB_DUAL_BANK_VALUE is not set, but as I don't know which SoC this is and I can't test the behaviour and the driver does not take this into account. Signed-off-by: Thomas Stranger <[email protected]>
- Loading branch information