WSL2 steps continued (as I cannot edit the initial post anymore):
Debugger from cmd-line
Used the following excellent post here to get myself setup to debug:
From command line, I can get it to work with two commands (in two shells):
openocd \
-f interface/cmsis-dap.cfg \
-f target/rp2040.cfg \
-c "adapter speed 5000"
gdb-multiarch bus_pirate5_rev10.elf \
--ex "target remote localhost:3333" \
--ex "monitor reset init" \
--ex "continue" \
--ex "set timeout unlimited"
I’m getting closer. I can get VSCode to build, upload, and appear to be debugging by adding the following contents as file ./.vscode/launch.json
:
click to expand
{
"version": "0.2.0",
"configurations": [
{
"name": "BP5_Rev10",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceRoot}/build/bus_pirate5_rev10.elf",
"MIMode": "gdb",
"miDebuggerPath": "gdb-multiarch",
"miDebuggerServerAddress": "localhost:3333",
"useExtendedRemote": true,
"postRemoteConnectCommands": [
//{"text": "target remote localhost:3333"},
{"text": "monitor reset init"},
{"text": "load"}
]
}
]
}
Only one change made above: set "useExtendedRemote"
to true
instead of false
. I have gotten some breakpoints to work. Crossing fingers that this stays working…