2022-01-31 02:44 PM
Background
Hardware:
Software:
Hello,
I have a couple questions.
Question 1: What is the difference between the user configuration option bits DB1M and DBANK?
According to the STM32L4 reference manual:
DB1M:
DBANK:
Based on the descriptions in the reference manual and STM32CubeProgrammer, they do the same thing. Having two bits with the same functionality seems unlikely, so there must be a difference.
Edit: Looks like someone asked the same question 3 years ago: https://community.st.com/s/feed/0D50X0000B09dgCSQQ
Question 2: When switching from dual-bank to single-bank, is it required to mass erase and reprogram the MCU?
Thanks,
Derek
Solved! Go to Solution.
2022-02-02 10:31 AM
I reached out to a FAE directly since I didn't get a response on here. Turns out that older versions of the STM32L4R9 reference manual (RM0432) are missing the following key notes:
In summary, use DBANK to toggle dual-bank mode when using a 2 MB flash device. Use DB1M to toggle dual-bank mode when using a 1 MB flash device. As for why there isn't just one bit for all devices regardless of flash size, that remains a mystery.
Regarding Question 2, this is the response I received: "This is not strictly required, but it is recommended to not make any flash access until reprogramming flash after enabling dual bank mode. It is possible that some of the data is corrupted when changing the flash organization. When switching in application, it is recommended that you execute code out of SRAM or just use the system memory bootloader. Else, you can just change the option bytes then manually reprogram."
2022-02-02 10:31 AM
I reached out to a FAE directly since I didn't get a response on here. Turns out that older versions of the STM32L4R9 reference manual (RM0432) are missing the following key notes:
In summary, use DBANK to toggle dual-bank mode when using a 2 MB flash device. Use DB1M to toggle dual-bank mode when using a 1 MB flash device. As for why there isn't just one bit for all devices regardless of flash size, that remains a mystery.
Regarding Question 2, this is the response I received: "This is not strictly required, but it is recommended to not make any flash access until reprogramming flash after enabling dual bank mode. It is possible that some of the data is corrupted when changing the flash organization. When switching in application, it is recommended that you execute code out of SRAM or just use the system memory bootloader. Else, you can just change the option bytes then manually reprogram."