3 if [ -x /usr/bin/dfu-util ]; then
4 DFU_UTIL=/usr/bin/dfu-util
6 echo "Can't find dfu-util! Aborting."
10 if [ -x /usr/bin/ao-usbload ]; then
11 USBLOAD=/usr/bin/ao-usbload
13 echo "Can't find ao-usbload! Aborting."
20 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
21 echo "Copyright 2017 by Keith Packard. Released under GPL v2 or later"
24 echo "\t$PRODUCT v$VERSION powered from USB"
26 echo -n "$PRODUCT-$VERSION serial number: "
31 echo "$PRODUCT-$VERSION serial number: $SERIAL"
34 echo -n "$PRODUCT-$VERSION serial number: "
38 echo "Usage: $0 <serial-number>" 1>&2
43 FLASH_FILE=~/altusmetrumllc/Binaries/loaders/telemini-v$VERSION-altos-flash-*.bin
44 ALTOS_FILE=~/altusmetrumllc/Binaries/telemini-v$VERSION-*.elf
45 #FLASH_FILE=../src/telemini-v3.0/flash-loader/telemini-v$VERSION-altos-flash-*.bin
46 #ALTOS_FILE=../src/telemini-v3.0/telemini-v$VERSION-*.elf
48 $DFU_UTIL -a 0 -s 0x08000000:leave -D $FLASH_FILE || exit 1
52 $USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
56 dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
60 echo "$PRODUCT found on $dev"
63 echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
70 SERIAL=$SERIAL ./cal-freq $dev