summaryrefslogtreecommitdiff
path: root/ao-bringup
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-01-28 00:14:36 -0800
committerKeith Packard <keithp@keithp.com>2016-01-28 00:15:31 -0800
commitf2d3202de9a5847923f72afe2969eb7ccd7342c7 (patch)
treefcc2978cf91666fe078e7d2405b0ceedfc796eb7 /ao-bringup
parent02fd767ab60a9957faa2bff29c62ed954abc34e7 (diff)
altos/chaoskey: Add support for flipping between raw and cooked bits
Plug the 'force bootloader' thing onto the board while it's running and it will generate raw bits instead of running them through the CRC to whiten. Useful for validating the raw hardware. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-bringup')
-rwxr-xr-xao-bringup/turnon_chaoskey50
1 files changed, 50 insertions, 0 deletions
diff --git a/ao-bringup/turnon_chaoskey b/ao-bringup/turnon_chaoskey
new file mode 100755
index 00000000..8c8a6758
--- /dev/null
+++ b/ao-bringup/turnon_chaoskey
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+if [ -x /usr/bin/ao-flash-stm32f0x ]; then
+ FLASH_STM=/usr/bin/ao-flash-stm32f0x
+else
+ echo "Can't find ao-flash-stm32f0x! 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=0.1
+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 "\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
+
+$FLASH_STM ../src/chaoskey-v$VERSION/flash-loader/chaoskey-v$VERSION-*.elf || exit 1
+
+sleep 2
+
+$USBLOAD --serial=$SERIAL ../src/chaoskey-v$VERSION/chaoskey-v$VERSION*.ihx || exit 1
+
+exit $?