ao-bringup: Find dfu-util in $PATH for chaoskey
[fw/altos] / ao-bringup / turnon_chaoskey
1 #!/bin/sh
2
3 if [ -x `which dfu-util` ]; then
4     DFU_UTIL=`which dfu-util`
5 else
6     echo "Can't find dfu-util! Aborting."
7     exit 1
8 fi
9
10 if [ -x `which ao-usbload` ]; then
11         USBLOAD=`which ao-usbload`
12 else
13         echo "Can't find ao-usbload!  Aborting."
14         exit 1
15 fi
16
17 VERSION=1.0
18 PRODUCT=ChaosKey
19
20 echo "ChaosKey v$VERSION Turn-On and Calibration Program"
21 echo "Copyright 2015 by Keith Packard.  Released under GPL v2"
22 echo
23 echo "Expectations:"
24 echo "\tChaosKey v$VERSION powered from USB"
25 echo
26
27 FLASH_FILE=~/altusmetrumllc/Binaries/chaoskey-v1.0-all-*.bin
28 #ALTOS_FILE=~/altusmetrumllc/Binaries/chaoskey-v1.0-*.elf
29
30 $DFU_UTIL -a 0 -s 0x08000000:leave -D $FLASH_FILE || true
31
32 #sleep 2
33
34 #$USBLOAD --serial=1 $ALTOS_FILE || exit 1
35
36 sleep 3
37
38 ./test-chaoskey
39
40 exit $?