5 REPO=~/altusmetrumllc/Binaries
7 if [ -x ../ao-tools/ao-flash/ao-flash-stm ]; then
8 STMLOAD=../ao-tools/ao-flash/ao-flash-stm
10 echo "Can't find ao-flash-stm! Aborting."
14 if [ -x ../ao-tools/ao-usbload/ao-usbload ]; then
15 USBLOAD=../ao-tools/ao-usbload/ao-usbload
17 echo "Can't find ao-usbload! Aborting."
21 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
22 echo "Copyright 2018 by Bdale Garbee. Released under GPL v2"
25 echo "\t$PRODUCT v$VERSION"
26 echo "\t\twith USB cable attached"
27 echo "\t\twith ST-Link-V2 cabled to debug header"
33 echo "$PRODUCT-$VERSION serial number: $SERIAL"
36 echo -n "$PRODUCT-$VERSION serial number: "
40 echo "Usage: $0 <serial-number>" 1>&2
47 $STMLOAD $REPO/loaders/easymega-v$VERSION*.elf || exit 1
51 $USBLOAD --serial=$SERIAL $REPO/easymega-v$VERSION*.elf || exit 1
55 dev=`../ao-tools/ao-list/ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
59 echo "$PRODUCT found on $dev"
62 echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
69 ../ao-tools/ao-cal-accel/ao-cal-accel $dev || exit 1