firmware: debug/test build profiles with real behavioural differences

This commit is contained in:
Lars Nolden
2026-09-01 11:23:28 +02:00
parent 31c7aa7d02
commit c835c62172
9 changed files with 133 additions and 13 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Build a named firmware profile.
# ./tools/build.sh test (default) - configuration all HIL numbers use
# ./tools/build.sh debug - verbose, assertions, per-TX dumps
# Build dirs are kept separate so switching profiles cannot silently reuse
# a stale sdkconfig.
set -euo pipefail
cd "$(dirname "$0")/../firmware"
PROFILE=${1:-test}
case "$PROFILE" in
test|debug) ;;
*) echo "unknown profile: $PROFILE (use test|debug)" >&2; exit 2 ;;
esac
export SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.$PROFILE"
exec idf.py -B "build-$PROFILE" -D SDKCONFIG="sdkconfig.$PROFILE" "${@:2}" build
+15 -4
View File
@@ -1,11 +1,22 @@
#!/usr/bin/env bash
# Build + flash the firmware to the discovered DUT. Refuses ambiguous devices.
# Build + flash a firmware profile to the discovered DUT.
# ./tools/flash.sh [test|debug]
# Refuses ambiguous serial devices (see tools/discover_devices.sh).
set -euo pipefail
cd "$(dirname "$0")/.."
PROFILE=${1:-test}
eval "$(./tools/discover_devices.sh)"
echo "Flashing DUT: $DUT_PORT" >&2
echo "Flashing profile '$PROFILE' to: $DUT_PORT" >&2
./tools/build.sh "$PROFILE"
cd firmware
idf.py build
idf.py -p "$DUT_PORT" flash
if ! idf.py -B "build-$PROFILE" -p "$DUT_PORT" flash; then
# entering download mode re-enumerates the USB device; rediscover once
sleep 2
cd ..
eval "$(./tools/discover_devices.sh)"
cd firmware
idf.py -B "build-$PROFILE" -p "$DUT_PORT" flash
fi