From f2d3202de9a5847923f72afe2969eb7ccd7342c7 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 28 Jan 2016 00:14:36 -0800 Subject: 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 --- ao-bringup/turnon_chaoskey | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 ao-bringup/turnon_chaoskey (limited to 'ao-bringup') 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 " 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 $? -- cgit v1.2.3