Hi,
I need some help with debugging an RP2040 via Picoprobe from within PlatformIO.
Up until now I have been using the USB Port of the Pi Pico to upload my programm. This was my configuration in PlatformIO that has been working well.
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico
framework = arduino
lib_extra_dirs = /Users/Succubus/Documents/Arduino/libraries
build_flags =
-DTARGET_RP2040
-O2
upload_protocol = picotool
upload_port = D:
Since the program has become lager I wanted to have the possibilty to debug my code and hence ordered a Picoprobe.
I have changed the configration to
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico
framework = arduino
lib_extra_dirs = /Users/Succubus/Documents/Arduino/libraries
build_flags =
-DTARGET_RP2040
-O2
upload_protocol = cmsis-dap
upload_port = cmsis-dap
debug_tool = cmsis-dap
and this seems to work. The code is uploaded the the PI but very slowly. The normal upload via USB takes about 10 seconds. The SWD methode over 70. I got a lot of messages that looks like this during the upload
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
but ultimately
Programming Finished
Verify Started
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
Verified OK
Resetting Target
shutdown command invoked
so besides being slow this works. Now the real problem is debuggin. I set a breakpoint at the start of my main programm. And start debuggin with ctrl+shift+D.
after about 2 minutes I get a lot of output from the terminal windows again
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (31168 ms). Workaround: increase "set remotetimeout" in GDB
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ea msp: 0x20041f00
and the code stops at a temporary breakpoint somewhere deep in the workings of PlatformIO. Fine let it continue, but now my set breakpoint is never reched. I also got an error message in a pop up that says:
Unable to parse SVD file: TypeError: Cannot read properties of undefined (reading '0')
and
A syntax error in expression, near `'. (from data-evaluate-expression struct)
So basically I have 2 problems the slow speed and the fact that I can not debug at All. I am using Windows 10 with the latest Visual Studio Code release. Everything seems to be up to date. Any idea how to solve this?
.
BR Christopher