Unable to Debug HelloWorld with vsCode

I’m trying to debug the HelloWorld project using vsCode. The build seems to complete successfully, but whenever I click the debug icon (on the bottom bar), I get the following error:

[main] Problem getting debug configuration from cache. Error: Unable to find GDB in default search path and gdb.

Any ideas?

Here is the full output:

[build] Starting build
[driver] Start build Onethinx_HelloWorld.elf
[driver] Runnnig pre-configure checks and steps
[proc] Executing command: “C:/Program Files/CMake/bin/cmake.exe” --build “c:/Users/Paul Gyurkikiss/Documents/VSCode/Onethinx_HelloWorld/build” --config DEBUG --target Onethinx_HelloWorld.elf – -j 6
[build] [100%] Built target Onethinx_HelloWorld.elf
[driver] Run _refreshExpansions
[cms-driver] Run doRefreshExpansions
[driver] Run _refreshExpansions cb
[build] Build finished with exit code 0
[cache] Reading CMake cache file c:/Users/Paul Gyurkikiss/Documents/VSCode/Onethinx_HelloWorld/build/CMakeCache.txt
[cache] Parsing CMake cache string
[proc] Executing command: “C:/Program Files (x86)/GNU Tools Arm Embedded/9 2019-q4-major/bin/arm-none-eabi-gdb.exe” --version
[cache] Reading CMake cache file c:/Users/Paul Gyurkikiss/Documents/VSCode/Onethinx_HelloWorld/build/CMakeCache.txt
[cache] Parsing CMake cache string
[proc] Executing command: gdb --version
[main] Problem getting debug configuration from cache. Error: Unable to find GDB in default search path and gdb.
[extension] [2124] cmake.debugTarget finished (returned null)

Can you try to debug using the extension? It’s the ‘bug’ icon at the left bar and then ‘Launch [config]’ at the top.

Schermafbeelding 2020-02-05 om 09.09.04

Rolf,
Using the extension, I don’t see any error message, but when I start the debugging, I get a traveling blue bar at the top (see screenshot) that goes on forever. Nothing else appears to happen.

Paul

Paul,

Can you send me the ‘Adapter output’ log? It’s at the output window, select ‘Adapter output’ at the right.

Thanks,
Rolf

Rolf,
I can’t find an “Adapter Output” option. Here are my choices:


Paul

Did you install the Cortex Debug Extension?

I think so. Is this the correct one?

Yes, it’s the correct one.

For some reason GDB or OpenOCD is not starting. It should fail after about 20 seconds automatically, not sure why it hangs. Which operating system are you using?

You may want to check this topic…

Windoze 10 Pro 64-bit

Can you try to restart your machine?

If that doesn’t help, maybe the prelaunch task is failing. Can you comment (//) this line from your selected launch (CM4 Kitprog):
//"preLaunchTask": "Check build", // Set this to run a task from tasks.json before starting a debug session

Also, if you open Command Prompt and you type set, does it show the ONETHINX_ environment variables?

Restarting did not help.
Commenting out the pre-launch task didn’t help.
Here are the ONETHINX environment variables:

Does openocd start from the location set in launch.Json if you try it in the terminal window of VScode? And GDB?

launch.json has several paths. It’s not obvious to me which one you mean.

Paul

Rolf,
I tried manually navigating to the serverpath location, using a command window. From that location, I could invoke openocd, but not GDB.

Paul