]> git.gag.com Git - fw/altos/blob - ao-bringup/turnon_telegps_v1
Switch from AdoptOpenJDK to Adoptium
[fw/altos] / ao-bringup / turnon_telegps_v1
1 #!/bin/sh
2
3 if [ -x ../ao-tools/ao-flash/ao-flash-lpc ]; then
4         FLASH_LPC=../ao-tools/ao-flash/ao-flash-lpc
5 elif [ -x /usr/bin/ao-flash-lpc ]; then
6         FLASH_LPC=/usr/bin/ao-flash-lpc
7 else
8         echo "Can't find ao-flash-lpc!  Aborting."
9         exit 1
10 fi
11
12 if [ -x /usr/bin/ao-usbload ]; then
13         USBLOAD=/usr/bin/ao-usbload
14 else
15         echo "Can't find ao-usbload!  Aborting."
16         exit 1
17 fi
18
19 PRODUCT=TeleGPS
20 VERSION=1.0
21 BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
22 echo $FILE
23
24 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
25 echo "Copyright 2014 by Bdale Garbee.  Released under GPL v2"
26 echo
27 echo "Expectations:"
28 echo "\t$PRODUCT v$VERSION powered from USB"
29 echo "\t\twith ST-Link-V2 cabled to debug header"
30 echo
31
32 case $# in
33     1)
34         SERIAL="$1"
35         echo "$PRODUCT-$VERSION serial number: $SERIAL" 
36         ;;
37     0)
38         echo -n "$PRODUCT-$VERSION serial number: "
39         read SERIAL
40         ;;
41     *)
42         echo "Usage: $0 <serial-number>" 1>&2
43         exit 1;
44         ;;
45 esac
46
47 #
48 # Use released versions of everything
49 #
50 FLASH_FILE=~/altusmetrumllc/Binaries/loaders/telegps-v1.0-altos-flash-*.elf
51 ALTOS_FILE=~/altusmetrumllc/Binaries/telegps-v1.0-*.elf
52
53 echo $FLASH_LPC $FLASH_FILE
54
55 $FLASH_LPC $FLASH_FILE || exit 1
56
57 sleep 2
58
59 echo $USBLOAD $ALTOS_FILE
60
61 $USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
62
63 sleep 2
64
65 dev=`ao-list | awk '/TeleGPS-v'"$VERSION"'/ { print $3; exit(0); }'`
66
67 case "$dev" in
68 /dev/tty*)
69         echo "TeleGPS found on $dev"
70         ;;
71 *)
72         echo 'No TeleGPS-v'"$VERSION"' found'
73         exit 1
74         ;;
75 esac
76
77 SERIAL=$SERIAL ./cal-freq $dev
78
79 ./test-telegps-v1
80
81 exit $?