Failed to launch OpenOCD GDB Server: Error: spawn
See original GitHub issueI have search through the issues and I am still unable to get OpenOCD to work with VS Code and cortex-debug. My issue is identical to: https://github.com/Marus/cortex-debug/issues/281#issue-607868097
Unfortunately, updating my system path to include OpenOCD did not correct my problem. I have tried several versions of OpenOCD and I get the same issue. As a hail mary, I attempted to run the debugger in safe mode. This provided interesting error output.
The error output running normal windows is as follows:
Both applications, openocd.exe and arm-none-eabi-gdb.exe can be launched from the command window without issue. The utilities are accessible in the designated files.
The following versions of Windows, VS Code, and Cortex-Debug are being used.
Here is my launch.json settings:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"cwd": "D:/target",
"executable": "${workspaceFolder}/target/thumbv7em-none-eabi/debug/target.elf",
"request": "launch",
"type": "cortex-debug",
//"servertype": "external",
//"gdbTarget": "localhost:50000",
"servertype": "openocd",
"searchDir": [
"D:/boards/target/jtag"
],
"configFiles": [
"config.cfg",
"chip.cfg",
"board.cfg"
],
"runToMain": false,
"preRestartCommands": [
"monitor reset",
"file D:/target/thumbv7em-none-eabi/debug/target.elf",
"load",
"target extended-remote :50000",
"monitor reset halt"
]
}
]
}
Note, I tried setting the severtype to external and I get the same ENOENT error for the armToolchainPath.
Here is my settings.json:
{
"editor.formatOnSave": true,
"cortex-debug.openocdPath": "C:/Users/<user>/AppData/Roaming/xPacks/xpack-openocd-0.11.0-1/bin/openocd.exe",
//"cortex-debug.openocdPath": "C:/Temp/xpack-openocd-0.11.0-1/bin/openocd.exe",
//"cortex-debug.openocdPath": "openocd.exe",
"cortex-debug.armToolchainPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2020-q4-major/bin",
}
What else can I try to get the cortex debugger to work?
Thank you in advance for any feedback.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Update: Long story short, I built a new system and loaded a fresh copy of Windows 7. At first, I had the same issue. After playing around a bit, I finally got the extension working. Will provide further details in the future. Closing this issue now.
I doubt NodeJS is wrong. I am using 14.6.0 and I am getting the same problem if I change package.json to upgrade to latest webpack. It still compiles though.
After cloning the report, just run ‘npm install’, do not install/upgrade any modules. There are too many dependencies and if you change one thing, it leads to another. I will clean it up when I have some time.