我正在使用Raspberry Pico,并试图在Raspberry Pi 4上使用来自VSCode的VS代码中的调试工具,但我得到了以下错误:
OpenOCD GDB executable "arm-none-eabi-gdb" was not found. Please configure "cortex-debug.armToolchainPath" correctly.
我为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"
]
}
]
}
下面是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
}
发布于 2021-02-17 19:45:55
文档中最近有一个修复。
如此链接所述:https://github.com/raspberrypi/pico-examples/issues/8
按照入门指南中的说明设置Raspberry Pi时,启动调试器时会出现两个问题:
忽略启动设置,使用arm-none-eabi-gdb时,在launch.json中设置gdbpath被标记为不允许,该选项不可用。似乎只能在settings.json中设置cortex DEBUG.gdbpath
所以去掉吧。
"gdbpath“:在launch.json中添加"gdb-multiarch”,并在settings.json中添加“cortex debug.gdbpath”:"gdb-multiarch“。
https://stackoverflow.com/questions/65872178
复制相似问题