Skip to main content
Visitor II
November 1, 2023
Question

Not able to debug code executing from QSPI memory in stm32cubeide

  • November 1, 2023
  • 2 replies
  • 2537 views

Hello, I wrote two separate codes for this, 1st one is bootloader and 2nd is my application code. Bootloader will jump to the application code which is placed in QSPI memory. Code is executing and running fine, But the issue is I am not able to debug my application code. It is something that my debugger is not able to halt code in the main of my application code. it is showing following error....issue.png

Can someone please tell me, how to give access of QSPI memory to set breakpoint or to halt code in main of application code. I am using STM32L476 disc board and STM32cubeIDE.

    This topic has been closed for replies.

    2 replies

    Graduate II
    November 1, 2023

    Not my tool of choice..

    Can't you create a Debug Script to walk the MCU through clocks, pins, peripheral and memory-mapping?

    Get QSPI up in SystemInit()

    Perhaps you can make a small wedge-loader in Internal Flash such there is enough code to bring up the QSPI, and for the debugger to place an initial breakpoint. Is the address suggestive of main() ??

    STM32CubeIDE should be able to do this...

    Graduate II
    November 1, 2023

    @Nawres GHARBI @Aziz BRIGUI 

    Some way of using the External Loader Init() function to get a memory mapped context up on a system?

    Technical Moderator
    November 2, 2023

    @Aziz BRIGUI @Semer CHERNI  could you help ?

    ST Employee
    November 2, 2023

    Hello @Rohit1 

    First let me thank you for posting.

    Could you share the debug configuration. And if possible could you share a simplistic version of you project which show the issue for analysis.

    BR,

    Semer.

    Rohit1Author
    Visitor II
    November 3, 2023

    Hello @Semer CHERNI 

    I refer this video for my project, in which I created 2 separate projects.

    1. Custom_bootloader in which I initialize and set the QSPI in memory mapped mode and then jump to the User_Application.Bootloader_code_1.png

    2.User_Application in which I am toggling LED. 

    Application_2.png

    and made changes in linker file and set vector table to QSPI Memory address

    Flsh.ld_app.pngststem_vtor.png

    When I tried to debug, it is jumping to the Reset_Handler of the User_Application code and after that it should halt in the main() of application, but it is not halting in main(), Application code is running i.e., LED is toggling but code is not halting.

    Bootloader_code_2.png

    App_reset_handler.png

    Application_2.png

    And I tried to debut it using OpenOCD, I got following warning and errors after jumping to the user application

    openocd.png

    and I got "Error:Cortex-M Flash Patch Breakpoint rev.1 cannot handle HW breakpoint above address 0x1FFFFFFE"

    Debug configurations:debug_configuration.png

    debug_conf2.png

    I flash user application in qspi memory using external loader.

    Thanx in advance

    Visitor II
    January 22, 2024

    Did you solve your problem ?

    I have exactly the same issue. 

    I can debug the apllication from QSPI normally using STM32CubeIDE 1.12.1, but not using any more recent version after that. But if you copy the GDB Server from 1.12.1 overwriting the one from 1.13.x or 1.14.x, breakpoints works again in NOR.

    I suspect GDB Server in recent versions defaults to "soft brekpoints" in QSPI region, instead of "hardware breakpoints", and obviously fails to insert them.

    Cfr. see https://www.openstm32.org/forumthread8403

    I'm still on 1.12.1 for this issue!