Initial Commit - Copy from Altus Metrum AltOS

This commit is contained in:
2024-06-25 19:03:04 +02:00
commit 13fc49c923
2048 changed files with 1206748 additions and 0 deletions

3
ao-bringup/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
ao_led_blink
ao_radio_xmit
cal_values

34
ao-bringup/ao_bringup.h Normal file
View File

@@ -0,0 +1,34 @@
/*
* Copyright © 2009 Keith Packard <keithp@keithp.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#ifndef _AO_BRINGUP_H_
#define _AO_BRINGUP_H_
#include <stdint.h>
#include <cc1111.h>
void
ao_radio_init(void);
void
ao_radio_idle(void);
void
ao_init(void);
#endif

29
ao-bringup/ao_init.c Normal file
View File

@@ -0,0 +1,29 @@
/*
* Copyright © 2009 Keith Packard <keithp@keithp.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "ao_bringup.h"
void
ao_init(void)
{
CLKCON = 0;
while (!(SLEEP & SLEEP_XOSC_STB))
;
P1 = 0;
P1DIR = 3;
}

51
ao-bringup/ao_led_blink.c Normal file
View File

@@ -0,0 +1,51 @@
/*
* Copyright © 2010 Keith Packard <keithp@keithp.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "ao_bringup.h"
#define nop() _asm nop _endasm;
void
delay (unsigned char n)
{
unsigned char i = 0, j = 0;
n <<= 1;
while (--n != 0)
while (--j != 0)
while (--i != 0)
nop();
}
main()
{
ao_init();
/* Set p1_0 and p1_1 to output */
P1DIR = 0x03;
P1INP = 0x00;
for (;;) {
P1 = 1;
delay(5);
P1 = 2;
delay(5);
P1 = 3;
delay(5);
P1 = 0;
delay(5);
}
}

252
ao-bringup/ao_radio_init.c Normal file
View File

