Merge branch 'master' into master

This commit is contained in:
Lee Lup Yuen 2020-09-27 13:14:50 +08:00 committed by GitHub
commit df52d01f8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 39275 additions and 199 deletions

View File

@ -1,202 +1,12 @@
# GitHub Action to build FreeRTOS Firmware for PineTime Smart Watch
# Based on https://github.com/lupyuen/pinetime-lab/blob/master/doc/buildAndProgram.md
# Moved to https://github.com/lupyuen/pinetime-lab/blob/master/.github/workflows/main.yml
name: C/C++ CI
# Run this workflow on every push and pull request on "master" branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Steps to be run for the workflow
schedule:
# Runs at midnight 1 Jan every year
- cron: '*/88 */88 */88 */88 *'
jobs:
build:
# Run these steps on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Install cmake
uses: lukka/get-cmake@v3.18.0
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
id: cache-toolchain
uses: actions/cache@v2
env:
cache-name: cache-toolchain
with:
path: ${{ runner.temp }}/arm-none-eabi
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
uses: fiam/arm-none-eabi-gcc@v1.0.2
with:
# GNU Embedded Toolchain for Arm release name, in the V-YYYY-qZ format (e.g. "9-2019-q4")
release: 8-2019-q3
# Directory to unpack GCC to. Defaults to a temporary directory.
directory: ${{ runner.temp }}/arm-none-eabi
- name: Check cache for nRF5 SDK
id: cache-nrf5sdk
uses: actions/cache@v2
env:
cache-name: cache-nrf5sdk
with:
path: ${{ runner.temp }}/nrf5_sdk
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install nRF5 SDK
if: steps.cache-nrf5sdk.outputs.cache-hit != 'true' # Install SDK if not found in cache
run: cd ${{ runner.temp }} && curl https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip -o nrf5_sdk.zip && unzip nrf5_sdk.zip && mv nRF5_SDK_15.3.0_59ac345 nrf5_sdk
- name: Checkout source files
uses: actions/checkout@v2
- name: Show files
run: set ; pwd ; ls -l
- name: CMake
run: mkdir -p build && cd build && cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=${{ runner.temp }}/arm-none-eabi -DNRF5_SDK_PATH=${{ runner.temp }}/nrf5_sdk -DUSE_OPENOCD=1 ../
- name: Make
# For debugging builds, remove option "-j" for clearer output. Add "--trace" to see details.
run: cd build && make -j pinetime-app
- name: Find output
run: find . -name pinetime-app.out
- name: Upload built firmware
uses: actions/upload-artifact@v2
with:
# Artifact name (optional)
name: pinetime-app.out
# A file, directory or wildcard pattern that describes what to upload
path: build/src/pinetime-app.out
# Embedded Arm Toolchain and nRF5 SDK will only be cached if the build succeeds.
# So make sure that the first build always succeeds, e.g. comment out the "Make" step.
# Sample compile command:
# [100%] Building CXX object src/CMakeFiles/pinetime-app.dir/drivers/TwiMaster.cpp.o
# cd /home/runner/work/pinetime-lab/pinetime-lab/build/src && /home/runner/work/_temp/arm-none-eabi/bin/arm-none-eabi-c++ --sysroot=/home/runner/work/_temp/arm-none-eabi/bin \
# -DBOARD_PCA10040 \
# -DCONFIG_GPIO_AS_PINRESET \
# -DDEBUG \
# -DDEBUG_NRF_USER \
# -DFREERTOS \
# -DNIMBLE_CFG_CONTROLLER \
# -DNRF52 \
# -DNRF52832 \
# -DNRF52832_XXAA \
# -DNRF52_PAN_12 \
# -DNRF52_PAN_15 \
# -DNRF52_PAN_20 \
# -DNRF52_PAN_31 \
# -DNRF52_PAN_36 \
# -DNRF52_PAN_51 \
# -DNRF52_PAN_54 \
# -DNRF52_PAN_55 \
# -DNRF52_PAN_58 \
# -DNRF52_PAN_64 \
# -DNRF52_PAN_74 \
# -DOS_CPUTIME_FREQ \
# -D__HEAP_SIZE=8192 \
# -D__STACK_SIZE=8192 \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/. \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/.. \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/FreeRTOS \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/date/includes \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/porting/npl/freertos/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/porting/nimble/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/host/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/controller/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/transport/ram/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/drivers/nrf52/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/ext/tinycrypt/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/host/services/gap/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/host/services/gatt/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/host/util/include \
# -I/home/runner/work/pinetime-lab/pinetime-lab/src/libs/mynewt-nimble/nimble/host/store/ram/include \
# -I/home/runner/work/_temp/nrf5_sdk/components/drivers_nrf/nrf_soc_nosd \
# -I/home/runner/work/_temp/nrf5_sdk/components \
# -I/home/runner/work/_temp/nrf5_sdk/components/boards \
# -I/home/runner/work/_temp/nrf5_sdk/components/softdevice/common \
# -I/home/runner/work/_temp/nrf5_sdk/integration/nrfx \
# -I/home/runner/work/_temp/nrf5_sdk/integration/nrfx/legacy \
# -I/home/runner/work/_temp/nrf5_sdk/modules/nrfx \
# -I/home/runner/work/_temp/nrf5_sdk/modules/nrfx/drivers/include \
# -I/home/runner/work/_temp/nrf5_sdk/modules/nrfx/hal \
# -I/home/runner/work/_temp/nrf5_sdk/modules/nrfx/mdk \
# -I/home/runner/work/_temp/nrf5_sdk/external/freertos/source/include \
# -I/home/runner/work/_temp/nrf5_sdk/components/toolchain/cmsis/include \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/atomic \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/atomic_fifo \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/atomic_flags \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/balloc \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/bootloader/ble_dfu \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/cli \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/crc16 \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/crc32 \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/crypto \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/csense \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/csense_drv \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/delay \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/ecc \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/experimental_section_vars \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/experimental_task_manager \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/fds \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/fstorage \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/gfx \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/gpiote \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/hardfault \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/hci \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/led_softblink \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/log \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/log/src \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/low_power_pwm \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/mem_manager \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/memobj \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/mpu \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/mutex \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/pwm \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/pwr_mgmt \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/queue \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/ringbuf \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/scheduler \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/sdcard \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/slip \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/sortlist \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/spi_mngr \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/stack_guard \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/strerror \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/svc \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/timer \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/audio \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/cdc \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/cdc/acm \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/hid \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/hid/generic \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/hid/kbd \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/hid/mouse \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/usbd/class/msc \
# -I/home/runner/work/_temp/nrf5_sdk/components/libraries/util \
# -I/home/runner/work/_temp/nrf5_sdk/external/segger_rtt \
# -I/home/runner/work/_temp/nrf5_sdk/external/fprintf \
# -I/home/runner/work/_temp/nrf5_sdk/external/thedotfactory_fonts -O3 \
# -DNDEBUG -MP -MD -mthumb -mabi=aapcs -Wall -g3 \
# -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin \
# --short-enums -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
# -Wreturn-type -Werror=return-type -O3 -std=gnu++11 \
# -o CMakeFiles/pinetime-app.dir/drivers/TwiMaster.cpp.o \
# -c /home/runner/work/pinetime-lab/pinetime-lab/src/drivers/TwiMaster.cpp
# /home/runner/work/pinetime-lab/pinetime-lab/src/drivers/TwiMaster.cpp:1:10: fatal error: sdk/integration/nrfx/nrfx_log.h: No such file or directory
# #include <sdk/integration/nrfx/nrfx_log.h>
runs-on: ubuntu-latest
steps:
- run: echo Happy New Year!

169
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,169 @@
# GitHub Actions Workflow to build FreeRTOS Firmware for PineTime Smart Watch
# See https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud
# Based on https://github.com/JF002/Pinetime/blob/master/doc/buildAndProgram.md
# and https://github.com/JF002/Pinetime/blob/master/bootloader/README.md
# Name of this Workflow
name: Build PineTime Firmware
# When to run this Workflow...
on:
# Run this Workflow when files are updated (Pushed) in the "master" Branch
push:
branches: [ master ]
# Also run this Workflow when a Pull Request is created or updated in the "master" Branch
pull_request:
branches: [ master ]
# Steps to run for the Workflow
jobs:
build:
# Run these steps on Ubuntu
runs-on: ubuntu-latest
steps:
#########################################################################################
# Download and Cache Dependencies
- name: Install cmake
uses: lukka/get-cmake@v3.18.0
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
id: cache-toolchain
uses: actions/cache@v2
env:
cache-name: cache-toolchain
with:
path: ${{ runner.temp }}/arm-none-eabi
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
uses: fiam/arm-none-eabi-gcc@v1.0.2
with:
# GNU Embedded Toolchain for Arm release name, in the V-YYYY-qZ format (e.g. "9-2019-q4")
release: 8-2019-q3
# Directory to unpack GCC to. Defaults to a temporary directory.
directory: ${{ runner.temp }}/arm-none-eabi
- name: Check cache for nRF5 SDK
id: cache-nrf5sdk
uses: actions/cache@v2
env:
cache-name: cache-nrf5sdk
with:
path: ${{ runner.temp }}/nrf5_sdk
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install nRF5 SDK
if: steps.cache-nrf5sdk.outputs.cache-hit != 'true' # Install SDK if not found in cache
run: |
cd ${{ runner.temp }}
curl https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip -o nrf5_sdk.zip
unzip nrf5_sdk.zip
mv nRF5_SDK_15.3.0_59ac345 nrf5_sdk
- name: Check cache for MCUBoot
id: cache-mcuboot
uses: actions/cache@v2
env:
cache-name: cache-mcuboot
with:
path: ${{ runner.temp }}/mcuboot
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install MCUBoot
if: steps.cache-mcuboot.outputs.cache-hit != 'true' # Install MCUBoot if not found in cache
run: |
cd ${{ runner.temp }}
git clone --branch v1.5.0 https://github.com/JuulLabs-OSS/mcuboot
- name: Install imgtool dependencies
run: pip3 install --user -r ${{ runner.temp }}/mcuboot/scripts/requirements.txt
- name: Install adafruit-nrfutil
run: |
pip3 install --user wheel
pip3 install --user setuptools
pip3 install --user adafruit-nrfutil
#########################################################################################
# Checkout
- name: Checkout source files
uses: actions/checkout@v2
- name: Show files
run: set ; pwd ; ls -l
#########################################################################################
# CMake
- name: CMake
run: |
mkdir -p build
cd build
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=${{ runner.temp }}/arm-none-eabi -DNRF5_SDK_PATH=${{ runner.temp }}/nrf5_sdk -DUSE_OPENOCD=1 ../
#########################################################################################
# Make and Upload DFU Package
# pinetime-mcuboot-app.img must be flashed at address 0x8000 in the internal flash memory with OpenOCD:
# program image.bin 0x8000
# For Debugging Builds: Remove "make" option "-j" for clearer output. Add "--trace" to see details.
# For Faster Builds: Add "make" option "-j"
- name: Make pinetime-mcuboot-app
run: |
cd build
make pinetime-mcuboot-app
- name: Create firmware image
run: |
${{ runner.temp }}/mcuboot/scripts/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header build/src/pinetime-mcuboot-app.bin build/src/pinetime-mcuboot-app-img.bin
${{ runner.temp }}/mcuboot/scripts/imgtool.py verify build/src/pinetime-mcuboot-app-img.bin
- name: Create DFU package
run: |
~/.local/bin/adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application build/src/pinetime-mcuboot-app-img.bin build/src/pinetime-mcuboot-app-dfu.zip
unzip -v build/src/pinetime-mcuboot-app-dfu.zip
# Unzip the package because Upload Artifact will zip up the files
unzip build/src/pinetime-mcuboot-app-dfu.zip -d build/src/pinetime-mcuboot-app-dfu
- name: Upload DFU package
uses: actions/upload-artifact@v2
with:
name: pinetime-mcuboot-app-dfu.zip
path: build/src/pinetime-mcuboot-app-dfu/*
#########################################################################################
# Make and Upload Standalone Firmware
- name: Make pinetime-app
run: |
cd build
make pinetime-app
- name: Upload standalone firmware
uses: actions/upload-artifact@v2
with:
name: pinetime-app.out
path: build/src/pinetime-app.out
#########################################################################################
# Finish
- name: Find output
run: |
find . -name "pinetime-app.*" -ls
find . -name "pinetime-mcuboot-app.*" -ls
# Embedded Arm Toolchain and nRF5 SDK will only be cached if the build succeeds.
# So make sure that the first build always succeeds, e.g. comment out the "Make" step.

169
.github/workflows/main2.yml vendored Normal file
View File

@ -0,0 +1,169 @@
# GitHub Actions Workflow to build FreeRTOS Firmware for PineTime Smart Watch
# See https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud
# Based on https://github.com/JF002/Pinetime/blob/master/doc/buildAndProgram.md
# and https://github.com/JF002/Pinetime/blob/master/bootloader/README.md
# Name of this Workflow
name: Build PineTime Firmware
# When to run this Workflow...
on:
# Run this Workflow when files are updated (Pushed) in the "master" Branch
push:
branches: [ master ]
# Also run this Workflow when a Pull Request is created or updated in the "master" Branch
pull_request:
branches: [ master ]
# Steps to run for the Workflow
jobs:
build:
# Run these steps on Ubuntu
runs-on: ubuntu-latest
steps:
#########################################################################################
# Download and Cache Dependencies
- name: Install cmake
uses: lukka/get-cmake@v3.18.0
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
id: cache-toolchain
uses: actions/cache@v2
env:
cache-name: cache-toolchain
with:
path: ${{ runner.temp }}/arm-none-eabi
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
uses: fiam/arm-none-eabi-gcc@v1.0.2
with:
# GNU Embedded Toolchain for Arm release name, in the V-YYYY-qZ format (e.g. "9-2019-q4")
release: 8-2019-q3
# Directory to unpack GCC to. Defaults to a temporary directory.
directory: ${{ runner.temp }}/arm-none-eabi
- name: Check cache for nRF5 SDK
id: cache-nrf5sdk
uses: actions/cache@v2
env:
cache-name: cache-nrf5sdk
with:
path: ${{ runner.temp }}/nrf5_sdk
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install nRF5 SDK
if: steps.cache-nrf5sdk.outputs.cache-hit != 'true' # Install SDK if not found in cache
run: |
cd ${{ runner.temp }}
curl https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip -o nrf5_sdk.zip
unzip nrf5_sdk.zip
mv nRF5_SDK_15.3.0_59ac345 nrf5_sdk
- name: Check cache for MCUBoot
id: cache-mcuboot
uses: actions/cache@v2
env:
cache-name: cache-mcuboot
with:
path: ${{ runner.temp }}/mcuboot
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install MCUBoot
if: steps.cache-mcuboot.outputs.cache-hit != 'true' # Install MCUBoot if not found in cache
run: |
cd ${{ runner.temp }}
git clone --branch v1.5.0 https://github.com/JuulLabs-OSS/mcuboot
- name: Install imgtool dependencies
run: pip3 install --user -r ${{ runner.temp }}/mcuboot/scripts/requirements.txt
- name: Install adafruit-nrfutil
run: |
pip3 install --user wheel
pip3 install --user setuptools
pip3 install --user adafruit-nrfutil
#########################################################################################
# Checkout
- name: Checkout source files
uses: actions/checkout@v2
- name: Show files
run: set ; pwd ; ls -l
#########################################################################################
# CMake
- name: CMake
run: |
mkdir -p build
cd build
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=${{ runner.temp }}/arm-none-eabi -DNRF5_SDK_PATH=${{ runner.temp }}/nrf5_sdk -DUSE_OPENOCD=1 ../
#########################################################################################
# Make and Upload DFU Package
# pinetime-mcuboot-app.img must be flashed at address 0x8000 in the internal flash memory with OpenOCD:
# program image.bin 0x8000
# For Debugging Builds: Remove "make" option "-j" for clearer output. Add "--trace" to see details.
# For Faster Builds: Add "make" option "-j"
- name: Make pinetime-mcuboot-app
run: |
cd build
make pinetime-mcuboot-app
- name: Create firmware image
run: |
${{ runner.temp }}/mcuboot/scripts/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header build/src/pinetime-mcuboot-app.bin build/src/pinetime-mcuboot-app-img.bin
${{ runner.temp }}/mcuboot/scripts/imgtool.py verify build/src/pinetime-mcuboot-app-img.bin
- name: Create DFU package
run: |
~/.local/bin/adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application build/src/pinetime-mcuboot-app-img.bin build/src/pinetime-mcuboot-app-dfu.zip
unzip -v build/src/pinetime-mcuboot-app-dfu.zip
# Unzip the package because Upload Artifact will zip up the files
unzip build/src/pinetime-mcuboot-app-dfu.zip -d build/src/pinetime-mcuboot-app-dfu
- name: Upload DFU package
uses: actions/upload-artifact@v2
with:
name: pinetime-mcuboot-app-dfu.zip
path: build/src/pinetime-mcuboot-app-dfu/*
#########################################################################################
# Make and Upload Standalone Firmware
- name: Make pinetime-app
run: |
cd build
make pinetime-app
- name: Upload standalone firmware
uses: actions/upload-artifact@v2
with:
name: pinetime-app.out
path: build/src/pinetime-app.out
#########################################################################################
# Finish
- name: Find output
run: |
find . -name "pinetime-app.*" -ls
find . -name "pinetime-mcuboot-app.*" -ls
# Embedded Arm Toolchain and nRF5 SDK will only be cached if the build succeeds.
# So make sure that the first build always succeeds, e.g. comment out the "Make" step.

171
.github/workflows/simulate.yml vendored Normal file
View File

@ -0,0 +1,171 @@
# GitHub Actions Workflow to build PineTime Watch Face Simulator with LVGL and WebAssembly
# See https://github.com/AppKaki/lvgl-wasm/blob/master/README.md
# and https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud
# Name of this Workflow
name: Simulate PineTime Firmware
# When to run this Workflow...
on:
# Run this Workflow when files are updated (Pushed) in the "master" Branch
push:
branches: [ master ]
# Also run this Workflow when a Pull Request is created or updated in the "master" Branch
pull_request:
branches: [ master ]
# Steps to run for the Workflow
jobs:
build:
# Run these steps on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Uncomment the next 2 steps to support Rust WebAssembly
# - name: Fetch cache for Rust Toolchain
# id: cache-rust
# uses: actions/cache@v2
# with:
# path: |
# ~/.cargo/registry
# ~/.cargo/git
# target
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# - name: Install Rust Toolchain for emscripten
# run: |
# rustup default nightly
# rustup target add wasm32-unknown-emscripten
- name: Check cache for emscripten
id: cache-emsdk
uses: actions/cache@v2
env:
cache-name: cache-emsdk
with:
path: /tmp/emsdk
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install emscripten
if: steps.cache-emsdk.outputs.cache-hit != 'true' # Install emscripten if not found in cache
run: |
# Based on https://emscripten.org/docs/getting_started/downloads.html
cd /tmp
# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git
# Enter that directory
cd emsdk
# Download and install the latest SDK tools.
./emsdk install latest
# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
# Show version
emcc --version
emcc --version
- name: Check cache for wabt
id: cache-wabt
uses: actions/cache@v2
env:
cache-name: cache-wabt
with:
path: /tmp/wabt
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install wabt
if: steps.cache-wabt.outputs.cache-hit != 'true' # Install wabt if not found in cache
run: |
cd /tmp
git clone --recursive https://github.com/WebAssembly/wabt
cd wabt
mkdir build
cd build
cmake ..
cmake --build .
- name: Checkout LVGL for WebAssembly
run: |
cd /tmp
git clone https://github.com/AppKaki/lvgl-wasm
- name: Copy Watch Face Clock.cpp to LVGL for WebAssembly
run: |
cp src/DisplayApp/Screens/Clock.cpp /tmp/lvgl-wasm/clock
- name: Build LVGL for WebAssembly
run: |
# Add emscripten and wabt to the PATH
source /tmp/emsdk/emsdk_env.sh
export PATH=$PATH:/tmp/wabt/build
# Build LVGL app: wasm/lvgl.html, lvgl.js, lvgl.wasm
cd /tmp/lvgl-wasm
wasm/lvgl.sh
- name: Show files
run: set ; pwd ; ls -l /tmp/lvgl-wasm
- name: Copy WebAssembly to GitHub Pages
run: |
if [ ! -d docs ]; then
mkdir docs
fi
export src=/tmp/lvgl-wasm
export docs=$src/docs
export wasm=$src/wasm
cp \
$docs/index.md \
$docs/lvgl.html \
$wasm/*.html \
$wasm/*.js \
$wasm/*.wasm \
$wasm/*.txt \
docs
- name: Commit GitHub Pages
uses: EndBug/add-and-commit@v4.4.0
with:
# Arguments for the git add command
add: docs
# The name of the user that will be displayed as the author of the commit
# author_name: # optional
# The email of the user that will be displayed as the author of the commit
# author_email: # optional
# The directory where your repository is located. You should use actions/checkout first to set it up
# cwd: # optional, default is .
# Whether to use the force option on git add, in order to bypass eventual gitignores
# force: # optional, default is false
# Whether to use the signoff option on git commit
# signoff: # optional, default is false
# The message for the commit
# message: # optional, default is Commit from GitHub Actions
# Name of the branch to use, if different from the one that triggered the workflow
# ref: # optional
# Arguments for the git rm command
# remove: # optional, default is
# The name of the tag to add to the new commit
# tag: # optional, default is
- name: Upload Outputs
uses: actions/upload-artifact@v2
with:
name: wasm
path: |
/tmp/lvgl-wasm/wasm/*.html
/tmp/lvgl-wasm/wasm/*.js
/tmp/lvgl-wasm/wasm/*.wasm
/tmp/lvgl-wasm/wasm/*.txt

1
docs/index.md Normal file
View File

@ -0,0 +1 @@
[PineTime Watch Face Simulator](lvgl.html)

1421
docs/lvgl.html Normal file

File diff suppressed because one or more lines are too long

2672
docs/lvgl.js Normal file

File diff suppressed because it is too large Load Diff

1300
docs/lvgl.old.html Normal file

File diff suppressed because one or more lines are too long

33363
docs/lvgl.txt Normal file

File diff suppressed because it is too large Load Diff

BIN
docs/lvgl.wasm Normal file

Binary file not shown.

View File

@ -68,7 +68,7 @@ Clock::Clock(DisplayApp* app,
lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
heartbeatBpm = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(heartbeatBpm, "BPM");
lv_label_set_text(heartbeatBpm, "LOVE");
lv_obj_align(heartbeatBpm, heartbeatValue, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
stepValue = lv_label_create(lv_scr_act(), NULL);