Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

visual studio code - OpenOCD GDB executable "arm-none-eabi-gdb" was not found. Please configure "cortex-debug.armToolchainPath" correctly

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
}
question from:https://stackoverflow.com/questions/65872178/openocd-gdb-executable-arm-none-eabi-gdb-was-not-found-please-configure-cort

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...