Unable to debug/singlestep code located in SDRAM, using "System Workbench for STM32"
Hello
I am unable to debug code located in SDRAM using “System Workbench” / ST-LINK debugger
Setup:
It’s a large application running on STM32H743I-eval, where most of our code is located in QSPI FLASH and then copied into SDRAM during boot
Project memory map:
MEMORY
{
/* Internal memory */
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
/* Two sectores of 128KB reserved for bootloader and 512 bytes for header information */
FLASH (rx) : ORIGIN = 0x08040200, LENGTH = 0x1BFE00
/* External memory */
SDRAM (xrw) : ORIGIN = 0x70000000, LENGTH = 32M
QSPI_FLASH (rx) : ORIGIN = 0x90000000, LENGTH = 16M
}
Our start-up file “startup_agc150.S” are located in “FLASH” and the main function and most other modules are located in QSPI / SDRAM.
Stepping through the start-up file “startup_agc150.S” works without problems
Stepping “into” function located in FLASH from main results in a normal “step into” debug step
Stepping “into” function located in SDRAM from main results in a “step over” debug step
It’s sometimes possible to set a breakpoint in the SDRAM function, but after a few steps the ST-LINK debugger “freezes” i.e. the program counter is no longer incremented, when single stepping and it’s not possible to resume execution with F8.
In our system we have a bootloader, located at address 0x08000000. I have tried changing the linker file to run without bootloader, but this does not change anything.
I hope someone has some suggestions for this issue. Thanks !