summaryrefslogtreecommitdiff
path: root/ao-bringup
diff options
context:
space:
mode:
Diffstat (limited to 'ao-bringup')
-rwxr-xr-xao-bringup/cal-freq11
-rwxr-xr-xao-bringup/cal-freq-file54
-rwxr-xr-xao-bringup/test-easymega23
-rwxr-xr-xao-bringup/test-easymini20
-rwxr-xr-xao-bringup/test-igniters25
-rwxr-xr-xao-bringup/test-telegps4
-rwxr-xr-xao-bringup/test-telemega66
-rwxr-xr-xao-bringup/test-telemetrum67
-rwxr-xr-xao-bringup/turnon_teledongle15
-rwxr-xr-xao-bringup/turnon_teledonglev389
-rwxr-xr-xao-bringup/turnon_telemega16
-rwxr-xr-xao-bringup/turnon_telemetrum4
12 files changed, 347 insertions, 47 deletions
diff --git a/ao-bringup/cal-freq b/ao-bringup/cal-freq
index 68a8ebf2..5d876e21 100755
--- a/ao-bringup/cal-freq
+++ b/ao-bringup/cal-freq
@@ -19,16 +19,17 @@ while true; do
echo 'C 0' > $dev
+ calline=`./get-radio-cal $dev`
+ CURRENT_CAL=`echo $calline | awk '{print $2}'`
+ CURRENT_FREQ=`echo $calline | awk '{print $4}'`
+ CAL_VALUE=$CURRENT_CAL
+
case "$FREQ" in
"")
echo $SERIAL","$CAL_VALUE >> cal_values
exit 0
;;
*)
- calline=`./get-radio-cal $dev`
- CURRENT_CAL=`echo $calline | awk '{print $2}'`
- CURRENT_FREQ=`echo $calline | awk '{print $4}'`
-
echo "Current radio calibration "$CURRENT_CAL
echo "Current radio frequency "$CURRENT_FREQ
@@ -36,6 +37,8 @@ while true; do
echo "Programming flash with cal value " $CAL_VALUE
+ dd if=$dev iflag=nonblock
+
cat << EOF > $dev
c f $CAL_VALUE
c w
diff --git a/ao-bringup/cal-freq-file b/ao-bringup/cal-freq-file
new file mode 100755
index 00000000..fb48907a
--- /dev/null
+++ b/ao-bringup/cal-freq-file
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+case $# in
+2)
+ dev="$1"
+ serial="$2"
+ ;;
+*)
+ echo "Usage: $0 <device> <serial>"
+ exit 1;
+ ;;
+esac
+
+echo 'E 0' > $dev
+
+while true; do
+
+ dd if=$dev iflag=nonblock of=/dev/null > /dev/null 2>&1
+
+ echo 'C 1' > $dev
+
+ echo -n "Generating RF carrier. Please enter measured frequency [enter for done]: "
+
+ read FREQ
+
+ echo 'C 0' > $dev
+
+ calline=`./get-radio-cal $dev`
+ CURRENT_CAL=`echo $calline | awk '{print $2}'`
+ CURRENT_FREQ=`echo $calline | awk '{print $4}'`
+ CAL_VALUE=$CURRENT_CAL
+
+ case "$FREQ" in
+ "")
+ echo $serial","$CAL_VALUE >> cal_values
+ exit 0
+ ;;
+ *)
+ echo "Current radio calibration "$CURRENT_CAL
+ echo "Current radio frequency "$CURRENT_FREQ
+
+ CAL_VALUE=`nickle -e "floor($CURRENT_FREQ / $FREQ * $CURRENT_CAL + 0.5)"`
+
+ echo "Setting cal value" $CAL_VALUE
+
+ dd if=$dev iflag=nonblock of=/dev/null > /dev/null 2>&1
+
+ cat << EOF > $dev
+c f $CAL_VALUE
+EOF
+ ;;
+ esac
+done
+
diff --git a/ao-bringup/test-easymega b/ao-bringup/test-easymega
index eabe1ee5..76f3effb 100755
--- a/ao-bringup/test-easymega
+++ b/ao-bringup/test-easymega
@@ -17,22 +17,10 @@ ao-list | while read product serial dev; do
"$PRODUCT-v$VERSION")
echo "Testing $product $serial $dev"
+ echo ""
- for igniter in drogue main 0 1 2 3; do
- echo "Testing $igniter igniter."
- echo -n "Press enter to continue..."
- read foo < /dev/tty
- ../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" $igniter
-
- case $? in
- 0)
- ;;
- *)
- echo "failed"
- exit 1
- ;;
- esac
- done
+ ./test-igniters $dev drogue main 0 1 2 3
+ echo""
echo "Testing baro sensor"
../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
@@ -44,6 +32,7 @@ ao-list | while read product serial dev; do
echo "failed"
exit 1
esac
+ echo""
FLASHSIZE=8388608
@@ -57,12 +46,10 @@ ao-list | while read product serial dev; do
echo "failed"
exit 1
esac
+ echo""
echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
ret=0
;;
- *)
- echo "Skipping $product $serial $dev"
- ;;
esac
done
diff --git a/ao-bringup/test-easymini b/ao-bringup/test-easymini
index 17e00955..e11244d2 100755
--- a/ao-bringup/test-easymini
+++ b/ao-bringup/test-easymini
@@ -17,17 +17,10 @@ ao-list | while read product serial dev; do
"$PRODUCT-v$VERSION")
echo "Testing $product $serial $dev"
-
- echo "Testing igniters. Both should flash"
- ../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" drogue main
-
- case $? in
- 0)
- ;;
- *)
- echo "failed"
- exit 1
- esac
+ echo ""
+
+ ./test-igniters "$dev" drogue main
+ echo ""
echo "Testing baro sensor"
../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
@@ -39,6 +32,7 @@ ao-list | while read product serial dev; do
echo "failed"
exit 1
esac
+ echo""
FLASHSIZE=1048576
@@ -52,12 +46,10 @@ ao-list | while read product serial dev; do
echo "failed"
exit 1
esac
+ echo""
echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
ret=0
;;
- *)
- echo "Skipping $product $serial $dev"
- ;;
esac
done
diff --git a/ao-bringup/test-igniters b/ao-bringup/test-igniters
new file mode 100755
index 00000000..763f42a9
--- /dev/null
+++ b/ao-bringup/test-igniters
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+dev="$1"
+shift
+
+for igniter in "$@"; do
+ pass="n"
+ while [ $pass != "y" ]; do
+ echo -n "Testing $igniter igniter. Press enter to continue..."
+ read foo < /dev/tty
+ ../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" $igniter
+
+ case $? in
+ 0)
+ echo "pass"
+ pass="y"
+ ;;
+ *)
+ echo "Failed. Try again."
+ ;;
+ esac
+ done
+done
+
+exit 0
diff --git a/ao-bringup/test-telegps b/ao-bringup/test-telegps
index 9295dd06..0b275802 100755
--- a/ao-bringup/test-telegps
+++ b/ao-bringup/test-telegps
@@ -21,7 +21,7 @@ ao-list | while read product serial dev; do
FLASHSIZE=2097152
echo "Testing flash"
- ./test-flash "$dev" "$FLASHSIZE"
+ ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
case $? in
0)
@@ -32,7 +32,7 @@ ao-list | while read product serial dev; do
esac
echo "Testing GPS"
- ./test-gps "$dev"
+ ../ao-tools/ao-test-gps/ao-test-gps --tty="$dev"
case $? in
0)
diff --git a/ao-bringup/test-telemega b/ao-bringup/test-telemega
new file mode 100755
index 00000000..2e497886
--- /dev/null
+++ b/ao-bringup/test-telemega
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+VERSION=1.0
+PRODUCT=TeleMega
+BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
+
+echo "$PRODUCT-v$VERSION Test Program"
+echo "Copyright 2014 by Keith Packard. Released under GPL v2"
+echo
+echo "Expectations:"
+echo "\t$PRODUCT v$VERSION powered from USB"
+echo
+
+ret=1
+ao-list | while read product serial dev; do
+ case "$product" in
+ "$PRODUCT-v$VERSION")
+
+ echo "Testing $product $serial $dev"
+
+ ./test-igniters $dev main drogue 3 0 1 2
+ echo""
+
+ echo "Testing baro sensor"
+ ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
+
+ case $? in
+ 0)
+ ;;
+ *)
+ echo "failed"
+ exit 1
+ esac
+ echo""
+
+ FLASHSIZE=8388608
+
+ echo "Testing flash"
+ ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
+
+ case $? in
+ 0)
+ ;;
+ *)
+ echo "failed"
+ exit 1
+ esac
+ echo""
+
+ echo "Testing GPS"
+ ../ao-tools/ao-test-gps/ao-test-gps --tty="$dev"
+
+ case $? in
+ 0)
+ ;;
+ *)
+ echo "failed"
+ exit 1
+ esac
+ echo""
+
+ echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
+ ret=0
+ ;;
+ esac
+done
diff --git a/ao-bringup/test-telemetrum b/ao-bringup/test-telemetrum
new file mode 100755
index 00000000..57a4d90d
--- /dev/null
+++ b/ao-bringup/test-telemetrum
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+VERSION=2.0
+PRODUCT=TeleMetrum
+BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
+
+echo "$PRODUCT-v$VERSION Test Program"
+echo "Copyright 2014 by Keith Packard. Released under GPL v2"
+echo
+echo "Expectations:"
+echo "\t$PRODUCT v$VERSION powered from USB"
+echo
+
+ret=1
+ao-list | while read product serial dev; do
+ case "$product" in
+ "$PRODUCT-v$VERSION")
+
+ echo "Testing $product $serial $dev"
+ echo ""
+
+ ./test-igniters "$dev" drogue main
+ echo ""
+
+ echo "Testing baro sensor"
+ ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
+
+ case $? in
+ 0)
+ ;;
+ *)
+ echo "failed"
+ exit 1
+ esac
+ echo""
+
+ FLASHSIZE=8388608
+
+ echo "Testing flash"
+ ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
+
+ case $? in
+ 0)
+ ;;
+ *)
+ echo "failed"
+ exit 1
+ esac
+ echo""
+
+ echo "Testing GPS"
+ ../ao-tools/ao-test-gps/ao-test-gps --tty="$dev"
+
+ case $? in
+ 0)
+ ;;
+ *)
+ echo "failed"
+ exit 1
+ esac
+ echo""
+
+ echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
+ ret=0
+ ;;
+ esac
+done
diff --git a/ao-bringup/turnon_teledongle b/ao-bringup/turnon_teledongle
index ddee5ee8..058e72ce 100755
--- a/ao-bringup/turnon_teledongle
+++ b/ao-bringup/turnon_teledongle
@@ -31,18 +31,27 @@ read SERIAL
echo $RAWLOAD
-$RAWLOAD -D 100 -r ao_led_blink.ihx
+case $USER in
+ bdale)
+ programmer=100
+ ;;
+ keithp)
+ programmer=186
+ ;;
+esac
+
+$RAWLOAD -D $programmer -r ao_led_blink.ihx
echo "LEDs should be blinking"
sleep 5
-$RAWLOAD -D 100 -r ao_radio_xmit.ihx
+$RAWLOAD -D $programmer -r ao_radio_xmit.ihx
echo -n "Generating RF carrier. Please enter measured frequency: "
read FREQ
CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"`
echo "Programming flash with cal value " $CAL_VALUE
-$AOLOAD -D 100 --cal $CAL_VALUE /usr/share/altos/teledongle-v0.2*.ihx $SERIAL
+$AOLOAD -D $programmer --cal $CAL_VALUE /usr/share/altos/teledongle-v0.2*.ihx $SERIAL
echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
echo $SERIAL","$CAL_VALUE >> cal_values
diff --git a/ao-bringup/turnon_teledonglev3 b/ao-bringup/turnon_teledonglev3
new file mode 100755
index 00000000..e6750c45
--- /dev/null
+++ b/ao-bringup/turnon_teledonglev3
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+if [ -x ../ao-tools/ao-flash/ao-flash-lpc ]; then
+ FLASH_LPC=../ao-tools/ao-flash/ao-flash-lpc
+elif [ -x /usr/bin/ao-flash-lpc ]; then
+ FLASH_LPC=/usr/bin/ao-flash-lpc
+else
+ echo "Can't find ao-flash-lpc! Aborting."
+ exit 1
+fi
+
+if [ -x /usr/bin/ao-usbload ]; then
+ USBLOAD=/usr/bin/ao-usbload
+else
+ echo "Can't find ao-usbload! Aborting."
+ exit 1
+fi
+
+PRODUCT=teledongle
+PRODUCT_NAME=TeleDongle
+VERSION=3.0
+
+echo "$PRODUCT_NAME v$VERSION Turn-On and Calibration Program"
+echo "Copyright © 2015 by Bdale Garbee. Released under GPL v2"
+echo
+echo "Expectations:"
+echo "\t$PRODUCT_NAME v$VERSION powered from USB"
+echo "\t\twith ST-Link-V2 cabled to debug header"
+echo "\t\twith coax from UHF to frequency counter"
+echo
+echo -n "$PRODUCT_NAME-$VERSION serial number: "
+read SERIAL
+
+BINARIES=$HOME/altusmetrumllc/Binaries
+
+LOADER="$BINARIES/loaders/$PRODUCT-v$VERSION-"*.elf
+ALTOS="$BINARIES/$PRODUCT-v$VERSION"*.elf
+
+$FLASH_LPC $LOADER || exit 1
+
+sleep 2
+
+$USBLOAD --serial=$SERIAL $ALTOS || exit 1
+
+sleep 5
+
+dev=`ao-list | awk '/TeleDongle-v'"$VERSION"'/ { print $3; exit(0); }'`
+
+case "$dev" in
+/dev/tty*)
+ echo "TeleDongle found on $dev"
+ ;;
+*)
+ echo 'No TeleDongle-v'"$VERSION"' found'
+ exit 1
+ ;;
+esac
+
+echo 'E 0' > $dev
+
+./cal-freq-file $dev $SERIAL
+
+case $? in
+ 0)
+ ;;
+ *)
+ echo "Frequency calibration failed"
+ exit 1
+ ;;
+esac
+
+CAL_VALUE=`grep "^$SERIAL," cal_values | tail -1 | sed 's/^[^,]*,//'`
+
+case "$CAL_VALUE" in
+ [1-9]*)
+ ;;
+ *)
+ echo "Invalid calibration value: $CAL_VALUE"
+ exit 1
+ ;;
+esac
+
+echo "Reflashing with calibration: $CAL_VALUE"
+
+$USBLOAD --cal=$CAL_VALUE --tty=$dev $ALTOS || exit 1
+
+echo "$PRODUCT_NAME-v$VERSION $SERIAL is ready to ship"
+
+exit $?
diff --git a/ao-bringup/turnon_telemega b/ao-bringup/turnon_telemega
index 7745a8e5..7b95bf20 100755
--- a/ao-bringup/turnon_telemega
+++ b/ao-bringup/turnon_telemega
@@ -1,7 +1,7 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
- STMLOAD=/usr/bin/ao-flash-stm
+ FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! Aborting."
exit 1
@@ -21,22 +21,22 @@ echo "TeleMega v$VERSION Turn-On and Calibration Program"
echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
-echo "\tTeleMega v$VERSIOn powered from USB"
+echo "\tTeleMega v$VERSION powered from USB"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo "\t\twith coax from UHF to frequency counter"
echo
echo -n "TeleMega-$VERSION serial number: "
read SERIAL
-echo $STMLOAD
+echo $FLASH_STM
-$STMLOAD $REPO/loaders/telemega-v$VERSION*.elf || exit 1
+$FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf || exit 1
-sleep 2
+sleep 5
$USBLOAD --serial=$SERIAL $REPO/telemega-v$VERSION*.elf || exit 1
-sleep 2
+sleep 5
dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
@@ -57,3 +57,7 @@ SERIAL=$SERIAL ./cal-freq $dev
../ao-tools/ao-cal-accel/ao-cal-accel $dev
echo 'E 1' > $dev
+
+./test-telemega
+
+exit $?
diff --git a/ao-bringup/turnon_telemetrum b/ao-bringup/turnon_telemetrum
index 48ff1e27..ba40a08a 100755
--- a/ao-bringup/turnon_telemetrum
+++ b/ao-bringup/turnon_telemetrum
@@ -56,3 +56,7 @@ SERIAL=$SERIAL ./cal-freq $dev
../ao-tools/ao-cal-accel/ao-cal-accel $dev
echo 'E 1' > $dev
+
+./test-telemetrum
+
+exit $?