[SOLVED] How to debug code in external RAM?

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

  • [SOLVED] How to debug code in external RAM?

    Hello.

    I have an interesting problem to solve.

    We have a product where we need so much RAM and Flash that there's simply no MCU that covers our needs, so we picked an STM32F750 and added an external QSPI-Flash (128 MB) and external SDRAM (16 MB). The plan is to use the internal flash (64 kB) for a simple boot loader that initializes QSPI and SDRAM and then copies the program from a segment of the Flash to SDRAM and jumps to the start address. No rocket science, I've already done a proof of concept that shows that it's possible. However, it's hopeless to debug without being able to step and set break points in the software.

    So I'm wondering, how to set up Seggers tools (preferably Ozone) to initialize the external SDRAM, write the program to the SDRAM and execute it with full debugging access?

    Regards

    /Martin
  • eTLA wrote:

    ..... initializes QSPI and SDRAM ....


    So I'm wondering, how to set up Seggers tools (preferably Ozone) to initialize the external SDRAM, write the program to the SDRAM and execute it with full debugging access?
    ....
    In principle (dunno you specific chip/mcu) it's just that - pre-init your SDRAM. Way I did it to debug boot is to essentially copy the SDRAM (and what else needed) registers setup as you have your bootloader to JLink init script sequence /steps before writing/ flashing the firmware.
    After that you debug as before.
  • Depends on your setup...
    You could also configure your Ozone project to do the following:
    1) Download the BTL + app to internal flash + QSPI
    2) Issue a reset to the device which halts before executing the code in internal flash
    3) Set a BP onto the jump from internal flash to SDRAM
    4) Let the CPU run to that point

    1-4 can be automatized with Ozone projects so that your debug session would "start in SDRAM".
    This way there is no need to move the SDRAM init into your Ozone project etc.
    Alternatively, you could execute directly from QSPI flash without copying over to SDRAM at all.
    Since the Cortex-M7 core incorporates L1 cache, execute-in-place from QSPI should still give you a good performance.
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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.