User Tools

Site Tools


pinetime_introduction

This is an old revision of the document!


PineTime - 14/02/22 - 11:58

https://wiki.pine64.org/wiki/PineTime

This document is very much a work in progress, None of it is warranted as Correct, Accurate or Optimal.. Suggestions very welcome.

Requirements

  • PineTime Dev kit
  • ST-Link programmer
  • POGO Pin connector for ST-LINK or soldering skills

Setup OpenOCD to use the ST-Link

Triple check the wiring! The wiring on this page is misleading

https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/doc/openOCD.md

Better wiring info here

https://wiki.pine64.org/wiki/PineTime_Devkit_Wiring

Simple Updater - To check ST-Link is working

https://github.com/lupyuen/pinetime-updater

cd ~/Documents/PineTime/pinetime-updater
./run.sh

Build tools and Flash Setup

https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/doc/buildAndProgram.md

Dependencies

Environment setup

Install

CMake - Build make configurations

https://zbm2.com/dokuwiki/doku.php?id=pinetime_introductionhttps://zbm2.com/dokuwiki/doku.php?id=pinetime_introduction
cd ~/Documents/PineTime/InfiniTime/build
 
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update/ -DNRF5_SDK_PATH=/opt/nRFSDK -DUSE_OPENOCD=1  ../

Seems to ignore ST-Link flags(?)

Make - Build the firmware with the support of the bootloader (based on MCUBoot)

https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/bootloader/README.md

make -j pinetime-mcuboot-app

Flash Config File - flash_bootloader_app.ocd

init
 
program /home/nicolas/Documents/PineTime/InfiniTime/build/src/pinetime-mcuboot-app-image-1.8.0.bin verify 0x00008000
 
reset

Flash

cd ~/Documents/PineTime
sudo openocd -f ./openocd-stlink.ocd -f ./flash_bootloader_app.ocd

Development

https://docs.infinitime.io/en/latest/developer-documentation/index.html#how-to-implement-an-app

Github Cloud Build

With the build working locally from the command line I tried this Github cloud build. Note these articles are old and things have moved on.

https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud#add-github-actions-to-our-fork

I used the develop work flow main.yml on my fork, all runs well.

nRF Connect For Mobile app to upload the DFU file or use GadgetBridge.

VSCode Setup

https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/doc/buildWithVScode.md

pip3 install –user adafruit-nrfutil

Ensure the MCUBoot python tools are already installed

Cmake tools extension configuration

Cmake: Configure Environment Environment variables to pass to CMake during configure.

ARM_NONE_EABI_TOOLCHAIN_PATH /opt/gcc-arm-none-eabi-9-2020-q2-update NRF5_SDK_PATH /opt/nRFSDK

C_cpp_properties.json

“compilerPath”: “/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc”,

Build

Successfully builds from VSCode

Simulator Setup

Install SDL2 https://www.libsdl.org/download-2.0.php

https://github.com/NeroBurner/InfiniTime/tree/lv_simulation

Clone the branch

git clone --branch lv_simulation https://github.com/NeroBurner/InfiniTime.git
cd lv_sim
git submodule update --init

Build simulator version

cd ~/Documents/PineTimeSim/InfiniTime/lv_sim
cmake -S . -B build
cmake --build build --clean-first # Clean first if needed

Run simulator

build/pinesim

Commands

https://github.com/NeroBurner/InfiniTime/blob/84b424cafff4597bca39b5e75a3a596c18852a5a/lv_sim/main.cpp#L632

  Switch between screens with numbers on the keyboard
  Right mouse button - Back,Wake up
  r ... enable ringing
  R ... disable ringing
  m ... let motor run for 100 ms
  M ... stop motor let motor run for max time (255 ms)
  v ... increase remaining battery by 10 %
  V ... decrease remaining battery by 10 %
  c ... battery is charging
  C ... battery is not charging

Next

  • Debugging?
  • Shake to refresh app view
  • Multiple BLE connections? Handling of BLE messages
  • Make hard wired powered dev board?

Notes

https://zbm2.com/dokuwiki/doku.php?id=pinetime_introduction

Development

pinetime_introduction.1645309315.txt.gz · Last modified: by nicolas