3 if [ -x /usr/bin/ao-flash-stm ]; then
4 FLASH_STM=/usr/bin/ao-flash-stm
6 echo "Can't find ao-flash-stm! Aborting."
10 if [ -x /usr/bin/ao-usbload ]; then
11 USBLOAD=/usr/bin/ao-usbload
13 echo "Can't find ao-usbload! Aborting."
18 REPO=~/altusmetrumllc/Binaries
21 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
22 echo "Copyright 2017 by Bdale Garbee. Released under GPL v3"
25 echo "\t$PRODUCT v$VERSION powered from USB"
26 echo "\t\twith ST-Link-V2 cabled to debug header"
27 echo "\t\twith coax from UHF to frequency counter"
33 echo "$PRODUCT-$VERSION serial number: $SERIAL"
36 echo -n "$PRODUCT-$VERSION serial number: "
40 echo "Usage: $0 <serial-number>" 1>&2
47 $FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf
51 $USBLOAD --serial=$SERIAL --force $REPO/telemega-v$VERSION*.elf || exit 1
55 dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
59 echo "TeleMega found on $dev"
62 echo 'No TeleMega-v'"$VERSION"' found'
69 SERIAL=$SERIAL ./cal-freq $dev
72 while [ $failed = 1 ]; do
73 ../ao-tools/ao-cal-accel/ao-cal-accel $dev