[SOLVED] Setting DBANK to zero (single bank) in the option bytes of the STM32l4 series?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Setting DBANK to zero (single bank) in the option bytes of the STM32l4 series?

    For the STM32L4 Option Bytes on devices with DBANK (as apposed to nDBANK) in the User Configuration, the default is DBANK = 1: Dual-bank mode with 64 bits data

    However, I need to switch it to DBANK = 0: Single-bank mode with 128 bits data read width

    Which I understand is possible via the J-Link Pro, but is it a script? Has anyone been able to successfully change the DBANK, or have a better understanding of how to set the user config option bytes? From the ST side, the documentation seems really limited, which is surprising given that it is such an basic part of every microcontroller.
  • Hi,
    Thank you for your inquiry.

    How to change the bank mode can be found in the manual for your device (normally some register writes).
    You will have to execute the necessary steps yourself (e.g. via the J-Link Commander or J-Flash via init steps).
    Further information about the J-Link Commander can be found here:
    wiki.segger.com/J-Link_Commander
    For further information about J-Flash please refer to the J-Flash User Manual (UM08003).

    Does this answer your question?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.
  • Thank you, I began looking through the scripts and the wiki, but I noticed that on the wiki for the STM32L4 it says:


    Problem description

    The flash algorithm has to behave differently, depending on the active flash bank mode configuration as the flash controller expects different page indices for the same destination address.

    Solution
    When using the J-Link flash loader, make sure that the flash controller is configured for dual bank flash layout (DUALBANK == 1), which is the default.


    Question : In my case, I'm configuring for DBANK == 0, how do I verify that the the flash controller is configured correctly?

    Thanks!
  • Hi,
    You could read the register which contains the bit that indicates which bank mode is active.
    A tool to do this very easily is the J-Link Commander (JLink.exe), using the "mem32" command.
    Please refer to the article linked above for more information about the J-Link Commander and all available commands.

    Does this answer your questions?

    Best regards,
    Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.
  • Yes, that does work.

    One last question, changing it from dual bank to single bank for my device it changes the page size. This means the page size is now 8K rather than 4K, thus my IDE crashes when it attempts to program the device using my J-Link. How do I modify the J-Link to use 8K page sizes or modify the number of sectors?

    I see in the .jflash file for my device where i added the steps for modifying the option byes, but under:

    [FLASH]
    NumBanks = 1
    ...
    BaseAddr = 0x08000000


    I haven't been able to find documentation on all of the definitions (e.g. BankSelMode, NumBanks, aRangeSel, etc) for modifying these things.


    Thanks!
  • Hi,

    We will close this ticket, since you also contacted us via the support ticket system and we want to keep discussions to a single channel of communication.
    Otherwise this leads to a higher work load on our side and therefore to longer wait times on the customers side.

    Please keep requests and discussions to a single channel of communication in the future, for the same reasons.

    Best regards,Fabian
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/


    Or you can contact us via e-mail.