cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between user option bits DB1M and DBANK - STM32L4R9

DerekR
Senior

Background

Hardware:

  • STM32L4R9ZGJ6 (1 MB flash)
  • Custom board

Software:

  • STM32CubeIDE v1.6.1
  • STM32CubeProgrammer v2.8.0

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:

  • "The dual-bank feature on 1 Mbyte devices is enabled by setting the DB1M option bit"

DBANK:

  • "Single-bank mode DBANK=0: read access of 128 bits"
  • "Dual-bank mode DBANK=1: read access of 64 bits"

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

1 ACCEPTED SOLUTION

Accepted Solutions
DerekR
Senior

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:

0693W00000JOJbjQAH.pngIn 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."

View solution in original post

1 REPLY 1
DerekR
Senior

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:

0693W00000JOJbjQAH.pngIn 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."