summaryrefslogtreecommitdiff
path: root/ao-bringup/turnon_chaoskey
blob: 4a255bff3d27581e1070641c5cf1f59d79ab7243 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

if [ -x /usr/bin/dfu-util ]; then
    DFU_UTIL=/usr/bin/dfu-util
else
    echo "Can't find dfu-util! Aborting."
    exit 1
fi

if [ -x `which ao-usbload` ]; then
	USBLOAD=`which ao-usbload`
else
	echo "Can't find ao-usbload!  Aborting."
	exit 1
fi

VERSION=1.0
PRODUCT=ChaosKey

echo "ChaosKey v$VERSION Turn-On and Calibration Program"
echo "Copyright 2015 by Keith Packard.  Released under GPL v2"
echo
echo "Expectations:"
echo "\tChaosKey v$VERSION powered from USB"
echo

FLASH_FILE=~/altusmetrumllc/Binaries/loaders/chaoskey-v1.0-altos-flash-*.bin
ALTOS_FILE=~/altusmetrumllc/Binaries/chaoskey-v1.0-*.elf

$DFU_UTIL -a 0 -s 0x08000000:leave -D $FLASH_FILE || true

sleep 2

$USBLOAD --serial=1 $ALTOS_FILE || exit 1

sleep 1

./test-chaoskey

exit $?