I am using the Raspberry Pico and attempting to use the debugging tool in VS Code from VSCode on a Raspberry Pi 4, but I am getting the following error:
OpenOCD GDB executable "arm-none-eabi-gdb" was not found. Please configure "cortex-debug.armToolchainPath" correctly.
I have the following config for launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "TempSensor",
"cwd": "${workspaceRoot}",
"executable": "/home/pi/pico/devices/build/tempSensor/tempSensor.elf",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
// This may need to be arm-none-eabi-gdb depending on your system
"gdbpath": "gdb-multiarch",
"device": "RP2040",
"configFiles": [
"interface/raspberrypi-swd.cfg",
"target/rp2040.cfg"
],
"svdFile": "/home/pi/pico/pico-sdk/src/rp2040/hardware_regs/rp2040.svd",
"runToMain": true,
// Work around for stopping at main on restart
"postRestartCommands": [
"break main",
"continue"
]
}
]
}
And the following code for settings.json
{
// These settings tweaks to the cmake plugin will ensure
// that you debug using cortex-debug instead of trying to launch
// a Pico binary on the host
"cmake.statusbar.advanced": {
"debug": {
"visibility": "hidden"
},
"launch": {
"visibility": "hidden"
}
},
"cmake.buildBeforeRun": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": false
}
There has been a fix recently in the documentation.
As explained in this link: https://github.com/raspberrypi/pico-examples/issues/8
When setting a Raspberry Pi up as described in the Getting Started guide, two problems arise when launching the debugger:
Setting "gdbpath" in launch.json is marked as not allowed When launching the setting is ignored, and arm-none-eabi-gdb is used, which is unavailable It seems that setting "cortex-debug.gdbpath" can only be set in settings.json
So remove.
"gdbpath" : "gdb-multiarch" from launch.json and add "cortex-debug.gdbPath": "gdb-multiarch" to settings.json.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With