Files
ChameleonUltra/firmware/flash-dfu-app.sh
Augusto Zanellato 9d5cf21182 Fix non-clean builds failure
Fix flash-dfu-* scripts being now broken
2023-08-23 13:58:27 +02:00

32 lines
717 B
Bash
Executable File

#!/bin/bash
if [[ $BASH_SOURCE = */* ]]; then
cd -- "${BASH_SOURCE%/*}/" || exit
fi
if ! ../resource/tools/enter_dfu.py; then
echo "Wait for device to be off"
echo "Press B and plug"
echo "LEDS 4 & 5 should blink"
fi
while :; do
lsusb|grep -q 1915:521f && break
sleep 1
done
device_type=ultra
lsusb | grep 1915:521f | grep -q ChameleonLite && device_type=lite
echo "Flashing $device_type"
dfu_package=objects/${device_type}-dfu-app.zip
if [ ! -f $dfu_package ]; then
echo "DFU package for $device_type not found, aborting."
echo "Build firmware using CURRENT_DEVICE_TYPE=$device_type firmware/build.sh"
exit 1
fi
nrfutil device program --firmware $dfu_package --traits nordicDfu