Remove cc1111 products from 'fat_altos' list, which is used for keithp-fat
[fw/altos] / ao-bringup / turnon_telebt_v1
1 #!/bin/sh
2
3 if [ -x ../ao-tools/ao-load/ao-load ]; then
4         AOLOAD=../ao-tools/ao-load/ao-load
5 elif [ -x /usr/bin/ao-load ]; then
6         AOLOAD=/usr/bin/ao-load
7 else
8         echo "Can't find ao-load!  Aborting."
9         exit 1
10 fi
11
12 if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
13         RAWLOAD=../ao-tools/ao-rawload/ao-rawload
14 elif [ -x /usr/bin/ao-rawload ]; then
15         RAWLOAD=/usr/bin/ao-rawload
16 else
17         echo "Can't find ao-rawload!  Aborting."
18         exit 1
19 fi
20
21 echo "TeleBT v1.1 Turn-On and Calibration Program"
22 echo "Copyright 2013 by Bdale Garbee.  Released under GPL v2"
23 echo
24 echo "Expectations:"
25 echo "\tTeleBT v1.1 powered from USB"
26 echo "\t\twith TeleDonlge (on /dev/ttyACM0) cabled to debug header"
27 echo "\t\twith coax from SMA to frequency counter"
28 echo
29 echo -n "TeleBT serial number: "
30 read SERIAL
31
32 echo $RAWLOAD
33
34 case $USER in
35     bdale)
36         DONGLE=100
37         ;;
38     keithp)
39         DONGLE=186
40         ;;
41     *)
42         echo "Unknow user"
43         exit 1
44         ;;
45 esac
46
47 $RAWLOAD -D $DONGLE -r ao_led_blink.ihx
48 echo "LEDs should be blinking"
49 sleep 5
50
51 $RAWLOAD -D $DONGLE -r ao_radio_xmit.ihx
52 echo -n "Generating RF carrier.  Please enter measured frequency: "
53 read FREQ
54
55 CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"`
56
57 echo "Programming flash with cal value " $CAL_VALUE
58 $AOLOAD -D $DONGLE --cal $CAL_VALUE ~/altusmetrumllc/Binaries/telebt-v1.0*.ihx $SERIAL
59
60 echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
61 echo $SERIAL","$CAL_VALUE >> cal_values
62 echo "Unplug debug cable, power cycle, cu to the board, confirm freq and record power"