debugprobe icon indicating copy to clipboard operation
debugprobe copied to clipboard

Probe speed stuck at very low frequency

Open snaiperskaya96 opened this issue 9 months ago • 5 comments
trafficstars

Hi, Those few past days i've been trying a combination of rp2040 and rp2350 as both host and guest (debugger & target). I've got myself a mix of 4+ different 2040s, in both the official dev board and some other custom formats, spanning different revision.

No matter what software im using (openocd, pyOCD, probe-rs), i'm stuck with a speed that ranges between 10khz and 30khz, with 10 being the one that consistently works and 30 being somewhat unreliable where it could fail at some point during the flashing process.

Unfortunately i dont have any other debugger available to confirm that it is in fact an issue with debugprobe, but i dont know what else to look for so i'm opening this issue in the hope that its something known and workaround-able.

I've also tried with older revisions, going back to 1.0 but no difference at all.

That being said i've only tried interfacing with debugprobe on Windows, not sure if this could be the issue.

This is when i run it at 10khz openocd -f interface/cmsis-dap.cfg -c "set USE_CORE 0" -f target/rp2040.cfg -c "adapter speed 10"

Open On-Chip Debugger 0.12.0 (2024-09-16) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 d52e355daa09f17ce64819122cb067b8a2ee0d4b
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
0
adapter speed: 10 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=CCA25CB821B83DBE
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer 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 10 kHz
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x00000001
Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core0] target has 4 breakpoints, 2 watchpoints
Info : [rp2040.core0] Examination succeed
Info : [rp2040.core0] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections

And this is when running at the classic 5000khz openocd -f interface/cmsis-dap.cfg -c "set USE_CORE 0" -f target/rp2040.cfg -c "adapter speed 5000"

Open On-Chip Debugger 0.12.0 (2024-09-16) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 d52e355daa09f17ce64819122cb067b8a2ee0d4b
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
0
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=CCA25CB821B83DBE
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer 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
Error: Failed to connect multidrop rp2040.dap0

snaiperskaya96 avatar Jan 22 '25 14:01 snaiperskaya96

How are you connecting the probe to the target (electrically)?

P33M avatar Jan 22 '25 16:01 P33M

How are you connecting the probe to the target (electrically)?

I felt dumb for a moment thinking i did not try to solder wires directly from the probe to the target, as i only connected them via jumpers beforehand. But, then i tried to solder them and unfortunately im running into the exact same issue.

snaiperskaya96 avatar Jan 22 '25 18:01 snaiperskaya96

Sketch your connections.

P33M avatar Jan 23 '25 15:01 P33M

Sorry for the delay. I'm following the documentation and double checking it with the pin definitions in board_pico_config.h.

Probe Target
GPIO 2 SWCLK
GPIO 3 SWDIO
VSYS VSYS
GND GND

Image

Image

snaiperskaya96 avatar Jan 25 '25 18:01 snaiperskaya96

5MHz definitely isn't going to work with that sort of setup. 30kHz is a bit low but not unsurprising. You have a large loop between SWD/SWCLK and the GND wire because the connections are separated. What's really dumb is that the RP2040-zero has a single ground pad and that has to be used as the return for both Pico W power and SWD line current.

Connect the centre GND pin on the SWD/SCLK header on the Pico W to the GND on the RP2040-zero. Twist the SWD/SWCLK wires together with the GND wire. It should go a bit faster.

P33M avatar Feb 05 '25 17:02 P33M