Newer
Older
Tardis / scripts / build.sh
@Jookia Jookia on 19 Mar 2023 606 bytes Initial commit
#!/bin/bash
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