Difference between revisions of "PineTime Development"

From PINE64
Jump to navigation Jump to search
Line 163: Line 163:
| [https://github.com/ZephyrLabs/PinetimeFlasher ZephyrLabs/PinetimeFlasher]
| [https://github.com/ZephyrLabs/PinetimeFlasher ZephyrLabs/PinetimeFlasher]
|  
|  
|
|-
! ESP32 / ESP8266 SWD WebFlasher
| https://youtu.be/Iu6RoXRZxOk
| https://github.com/atc1441/ESP32_nRF52_SWD
|  
|  



Revision as of 05:13, 23 June 2021

Reprogramming

Wire it up and then flash something.

Available firmware and projects

Project Homepage Project Source PineTime Implementations
FreeRTOS https://www.freertos.org https://sourceforge.net/projects/freertos/
InfiniTime (GitHub: JF002/Pinetime)
kaythe/pinetime-os
Zephyr https://www.zephyrproject.org https://github.com/zephyrproject-rtos/zephyr
najnesnaj/pinetime-zephyr
SuperPrower/pinetime_zephyr_sample_fw
Dejvino/pinetime-hermes-firmware
endian-albin/pinetime-hypnos
mynewt https://mynewt.apache.org/about/ https://github.com/apache/mynewt-core
lupyuen/pinetime-rust-mynewt
caspermeijn/klok
MbedOS https://os.mbed.com https://github.com/ARMmbed/mbed-os
sethitow/mbed-pinetime
geoffrey.vl/mbed-pinetime
RIOT http://riot-os.org/ https://github.com/RIOT-OS/RIOT/ bosmoment/PineTime-apps
TinyGo https://tinygo.org https://github.com/tinygo-org/tinygo aykevl/go-smartwatch
wasp-os (MicroPython) https://wasp-os.readthedocs.io/ https://github.com/daniel-thompson/wasp-os WaspOS PineTime install guide
Rust + RTFM https://rtfm.rs/ rtfm-rs/cortex-m-rtfm https://github.com/dbrgn/pinetime-rtfm/
Bare Metal
https://github.com/xriss/timecake
https://github.com/Arc13/Pyrus
xriss/timecake
Arc13/Pyrus
AdaFruit bootloader https://github.com/adafruit/Adafruit_nRF52_Bootloader daniel-thompson/wasp-bootloader
Useful drivers https://github.com/sethitow/mbed-pinetime https://github.com/sethitow/mbed-pinetime
Project Homepage Project Source PineTime Implementations
Gadgetbridge (Android companion app) https://gadgetbridge.org/ https://codeberg.org/Freeyourgadget/Gadgetbridge InfiniTime support in mainline
Arduino https://youtu.be/4aFDjymXjOw https://github.com/atc1441/ATCwatch https://github.com/atc1441/ATCwatch
OTA Update Flasher / DaFlasher https://youtu.be/gUVEz-pxhgg https://github.com/atc1441/DaFlasherFiles https://github.com/atc1441/DaFlasherFiles
InfiniTime companion app for Linux alexr4535/siglo
Wasp-os companion app for Linux arteeh/wasp-companion
UI design proposal arteeh/pinetime
Flashing app for Linux arteeh/pinetime-flasher
Flashing app for Windows ZephyrLabs/PinetimeFlasher
ESP32 / ESP8266 SWD WebFlasher https://youtu.be/Iu6RoXRZxOk https://github.com/atc1441/ESP32_nRF52_SWD

Manuals

How to write battery friendly software?

The key to save battery is to enable only what you need when you need it. nRF52832 has a lot of functionalities allowing you to draw as little current as possible. Here are some tips and tricks:

  • Disable / shutdown / put in sleep mode all devices around the MCU (display controller, touch controller, external memory,...).
  • Disable all peripheral inside the MCU when you don't need them (SPI, TWI(I²C),...). The power management of the NRF52832 is very smart and will completely shut down (power off and disable the clock) the peripheral when the software disables it.
  • Put the MCU to sleep as soon and as often as possible. If you are not using a RTOS, this is done by calling WFE (wait for event) instruction. Most of the time, RTOS implement this functionality. For example, FreeRTOS calls it the tickless mode : it puts the CPU in sleep mode when no task is planned for execution for more than a specified time, and wakes up as soon as an event is detected or when a task is ready to run.
  • Do not use logging (JLink RTT, SWO, semihosting,...), it uses a lot of power.
  • Ensure that the debug circuitry of the MCU is not enabled when you measuring the battery life. The debug peripheral is enabled as soon as you connect a debugger to the device, and is not automatically disabled, even if you disconnect the debugger you will have to wait for the battery to go flat to disable to port. The software running in the NRF52832 cannot disable the debug peripheral. How to disable the debug circuitry:
 - using nrfjprog --reset
 - using JLinkExe : issue the command writeDP 1 0
 or with OpenOCD
 - issue the command halt
 - issue the command flash fillw 0x10001208 0xFFFFFF00 0x01
 - issue the command reset
 you can check if the debug port is enabled using the following code
 DWT->CYCCNT ? "NO":"YES"

Wishlist

In order to keep track of features and changes to the hardware people would like to see, check out this article: PineTime Hardware Wishlist

Compatibility with other projects

Different firmware running using different bootloaders and Bluetooth stacks on the nRF52832 have different requirements on how they should be initialised and what should be placed where in the internal flash.

To keep track of what, how and why things work like they do across the different projects, check out the PineTime SoftDevice and MCUBoot compatibility article.

Compatibility with companions apps and Bluetooth communication

There are a lot of different firmware running on the Pinetime that implement different BLE APIs (time synchronization, notifications, ...). Companion apps must be able to differentiate between different firmware and forks of the same firmware. See PineTime Bluetooth.

PineTime equivalents and jailbreaking

This page contains a list of PineTime-like smartwatches that might be "jailbreakable" or a good source for ideas for the PineTime: PineTime Equivalents