Using an Raspberry Pico as picoprobe debugger for another RP2040 based board

Hi at all,
Now I’m working whit a board based on RP2040 so for debug it I would like to set another RP2040 as debugger.

I’m working from Windows 10 fully updated and I tried OpenOCD native installation and also using it whit PlatformIO on VSCode but nothing works!

My Environment:

  • Pico Probe software: I downloaded the latest debugprobe.uf2 realise from debugprobe and flashed into the Raspberry Pico
  • I wired the two boards as seen in the Raspberry Pico starting guide Apendix A
  • I setted up OpenOCD following the same Apendix A of above
  • and I also tried this .ino configuration on PlatformIO:
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0m
debug_tool = cmsis-dap
upload_protocol = cmsis-dap
debug_speed = 30000
build_type = debug

SO, nothing works and those are the results:

If anyone can help me is wonderful… I’m becoming crazy!!

Alan

The last screenshot looks kind of good, it at least finds the debug adapter, but it was unable to connect to the target RP2040 chip. This is likely because

you did this this step wrong, the debugprobe.uf2 is for the “Debug Probe” hardware and changes the SWDIO/SWCLK pinout. (GP2/3 for SWCLK/SWDIO in picoprobe.uf2, GP12/14 for debugprobe.uf2)

You need to flash the picoprobe.uf2 on your regular Pi Pico.

Make sure to follow the right pinout then as documented, if not already the case.

Hi,
I didn’t think it was relevant but yesterday I tried also that firmware, now I’ve retried and nothing is different!

So now I check another time the wiring and I made another test, so I uploaded a blink program on the DUT whit classical method, then I connected it to the debugger and noting seems working, so I measure Vin voltage and the surprise: my second board is not the official one and VSYS pin has not the VSYS volt because is called Vin (later I’ll check what is exactly) so it didn’t power on the target RP2040!!

Changed VSYS whit VBUS and all it’s working!

THANKS A LOT!!
Alan

1 Like

Would you please send me the exact circumstances how it works. I have a same hardware 2 rp2040 that works under VScode Using an Raspberry Pico as picoprobe debugger for another RP2040. Same hrdware as in the picture
I Works fine under SDK ver 2.0.0 with Pico Debug(Cortex debug), but not under platformio PIO debug

undefinedC:\Users\Peter.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.

Reading symbols from e:\Raspberry-pi\Raspberry pico\software\C++\temperature\onboard_temperature\onboard_temperature_platformio.pio\build\pico\firmware.elf…

PlatformIO Unified Debugger → Redirecting...

PlatformIO: debug_tool = cmsis-dap

PlatformIO: Initializing remote target…

Open On-Chip Debugger 0.12.0+dev-gebec9504d (2024-09-07-00:55)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

2

Info : Hardware thread awareness created

adapter speed: 1000 kHz

Info : tcl server disabled

Info : telnet server disabled

Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6616408438B6D2A

Error: CMSIS-DAP command CMD_INFO failed.

.pioinit:13: Error in sourced command file:

Remote communication error. Target disconnected.: Success.

This should already work with the wiring provided above plus the latest firmware from https://github.com/raspberrypi/debugprobe/releases, e.g., debugprobe_on_pico.uf2. If you have problems, post your platformio.ini, wireup, and output of pio debug --interface=gdb -- -x .pioinit from the CLI.

I did it, I got the:

Resolving pico dependencies…

MissingPackageManifestError: Could not find one of ‘package.json’ manifest files in the package

So what should I do?

That should be absolutely impossible if you use the exact platformio.ini from above and followed the docs.

If in doubt, delete C:\Users\<user>\platformio and reopen VSCode to get a clean start.

Did you try to remove the .pio folder and relounch VSCode?

Alan

Translated in platformio environment


Translated in raspberry pico project

downloaded debugger software:
debugprobe_on_pico (1).uf2

Screenshot of https://zadig.akeo.ie/ with the CMSIS-DAP device selected shows what? (The interface which should have WinUSB or libusb drivers loaded, not the serial port interface)

Yes, I did with no luck.

I attach the requested screenshot as well

Try this:

Stop ongoing debugging session and close all VSCode windows.

Open a new terminal (Windows + R → cmd.exe)

Then execute

cd C:\Users\%USERNAME%\.platformio\packages\tool-openocd-rp2040-earlephilhower

And

bin\openocd.exe -f interface/cmsis-dap.cfg -f target/rp2040.cfg

What is the output? Does it connect?

If not, change the driver for CMSIS-DAP interface 0 in Zadig to the opposite setting (WinUSB ↔ libUSB) and retry.

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0m
debug_tool = cmsis-dap
upload_protocol = cmsis-dap
debug_speed = 30000             **This is the problem. Max speed is 10000**
build_type = debug

Solved

Here is the link to my files:

how can I change Debug mode to Normal mode without change the USB plug from debugger to debugged board?