VisualGDB cannot load STM32

Sysprogs forums Forums VisualGDB VisualGDB cannot load STM32

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  support 4 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31944

    FrankNatoli
    Participant

    Developing code for and debugging two STM32 systems, one a “Discovery” board, another a 7B3I display board.
    Originally developed code using IAR, no problem with either STM32 system, flashing and debugging using ST via USB.
    Ported to Visual Studio Pro 2022, with VisualGDB.
    Can compile code for both projects with VisualGDB using IAR compiler.
    Can download “Discovery” flash and debug.
    Cannot download 7B3I flash, GDB session pane merely says “Load failed” in red, no other explanation.
    7B3I is running, but running old code, not code I am attempting to flash.
    Curiously, can set and hit breakpoints, but what’s happening with the debugger has nothing to do with what’s happening with the 7B3I target.
    How can I manually flash the 7B3I and identify what’s going wrong with the flash process?

    #31949

    support
    Keymaster

    No problem Please try locating the View->Debug->VisualGDB Output->OpenOCD window. It will contain the output from OpenOCD – the open-source tool that handles the actual FLASH programming. It should normally explain what is going on.

    Most FLASH programming issues with OpenOCD can be resolved by:

    • Trying to use the ST fork of OpenOCD instead of the mainline (selectable via VisualGDB Project Properties) and/or the OpenOCD script generated by STM32CubeIDE for this specific device, rather than the one from the OpenOCD repository.
    • Padding/aligning small FLASH sections.
    • Switching to Segger J-Link with the J-Link software that is generally more reliable than open-source GDB.

    You can also try reproducing the issue outside VisualGDB as follows:

    1. Take a note of the OpenOCD command line from the VisualGDB Output window
    2. Run it manually with the same command line
    3. Start GDB manually (arm-none-eabi-gdb.exe <your ELF file>) and run the following commands:
      1. target remote :<OpenOCD GDB port>
      2. load

    You should get the same error message as shown by VisualGDB. If you would like to troubleshoot it, you would need to step through the debug build of OpenOCD and possibly patch the STM32F7 FLASH driver. See this tutorial for a detailed example of building OpenOCD from sources.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.