firmware: debug/test build profiles with real behavioural differences
This commit is contained in:
+15
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user