PINE64
Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - 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: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch (/showthread.php?tid=8726)



Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - lupyuen - 01-07-2020

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


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - Luke - 01-08-2020

(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


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - lupyuen - 01-08-2020

(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-mynewt/blob/master/scripts/nrf52-pi/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/


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - Luke - 01-08-2020

(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-mynewt/blob/master/scripts/nrf52-pi/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?


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - ryantrinkle - 01-08-2020

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!


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - lupyuen - 01-08-2020

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/99d64ec2bf5bc2e470d3c5a8a020b8e9

And you may refer to my OpenOCD scripts:

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

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

Assuming that the flash ROM has been unprotected (via Raspberry Pi or other means)


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - lupyuen - 01-09-2020

Now we can build AND flash PineTime firmware on Raspberry Pi! Surprised me too...

https://twitter.com/MisterTechBlog/status/1215503431055527936?s=20


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - ryantrinkle - 01-11-2020

@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.


RE: Article: Build and Flash Rust+Mynewt Firmware for PineTime Smart Watch - clover - 01-18-2020

I used the raspberry pi and was able to unlock my pinetime! thank you.