CLion Run Configuration for a new Pi Pico Debugger
Hello,
I'm using a new debugger, intended for Pi Pico. It is called pico_debug and is available here: https://github.com/essele/pico_debug
According to its documentation, if I were using Visual Code, then the run configuration would need to look like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Pico Debug",
"cwd": "${workspaceRoot}",
"executable": "${command:cmake.launchTargetPath}",
"request": "launch",
"type": "cortex-debug",
"servertype": "external",
"gdbPath" : "gdb-multiarch",
"gdbTarget" : "/dev/ttyACM2",
"device": "RP2040",
"svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
// runToEntryPoint causes differences in behavour between launch and reset
// so best avoided for this use case.
//"runToEntryPoint": "main",
// breakAfterReset means it consistantly stops in the reset handler code
// so we can follow that with some commands to get us to main
"breakAfterReset": true,
// get_to_main puts a breakpoint at main, gets there, and then remove is
// immediately after flashing. This means that by the time any ram based
// breakpoints are applied the relevant stuff is in RAM.
"postLaunchCommands": [
"break main", "continue", "clear main",
],
// With breakAfterReset we have a consistent approach so can use the same
// commands to get us to main after a restart...
"postRestartCommands": [
"break main",
"continue",
"clear main"
]
}
]
}
Notice that the GDB target is a USB device, called /dev/ttyACM2 in that example, although on windows it will be a USB device present in the Windows Control Panel, and that the servertype is set to "external".
What Run Configuration can I use in CLion, that will approximate that Visual Code configuration?
A screenshot showing what it should look like would be really helpful if possible.
I think this will help a lot of people, because it allows for very fast development on the Pi Pico, compared to the older PicoProbe.
Many thanks.
Please sign in to leave a comment.