2023-11-30 12:02 AM
I'm wondering what happens with the EDATA sectors when bank swapping is enabled.
In the GetBank_EDATA() helper function in the FLASH_EDATA_EraseProgram example, the FLASH_OPTSR_SWAP_BANK flag is not checked, so it would seem the EDATA areas do not swap when the banks are swapped.
Is that indeed the case?
Solved! Go to Solution.
2023-11-30 12:25 AM
I think I found the answer:
secton 7.3.10
"When SWAP_BANK feature is enabled, the banks are swapped: the flash high-cycle data in
Bank 2 are accessible from 0x0900_000 to 0x0900_BFFF and the data in Bank 1 are
accessible from 0x0900_C000 to 0x0901_7FFF"
This means the GetBank_EDATA() helper in the FLASH_EDATA_EraseProgram example is incomplete, it should have checked the FLASH_OPTSR_SWAP_BANK flag, just like the GetBank() helper in the FLASH_EraseProgram example does.
2023-11-30 12:25 AM
I think I found the answer:
secton 7.3.10
"When SWAP_BANK feature is enabled, the banks are swapped: the flash high-cycle data in
Bank 2 are accessible from 0x0900_000 to 0x0900_BFFF and the data in Bank 1 are
accessible from 0x0900_C000 to 0x0901_7FFF"
This means the GetBank_EDATA() helper in the FLASH_EDATA_EraseProgram example is incomplete, it should have checked the FLASH_OPTSR_SWAP_BANK flag, just like the GetBank() helper in the FLASH_EraseProgram example does.
2024-02-13 07:05 AM
I adjusted the 'X-CUBE-EEPROM v6.1.0' project from ST to accommodate bank switching for the H5 and it works! I'm totally amazed. Changes to the emulated eeprom contents will propogate to the opposite bank just as the RM states. I wouldn't believe until I saw it.