InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.64k stars 904 forks source link

small changes to build documentation #1761

Open khimaros opened 1 year ago

khimaros commented 1 year ago
khimaros commented 1 year ago

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 commented 3 months ago

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