cancel
Showing results for 
Search instead for 
Did you mean: 

What are the prerequisites to disable DBANK(dual to single bank mode)..??

Pkhot.1
Associate

We are using STM32L5 Nucleo board and TZEN is enabled and DBANK mode is enabled too..!

How to switch dual bank mode to single bank mode in option bytes(if any h/w or s/w changes)??

Please explain the procedure to understand what are the changes needed to be done before I uncheck DBANK option byte in Cube programmer...?

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @Pkhot.1​ and welcome to the STM32 Community =)

To disable DBANK and switch from DBANK=1 to DBANK=0 (from dual bank to single) it is recommended to execute the code from the SRAM or use the bootloader.

To avoid reading corrupted data from the Flash when the memory organization is changed, any access (either CPU or DMAs) to Flash memory should be avoided before reprogramming.

  • If any secure Flash protection is enabled (watemark or block-based), all must be disabled.
  • Disable the instruction cache if it is enabled
  • Clear the DBANK option bit and all WRP write protection (follow user option modification and option bytes loader procedure).
    • Once OBL is done with DBANK=0, perform a mass erase.
    • Start a new programing of code in 128 bits mode with DBANK=0 memory mapping.
    • Set the new secure protection if needed.

This is applicable when TZEN is disabled or enabled, with a small difference when TZEN = 1 being that the DBANK can only be modified when all secure protections are disabled : secure watermark (SEC WM) or block-based area (SECBB) .

For more details, you can refer to the RM0438 :

  • De-activating dual-bank mode (switching from DBANK=1 to DBANK=0) (page 194)
  • Rules for modifying specific option bytes (page 195)

Please mark my answer as best by clicking on the "Select as Best" button, if it answered your question 😊 This will help other users find this solution more quickly.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

1 REPLY 1
Imen.D
ST Employee

Hello @Pkhot.1​ and welcome to the STM32 Community =)

To disable DBANK and switch from DBANK=1 to DBANK=0 (from dual bank to single) it is recommended to execute the code from the SRAM or use the bootloader.

To avoid reading corrupted data from the Flash when the memory organization is changed, any access (either CPU or DMAs) to Flash memory should be avoided before reprogramming.

  • If any secure Flash protection is enabled (watemark or block-based), all must be disabled.
  • Disable the instruction cache if it is enabled
  • Clear the DBANK option bit and all WRP write protection (follow user option modification and option bytes loader procedure).
    • Once OBL is done with DBANK=0, perform a mass erase.
    • Start a new programing of code in 128 bits mode with DBANK=0 memory mapping.
    • Set the new secure protection if needed.

This is applicable when TZEN is disabled or enabled, with a small difference when TZEN = 1 being that the DBANK can only be modified when all secure protections are disabled : secure watermark (SEC WM) or block-based area (SECBB) .

For more details, you can refer to the RM0438 :

  • De-activating dual-bank mode (switching from DBANK=1 to DBANK=0) (page 194)
  • Rules for modifying specific option bytes (page 195)

Please mark my answer as best by clicking on the "Select as Best" button, if it answered your question 😊 This will help other users find this solution more quickly.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen