InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

small changes to build documentation

Open khimaros opened this issue 2 years ago • 2 comments

  • document lv_img_conf dep for resource building
  • add example command with all needed defines for firmware build

khimaros avatar May 10 '23 19:05 khimaros

for posterity, my personal setup also makes use of https://github.com/jdx/mise/ and pip-tools to improve reproducibility and hermeticity.

the full reproducible build for me (linux, amd64, debian 12, bash) was the following:

# install and activate mise
curl https://mise.run | sh
eval "$(~/bin/rtx activate bash)"

# clone the infinitime repository
git clone --recurse-submodules https://github.com/InfiniTimeOrg/InfiniTime
cd InfiniTime

# download and extract the NRF5 SDK
wget https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip
unzip nRF5_SDK_15.3.0_59ac345.zip

# download and extract the cross compiler
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
tar -xvjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2

# prepare the build environment
mkdir build
cd build

# set python and node versions for this path
cat > .mise.toml <<EOF
[tools]
python = {version = "3.10", virtualenv = ".venv"}
node = "12"
EOF
mise install

# configure pip-tools and install requirements
pip install pip-tools
cp ../tools/mcuboot/requirements.txt requirements.in
echo "adafruit-nrfutil" >> requirements.in
echo "Pillow" >> requirements.in
pip-compile --generate-hashes
pip-sync

# install required npm packages
npm install lv_font_conv

# prepare npm path
export PATH="${PWD}/node_modules/.bin:${PATH}"

# run the cmake build
cmake \
    -DBUILD_DFU=1 -DBUILD_RESOURCES=1 \
    -DARM_NONE_EABI_TOOLCHAIN_PATH=$(realpath ../gcc-arm-none-eabi-10.3-2021.10/) \
    -DNRF5_SDK_PATH=$(realpath ../nRF5_SDK_15.3.0_59ac345/) \
    ..
make pinetime-mcuboot-app

you can then flash src/pinetime-mcuboot-app-dfu-{X.Y.Z}.zip and src/resources/infinitime-resources-{X.Y.Z}.zip using Gadgetbridge or another flashing tool of your choosing.

be careful not to "verify" the firmware until you're sure that all functionality is working, including the ability to flash new firmware with your companion app of choice.

you may want to bump the version number in CMakeLists.txt between builds.

khimaros avatar May 10 '23 19:05 khimaros

FYI, i've updated this to keep up with recent changes to InfiniTime and upstream deps.

khimaros avatar Mar 07 '24 20:03 khimaros