PINE64
Article: OpenOCD on Raspberry Pi: Better with SWD on SPI - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PineTime (https://forum.pine64.org/forumdisplay.php?fid=134)
+--- Forum: PineTime Tutorials (https://forum.pine64.org/forumdisplay.php?fid=138)
+--- Thread: Article: OpenOCD on Raspberry Pi: Better with SWD on SPI (/showthread.php?tid=8830)



Article: OpenOCD on Raspberry Pi: Better with SWD on SPI - lupyuen - 01-18-2020

Hi PineTime Fans: I have modified OpenOCD to run on Raspberry Pi using the faster SPI interface (31 MHz!) instead of the old GPIO Bit Banging.  If this works, we should be able to flash AND debug PineTime firmware with VSCode on Raspberry Pi!

But I need your help to test this modified version of OpenOCD.  (Test instructions are in the article below)  If it's tested OK, I'll publish the steps to debug PineTime firmware on VSCode.  Please lemme know if it works. Thanks! :-)


OpenOCD on Raspberry Pi: Better with SWD on SPI


RE: Article: OpenOCD on Raspberry Pi: Better with SWD on SPI - Surehand53 - 01-18-2020

Wow, that's a lot of information Big Grin . Thanks.

Do you think this might work with a Raspberry Pi Zero as well ?


Article: OpenOCD on Raspberry Pi: Better with SWD on SPI - lupyuen - 01-18-2020

No harm trying

Sent from my Pixel 4 XL using Tapatalk


RE: Article: OpenOCD on Raspberry Pi: Better with SWD on SPI - Surehand53 - 01-30-2020

Happy to confirm that it works just fine with the RPi Zero.


Article: OpenOCD on Raspberry Pi: Better with SWD on SPI - lupyuen - 01-30-2020

Awesome... Thanks so much!

Sent from my Pixel 4 XL using Tapatalk


RE: Article: OpenOCD on Raspberry Pi: Better with SWD on SPI - johns - 04-05-2020

(01-18-2020, 01:23 AM)lupyuen Wrote: Hi PineTime Fans: I have modified OpenOCD to run on Raspberry Pi using the faster SPI interface (31 MHz!) instead of the old GPIO Bit Banging.  If this works, we should be able to flash AND debug PineTime firmware with VSCode on Raspberry Pi!

But I need your help to test this modified version of OpenOCD.  (Test instructions are in the article below)  If it's tested OK, I'll publish the steps to debug PineTime firmware on VSCode.  Please lemme know if it works. Thanks! :-)


OpenOCD on Raspberry Pi: Better with SWD on SPI

I'm trying to follow this and so far not having any luck. But this is also my first time doing this sort of thing (SPI, SWD) at all, so I'm probably doing something very obviously wrong.

I successfully built OpenOCD following your instructions. When I connect the pins (using the cable that came with the PineTime) and run flash-unprotect on the Pi, I get:

+ openocd/bin/openocd -f scripts/nrf52-pi/swd-pi.ocd -f scripts/nrf52-pi/flash-unprotect.ocd
Open On-Chip Debugger 0.10.0+dev-01130-g9d1b46f5 (2020-04-02-21:55)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
force hard breakpoints
Info : BCM2835 SPI SWD driver
Info : SWD only mode enabled
Info : clock speed 31200 kHz


and it just returns instantly after that; no error.

Sometimes there is one more line:

Info : SWD DPIDR 0x0193b434

but not often.

Any ideas? Are there logs I can enable / look at?

Thanks so much for doing the work on this!

-john