build.sh
build.sh {build|rebuild|flash|flash-erase|build-flash} — build the Aliro…
Overview
build.sh {build|rebuild|flash|flash-erase|build-flash} — build the Aliro NFC+UWB image from the self-contained ./workspace. Run scripts/bootstrap.sh first. Layers our modules + ISC dw3000 onto the fetched add-on via out-of-tree overlays. Output → ./build (git-ignored). Incremental by default — a full from-scratch (pristine) build runs only when it has to: first build, changed build flags (UWB chip / self-test / config), or when you ask for one. A preflight first checks the workspace is bootstrapped. scripts/build.sh build # incremental where safe (fast) scripts/build.sh rebuild # force a clean pristine build PRISTINE=1 scripts/build.sh build # same as rebuild UWB_SELFTEST=1 scripts/build.sh build # one-shot boot self-test, no iPhone (diagnostic) PRETTY=1 scripts/build.sh build # curated/clean console (reversible; default verbose) ALIRO_SOURCE=1 scripts/build.sh build # clean-room source stack (discovery slice) UWB_CHIP=dw3720 scripts/build.sh build # select the plugged-in UWB chip (default: dw3000)
API
Fsha()
Compute SHA-1 hash; tries shasum first (BSD/macOS), falls back to sha1sum (Linux). Filters output to the hash hex string only.
do_buildFhdr()
Print a section header to stdout: blue "==>" followed by bold text. Used to mark the start of major build phases (preflight, build, done).
do_build, preflightFok()
Print a checkmark to stdout in green followed by text. Used to mark successful completion of build steps.
do_build, preflightFkv()
Print a key-value pair indented: dim key (9 chars wide) and value. Used to display build configuration during the build phase.
do_build, resolve_snrFdie()
Print an error message to stderr and exit with status 1. First line prints the error text in red; remaining arguments are printed as indented hints (dim text with arrow prefix). Used by preflight checks and build validation to fail fast on missing prerequisites or configuration errors.
do_build, preflight, require_built, resolve_chip, resolve_snrFresolve_chip()
Resolve UWB_CHIP -> the dw3000 decadriver's chip Kconfig choice (deps/dw3000/Kconfig). Same DT node + wiring for both; only which *_device.c/dwt_driver builds changes.
do_build · calls dieFpreflight()
Verify bootstrap.sh left everything the build needs. All cheap fs/git checks.
do_build · calls die, hdr, okFdo_build()
Build the Aliro UWB firmware image. Runs preflight checks, resolves chip config, applies optional overlays (pretty console, latency diagnostics, self-test), computes a signature from all -D flags, and runs west build (pristine if config changed, incremental otherwise). Writes build signature to a cache file to detect future flag changes. Outputs merged.hex to BUILD directory.
die, hdr, kv, launch, ok, preflight, resolve_chip, shaFrequire_built()
Verify that a west build has completed in BUILD directory (build.ninja exists). Called before flash operations to fail fast if build has not run.
dieFresolve_snr()
Resolve which J-Link probe to flash, into SNR. Only nRF5340DKs (board version PCA10095 in nrfutil device list) qualify, so another attached probe (e.g. a DWM3001CDK) is never a candidate. One DK -> auto-select it; several -> prompt; none -> fail loud. The flash always names its target explicitly via --dev-id.
die, kvUndocumented (1)
launch