Skip to content

Commit

Permalink
Merge branch 'develop' of JF/PineTime into master
Browse files Browse the repository at this point in the history
  • Loading branch information
JF002 authored and Gitea committed Mar 7, 2021
2 parents b89c92b + e63596b commit 5cd4b36
Show file tree
Hide file tree
Showing 55 changed files with 3,687 additions and 158 deletions.
25 changes: 1 addition & 24 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10)
project(pinetime VERSION 0.14.0 LANGUAGES C CXX ASM)
project(pinetime VERSION 0.14.1 LANGUAGES C CXX ASM)

set(NRF_TARGET "nrf52")

Expand Down Expand Up @@ -41,6 +41,10 @@ if(DEFINED USE_DEBUG_PINS AND USE_DEBUG_PINS)
add_definitions(-DUSE_DEBUG_PINS)
endif()

if(BUILD_DFU)
set(BUILD_DFU true)
endif()

message("BUILD CONFIGURATION")
message("-------------------")
message(" * Version : " ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
Expand All @@ -62,6 +66,11 @@ if(USE_DEBUG_PINS)
else()
message(" * Debug pins : Disabled")
endif()
if(BUILD_DFU)
message(" * Build DFU (using adafruit-nrfutil) : Enabled")
else()
message(" * Build DFU (using adafruit-nrfutil) : Disabled")
endif()

set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -24,7 +24,8 @@ The goal of this project is to design an open-source firmware for the Pinetime s

## Overview

![Pinetime screens](images/0.7.0/montage.jpg "PinetimeScreens")
![Pinetime screens](images/0.14.0/collage1.png "PinetimeScreens")
![Pinetime screens](images/0.14.0/collage2.png "PinetimeScreens")

As of now, here is the list of achievements of this project:

Expand All @@ -46,6 +47,7 @@ As of now, here is the list of achievements of this project:
- Supported by 2 companion apps (development is in progress):
* [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) (on Android)
* [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux)
* **[Experimental]** [WebBLEWatch](https://hubmartin.github.io/WebBLEWatch/) Synchronize time directly from your web browser. [video](https://youtu.be/IakiuhVDdrY)
- **[Experimental]** OTA (Over-the-air) update via BLE
- **[Experimental]** Bootloader based on [MCUBoot](https://juullabs-oss.github.io/mcuboot/)

Expand Down
23 changes: 16 additions & 7 deletions doc/buildAndProgram.md
Expand Up @@ -26,7 +26,10 @@ CMake configures the project according to variables you specify the command line
**NRFJPROG**|Path to the NRFJProg executable. Used only if `USE_JLINK` is 1.|`-DNRFJPROG=/opt/nrfjprog/nrfjprog`
**GDB_CLIENT_BIN_PATH**|Path to arm-none-eabi-gdb executable. Used only if `USE_GDB_CLIENT` is 1.|`-DGDB_CLIENT_BIN_PATH=/home/jf/nrf52/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gdb`
**GDB_CLIENT_TARGET_REMOTE**|Target remote connection string. Used only if `USE_GDB_CLIENT` is 1.|`-DGDB_CLIENT_TARGET_REMOTE=/dev/ttyACM0`
**BUILD_DFU (\*)**|Build DFU files while building (needs [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil)).|`-BUILD_DFU=1`

####(*) Note about **BUILD_DFU**:
DFU files are the files you'll need to install your build of InfiniTime using OTA (over-the-air) mecanism. To generate the DFU file, the Python tool [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) is needed on your system. Check that this tool is properly installed before enabling this option.

#### CMake command line for JLink
```
Expand All @@ -45,11 +48,14 @@ cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=... -DNRF5_SDK_PATH=... -DUSE_OPENOCD=1 -DG

### Build the project
During the project generation, CMake created the following targets:
- FLASH_ERASE : mass erase the flash memory of the NRF52.
- FLASH_pinetime-app : flash the firmware into the NRF52.
- pinetime-app : build the standalone (without bootloader support) version of the firmware.
- pinetime-mcuboot-app : build the firmware with the support of the bootloader (based on MCUBoot).
- pinetime-graphics : small firmware that writes the boot graphics into the SPI flash.
- **FLASH_ERASE** : mass erase the flash memory of the NRF52.
- **FLASH_pinetime-app** : flash the firmware into the NRF52.
- **pinetime-app** : build the standalone (without bootloader support) version of the firmware.
- **pinetime-recovery** : build the standalone recovery version of infinitime (light firmware that only supports OTA and basic UI)
- **pinetime-recovery-loader** : build the standalone tool that flashes the recovery firmware into the external SPI flash
- **pinetime-mcuboot-app** : build the firmware with the support of the bootloader (based on MCUBoot).
- **pinetime-mcuboot-recovery** : build pinetime-recovery with bootloader support
- **pinetime-mcuboot-recovery-loader** : build pinetime-recovery-loader with bootloader support

If you just want to build the project and run it on the Pinetime, using *pinetime-app* is recommanded. See [this page](../bootloader/README.md) for more info about bootloader support.

Expand All @@ -64,8 +70,11 @@ Binary files are generated into the folder `src`:
- **pinetime-app.map** : map file
- **pinetime-mcuboot-app.bin, .hex and .out** : firmware with bootloader support in bin, hex and out formats.
- **pinetime-mcuboot-app.map** : map file
- **pinetime-graphics.bin, .hex and .out** : firmware for the boot graphic in bin, hex and out formats.
- **pinetime-graphics.map** : map file
- **pinetime-mcuboot-app-image** : MCUBoot image of the firmware
- **pinetime-mcuboot-ap-dfu** : DFU file of the firmware

The same files are generated for **pinetime-recovery** and **pinetime-recoveryloader**


### Program and run
#### Using CMake targets
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Expand Up @@ -17,7 +17,8 @@ RUN apt-get update -qq \
# aarch64 packages
libffi-dev \
libssl-dev \
python3-dev \
python3-dev \
python \
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/*;

RUN pip3 install adafruit-nrfutil
Expand Down
1 change: 1 addition & 0 deletions docker/build.sh
Expand Up @@ -63,6 +63,7 @@ CmakeGenerate() {
-DUSE_OPENOCD=1 \
-DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_VER" \
-DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \
-DBUILD_DFU=1 \
"$SOURCES_DIR"
cmake -L -N .
}
Expand Down
11 changes: 4 additions & 7 deletions docker/post_build.sh.in
Expand Up @@ -9,15 +9,12 @@ export PROJECT_VERSION="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT
mkdir -p "$OUTPUT_DIR"

cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin
cp "$BUILD_DIR/src/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin"
cp "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip"

"$TOOLS_DIR"/mcuboot/scripts/imgtool.py create --version 1.0.0 \
--align 4 --header-size 32 --slot-size 475136 --pad-header \
"$BUILD_DIR/src/pinetime-mcuboot-app-$PROJECT_VERSION.bin" \
"$OUTPUT_DIR/image-$PROJECT_VERSION.bin"
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin"
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"

adafruit-nrfutil dfu genpkg --dev-type 0x0052 \
--application "$OUTPUT_DIR/image-$PROJECT_VERSION.bin" \
"$OUTPUT_DIR/dfu-$PROJECT_VERSION.zip"

mkdir -p "$OUTPUT_DIR/src"
cd "$BUILD_DIR"
Expand Down
Binary file added images/0.14.0/collage1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/0.14.0/collage2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/infinitime-logo-github.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5cd4b36

Please sign in to comment.