Article: OpenOCD on Raspberry Pi: Better with SWD on SPI
#1
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
  Reply
#2
Wow, that's a lot of information Big Grin . Thanks.

Do you think this might work with a Raspberry Pi Zero as well ?
  Reply
#3
No harm trying

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

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


Possibly Related Threads...
Thread Author Replies Views Last Post
  Article: My First Week As Embedded FOSS Advocate lupyuen 3 335 03-26-2020, 07:10 PM
Last Post: aalevy
  Article: Visual Rust for PineTime Smart Watch lupyuen 1 214 03-09-2020, 05:47 PM
Last Post: tllim
  Article: CHIP-8 Game Emulator in Rust for PineTime Smart Watch lupyuen 0 122 03-04-2020, 08:13 PM
Last Post: lupyuen
  Article: Debug RIOT-OS on PineTime with VSCode lupyuen 0 127 02-02-2020, 01:43 AM
Last Post: lupyuen
  Article: Debug Rust+Mynewt Firmware for PineTime on Raspberry Pi lupyuen 4 250 01-24-2020, 05:20 AM
Last Post: lupyuen
  Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch lupyuen 8 532 01-18-2020, 01:01 AM
Last Post: clover
  Article: Optimising PineTime’s Display Driver with Rust and Mynewt lupyuen 0 197 12-28-2019, 05:46 PM
Last Post: lupyuen
  Article: Porting [druid] Rust Widgets to PineTime Smart Watch lupyuen 3 312 12-19-2019, 04:31 AM
Last Post: lupyuen
  Article: Building a Rust Driver for PineTime’s Touch Controller lupyuen 1 306 11-22-2019, 08:46 AM
Last Post: xalius
  Article: Sneak Peek of PineTime Smart Watch… And why it’s perfect for teaching IoT lupyuen 0 546 11-15-2019, 02:18 AM
Last Post: lupyuen

Forum Jump:


Users browsing this thread: 1 Guest(s)