diff options
| author | JF <jf@codingfield.com> | 2021-01-04 18:56:56 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2021-01-04 18:56:56 (GMT) |
| commit | 1d940af924bac5728a4d494f780e298e5b67b707 (patch) | |
| tree | 24540888f3d038ca3c88a0789b63faa8ac07d631 /doc | |
| parent | 04abc91f157f5925ffa404728291a69893acf8cf (diff) | |
| parent | 50ae0ae5e073ac48652e6c26549f9b19655e8da3 (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/buildWithDocker.md | 72 | ||||
| -rw-r--r-- | doc/gettingStarted/dfuFile.png | bin | 0 -> 17987 bytes | |||
| -rw-r--r-- | doc/gettingStarted/gadgetbridge0.jpg | bin | 0 -> 37874 bytes | |||
| -rw-r--r-- | doc/gettingStarted/gadgetbridge1.jpg | bin | 0 -> 43398 bytes | |||
| -rw-r--r-- | doc/gettingStarted/gadgetbridge2.jpg | bin | 0 -> 29721 bytes | |||
| -rw-r--r-- | doc/gettingStarted/gadgetbridge3.jpg | bin | 0 -> 42135 bytes | |||
| -rw-r--r-- | doc/gettingStarted/gadgetbridge4.jpg | bin | 0 -> 30844 bytes | |||
| -rw-r--r-- | doc/gettingStarted/gadgetbridge5.jpg | bin | 0 -> 33515 bytes | |||
| -rw-r--r-- | doc/gettingStarted/gettingStarted.md | 101 | ||||
| -rw-r--r-- | doc/gettingStarted/imageFile.png | bin | 0 -> 37523 bytes | |||
| -rw-r--r-- | doc/gettingStarted/nrfconnect0.jpg | bin | 0 -> 33306 bytes | |||
| -rw-r--r-- | doc/gettingStarted/nrfconnect1.jpg | bin | 0 -> 76803 bytes | |||
| -rw-r--r-- | doc/gettingStarted/nrfconnect2.jpg | bin | 0 -> 50510 bytes | |||
| -rw-r--r-- | doc/gettingStarted/nrfconnect3.jpg | bin | 0 -> 34187 bytes | |||
| -rw-r--r-- | doc/gettingStarted/nrfconnectcts0.jpg | bin | 0 -> 42101 bytes | |||
| -rw-r--r-- | doc/gettingStarted/nrfconnectcts1.jpg | bin | 0 -> 40193 bytes |
16 files changed, 157 insertions, 16 deletions
diff --git a/doc/buildWithDocker.md b/doc/buildWithDocker.md index 705c6d9..7a2f372 100644 --- a/doc/buildWithDocker.md +++ b/doc/buildWithDocker.md @@ -1,33 +1,73 @@ # Build the project using Docker -A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. This image makes the build of the firmware and the generation of the DFU file for OTA. -## Build the image -The image is not (yet) available on DockerHub, you need to build it yourself, which is quite easy. The following commands must be run from the root of the project. +A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed. + +Based on Ubuntu 18.04 with the following build dependencies: + +* ARM GCC Toolchain +* nRF SDK +* MCUBoot +* adafruit-nrfutil + +## Run a container to build the project + +The `infinitime-build` image contains all the dependencies you need. The default `CMD` will compile sources found in `/sources`, so you need only mount your code. + +This example will build the firmware, generate the MCUBoot image and generate the DFU file. Outputs will be written to **<project_root>/build/output**: -If you are running on a x86_64 computer : +```bash +cd <project_root> # e.g. cd ./work/Pinetime +docker run --rm -it -v $(pwd):/sources infinitime-build ``` -docker image build -t infinitime-build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) docker/x86_64/ + +If you only want to build a single CMake target, you can pass it in as the first parameter to the build script. This means calling the script explicitly as it will override the `CMD`. Here's an example For `pinetime-app`: + +```bash +docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-app ``` -And if your are running on an ARM64 device (tested on RaspberryPi4 and Pine64 PineBookPro): +The image is built using 1000:1000 for the user id and group id. If this is different to your user or group ids (run `id -u` and `id -g` to find out what your id values are if you are unsure), you will need to override them via the `--user` parameter in order to prevent permission errors with the output files (and the cmake build cache). + +Running with this image is the same as above, you just specify the ids to `docker run` + +```bash +docker run --rm -it -v $(pwd):/sources --user $(id -u):$(id -g) pfeerick/infinitime-build ``` -docker image build -t infinitime-build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) docker/arm64/ + +Or you can specify your user id and group id (by number, not by name) directly: + +```bash +docker run --rm -it -v $(pwd):/sources --user 1234:1234 infinitime-build ``` -This operation will take some time. It builds a Docker image based on Ubuntu, install some packages, download the ARM toolchain, the NRF SDK, MCUBoot and adafruit-nrfutil. +## Using the image from Docker Hub -When this is done, a new image named *infinitime-build* is available. +The image is avaiable via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/repository/docker/pfeerick/infinitime-build). -## Run a container to build the project: +It can be pulled (downloaded) using the following command: -``` -docker run --rm -v <project_root>:/sources infinitime-build +```bash +docker pull pfeerick/infinitime-build ``` -Replace *<project_root>* by the path of the root of the project on your computer. For example: +The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually: -``` -docker run --rm -v /home/jf/git/PineTime:/sources infinitime-build +* For AMD64 (x86_64) systems: `docker pull pfeerick/infinitime-build:amd64` + +* For ARM64v8 (ARM64/aarch64) systems: `docker pull pfeerick/infinitime-build:arm64v8` + +## Build the image + +You can build the image yourself if you like! + +The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available. + +```bash +docker image build -t infinitime-build ./docker ``` -This will start a container, build the firmware and generate the MCUBoot image and the DFU file. The output of the build is stored in **<project_root>/built/output**.
\ No newline at end of file +The `PUID` and `PGID` build arguments are used to set the user and group ids used in the container, meaning you will not need to specify it later unless they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make the command you need to run later a bit shorter. In the below examples, they are set to your current user id and group id automatically. You can specify them manually, but they must be specified by number, not by name. + +```bash +docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) ./docker +``` diff --git a/doc/gettingStarted/dfuFile.png b/doc/gettingStarted/dfuFile.png Binary files differnew file mode 100644 index 0000000..f6d112e --- /dev/null +++ b/doc/gettingStarted/dfuFile.png diff --git a/doc/gettingStarted/gadgetbridge0.jpg b/doc/gettingStarted/gadgetbridge0.jpg Binary files differnew file mode 100644 index 0000000..7ea2e3c --- /dev/null +++ b/doc/gettingStarted/gadgetbridge0.jpg diff --git a/doc/gettingStarted/gadgetbridge1.jpg b/doc/gettingStarted/gadgetbridge1.jpg Binary files differnew file mode 100644 index 0000000..470b0b3 --- /dev/null +++ b/doc/gettingStarted/gadgetbridge1.jpg diff --git a/doc/gettingStarted/gadgetbridge2.jpg b/doc/gettingStarted/gadgetbridge2.jpg Binary files differnew file mode 100644 index 0000000..8f75b23 --- /dev/null +++ b/doc/gettingStarted/gadgetbridge2.jpg diff --git a/doc/gettingStarted/gadgetbridge3.jpg b/doc/gettingStarted/gadgetbridge3.jpg Binary files differnew file mode 100644 index 0000000..cfb83f5 --- /dev/null +++ b/doc/gettingStarted/gadgetbridge3.jpg diff --git a/doc/gettingStarted/gadgetbridge4.jpg b/doc/gettingStarted/gadgetbridge4.jpg Binary files differnew file mode 100644 index 0000000..e41aff0 --- /dev/null +++ b/doc/gettingStarted/gadgetbridge4.jpg diff --git a/doc/gettingStarted/gadgetbridge5.jpg b/doc/gettingStarted/gadgetbridge5.jpg Binary files differnew file mode 100644 index 0000000..1ef9f77 --- /dev/null +++ b/doc/gettingStarted/gadgetbridge5.jpg diff --git a/doc/gettingStarted/gettingStarted.md b/doc/gettingStarted/gettingStarted.md new file mode 100644 index 0000000..a3aa49a --- /dev/null +++ b/doc/gettingStarted/gettingStarted.md @@ -0,0 +1,101 @@ +# Flash and upgrade InfiniTime +If you just want to flash or upgrade InfiniTime on your PineTime, this page is for you! + +- [InfiniTime releases and versions](#infinitime-releases-and-versions) +- [How to upgrade Over-The-Air (OTA)](#how-to-upgrade-over-the-air-ota) + - [Using Gadgetbridge](#using-gadgetbridge) + - [Using NRFConnect](#Using-nrfconnect) +- [How to flash InfiniTime using the SWD interface](#how-to-flash-infinitime-using-the-swd-interface) + +## InfiniTime releases and versions +All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/JF002/Pinetime/releases). + +Versions that are tagged as **RELEASE CANDIDATE** are pre-release versions, that are available for testing before actually releasing a new stable version. If you want to help us debug the project and provide stable versions to other user, you can use them. If you want stable and tested version, you should not flash these release candidate version. + +Release files are available under the *Assets* button. + +## How to upgrade Over-The-Air (OTA) +OTA is the easiest method to upgrade InfiniTime. Note that it's only possible is your PineTime is already running InfiniTime (>= 0.7.1). + +2 companion apps provide support for OTA : + - [Gadgetbridge](https://gadgetbridge.org/) (open source, runs on Android, [available on F-Droid](https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/)). + - [NRFConnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) (close source, runs on Android and iOS). + +Both applications need you to download the **DFU file** of InfiniTime. This file contains the new version of InfiniTime that will be flashed into your device. It's called **dfu-x.y.z.zip** (ex: dfu-0.9.0.zip) in the release note. + + +### Using Gadgetbridge +Launch Gadgetbridge and tap on the **"+"** button on the bottom right to add a new device: + + + +Wait for the scan to complete, your PineTime should be detected: + + + +Tap on it. Gadgdetbridge will pair and connect to your device: + + + +Now that Gadgetbridge is connected to your PineTime, use a file browser application (I'm using Seafile to browse my NAS) and browse to the DFU file (image-xxx.zip) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer: + + + +Read carefully the warning and tap **Install**: + + + +Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime! + + + +### Using NRFConnect +Open NRFConnect. Swipe down in the *Scanner* tab and wait for your device to appear: + + + +Tap on the *Connect* button on the right of your device. NRFConnect will connect to your PineTime and discover its characteristics. Tap on the **DFU** button on the top right: + + + +Select **Distribution packet (ZIP)**: + + + +Browse to the DFU file you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime! + + + +## How to flash InfiniTime using the SWD interface +Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page: + + + +The bootloader reads a boot logo from the external SPI flash memory. The first step consists in flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommanded (the bootloader will display garbage on screen for a few second if you don't do it). +Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few second, until the logo is completely drawn on the display. + +Then, using your SWD tool, flash those file at specific offset: + + - bootloader.bin : **0x0000** + - image-x.y.z.bin : **0x8000** + +Reset and voilĂ , you're running InfiniTime on your PineTime! + +If you are using OpenOCD with a STLinkV2, you can find more info [on this page](../openOCD.md). + +## How to synchronize the time + +### Using Gadgetbridge +Good news! Gadgetbridge **automatically** synchronizes the time when connecting to your PineTime! + +### Using NRFConnect +You must enable the **CTS** *GATT server* into NRFConnect so that InfiniTime can synchronize the time with your smartphone. + +Launch NRFConnect, tap the sandwish button on the top left and select *Configure GATT server*: + + + + +Tap *Add service* and select the server configuration *Current Time service*. Tap OK and connect to your PineTime, it should automcatically sync the time once the connection is established! + +
\ No newline at end of file diff --git a/doc/gettingStarted/imageFile.png b/doc/gettingStarted/imageFile.png Binary files differnew file mode 100644 index 0000000..64e9432 --- /dev/null +++ b/doc/gettingStarted/imageFile.png diff --git a/doc/gettingStarted/nrfconnect0.jpg b/doc/gettingStarted/nrfconnect0.jpg Binary files differnew file mode 100644 index 0000000..68f0653 --- /dev/null +++ b/doc/gettingStarted/nrfconnect0.jpg diff --git a/doc/gettingStarted/nrfconnect1.jpg b/doc/gettingStarted/nrfconnect1.jpg Binary files differnew file mode 100644 index 0000000..29778c3 --- /dev/null +++ b/doc/gettingStarted/nrfconnect1.jpg diff --git a/doc/gettingStarted/nrfconnect2.jpg b/doc/gettingStarted/nrfconnect2.jpg Binary files differnew file mode 100644 index 0000000..3b14a47 --- /dev/null +++ b/doc/gettingStarted/nrfconnect2.jpg diff --git a/doc/gettingStarted/nrfconnect3.jpg b/doc/gettingStarted/nrfconnect3.jpg Binary files differnew file mode 100644 index 0000000..e8a5d8e --- /dev/null +++ b/doc/gettingStarted/nrfconnect3.jpg diff --git a/doc/gettingStarted/nrfconnectcts0.jpg b/doc/gettingStarted/nrfconnectcts0.jpg Binary files differnew file mode 100644 index 0000000..d42bea2 --- /dev/null +++ b/doc/gettingStarted/nrfconnectcts0.jpg diff --git a/doc/gettingStarted/nrfconnectcts1.jpg b/doc/gettingStarted/nrfconnectcts1.jpg Binary files differnew file mode 100644 index 0000000..2a478e9 --- /dev/null +++ b/doc/gettingStarted/nrfconnectcts1.jpg |
