Debugging the pico

Hello, I have been trying to get some programs to work on the pico, but its really difficult without realtime debugging, naturally I bought a second pico and I am trying to setup Picoprobe, Unfortunetaly though when I run openocd I get a DAP init failed error, I am using the pimoroni debug cable (male) with the leads hooked up to a breadboard to the GPIO pins they need to be attached to on the debug pico, though this does not work, I believe (based on google searches) this is due to a bad connection on the swd pins, but I do not want to get the perf board out and permanently solder the pins as I know that people have gotten this to work in the past, Any advice?

Can you post the exact error, and an image of how you’ve got it wired up?

I’ve had issues with things like this in the past too, it’s not as straightforward as I’d hoped it would be. It looks like in some cases long or poorly connecting wires can cause the whole thing to fall over.

Here is the command and error:

sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -s tcl
[sudo] password for jakubszamuk:
Open On-Chip Debugger 0.11.0-g8e3c38f (2023-12-06-16:55)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
adapter speed: 5000 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6613008E35BA52D
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 5000 kHz
Info : DAP init failed

And the wiring:

That is obviously not attached to power, But I connect the top pico to power with a usb cable and the seven segment lights up indicating the second pico having power, I wired it up according to the official diagram for pico probe and the bottom pico has my uf2 and the top one has pico probe uf2

It’s hard to see, but does the pico on the left have a connection to ground? It needs to share a ground with the one you’re debugging.

EDIT: Actually yes it does, but maybe check the wires which cross the bread board to make sure they’re making good contact with the board. If possible I’d also maybe try to shorten the distance between the picos (could you have the display on the far right with the pico getting programmed in the middle?).

Yes it does, Sorry for that, but it has a shared ground as the power rails are attached near the middle

ok, let me try that rearrangement, Though the wire length will stay the same as the debug cable will not get shorter, the only difference will be the ground, I am trying it now…

Yeah that’s fair, but it’s worth a try maybe. That does look like a very long debug cable!

Yes, Its this one:

Ok, Just rewired it and I have the same problem

A couple of other suggestions:

  • Possibly try reducing the adapter speed to 2000?
  • If the display is on the breadboard try taking it and all of its wiring out, just in case that’s shorting something.
  • Possibly move the ground of the debug cabe closer to the pico debugger board, rather than having it next to the board being debugged.

I’m honestly not sure what the issue could be. I’ve just hooked up a similar system and it seems to be working OK, so there must be something to do with your setup which isn’t quite right.

Ok I just tried all of those things and it still does not work, Thank you though

could you show a photo of your setup please? I must have missed something, This article worries me:

That setup works fine.