PINE64

Full Version: Article: OpenOCD on Raspberry Pi: Better with SWD on SPI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
Wow, that's a lot of information Big Grin . Thanks.

Do you think this might work with a Raspberry Pi Zero as well ?
No harm trying [emoji3]

Sent from my Pixel 4 XL using Tapatalk
Happy to confirm that it works just fine with the RPi Zero.
Awesome... Thanks so much! [emoji3]

Sent from my Pixel 4 XL using Tapatalk
(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