Skip to content

Can't use GDB in VS Code #380

Closed
Closed
@SlazyHW

Description

@SlazyHW

Hello everyone! I followed the guide (on https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf) to start debugging my Pico with VS Code. Everytime I start trying to debug the code with the green debug button in the upper left corner, I get following error in the Output Window:

Reading symbols from objdump-multiarch --syms -C -h -w /home/jan/pico/pico-examples/build/hello_world/usb/hello_usb.elf
Reading symbols from nm-multiarch --defined-only -S -l -C -p /home/jan/pico/pico-examples/build/hello_world/usb/hello_usb.elf
Launching GDB: gdb-multiarch -q --interpreter=mi2
IMPORTANT: Set "showDevDebugOutput": "raw" in "launch.json" to see verbose GDB transactions here. Very helpful to debug issues or report problems
Launching gdb-server: openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /home/jan/pico/pico-examples -f /home/jan/.vscode/extensions/marus25.cortex-debug-1.10.0/support/openocd-helpers.tcl -f interface/cmsis-dap.cfg -f target/rp2040.cfg
Please check TERMINAL tab (gdb-server) for output from openocd
Finished reading symbols from objdump: Time: 25 ms
Finished reading symbols from nm: Time: 37 ms
OpenOCD: GDB Server Quit Unexpectedly. See gdb-server output in TERMINAL tab for more details.

I am using the Raspberry Pi Debug Probe, so I looked at this tutorial: https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html.
I changed the interface from raspberrypi-swd to cmsis-dap, set the right path to my pico sdk folder.

my launch.json looks like this:

"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceRoot}",
"executable": "./bin/executable.elf",
"name": "Debug with OpenOCD",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"configFiles": [],
"searchDir": [],
"runToEntryPoint": "main",
"showDevDebugOutput": "none"
},
{
"name": "Pico Debug",
"cwd": "${workspaceRoot}",
"executable": "${command:cmake.launchTargetPath}",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
// This may need to be "arm-none-eabi-gdb" for some previous builds
"gdbPath" : "gdb-multiarch",
"device": "RP2040",
"configFiles": [
"interface/cmsis-dap.cfg",
"target/rp2040.cfg"
],
"svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
"runToEntryPoint": "main",
// Work around for stopping at main on restart
"postRestartCommands": [
"break main",
"continue"
]
}
]
}

I also had to go with "gdbPath" : "gdb-multiarch" instead of "gdbPath" :"arm-none-eabi-gdb".

Because the terminal doesn't show any errors and the output window aswell, I am totally lost. It just says that the GDB server quits. Any suggestions?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions