Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch
#1
Hi All: Here's my new article that explains how you may download my prebuilt Rust+Mynewt OS image and flash it to PineTime using a Raspberry Pi...

Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch
  Reply
#2
(01-07-2020, 06:00 PM)lupyuen Wrote: Hi All: Here's my new article that explains how you may download my prebuilt Rust+Mynewt OS image and flash it to PineTime using a Raspberry Pi...

Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch

Superb, I'll get it flashed for FOSDEM as one of the Demos Smile

[edit] I assume that a ROCK64 running Debian will do the same job as the RPI -- if so, then I could run this live at FOSDEM stall Smile
You can find me on IRC, Discord and Twitter


  Reply
#3
(01-08-2020, 06:41 AM)Luke Wrote: Superb, I'll get it flashed for FOSDEM as one of the Demos Smile

[edit] I assume that a ROCK64 running Debian will do the same job as the RPI -- if so, then I could run this live at FOSDEM stall Smile

Erm Luke some bad news for ROCK64 ;-) If you check my config for OpenOCD...

https://github.com/lupyuen/pinetime-rust...swd-pi.ocd

...you can see that it's using the Broadcom GPIO driver (bcm2835gpio). Which means that it only works with Raspberry Pi. The driver needs to support very precise GPIO timing. I don't think there's a similar driver for ROCK64 OpenOCD. Bummer.

I think you might be better off running Linux on PineBook Pro and using VSCode + ST-Link to flash PineTime?

The installation on Linux should be quite similar to the macOS steps in my article. Just need to update the OpenOCD path in the scripts flash-boot.sh and flash-app.sh in this folder...

https://github.com/lupyuen/pinetime-rust-mynewt/blob/master/scripts/nrf52/
  Reply
#4
(01-08-2020, 08:51 AM)lupyuen Wrote:
(01-08-2020, 06:41 AM)Luke Wrote: Superb, I'll get it flashed for FOSDEM as one of the Demos Smile

[edit] I assume that a ROCK64 running Debian will do the same job as the RPI -- if so, then I could run this live at FOSDEM stall Smile

Erm Luke some bad news for ROCK64 ;-) If you check my config for OpenOCD...

https://github.com/lupyuen/pinetime-rust...swd-pi.ocd

...you can see that it's using the Broadcom GPIO driver (bcm2835gpio). Which means that it only works with Raspberry Pi. The driver needs to support very precise GPIO timing. I don't think there's a similar driver for ROCK64 OpenOCD. Bummer.

I think you might be better off running Linux on PineBook Pro and using VSCode + ST-Link to flash PineTime?

The installation on Linux should be quite similar to the macOS steps in my article. Just need to update the OpenOCD path in the scripts flash-boot.sh and flash-app.sh in this folder...

https://github.com/lupyuen/pinetime-rust-mynewt/blob/master/scripts/nrf52/

Ah, indeed, thank you for pointing that out. Yes, then a ST-Link will likely be a better solution for a showcase. I was just reading this, and assume that this would also apply to your build / demo?
You can find me on IRC, Discord and Twitter


  Reply
#5
I was also able to successfully unlock and flash the PineTime using an FT232H breakout board from OpenOCD.  However, it would be great if something in the Pine ecosystem could do it!
  Reply
#6
Yep Luke, the article is spot on! Just note that there are 2 images to be flashed: Bootloader and Application...

https://gist.github.com/lupyuen/99d64ec2...a8a020b8e9

And you may refer to my OpenOCD scripts:

https://github.com/lupyuen/pinetime-rust...h-boot.ocd

https://github.com/lupyuen/pinetime-rust...sh-app.ocd

Assuming that the flash ROM has been unprotected (via Raspberry Pi or other means)
  Reply
#7
Now we can build AND flash PineTime firmware on Raspberry Pi! Surprised me too...

https://twitter.com/MisterTechBlog/statu...27936?s=20
  Reply
#8
@lupyuen Thanks so much for your great tutorial!

I've compiled my notes for using FT232H instead of Raspberry Pi here in case they're useful to anyone else.
  Reply
#9
I used the raspberry pi and was able to unlock my pinetime! thank you.
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Article: OpenOCD on Raspberry Pi: Better with SWD on SPI lupyuen 5 464 04-05-2020, 06:47 PM
Last Post: johns
  Article: My First Week As Embedded FOSS Advocate lupyuen 3 334 03-26-2020, 07:10 PM
Last Post: aalevy
  Article: Visual Rust for PineTime Smart Watch lupyuen 1 211 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 249 01-24-2020, 05:20 AM
Last Post: lupyuen
  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 311 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 545 11-15-2019, 02:18 AM
Last Post: lupyuen

Forum Jump:


Users browsing this thread: 1 Guest(s)