#!/bin/bash # SPDX-License-Identifier: MIT # Copyright (c) 2024 John Watts and the LuminaSensum contributors set -e if ! test -e .boardserial; then echo "Please run scripts/findboard.sh!" exit 1 fi if ! test -e mbed-os; then echo "Please provide mbed-os directory!" exit 1 fi SERIAL="$(cat .boardserial)" mkdir -p build test -f build/venv/.created || python3 -m venv build/venv touch build/venv/.created source build/venv/bin/activate test -f build/venv/.installed || pip install -r mbed-os/tools/requirements.txt touch build/venv/.installed test -f build/build.ninja || cmake -Bbuild -GNinja ninja -C build --quiet st-flash --serial "$SERIAL" --connect-under-reset write build/Tardis.bin 0x8000000