Skip to content

Instantly share code, notes, and snippets.

@meinside
Last active November 8, 2023 19:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meinside/24fa113a0f20bf221a7485748fa7ab09 to your computer and use it in GitHub Desktop.
Save meinside/24fa113a0f20bf221a7485748fa7ab09 to your computer and use it in GitHub Desktop.
VSCode files for debugging a Raspberry Pi Pico application with Picoprobe (Debug Probe)
  • Files:

    • launch.json: .vscode/launch.json file in your project directory.
    • settings.json: .vscode/settings.json file in your project directory.
  • Environment Variables:

export PICO_SDK_PATH="<path-to-your-pico-sdk-directory>"
export OPENOCD_PATH="<path-to-your-openocd-directory>"
  • Other Variables:
    • cortex-debug.openocdPath value in .vscode/settings.json file: the path to the openocd binary file.
{
"version": "0.2.0",
"configurations": [
{
"name": "Pico Debug",
"device": "RP2040",
"gdbPath": "arm-none-eabi-gdb",
"cwd": "${workspaceRoot}",
"executable": "${command:cmake.launchTargetPath}",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"configFiles": [
"/interface/cmsis-dap.cfg",
"/target/rp2040.cfg"
],
"searchDir": [
"${workspaceRoot}",
"${env:OPENOCD_PATH}/tcl"
],
"openOCDPreConfigLaunchCommands": ["adapter speed 5000"],
"svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
"runToEntryPoint": "main",
"postRestartCommands": [
"break main",
"continue"
]
}
]
}
{
"cmake.statusbar.advanced": {
"debug": {
"visibility": "hidden"
},
"launch": {
"visibility": "hidden"
},
"build": {
"visibility": "default"
},
"buildTarget": {
"visibility": "hidden"
}
},
"cmake.buildBeforeRun": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cortex-debug.openocdPath": "<path-to-the-openocd-binary-file>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment