X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-bringup%2Fturnon_chaoskey;h=50460008f2479717c2d226a341f3858e7bc4bb45;hp=3617e777d1f5de8076898b162d6d5999cd9a7a14;hb=c4926a69d6e72a035197b3d617c62893a7ea1861;hpb=88ee4ac0c91e12a02cc1954ffad0fd8603e24e55 diff --git a/ao-bringup/turnon_chaoskey b/ao-bringup/turnon_chaoskey index 3617e777..50460008 100755 --- a/ao-bringup/turnon_chaoskey +++ b/ao-bringup/turnon_chaoskey @@ -1,10 +1,10 @@ #!/bin/sh -if [ -x /usr/bin/ao-flash-stm32f0x ]; then - FLASH_STM=/usr/bin/ao-flash-stm32f0x +if [ -x /usr/bin/dfu-util ]; then + DFU_UTIL=/usr/bin/dfu-util else - echo "Can't find ao-flash-stm32f0x! Aborting." - exit 1 + echo "Can't find dfu-util! Aborting." + exit 1 fi if [ -x /usr/bin/ao-usbload ]; then @@ -22,13 +22,20 @@ 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 -$FLASH_STM ../src/chaoskey-v$VERSION/flash-loader/chaoskey-v$VERSION-*.elf || exit 1 +$DFU_UTIL -a 0 -s 0x08000000:leave -D ../src/chaoskey-v$VERSION/flash-loader/chaoskey-v$VERSION*.bin || exit 1 sleep 2 $USBLOAD --serial=1 ../src/chaoskey-v$VERSION/chaoskey-v$VERSION*.ihx || exit 1 +sleep 1 + +serial=`dmesg | grep 'on chaoskey' | tail -1 | sed 's/.*chaoskey \([0-9a-f][0-9a-f]*\) on chaoskey.*/\1/'` + +echo 'Testing ChaosKey' $serial + +./test-chaoskey $serial + exit $?