Well @zpm1066 has per Using PlatformIO debugger with Raspberry Pi Pico & Picoprobe gotten debugging to work. Even if the development platform doesn’t support debugging out of the box, users can always declare their own debugging tools – in a nutshell, through platformio.ini directives like
debug_tool = custom
debug_server =
executable-that-starts-gdb-server
-arg1
value1
--other-flag
; where the GDB server port will be opened -- this is the default for OpenOCD
debug_port = localhost:3333
; optional: provide path to SVD file for decoded periphal registers
debug_svd_path = C:\...
So, theoretically, if you have a build (or build it yourself with some config) of the Raspberry Pi OpenOCD version, you can tell PlatformIO to invoke that for debugging and it should work. The openocd invocation should be in some style like
bin\openocd.exe -f interface/stlink.cfg -f target/rp2040.cfg
(not checked if that works as I don’t have the hard or software.)
The linked repo also has a rp2040_jlink branch – so maybe JLink support is also functional?
Note that the tool debug server must start a GDB server though, not some custom other thing. PlatformIO will use the GDB executable of the toolchain to connect to it (aka arm-none-eabi-gdb here).
Once my Pico arrives I’ll play around with debugging and will try to PR into @wizio’s repo. The stm32 platform (see platform.py, debug sections in the board definition files, and main.py for using defined debugging protocols for normal upload) contains good hints on how it can be implemented.