PineTime firmware toolkit based on Zephyr Project RTOS.
A collection of drivers, libraries and samples to build your own PineTime smart watch firmware.
I took a break from this project (till winter) ; https://github.com/MarcusNordstrom/pinetime-zephyr These guys are doing some work on the accel sensor.
Read the tutorial! A helpful manual is included in the repository:
- Follow the Zephyr Getting Started Guide to install zephyr SDK and tools.
- Install
west
meta tool (https://docs.zephyrproject.org/latest/guides/west/install.html). - Create a working directory and enter it.
mkdir work
cd work
- Use west to clone pinetime repository and initialize pinetime project.
west init -m https://github.com/najnesnaj/pinetime-zephyr
Alternatively, you can also clone using manifest from specific branch or tag:
west init -m https://github.com/<user>/pinetime-zephyr --mr <branch>
- Use
west
to use clone and checkout all dependant repositories specified inwest.yml
(inluding zephyr).
west update
- Enjoy!
If you used zephyr and west before and want to stick to the same zephyr copy then you can clone pinetime next to zephyr in working directory and update manifest and west.
west config manifest.path pinetime
Resources:
- West documentation: https://docs.zephyrproject.org/latest/guides/west
- nRF Connect SDK is using zephyr in similar way and its documentation can be helpful as well: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_installing.html
Pinetime does not have UART pins but UART-like connection can be achieved using RTT (Real Time Transfer) feature of Segger JLink debugger. RTT data can be accessed using SEGGER tool (RTTViewer) or by using telnet connection to active debug session. Second methond is recommended since it gives better throughput and allows bitdirection communication using Zephyr Shell (with RTT as backend). PuTTY can be used to telnet to debug session.
Prerequisites:
- JLink debugger, for example one of Nordic Semiconductor Development Kits.
- Setup: https://wiki.pine64.org/index.php/PineTime#Using_JLink_programmer_and_nrfjprog_tools
Following steps needs to be taken to run RTT shell in the application:
- Install PuTTY and Setup RTT session. On Linux, copy
misc/rtt_shell/rtt
to~/putty/sessions
. On Windows, executemisc/rtt_shell/putty-rtt.reg
. - Enable logging and shell over RTT:
CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_RTT=y
-
Build and flash application.
-
Start debug session
west debug (will start gdb)
continue (in gdb console)
- Start PuTTY RTT session, prompt should be printed.
Resources:
- Zephyr shell documentation: https://docs.zephyrproject.org/latest/reference/shell/index.html
- Zephyr logger documentation: https://docs.zephyrproject.org/latest/reference/logging/index.html
In this repository you can find files that supplement a zephyr installation.
- board definition Contains the board definition for the pinetime.
- drivers Contains the drivers for the pinetime.
- samples Modified samples for blinky, new samples for the ST7789V display etc.
- the display
- bluetooth BLE
- graphics libraries
-
- LittlevGL
-
- Adafruit GFX
- RTC
- Serial NOR flash
- accel sensor
- heart rate sensor
- touchscreen
- CTS (setting time in bluetooth)
- DFU (wireless firmware update)
- HR detection (algorithm)
- build-in features of bosch accel sensor (eg step counter)
- testing interrupt/semaphore mechanism on accel sensor and touchscreen
- powermanagement
- watchdog