@@ -0,0 +1,252 @@
/*
* Copyright © 2009 Keith Packard <keithp@keithp.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "ao_bringup.h"
/* Values from SmartRF® Studio for:
*
* Deviation: 20.507812 kHz
* Datarate: 38.360596 kBaud
* Modulation: GFSK
* RF Freq: 434.549927 MHz
* Channel: 99.975586 kHz
* Channel: 0
* RX filter: 93.75 kHz
*/
/*
* For 434.550MHz, the frequency value is:
*
* 434.550e6 / (24e6 / 2**16) = 1186611.2
*/
#define FREQ_CONTROL 1186611
/*
* For IF freq of 140.62kHz, the IF value is:
*
* 140.62e3 / (24e6 / 2**10) = 6
*/
#define IF_FREQ_CONTROL 6
/*
* For channel bandwidth of 93.75 kHz, the CHANBW_E and CHANBW_M values are
*
* BW = 24e6 / (8 * (4 + M) * 2 ** E)
*
* So, M = 0 and E = 3
*/
#define CHANBW_M 0
#define CHANBW_E 3
/*
* For a symbol rate of 38360kBaud, the DRATE_E and DRATE_M values are:
*
* R = (256 + M) * 2** E * 24e6 / 2**28
*
* So M is 163 and E is 10
*/
#define DRATE_E 10
#define DRATE_M 163
/*
* For a channel deviation of 20.5kHz, the DEVIATION_E and DEVIATION_M values are:
*
* F = 24e6/2**17 * (8 + DEVIATION_M) * 2**DEVIATION_E
*
* So M is 6 and E is 3
*/
#define DEVIATION_M 6
#define DEVIATION_E 3
/*
* For our RDF beacon, set the symbol rate to 2kBaud (for a 1kHz tone),
* so the DRATE_E and DRATE_M values are:
*
* M is 94 and E is 6
*
* To make the tone last for 200ms, we need 2000 * .2 = 400 bits or 50 bytes
*/
#define RDF_DRATE_E 6
#define RDF_DRATE_M 94
#define RDF_PACKET_LEN 50
/*
* RDF deviation should match the normal NFM value of 5kHz
*
* M is 6 and E is 1
*
*/
#define RDF_DEVIATION_M 6
#define RDF_DEVIATION_E 1
/* This are from the table for 433MHz */
#define RF_POWER_M30_DBM 0x12
#define RF_POWER_M20_DBM 0x0e
#define RF_POWER_M15_DBM 0x1d
#define RF_POWER_M10_DBM 0x34
#define RF_POWER_M5_DBM 0x2c
#define RF_POWER_0_DBM 0x60
#define RF_POWER_5_DBM 0x84
#define RF_POWER_7_DBM 0xc8
#define RF_POWER_10_DBM 0xc0
#define RF_POWER RF_POWER_10_DBM
static __code uint8_t radio_setup[] = {
RF_PA_TABLE7_OFF, RF_POWER,
RF_PA_TABLE6_OFF, RF_POWER,
RF_PA_TABLE5_OFF, RF_POWER,
RF_PA_TABLE4_OFF, RF_POWER,
RF_PA_TABLE3_OFF, RF_POWER,
RF_PA_TABLE2_OFF, RF_POWER,
RF_PA_TABLE1_OFF, RF_POWER,
RF_PA_TABLE0_OFF, RF_POWER,
RF_FREQ2_OFF, (FREQ_CONTROL >> 16) & 0xff,
RF_FREQ1_OFF, (FREQ_CONTROL >> 8) & 0xff,
RF_FREQ0_OFF, (FREQ_CONTROL) & 0xff,
RF_FSCTRL1_OFF, (IF_FREQ_CONTROL << RF_FSCTRL1_FREQ_IF_SHIFT),
RF_FSCTRL0_OFF, (0 << RF_FSCTRL0_FREQOFF_SHIFT),
RF_MDMCFG4_OFF, ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
(CHANBW_M << RF_MDMCFG4_CHANBW_M_SHIFT) |
(DRATE_E << RF_MDMCFG4_DRATE_E_SHIFT)),
RF_MDMCFG3_OFF, (DRATE_M << RF_MDMCFG3_DRATE_M_SHIFT),
RF_MDMCFG2_OFF, (RF_MDMCFG2_DEM_DCFILT_OFF |
RF_MDMCFG2_MOD_FORMAT_GFSK |
RF_MDMCFG2_SYNC_MODE_15_16_THRES),
RF_MDMCFG1_OFF, (RF_MDMCFG1_FEC_EN |
RF_MDMCFG1_NUM_PREAMBLE_4 |
(2 << RF_MDMCFG1_CHANSPC_E_SHIFT)),
RF_MDMCFG0_OFF, (17 << RF_MDMCFG0_CHANSPC_M_SHIFT),
RF_CHANNR_OFF, 0,
RF_DEVIATN_OFF, ((DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) |
(DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)),
/* SmartRF says set LODIV_BUF_CURRENT_TX to 0
* And, we're not using power ramping, so use PA_POWER 0
*/
RF_FREND0_OFF, ((1 << RF_FREND0_LODIV_BUF_CURRENT_TX_SHIFT) |
(0 << RF_FREND0_PA_POWER_SHIFT)),
RF_FREND1_OFF, ((1 << RF_FREND1_LNA_CURRENT_SHIFT) |
(1 << RF_FREND1_LNA2MIX_CURRENT_SHIFT) |
(1 << RF_FREND1_LODIV_BUF_CURRENT_RX_SHIFT) |
(2 << RF_FREND1_MIX_CURRENT_SHIFT)),
RF_FSCAL3_OFF, 0xE9,
RF_FSCAL2_OFF, 0x0A,
RF_FSCAL1_OFF, 0x00,
RF_FSCAL0_OFF, 0x1F,
RF_TEST2_OFF, 0x88,
RF_TEST1_OFF, 0x31,
RF_TEST0_OFF, 0x09,
/* default sync values */
RF_SYNC1_OFF, 0xD3,
RF_SYNC0_OFF, 0x91,
/* max packet length */
RF_PKTLEN_OFF, 64,
RF_PKTCTRL1_OFF, ((1 << PKTCTRL1_PQT_SHIFT)|
PKTCTRL1_APPEND_STATUS|
PKTCTRL1_ADR_CHK_NONE),
RF_PKTCTRL0_OFF, (RF_PKTCTRL0_WHITE_DATA|
RF_PKTCTRL0_PKT_FORMAT_NORMAL|
RF_PKTCTRL0_CRC_EN|
RF_PKTCTRL0_LENGTH_CONFIG_FIXED),
RF_ADDR_OFF, 0x00,
RF_MCSM2_OFF, (RF_MCSM2_RX_TIME_END_OF_PACKET),
RF_MCSM1_OFF, (RF_MCSM1_CCA_MODE_RSSI_BELOW_UNLESS_RECEIVING|
RF_MCSM1_RXOFF_MODE_IDLE|
RF_MCSM1_TXOFF_MODE_IDLE),
RF_MCSM0_OFF, (RF_MCSM0_FS_AUTOCAL_FROM_IDLE|
RF_MCSM0_MAGIC_3|
RF_MCSM0_CLOSE_IN_RX_0DB),
RF_FOCCFG_OFF, (RF_FOCCFG_FOC_PRE_K_3K,
RF_FOCCFG_FOC_POST_K_PRE_K,
RF_FOCCFG_FOC_LIMIT_BW_OVER_4),
RF_BSCFG_OFF, (RF_BSCFG_BS_PRE_K_2K|
RF_BSCFG_BS_PRE_KP_3KP|
RF_BSCFG_BS_POST_KI_PRE_KI|
RF_BSCFG_BS_POST_KP_PRE_KP|
RF_BSCFG_BS_LIMIT_0),
RF_AGCCTRL2_OFF, 0x43,
RF_AGCCTRL1_OFF, 0x40,
RF_AGCCTRL0_OFF, 0x91,
RF_IOCFG2_OFF, 0x00,
RF_IOCFG1_OFF, 0x00,
RF_IOCFG0_OFF, 0x00,
RF_MDMCFG4_OFF, ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
(CHANBW_M << RF_MDMCFG4_CHANBW_M_SHIFT) |
(DRATE_E << RF_MDMCFG4_DRATE_E_SHIFT)),
RF_MDMCFG3_OFF, (DRATE_M << RF_MDMCFG3_DRATE_M_SHIFT),
RF_MDMCFG2_OFF, (RF_MDMCFG2_DEM_DCFILT_OFF |
RF_MDMCFG2_MOD_FORMAT_GFSK |
RF_MDMCFG2_SYNC_MODE_15_16_THRES),
RF_MDMCFG1_OFF, (RF_MDMCFG1_FEC_EN |
RF_MDMCFG1_NUM_PREAMBLE_4 |
(2 << RF_MDMCFG1_CHANSPC_E_SHIFT)),
RF_DEVIATN_OFF, ((DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) |
(DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)),
/* max packet length */
RF_PKTLEN_OFF, 0xff,
RF_PKTCTRL1_OFF, ((1 << PKTCTRL1_PQT_SHIFT)|
PKTCTRL1_APPEND_STATUS|
PKTCTRL1_ADR_CHK_NONE),
RF_PKTCTRL0_OFF, (RF_PKTCTRL0_WHITE_DATA|
RF_PKTCTRL0_PKT_FORMAT_NORMAL|
RF_PKTCTRL0_CRC_EN|
RF_PKTCTRL0_LENGTH_CONFIG_FIXED),
};
void
ao_radio_idle(void)
{
if (RF_MARCSTATE != RF_MARCSTATE_IDLE)
{
RFST = RFST_SIDLE;
do {
;
} while (RF_MARCSTATE != RF_MARCSTATE_IDLE);
}
}
void
ao_radio_init(void) {
uint8_t i;
for (i = 0; i < sizeof (radio_setup); i += 2)
RF[radio_setup[i]] = radio_setup[i+1];
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright © 2009 Keith Packard <keithp@keithp.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "ao_bringup.h"

View File

@@ -0,0 +1,29 @@
/*
* Copyright © 2009 Keith Packard <keithp@keithp.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "ao_bringup.h"
main ()
{
ao_init();
ao_radio_init();
ao_radio_idle();
RFST = RFST_STX;
P1 = 1;
for (;;);
}

25
ao-bringup/cal-freq Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
case $# in
1)
dev="$1"
;;
*)
echo "Usage: $0 <device>"
exit 1;
;;
esac
../ao-tools/ao-cal-freq/ao-cal-freq --tty=$dev
case $? in
0)
calline=`./get-radio-cal $dev`
CAL_VALUE=`echo $calline | awk '{print $2}'`
CURRENT_FREQ=`echo $calline | awk '{print $4}'`
echo $SERIAL","$CAL_VALUE >> cal_values
exit 0
;;
*)
exit 1
;;
esac

52
ao-bringup/fix-telebt Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/sh
VERSION=4.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleBT
ALTOS_FILE=$REPO/telebt-v$VERSION-*.elf
if [ -x /usr/bin/ao-usbload ]; then
USBLOAD=/usr/bin/ao-usbload
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
dev_serial=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { printf("%s %s\n", $3, $2); exit(0); }'`
dev=`echo $dev_serial | awk '{print $1;}'`
serial=`echo $dev_serial | awk '{print $2;}'`
case "$dev" in
/dev/tty*)
;;
*)
echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
exit 1
;;
esac
rfcal=`wget -O - -q 'http://altusmetrum.org/cgi-bin/unitinfo.cgi?sn='$serial | jq '.unitinfo.rfcal | tonumber'`
case $? in
0)
;;
*)
echo "Fetch rfcal for $serial failed"
exit 1
;;
esac
case "$rfcal" in
[0-9]*)
;;
*)
echo "Serial $serial: invalid rfcal $rfcal"
;;
esac
echo "$PRODUCT"'-v'"$VERSION $serial $dev rfcal $rfcal"
$USBLOAD --cal=$rfcal --tty=$dev $ALTOS_FILE || exit 1
echo "$PRODUCT"'-v'"$VERSION $serial $dev is ready to ship"

66
ao-bringup/get-radio-cal Executable file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/nickle
import File;
string timed_read(file f, int timeout) {
thread reader = fork func() { try { return fgets(f); } catch Thread::signal(int i) { return ""; } }();
thread killer = fork func() { sleep (timeout); Thread::send_signal(reader, 1); }();
poly v = Thread::join(reader);
if (is_string(v))
return v;
return "";
}
void flush_input(file f) {
for (;;) {
string s = timed_read(f, 100);
if (s == "")
break;
}
}
string[*] settings(file f) {
string[...] x = {};
flush_input(f);
fprintf (f, "c s\nv\n");
flush(f);
for (;;) {
string l = File::fgets(f);
x[dim(x)] = l;
if (String::index(l, "software-version") == 0)
break;
}
return x;
}
string[*] find_setting(string[*] s, string match) {
for (int i = 0; i < dim(s); i++)
if (String::index(s[i], match) == 0)
return String::split(s[i], " ");
return (string[*]) {};
}
int[*]
get_radio (file f) {
string[*] s = settings(f);
string[*] cal = find_setting(s, "Radio cal:");
string[*] freq = find_setting(s, "Frequency:");
if (dim(cal) == 0 || dim(freq) == 0)
return (int[2]) { 0, 0 };
int cal_val = string_to_integer(cal[2]);
int freq_val = string_to_integer(freq[1]);
return (int[2]) { cal_val, freq_val };
}
void main () {
string name = argv[1];
file f = open(name, "r+");
int[*] vals = get_radio(f);
printf ("cal %d freq %f\n", vals[0], vals[1] / 1000);
}
main();

4
ao-bringup/telemega.cfg Normal file
View File

@@ -0,0 +1,4 @@
# openocd config for TeleMega using the Olimex ARM-USB-OCD dongle
source /opt/stm32/share/openocd/scripts/interface/olimex-arm-usb-ocd.cfg
source /opt/stm32/share/openocd/scripts/target/stm32l.cfg

2
ao-bringup/telemega.gdb Normal file
View File

@@ -0,0 +1,2 @@
target remote localhost:3333
monitor poll

99
ao-bringup/test-baro Executable file
View File

@@ -0,0 +1,99 @@
#!/usr/bin/nickle
import File;
string timed_read(file f, int timeout) {
thread reader = fork func() {
try {
return fgets(f);
} catch Thread::signal(int i) {
return "";
}
}();
thread killer = fork func() {
try {
sleep (timeout);
Thread::send_signal(reader, 1);
} catch Thread::signal(int i) {
return;
}
}();
poly v = Thread::join(reader);
Thread::send_signal(killer, 1);
Thread::join(killer);
if (is_string(v))
return v;
return "";
}
void flush_input(file f) {
for (;;) {
string s = timed_read(f, 200);
if (s == "")
break;
}
}
string[*] baro(file f) {
string[...] x = {};
flush_input(f);
fprintf (f, "B\n");
flush(f);
for (;;) {
string l = timed_read(f, 1000);
if (l == "") {
File::fprintf(stderr, "read timedout\n");
exit(1);
}
x[dim(x)] = l;
if (String::index(l, "Altitude:") == 0)
break;
}
return x;
}
string[*] find_baro(string[*] s, string match) {
for (int i = 0; i < dim(s); i++)
if (String::index(s[i], match) >= 0)
return String::wordsplit(s[i], " ");
return (string[*]) {};
}
bool
do_baro(file f) {
string[*] i = baro(f);
string[*] temp = find_baro(i, "Temperature");
string[*] alt = find_baro(i, "Altitude");
real temperature = string_to_integer(temp[2]) / 100.0;
real altitude = string_to_integer(alt[1]);
if (altitude < -50 || 3000 < altitude) {
printf ("weird altitude %f\n", altitude);
return false;
}
if (temperature < 20 || 30 < temperature) {
printf ("weird temperature %f\n", temperature);
return false;
}
printf ("altitude %f temperature %f\n", altitude, temperature);
return true;
}
void main () {
string name = argv[1];
file f = open(name, "r+");
bool ret = true;
if (!do_baro(f))
ret = false;
exit (ret? 0 : 1);
}
main();

97
ao-bringup/test-chaoskey Executable file
View File

@@ -0,0 +1,97 @@
#!/bin/bash
snum="unknown"
case "$#" in
1)
case "$1" in
"-?"|"--help")
echo "Usage: $0 [serial]"
exit 0
;;
esac
snum="$1"
serial="--serial $1"
;;
0)
snum=`sudo dmesg -t | awk '/usb.*Product:/ { ck = index($0, "ChaosKey"); }
/usb.*SerialNumber:/ { if (ck) print $4; }' | tail -1`
case "$snum" in
"")
serial=""
;;
*)
serial="--serial $snum"
;;
esac
;;
*)
echo "Usage: $0 [serial]"
exit 1
;;
esac
echo -e '\e[34mTesting ChaosKey' $snum '\e[39m'
tests="0:100 1:100 2:100 3:100 12:10 13:100 15:10000 16:250 202:1000 203:100 204:500 206:20 207:1000:32 209:1000"
PASS=0
FAIL=0
WEAK=0
chaosread $serial --infinite --bytes | for test in $tests done; do
case $test in
*:*:*)
dnum=`echo $test | sed 's/:.*$//'`
tnum=`echo $test | sed 's/^[^:]*://'`
tnum=`echo $test | sed 's/^[^:]*://' | sed 's/:.*$//'`
nnum=`echo $test | sed 's/^.*://'`
opts="-d $dnum -t $tnum -n $nnum"
;;
*:*)
dnum=`echo $test | sed 's/:.*$//'`
tnum=`echo $test | sed 's/^.*://'`
opts="-d $dnum -t $tnum"
;;
*)
dnum=$test
opts="-d $dnum"
;;
esac
case $dnum in
done)
echo DONE
;;
*)
echo TEST $dnum
dieharder -g 200 $opts
;;
esac
done | while read result; do
case "$result" in
TEST*)
testnum=`echo $result | sed 's/TEST //'`
;;
*PASSED*)
PASS=`expr $PASS + 1`
;;
*WEAK*)
WEAK=`expr $WEAK + 1`
;;
*FAILED*)
echo test $testnum failed
FAIL=`expr $FAIL + 1`
;;
DONE)
echo pass $PASS weak $WEAK fail $FAIL
case $PASS:$FAIL in
[1-9]*:0)
echo -e '\e[32m'ChaosKey $snum is ready to ship'\e[39m'
exit 0
;;
*)
echo -e '\e[31m'ChaosKey $snum failed'\e[39m'
exit 1
;;
esac
;;
esac
done

55
ao-bringup/test-easymega Executable file
View File

@@ -0,0 +1,55 @@
#!/bin/sh
VERSION=2.0
PRODUCT=EasyMega
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2018 by Bdale Garbee. 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 --rplus=100 --rminus=27 --adcmax=4095 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 "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
ret=0
;;
esac
done

55
ao-bringup/test-easymega-v1.0 Executable file
View File

@@ -0,0 +1,55 @@
#!/bin/sh
VERSION=1.0
PRODUCT=EasyMega
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-tools/ao-list/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 0 1 2 3
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 "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
ret=0
;;
esac
done

62
ao-bringup/test-easymini Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
VERSION=2.0
PRODUCT=EasyMini
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 -e "\t$PRODUCT v$VERSION powered from USB"
echo
found=0
while [ $found -eq 0 ]; do
(ao-list; echo END END END END) | while read product serial dev; do
case "$product" in
"$PRODUCT-v$VERSION")
found=1
echo -e '\e[34m'Testing $product $serial $dev'\e[39m'
echo ""
sleep 0.25
./test-igniters-nowait "$dev" --rplus=100 --rminus=27 --adcmax=32767 drogue main
echo ""
echo "Testing baro sensor"
../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
if [ $? -ne 0 ]; then
echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
exit 1
fi
echo""
FLASHSIZE=1048576
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
if [ $? -ne 0 ]; then
echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
exit 1
fi
echo ""
echo -e '\e[32m'"$PRODUCT-v$VERSION" serial "$serial" is ready to ship'\e[39m'
exit 0
;;
END)
exit 2
;;
esac
done
result=$?
if [ $result -ne 2 ]; then
exit $result
fi
sleep 0.25
done

62
ao-bringup/test-easymini-v1.0 Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
VERSION=1.0
PRODUCT=EasyMini
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 -e "\t$PRODUCT v$VERSION powered from USB"
echo
found=0
while [ $found -eq 0 ]; do
(ao-list; echo END END END END) | while read product serial dev; do
case "$product" in
"$PRODUCT-v$VERSION")
found=1
echo -e '\e[34m'Testing $product $serial $dev'\e[39m'
echo ""
sleep 2
./test-igniters-nowait "$dev" drogue main
echo ""
echo "Testing baro sensor"
../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
if [ $? -ne 0 ]; then
echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
exit 1
fi
echo""
FLASHSIZE=1048576
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
if [ $? -ne 0 ]; then
echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
exit 1
fi
echo ""
echo -e '\e[32m'"$PRODUCT-v$VERSION" serial "$serial" is ready to ship'\e[39m'
exit 0
;;
END)
exit 2
;;
esac
done
result=$?
if [ $result -ne 2 ]; then
exit $result
fi
sleep 0.25
done

62
ao-bringup/test-easymini-v3.0 Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
VERSION=3.0
PRODUCT=EasyMini
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2022 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo -e "\t$PRODUCT v$VERSION powered from USB"
echo
found=0
while [ $found -eq 0 ]; do
(ao-list; echo END END END END) | while read product serial dev; do
case "$product" in
"$PRODUCT-v$VERSION")
found=1
echo -e '\e[34m'Testing $product $serial $dev'\e[39m'
echo ""
sleep 2
./test-igniters-nowait "$dev" drogue main
echo ""
echo "Testing baro sensor"
../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
if [ $? -ne 0 ]; then
echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
exit 1
fi
echo""
FLASHSIZE=1048576
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
if [ $? -ne 0 ]; then
echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
exit 1
fi
echo ""
echo -e '\e[32m'"$PRODUCT-v$VERSION" serial "$serial" is ready to ship'\e[39m'
exit 0
;;
END)
exit 2
;;
esac
done
result=$?
if [ $result -ne 2 ]; then
exit $result
fi
sleep 0.25
done

46
ao-bringup/test-easymotor-v3 Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/sh
VERSION=3
PRODUCT=EasyMotor
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2022 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo "\t\tand precision 2:1 resistor divider feeding pressure input from 5V out"
echo
ret=1
ao-list | while read product serial dev; do
case "$product" in
"$PRODUCT-v$VERSION")
echo "Testing $product $serial $dev"
echo ""
FLASHSIZE=8388608
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
echo ""
echo "Testing pressure sensor input"
../ao-tools/ao-test-pressure/ao-test-pressure --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

38
ao-bringup/test-easytimer Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
VERSION=1
PRODUCT=EasyTimer
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2020 by Bdale Garbee. Released under GPL v3"
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 0 1
echo""
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo""
echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
echo "\007"
ret=0
;;
esac
done

101
ao-bringup/test-flash Executable file
View File

@@ -0,0 +1,101 @@
#!/usr/bin/nickle
import File;
string timed_read(file f, int timeout) {
thread reader = fork func() {
try {
return fgets(f);
} catch Thread::signal(int i) {
return "";
}
}();
thread killer = fork func() {
try {
sleep (timeout);
Thread::send_signal(reader, 1);
} catch Thread::signal(int i) {
return;
}
}();
poly v = Thread::join(reader);
Thread::send_signal(killer, 1);
Thread::join(killer);
if (is_string(v))
return v;
return "";
}
void flush_input(file f) {
for (;;) {
string s = timed_read(f, 200);
if (s == "")
break;
}
}
string[*] flash(file f) {
string[...] x = {};
flush_input(f);
fprintf (f, "f\nv\n");
flush(f);
for (;;) {
string l = timed_read(f, 1000);
if (l == "") {
File::fprintf(stderr, "Read timedout\n");
exit(1);
}
x[dim(x)] = l;
if (String::index(l, "software-version") == 0)
break;
}
return x;
}
string[*] find_flash(string[*] s, string match) {
for (int i = 0; i < dim(s); i++)
if (String::index(s[i], match) >= 0)
return String::wordsplit(s[i], " ");
return (string[*]) {};
}
bool
do_flash(file f, int expected_size) {
string[*] i = flash(f);
string[*] size = find_flash(i, "Storage size:");
string[*] erase = find_flash(i, "Storage erase unit:");
int actual_size = string_to_integer(size[2]);
if (actual_size != expected_size) {
printf ("weird flash size %d != %d\n", actual_size, expected_size);
return false;
}
int actual_erase = string_to_integer(erase[3]);
if (actual_erase != 65536) {
printf ("weird erase size %d\n", actual_erase);
return false;
}
printf ("flash size %d erase block %d\n", actual_size, actual_erase);
return true;
}
void main () {
string name = argv[1];
string size = argv[2];
file f = open(name, "r+");
bool ret = true;
if (!do_flash(f, string_to_integer(size)))
ret = false;
exit (ret? 0 : 1);
}
main();

103
ao-bringup/test-gps Executable file
View File

@@ -0,0 +1,103 @@
#!/usr/bin/nickle
import File;
string timed_read(file f, int timeout) {
thread reader = fork func() {
try {
return fgets(f);
} catch Thread::signal(int i) {
return "";
}
}();
thread killer = fork func() {
try {
sleep (timeout);
Thread::send_signal(reader, 1);
} catch Thread::signal(int i) {
return;
}
}();
poly v = Thread::join(reader);
Thread::send_signal(killer, 1);
Thread::join(killer);
if (is_string(v))
return v;
return "";
}
void flush_input(file f) {
for (;;) {
string s = timed_read(f, 200);
if (s == "")
break;
}
}
string[*] gps(file f) {
string[...] x = {};
flush_input(f);
fprintf (f, "g\nv\n");
flush(f);
for (;;) {
string l = timed_read(f, 1000);
if (l == "") {
File::fprintf(stderr, "Read timedout\n");
exit(1);
}
x[dim(x)] = l;
if (String::index(l, "software-version") == 0)
break;
}
return x;
}
string[*] find_gps(string[*] s, string match) {
for (int i = 0; i < dim(s); i++)
if (String::index(s[i], match) >= 0)
return String::wordsplit(s[i], " ");
return (string[*]) {};
}
bool
do_gps(file f) {
string[*] i = gps(f);
string[*] flags = find_gps(i, "Flags:");
string[*] sats = find_gps(i, "Sats:");
int actual_flags = string_to_integer(flags[1]);
int actual_sats = string_to_integer(sats[1]);
while ((actual_flags & (1 << 4)) == 0) {
printf("Flags: %s\n", flags[1]);
printf("Sats: %s\n", sats[1]);
sleep(1000);
i = gps(f);
flags = find_gps(i, "Flags:");
sats = find_gps(i, "Sats:");
actual_flags = string_to_integer(flags[1]);
}
printf("Flags: %s\n", flags[1]);
printf("Sats: %s\n", sats[1]);
printf("GPS locked\n");
return true;
}
void main () {
string name = argv[1];
file f = open(name, "r+");
bool ret = true;
if (!do_gps(f))
ret = false;
exit (ret? 0 : 1);
}
main();

136
ao-bringup/test-igniter Executable file
View File

@@ -0,0 +1,136 @@
#!/usr/bin/nickle
import File;
string timed_read(file f, int timeout) {
thread reader = fork func() {
try {
return fgets(f);
} catch Thread::signal(int i) {
return "";
}
}();
thread killer = fork func() {
try {
sleep (timeout);
Thread::send_signal(reader, 1);
} catch Thread::signal(int i) {
return;
}
}();
poly v = Thread::join(reader);
Thread::send_signal(killer, 1);
Thread::join(killer);
if (is_string(v))
return v;
return "";
}
void flush_input(file f) {
for (;;) {
string s = timed_read(f, 200);
if (s == "")
break;
}
}
string[*] settings(file f) {
string[...] x = {};
flush_input(f);
fprintf (f, "c s\nv\n");
flush(f);
for (;;) {
string l = File::fgets(f);
x[dim(x)] = l;
if (String::index(l, "software-version") == 0)
break;
}
return x;
}
string[*] find_setting(string[*] s, string match) {
for (int i = 0; i < dim(s); i++)
if (String::index(s[i], match) == 0)
return String::wordsplit(s[i], " ");
return (string[*]) {};
}
string[*] igniters(file f) {
string[...] x = {};
flush_input(f);
fprintf (f, "t\nv\n");
flush(f);
for (;;) {
string l = File::fgets(f);
x[dim(x)] = l;
if (String::index(l, "software-version") == 0)
break;
}
return x;
}
string[*] find_igniter(string[*] s, string match) {
for (int i = 0; i < dim(s); i++)
if (String::index(s[i], match) >= 0)
return String::wordsplit(s[i], " ");
return (string[*]) {};
}
bool
do_igniter(file f, string igniter) {
string[*] i = igniters(f);
string[*] status = find_igniter(i, igniter);
if (dim(status) < 4) {
printf ("no igniter %s found in %v\n", igniter, i);
return false;
}
if (String::index(status[3], "ready") < 0) {
printf("igniter %s status is \"%s\"\n", igniter, status[3]);
return false;
}
fprintf(f, "i DoIt %s\n", igniter);
flush(f);
flush_input(f);
return true;
}
file
open_tty(string name)
{
int i = 0;
for (;;) {
try {
return open (name, "r+");
} catch open_error(string error, File::error_type error, string name) {
if (error == File::error_type.BUSY) {
if (i < 30) {
printf ("waiting for %s to be usable\n", name);
sleep(2000);
continue;
}
} else {
printf ("%s: %s\n", name, error);
exit(1);
}
}
}
}
void main () {
string name = argv[1];
string[dim(argv)-2] igniters = { [i] = argv[i+2] };
file f = open_tty(name);
bool ret = true;
for (int i = 0; i < dim(igniters); i++) {
if (!do_igniter(f, igniters[i]))
ret = false;
}
exit (ret? 0 : 1);
}
main();

33
ao-bringup/test-igniters Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
dev="$1"
shift
args=""
for igniter in "$@"; do
case "$igniter" in
-*)
args="$args $igniter"
;;
*)
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" $args $igniter
case $? in
0)
echo "pass"
pass="y"
;;
*)
echo "Failed. Try again."
;;
esac
done
;;
esac
done
exit 0

34
ao-bringup/test-igniters-nowait Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
dev="$1"
shift
args=""
for igniter in "$@"; do
case "$igniter" in
-*)
args="$args $igniter"
;;
*)
pass="n"
while [ $pass != "y" ]; do
echo "Testing $igniter igniter."
../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" $args $igniter
case $? in
0)
echo "pass"
pass="y"
;;
*)
echo -n "Failed. Try again. Press enter to continue..."
read foo < /dev/tty
;;
esac
done
;;
esac
done
exit 0

52
ao-bringup/test-telegps-v1 Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/sh
VERSION=1.0
PRODUCT=TeleGPS
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2014 by Bdale Garbee. 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"
FLASHSIZE=2097152
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo "Testing GPS"
../ao-tools/ao-test-gps/ao-test-gps --tty="$dev"
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo "$PRODUCT-v$VERSION" serial "$serial" passed functional tests
ret=0
;;
*)
echo "Skipping $product $serial $dev"
;;
esac
done

52
ao-bringup/test-telegps-v2 Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/sh
VERSION=2.0
PRODUCT=TeleGPS
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2014 by Bdale Garbee. 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"
FLASHSIZE=2097152
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo "Testing GPS"
../ao-tools/ao-test-gps/ao-test-gps --tty="$dev"
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo "$PRODUCT-v$VERSION" serial "$serial" passed functional tests
ret=0
;;
*)
echo "Skipping $product $serial $dev"
;;
esac
done

53
ao-bringup/test-telegps-v3 Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/sh
VERSION=3.0
PRODUCT=TeleGPS
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2023 by Bdale Garbee. Released under GPL v3"
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"
FLASHSIZE=2097152
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo "Testing GPS"
../ao-tools/ao-test-gps/ao-test-gps --tty="$dev"
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
echo "\007"
ret=0
;;
*)
echo "Skipping $product $serial $dev"
;;
esac
done

66
ao-bringup/test-telemega-v1.0 Executable file
View File

@@ -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

67
ao-bringup/test-telemega-v2.0 Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
VERSION=2.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
echo "\007"
ret=0
;;
esac
done

67
ao-bringup/test-telemega-v3.0 Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
VERSION=3.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
echo "\007"
ret=0
;;
esac
done

67
ao-bringup/test-telemega-v4.0 Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
VERSION=4.0
PRODUCT=TeleMega
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2020 by Bdale Garbee. Released under GPL v3"
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 --rplus=100 --rminus=27 --adcmax=4095 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
echo "\007"
ret=0
;;
esac
done

67
ao-bringup/test-telemega-v5.0 Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
VERSION=5.0
PRODUCT=TeleMega
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2021 by Bdale Garbee. Released under GPL v3"
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 --rplus=100 --rminus=27 --adcmax=4095 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
echo "\007"
ret=0
;;
esac
done

67
ao-bringup/test-telemega-v6.0 Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
VERSION=6.0
PRODUCT=TeleMega
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2023 by Bdale Garbee. Released under GPL v3"
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 --rplus=100 --rminus=27 --adcmax=4095 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
echo "\007"
ret=0
;;
esac
done

68
ao-bringup/test-telemetrum-v2.0 Executable file
View File

@@ -0,0 +1,68 @@
#!/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
echo "\007"
ret=0
;;
esac
done

68
ao-bringup/test-telemetrum-v3.0 Executable file
View File

@@ -0,0 +1,68 @@
#!/bin/sh
VERSION=3.0
PRODUCT=TeleMetrum
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2019 by Bdale Garbee. 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" --rplus=100 --rminus=27 --adcmax=4095 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
echo "\007"
ret=0
;;
esac
done

68
ao-bringup/test-telemetrum-v4.0 Executable file
View File

@@ -0,0 +1,68 @@
#!/bin/sh
VERSION=4.0
PRODUCT=TeleMetrum
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2023 by Bdale Garbee. 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" --rplus=100 --rminus=27 --adcmax=4095 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
echo "\007"
ret=0
;;
esac
done

56
ao-bringup/test-telemini Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/sh
VERSION=3.0
PRODUCT=TeleMini
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo "$PRODUCT-v$VERSION Test Program"
echo "Copyright 2017 by Keith Packard. Released under GPL v2 or later"
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" --rplus=100 --rminus=27 --adcmax=4095 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=524288
echo "Testing flash"
../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
case $? in
0)
;;
*)
echo "failed"
exit 1
esac
echo""
echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
echo "\007"
ret=0
;;
esac
done

17
ao-bringup/testplan Normal file
View File

@@ -0,0 +1,17 @@
Low level hardware tests
* cpu
* barometer
* accelerometer
* flash
* gps
* igniter continuity
* igniters
* radio calibration
* led
Higher level tests
* USB serial communication
* memory flashing
* reading/writing eeprom

40
ao-bringup/turnon_chaoskey Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/sh
if [ -x `which dfu-util` ]; then
DFU_UTIL=`which 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/chaoskey-v1.0-all-*.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 3
./test-chaoskey
exit $?

79
ao-bringup/turnon_easymega Executable file
View File

@@ -0,0 +1,79 @@
#!/bin/sh
PRODUCT=EasyMega
VERSION=2.0
REPO=~/altusmetrumllc/Binaries
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2018 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION"
echo "\t\twith USB cable attached"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/easymega-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL $REPO/easymega-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "$PRODUCT found on $dev"
;;
*)
echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-easymega
exit $?

76
ao-bringup/turnon_easymega_v1.0 Executable file
View File

@@ -0,0 +1,76 @@
#!/bin/sh
PRODUCT=EasyMega
if [ -x ../ao-tools/ao-flash/ao-flash-stm ]; then
STMLOAD=../ao-tools/ao-flash/ao-flash-stm
else
echo "Can't find ao-flash-stm! Aborting."
exit 1
fi
if [ -x ../ao-tools/ao-usbload/ao-usbload ]; then
USBLOAD=../ao-tools/ao-usbload/ao-usbload
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
VERSION=1.0
REPO=~/altusmetrumllc/Binaries
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION"
echo "\t\twith USB cable attached"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $STMLOAD
$STMLOAD $REPO/loaders/easymega-v$VERSION*.elf || exit 1
sleep 2
$USBLOAD --serial=$SERIAL $REPO/easymega-v$VERSION*.elf || exit 1
sleep 2
dev=`../ao-tools/ao-list/ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "$PRODUCT found on $dev"
;;
*)
echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
../ao-tools/ao-cal-accel/ao-cal-accel $dev || exit 1
echo 'E 1' > $dev
./test-easymega-v1.0
exit $?

69
ao-bringup/turnon_easymini Executable file
View File

@@ -0,0 +1,69 @@
#!/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 ../ao-tools/ao-usbload/ao-usbload ]; then
USBLOAD=../ao-tools/ao-usbload/ao-usbload
elif [ -x /usr/bin/ao-usbload ]; then
USBLOAD=/usr/bin/ao-usbload
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
VERSION=3.0
PRODUCT=EasyMini
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo $FILE
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2022 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
#
# Use released versions of everything
#
FLASH_FILE=~/altusmetrumllc/Binaries/loaders/easymini-v3.0-altos-flash-*.elf
ALTOS_FILE=~/altusmetrumllc/Binaries/easymini-v3.0-*.elf
echo $FLASH_LPC $FLASH_FILE
$FLASH_LPC $FLASH_FILE || exit 1
sleep 1
echo $USBLOAD $ALTOS_FILE
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 1
./test-easymini-v3.0
exit $?

72
ao-bringup/turnon_easymini_v1.0 Executable file
View File

@@ -0,0 +1,72 @@
#!/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 ../ao-tools/ao-usbload/ao-usbload ]; then
USBLOAD=../ao-tools/ao-usbload/ao-usbload
elif [ -x /usr/bin/ao-usbload ]; then
USBLOAD=/usr/bin/ao-usbload
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
VERSION=1.0
PRODUCT=EasyMini
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo $FILE
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2010 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
#
# Use released versions of everything
#
FLASH_FILE=~/altusmetrumllc/Binaries/loaders/easymini-v1.0-altos-flash-*.elf
ALTOS_FILE=~/altusmetrumllc/Binaries/easymini-v1.0-*.elf
#FLASH_FILE=../src/$BASE-v$VERSION/flash-loader/$BASE-v$VERSION-altos-flash-*.elf
#ALTOS_FILE=../src/$BASE-v$VERSION/*.ihx
echo $FLASH_LPC $FLASH_FILE
$FLASH_LPC $FLASH_FILE || exit 1
sleep 1
echo $USBLOAD $ALTOS_FILE
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 1
./test-easymini-v1.0
exit $?

94
ao-bringup/turnon_easymotor Executable file
View File

@@ -0,0 +1,94 @@
#!/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 ../ao-tools/ao-usbload/ao-usbload ]; then
USBLOAD=../ao-tools/ao-usbload/ao-usbload
elif [ -x /usr/bin/ao-usbload ]; then
USBLOAD=/usr/bin/ao-usbload
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
VERSION=3
PRODUCT=EasyMotor
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo $FILE
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2022 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo "\t\tand precision 2:1 resistor divider feeding pressure input from 5V out"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
otootor
#
# Use released versions of everything
#
FLASH_FILE=~/altusmetrumllc/Binaries/loaders/easymotor-v3-altos-flash-*.elf
ALTOS_FILE=~/altusmetrumllc/Binaries/easymotor-v3-*.elf
echo $FLASH_LPC $FLASH_FILE
$FLASH_LPC $FLASH_FILE || exit 1
sleep 1
echo $USBLOAD $ALTOS_FILE
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 2
dev=`ao-list | awk '/EasyMotor-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "EasyMotor found on $dev"
;;
*)
echo 'No EasyMotor-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
sleep 1
./test-easymotor-v3
exit $?

78
ao-bringup/turnon_easytimer Executable file
View File

@@ -0,0 +1,78 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=1
REPO=~/altusmetrumllc/Binaries
PRODUCT=EasyTimer
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2020 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/easytimer-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL --force $REPO/easytimer-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/EasyTimer-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "EasyTimer found on $dev"
;;
*)
echo 'No EasyTimer-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-easytimer
exit $?

96
ao-bringup/turnon_telebt Executable file
View File

@@ -0,0 +1,96 @@
#!/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 /usr/bin/ao-usbload ]; then
USBLOAD=/usr/bin/ao-usbload
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
VERSION=4.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleBT
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2017 by Bdale Garbee. Released under GPL v3+"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION attached by USB"
echo "\t\twith coax from UHF to frequency counter"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
FLASH_FILE=$REPO/loaders/telebt-v$VERSION-altos-flash-*.bin
ALTOS_FILE=$REPO/telebt-v$VERSION-*.elf
$DFU_UTIL -a 0 -s 0x08000000:leave -D $FLASH_FILE
sleep 2
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 3
dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "$PRODUCT found on $dev"
;;
*)
echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
exit 1
;;
esac
CALFILE=cal-$SERIAL.txt
../ao-tools/ao-cal-freq/ao-cal-freq --nosave --output=$CALFILE --tty=$dev
CAL_VALUE=`cat $CALFILE`
echo $SERIAL","$CAL_VALUE >> cal_values
echo "Reflashing with calibration: $CAL_VALUE"
$USBLOAD --cal=$CAL_VALUE --tty=$dev $ALTOS_FILE || exit 1
echo -n "checking BlueTooth functionality... "
btdev=`hcitool scan | awk -F \- '/TeleBT/ { print $2 }'`
if [ "$btdev" = "$SERIAL" ]; then
echo "working!"
else
echo "device not found"
exit 1
fi
echo -n "checking BTLE functionality... "
btdev=`sudo timeout -s SIGINT 5s hcitool lescan | awk -F \- '/TeleBT/ { print $2 }' | head -n 1`
if [ "$btdev" = "$SERIAL" ]; then
echo "working!"
else
echo "device not found"
exit 1
fi
echo "$PRODUCT-v$VERSION $SERIAL is ready to ship"
exit $?

62
ao-bringup/turnon_telebt_v1 Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/sh
if [ -x ../ao-tools/ao-load/ao-load ]; then
AOLOAD=../ao-tools/ao-load/ao-load
elif [ -x /usr/bin/ao-load ]; then
AOLOAD=/usr/bin/ao-load
else
echo "Can't find ao-load! Aborting."
exit 1
fi
if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
RAWLOAD=../ao-tools/ao-rawload/ao-rawload
elif [ -x /usr/bin/ao-rawload ]; then
RAWLOAD=/usr/bin/ao-rawload
else
echo "Can't find ao-rawload! Aborting."
exit 1
fi
echo "TeleBT v1.1 Turn-On and Calibration Program"
echo "Copyright 2013 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\tTeleBT v1.1 powered from USB"
echo "\t\twith TeleDonlge (on /dev/ttyACM0) cabled to debug header"
echo "\t\twith coax from SMA to frequency counter"
echo
echo -n "TeleBT serial number: "
read SERIAL
echo $RAWLOAD
case $USER in
bdale)
DONGLE=100
;;
keithp)
DONGLE=186
;;
*)
echo "Unknow user"
exit 1
;;
esac
$RAWLOAD -D $DONGLE -r ao_led_blink.ihx
echo "LEDs should be blinking"
sleep 5
$RAWLOAD -D $DONGLE -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 $DONGLE --cal $CAL_VALUE ~/altusmetrumllc/Binaries/telebt-v1.0*.ihx $SERIAL
echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
echo $SERIAL","$CAL_VALUE >> cal_values
echo "Unplug debug cable, power cycle, cu to the board, confirm freq and record power"

70
ao-bringup/turnon_telebt_v3 Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=3.0
REPO=~/altusmetrumllc/Binaries
echo "TeleBT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2015 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\tTeleBT 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 "TeleBT-$VERSION serial number: "
read SERIAL
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telebt-v$VERSION*.elf || exit 1
sleep 5
$USBLOAD --serial=$SERIAL $REPO/telebt-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleBT-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleBT found on $dev"
;;
*)
echo 'No TeleBT-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
echo 'E 1' > $dev
echo -n "checking BlueTooth functionality... "
btdev=`hcitool scan | awk -F \- '/TeleBT/ { print $2 }'`
if [ "$btdev" = "$SERIAL" ]; then
echo "working!"
else
echo "device not found"
exit 1
fi
echo "TeleBT-v$VERSION $SERIAL is ready to ship"
exit $?

106
ao-bringup/turnon_teledongle Executable file
View File

@@ -0,0 +1,106 @@
#!/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
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
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
CALFILE=cal-$SERIAL.txt
../ao-tools/ao-cal-freq/ao-cal-freq --verbose --nosave --output=$CALFILE --tty=$dev
case $? in
0)
;;
*)
echo "Frequency calibration failed"
exit 1
;;
esac
CAL_VALUE=`cat $CALFILE`
case "$CAL_VALUE" in
[1-9]*)
;;
*)
echo "Invalid calibration value: $CAL_VALUE"
exit 1
;;
esac
echo $SERIAL","$CAL_VALUE >> cal_values
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 $?

View File

@@ -0,0 +1,58 @@
#!/bin/sh
if [ -x ../ao-tools/ao-load/ao-load ]; then
AOLOAD=../ao-tools/ao-load/ao-load
elif [ -x /usr/bin/ao-load ]; then
AOLOAD=/usr/bin/ao-load
else
echo "Can't find ao-load! Aborting."
exit 1
fi
if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
RAWLOAD=../ao-tools/ao-rawload/ao-rawload
elif [ -x /usr/bin/ao-rawload ]; then
RAWLOAD=/usr/bin/ao-rawload
else
echo "Can't find ao-rawload! Aborting."
exit 1
fi
echo "TeleDongle v0.2 Turn-On and Calibration Program"
echo "Copyright 2010 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\tTeleDongle v0.2 powered from USB"
echo "\t\twith TIdongle (on /dev/ttyACM0) cabled to debug header"
echo "\t\twith coax from SMA to frequency counter"
echo
echo -n "TeleDongle serial number: "
read SERIAL
echo $RAWLOAD
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 $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 $programmer --cal $CAL_VALUE ~/altusmetrumllc/Binaries/teledongle-v0.2*.ihx $SERIAL
echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
echo $SERIAL","$CAL_VALUE >> cal_values
echo "Unplug and replug USB, cu to the board, confirm freq and record power"

74
ao-bringup/turnon_telefireeight Executable file
View File

@@ -0,0 +1,74 @@
#!/bin/sh
PRODUCT=TeleFireEight
VERSION=2.0
REPO=~/altusmetrumllc/Binaries
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2019 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION"
echo "\t\twith USB cable attached"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telefireeight-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL $REPO/telefireeight-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "$PRODUCT found on $dev"
;;
*)
echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
echo 'E 1' > $dev
echo "$PRODUCT-v$VERSION" serial "$SERIAL" is ready for integration and testing
echo "\007"
exit $?

84
ao-bringup/turnon_telegps Executable file
View File

@@ -0,0 +1,84 @@
#!/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=TeleGPS
VERSION=3.0
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo $FILE
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2023 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
#
# Use released versions of everything
#
FLASH_FILE=~/altusmetrumllc/Binaries/loaders/telegps-v3.0-altos-flash-*.elf
ALTOS_FILE=~/altusmetrumllc/Binaries/telegps-v3.0-*.elf
echo $FLASH_LPC $FLASH_FILE
$FLASH_LPC $FLASH_FILE || exit 1
sleep 1
echo $USBLOAD $ALTOS_FILE
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 1
dev=`ao-list | awk '/TeleGPS-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleGPS found on $dev"
;;
*)
echo 'No TeleGPS-v'"$VERSION"' found'
exit 1
;;
esac
CALFILE=cal-$SERIAL.txt
../ao-tools/ao-cal-freq/ao-cal-freq --output=$CALFILE --tty=$dev
CAL_VALUE=`cat $CALFILE`
echo $SERIAL","$CAL_VALUE >> cal_values
./test-telegps-v3
exit $?

81
ao-bringup/turnon_telegps_v1 Executable file
View File

@@ -0,0 +1,81 @@
#!/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=TeleGPS
VERSION=1.0
BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
echo $FILE
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo "\t\twith ST-Link-V2 cabled to debug header"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
#
# Use released versions of everything
#
FLASH_FILE=~/altusmetrumllc/Binaries/loaders/telegps-v1.0-altos-flash-*.elf
ALTOS_FILE=~/altusmetrumllc/Binaries/telegps-v1.0-*.elf
echo $FLASH_LPC $FLASH_FILE
$FLASH_LPC $FLASH_FILE || exit 1
sleep 2
echo $USBLOAD $ALTOS_FILE
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 2
dev=`ao-list | awk '/TeleGPS-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleGPS found on $dev"
;;
*)
echo 'No TeleGPS-v'"$VERSION"' found'
exit 1
;;
esac
SERIAL=$SERIAL ./cal-freq $dev
./test-telegps-v1
exit $?

76
ao-bringup/turnon_telegps_v2 Executable file
View File

@@ -0,0 +1,76 @@
#!/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 /usr/bin/ao-usbload ]; then
USBLOAD=/usr/bin/ao-usbload
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
PRODUCT=TeleGPS
VERSION=2.0
REPO=~/altusmetrumllc/Binaries
#BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
#echo $FILE
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2017 by Bdale Garbee. Released under GPL v3+"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from / attached to USB on this computer"
echo
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
#
# Use released versions of everything
#
FLASH_FILE=$REPO/loaders/telegps-v2.0-altos-flash-*.bin
ALTOS_FILE=$REPO/telegps-v2.0-*.elf
$DFU_UTIL -v -v -R -a 0 -s 0x08000000:leave -D $FLASH_FILE
sleep 3
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 3
dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "$PRODUCT found on $dev"
;;
*)
echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
exit 1
;;
esac
SERIAL=$SERIAL ./cal-freq $dev
./test-telegps-v2
exit $?

76
ao-bringup/turnon_telelco Executable file
View File

@@ -0,0 +1,76 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=2.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleLCO
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2018 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT 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
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telelco-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL --force $REPO/telelco-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/'"$PRODUCT-v$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "$PRODUCT"' found on $dev'
;;
*)
echo 'No '"$PRODUCT-v$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
echo 'E 1' > $dev
echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
echo "\007"
exit $?

81
ao-bringup/turnon_telemega Executable file
View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=6.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleMega
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2023 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT 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
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL --force $REPO/telemega-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMega found on $dev"
;;
*)
echo 'No TeleMega-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemega-v6.0
exit $?

63
ao-bringup/turnon_telemega_v1.0 Executable file
View File

@@ -0,0 +1,63 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=1.0
REPO=~/altusmetrumllc/Binaries
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 "\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 $FLASH_STM
$FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf || exit 1
sleep 5
$USBLOAD --serial=$SERIAL $REPO/telemega-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMega found on $dev"
;;
*)
echo 'No TeleMega-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
../ao-tools/ao-cal-accel/ao-cal-accel $dev
echo 'E 1' > $dev
./test-telemega-v1.0
exit $?

81
ao-bringup/turnon_telemega_v2.0 Executable file
View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=2.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleMega
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT 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
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf
sleep 5
$USBLOAD --serial=$SERIAL --force $REPO/telemega-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMega found on $dev"
;;
*)
echo 'No TeleMega-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemega-v2.0
exit $?

81
ao-bringup/turnon_telemega_v3.0 Executable file
View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=3.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleMega
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2017 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT 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
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL --force $REPO/telemega-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMega found on $dev"
;;
*)
echo 'No TeleMega-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemega-v3.0
exit $?

81
ao-bringup/turnon_telemega_v4.0 Executable file
View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=4.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleMega
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2020 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT 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
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL --force $REPO/telemega-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMega found on $dev"
;;
*)
echo 'No TeleMega-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemega
exit $?

81
ao-bringup/turnon_telemega_v5.0 Executable file
View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=5.0
REPO=~/altusmetrumllc/Binaries
PRODUCT=TeleMega
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2021 by Bdale Garbee. Released under GPL v3"
echo
echo "Expectations:"
echo "\t$PRODUCT 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
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM $REPO/loaders/telemega-v$VERSION*.elf
sleep 3
$USBLOAD --serial=$SERIAL --force $REPO/telemega-v$VERSION*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMega found on $dev"
;;
*)
echo 'No TeleMega-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemega-v5.0
exit $?

81
ao-bringup/turnon_telemetrum Executable file
View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-samd21 ]; then
FLASH_STM=/usr/bin/ao-flash-samd21
else
echo "Can't find ao-flash-samd21! 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
VERSION=4.0
PRODUCT=TeleMetrum
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2023 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT 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-$VERSION serial number: "
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM ~/altusmetrumllc/Binaries/loaders/telemetrum-v$VERSION-*.elf || exit 1
sleep 3
$USBLOAD --serial=$SERIAL ~/altusmetrumllc/Binaries/telemetrum-v$VERSION-*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMetrum-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMetrum found on $dev"
;;
*)
echo 'No TeleMetrum-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemetrum-v4.0
exit $?

View File

@@ -0,0 +1,49 @@
#!/bin/sh
if [ -x ../ao-tools/ao-load/ao-load ]; then
AOLOAD=../ao-tools/ao-load/ao-load
elif [ -x /usr/bin/ao-load ]; then
AOLOAD=/usr/bin/ao-load
else
echo "Can't find ao-load! Aborting."
exit 1
fi
if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
RAWLOAD=../ao-tools/ao-rawload/ao-rawload
elif [ -x /usr/bin/ao-rawload ]; then
RAWLOAD=/usr/bin/ao-rawload
else
echo "Can't find ao-rawload! Aborting."
exit 1
fi
echo "TeleMetrum v1.1 Turn-On and Calibration Program"
echo "Copyright 2010 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\tTeleMetrum v1.1 powered from USB"
echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header"
echo "\t\twith coax from UHF to frequency counter"
echo
echo -n "TeleMetrum serial number: "
read SERIAL
echo $RAWLOAD
$RAWLOAD --device 100 -r ao_led_blink.ihx
echo "the red LED should be blinking"
sleep 5
$RAWLOAD --device 100 -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 --device 100 --cal $CAL_VALUE \
~/altusmetrumllc/Binaries/telemetrum-v1.1*.ihx $SERIAL
echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
echo "Unplug and replug USB, cu to the board, confirm freq and record power"

View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=2.0
PRODUCT=TeleMetrum
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT 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-$VERSION serial number: "
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM ~/altusmetrumllc/Binaries/loaders/telemetrum-v$VERSION-*.elf || exit 1
sleep 3
$USBLOAD --serial=$SERIAL ~/altusmetrumllc/Binaries/telemetrum-v$VERSION-*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMetrum-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMetrum found on $dev"
;;
*)
echo 'No TeleMetrum-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemetrum-v2.0
exit $?

View File

@@ -0,0 +1,81 @@
#!/bin/sh
if [ -x /usr/bin/ao-flash-stm ]; then
FLASH_STM=/usr/bin/ao-flash-stm
else
echo "Can't find ao-flash-stm! 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
VERSION=3.0
PRODUCT=TeleMetrum
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\t$PRODUCT 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-$VERSION serial number: "
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
echo $FLASH_STM
$FLASH_STM ~/altusmetrumllc/Binaries/loaders/telemetrum-v$VERSION-*.elf || exit 1
sleep 3
$USBLOAD --serial=$SERIAL ~/altusmetrumllc/Binaries/telemetrum-v$VERSION-*.elf || exit 1
sleep 5
dev=`ao-list | awk '/TeleMetrum-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "TeleMetrum found on $dev"
;;
*)
echo 'No TeleMetrum-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
failed=1
while [ $failed = 1 ]; do
../ao-tools/ao-cal-accel/ao-cal-accel $dev
failed=$?
done
echo 'E 1' > $dev
./test-telemetrum-v3.0
exit $?

78
ao-bringup/turnon_telemini Executable file
View File

@@ -0,0 +1,78 @@
#!/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 which ao-usbload > /dev/null; then
USBLOAD=`which ao-usbload`
else
echo "Can't find ao-usbload! Aborting."
exit 1
fi
VERSION=3.0
PRODUCT=TeleMini
echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
echo "Copyright 2017 by Keith Packard. Released under GPL v2 or later"
echo
echo "Expectations:"
echo "\t$PRODUCT v$VERSION powered from USB"
echo
echo -n "$PRODUCT-$VERSION serial number: "
case $# in
1)
SERIAL="$1"
echo "$PRODUCT-$VERSION serial number: $SERIAL"
;;
0)
echo -n "$PRODUCT-$VERSION serial number: "
read SERIAL
;;
*)
echo "Usage: $0 <serial-number>" 1>&2
exit 1;
;;
esac
FLASH_FILE=~/altusmetrumllc/Binaries/loaders/telemini-v$VERSION-altos-flash-*.bin
ALTOS_FILE=~/altusmetrumllc/Binaries/telemini-v$VERSION-*.elf
#FLASH_FILE=../src/telemini-v3.0/flash-loader/telemini-v$VERSION-altos-flash-*.bin
#ALTOS_FILE=../src/telemini-v3.0/telemini-v$VERSION-*.elf
if lsusb -d 0483:df11 | grep -q STM; then
$DFU_UTIL -a 0 -s 0x08000000:leave -D $FLASH_FILE || exit 1
sleep 2
fi
$USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
sleep 3
dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
case "$dev" in
/dev/tty*)
echo "$PRODUCT found on $dev"
;;
*)
echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
exit 1
;;
esac
echo 'E 0' > $dev
SERIAL=$SERIAL ./cal-freq $dev
echo 'E 1' > $dev
./test-telemini
exit $?

53
ao-bringup/turnon_teleminiv2 Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/sh
if [ -x ../ao-tools/ao-load/ao-load ]; then
AOLOAD=../ao-tools/ao-load/ao-load
elif [ -x /usr/bin/ao-load ]; then
AOLOAD=/usr/bin/ao-load
else
echo "Can't find ao-load! Aborting."
exit 1
fi
if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
RAWLOAD=../ao-tools/ao-rawload/ao-rawload
elif [ -x /usr/bin/ao-rawload ]; then
RAWLOAD=/usr/bin/ao-rawload
else
echo "Can't find ao-rawload! Aborting."
exit 1
fi
echo "TeleMini v2.0 Turn-On and Calibration Program"
echo "Copyright 2011 by Bdale Garbee. Released under GPL v2"
echo "Copyright 2013 by Keith Packard. Released under GPL v2"
echo
echo "Expectations:"
echo "\tTeleMini v2.0 powered from LiPo"
echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header"
echo "\t\twith frequency counter able to sample RF output"
echo
echo -n "TeleMini serial number: "
read SERIAL
echo $RAWLOAD
#TTY=/dev/ttyACM0
PROGRAMMER="-D 186"
BIN=../src/telemini-v2.0*.ihx
$RAWLOAD $PROGRAMMER -r ao_led_blink.ihx
echo "LEDs should be blinking"
sleep 5
$RAWLOAD $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 $PROGRAMMER --cal=$CAL_VALUE $BIN $SERIAL
echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
echo "Unplug and replug USB, cu to the board, confirm freq and record power"

48
ao-bringup/turnon_teleshield Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/sh
if [ -x ../ao-tools/ao-load/ao-load ]; then
AOLOAD=../ao-tools/ao-load/ao-load
elif [ -x /usr/bin/ao-load ]; then
AOLOAD=/usr/bin/ao-load
else
echo "Can't find ao-load! Aborting."
exit 1
fi
if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
RAWLOAD=../ao-tools/ao-rawload/ao-rawload
elif [ -x /usr/bin/ao-rawload ]; then
RAWLOAD=/usr/bin/ao-rawload
else
echo "Can't find ao-rawload! Aborting."
exit 1
fi
echo "TeleShield v0.1 Turn-On and Calibration Program"
echo "Copyright 2012 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\tTeleShield v0.1 powered from USB"
echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header"
echo "\t\twith coax from SMA to frequency counter"
echo
echo -n "TeleShield serial number: "
read SERIAL
echo $RAWLOAD
$RAWLOAD -D 100 -r ao_led_blink.ihx
echo "LEDs should be blinking"
sleep 5
$RAWLOAD -D 100 -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 /home/bdale/debian/altos/src/teleshield-v0.1/*.ihx $SERIAL
echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
echo "Unplug and replug USB, cu to the board, confirm freq and record power"

48
ao-bringup/turnon_teleterra Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/sh
if [ -x ../ao-tools/ao-load/ao-load ]; then
AOLOAD=../ao-tools/ao-load/ao-load
elif [ -x /usr/bin/ao-load ]; then
AOLOAD=/usr/bin/ao-load
else
echo "Can't find ao-load! Aborting."
exit 1
fi
if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
RAWLOAD=../ao-tools/ao-rawload/ao-rawload
elif [ -x /usr/bin/ao-rawload ]; then
RAWLOAD=/usr/bin/ao-rawload
else
echo "Can't find ao-rawload! Aborting."
exit 1
fi
echo "TeleTerra v0.2 Turn-On and Calibration Program"
echo "Copyright 2012 by Bdale Garbee. Released under GPL v2"
echo
echo "Expectations:"
echo "\tTeleTerra v0.2 powered from USB"
echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header"
echo "\t\twith coax from SMA to frequency counter"
echo
echo -n "TeleTerra serial number: "
read SERIAL
echo $RAWLOAD
$RAWLOAD -D 100 -r ao_led_blink.ihx
echo "LEDs should be blinking"
sleep 5
$RAWLOAD -D 100 -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 /home/bdale/debian/altos/src/teleterra-v0.2/*.ihx $SERIAL
echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
echo "Unplug and replug USB, cu to the board, confirm freq and record power"