3617e777d1f5de8076898b162d6d5999cd9a7a14
[fw/altos] / ao-bringup / turnon_chaoskey
1 #!/bin/sh
2
3 if [ -x /usr/bin/ao-flash-stm32f0x ]; then
4         FLASH_STM=/usr/bin/ao-flash-stm32f0x
5 else
6         echo "Can't find ao-flash-stm32f0x!  Aborting."
7         exit 1
8 fi
9
10 if [ -x /usr/bin/ao-usbload ]; then
11         USBLOAD=/usr/bin/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 "\t\twith ST-Link-V2 cabled to debug header"
26 echo
27
28 $FLASH_STM ../src/chaoskey-v$VERSION/flash-loader/chaoskey-v$VERSION-*.elf || exit 1
29
30 sleep 2
31
32 $USBLOAD --serial=1 ../src/chaoskey-v$VERSION/chaoskey-v$VERSION*.ihx || exit 1
33
34 exit $?