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
#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


#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/
#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


#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!
#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)
#7
Now we can build AND flash PineTime firmware on Raspberry Pi! Surprised me too...

https://twitter.com/MisterTechBlog/statu...27936?s=20
#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.
#9
I used the raspberry pi and was able to unlock my pinetime! thank you.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Switching between two PineTime in Wasp-os Mpoint 1 37 Today, 03:07 AM
Last Post: danielt
  Switching your PineTime between InfiniTime and Wasp-os Peetz0r 1 362 06-09-2021, 04:18 AM
Last Post: danielt
  Flashing PineTime with 3rd party bootloader Mpoint 2 675 04-07-2021, 08:37 AM
Last Post: wibble
  Need HELP with firmware update jojuma 4 730 03-25-2021, 05:22 AM
Last Post: jojuma
  Flash firmware - Bloody beginner tutorial needed jojuma 9 3,646 03-20-2021, 05:54 AM
Last Post: jojuma
  First time working on the PineTime Dev Kit Msaulnier1 3 1,100 02-10-2021, 06:13 PM
Last Post: Msaulnier1
  Build issue on Windows 10 thibww67 0 805 08-11-2020, 06:17 AM
Last Post: thibww67
  Article: OpenOCD on Raspberry Pi: Better with SWD on SPI lupyuen 5 3,648 04-05-2020, 06:47 PM
Last Post: johns
  Article: My First Week As Embedded FOSS Advocate lupyuen 3 2,297 03-26-2020, 07:10 PM
Last Post: aalevy
  Article: Visual Rust for PineTime Smart Watch lupyuen 1 1,669 03-09-2020, 05:47 PM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)