raspberrypi / openocd

Other
149 stars 89 forks source link

OpenOCD + Picoprobe flashes extremely slowly #91

Open maxgerhardt opened 11 months ago

maxgerhardt commented 11 months ago

Testing a 1.5MByte file

dd if=/dev/zero of=test.bin bs=1500000 count=1

and using the Picoprobe setup (two Picos, one flashed with https://github.com/raspberrypi/picoprobe, latest 1.0.3 firmware), gives extremely slow speeds of 3 minutes, 18 seconds.

$ time openocd -d2  -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 10000" -c "program {test.bin} 0x10000000  verify; reset init; resume; shutdown;"
Open On-Chip Debugger 0.12.0-g4d87f6dca (2023-09-11-23:12)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : Hardware thread awareness created
Info : Hardware thread awareness created
adapter speed: 10000 kHz

Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E66038B713193E30
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 10000 kHz
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x00000001
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x10000001
Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core0] target has 4 breakpoints, 2 watchpoints
Info : [rp2040.core1] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core1] target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections
[rp2040.core0] halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
[rp2040.core1] halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
** Programming Started **
Info : Found flash device 'win w25q16jv' (ID 0x001540ef)
Info : RP2040 B0 Flash Probe: 2097152 bytes @0x10000000, in 32 sectors

Info : Padding image section 0 at 0x1016e360 with 160 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x1016e400 .. 0x1016ffff
** Programming Finished **
** Verify Started **
** Verified OK **
[rp2040.core0] halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
[rp2040.core1] halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
shutdown command invoked

real    3m18,361s
user    0m0,996s
sys 0m2,425s

I remember this being a lot faster.

Notice that this is not https://github.com/raspberrypi/picoprobe/issues/49 because the speed is already at 10MHz.

OS is Linux Mint 21.2, x64.

lurch commented 11 months ago

I've seen "adapter speed 5000" recommended elsewhere - what does that do to your timings?