aboutsummaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-08-11 10:14:11 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-08-11 10:14:11 +0200
commitad0703886a80ba9e3eec0eb023243f691d53de75 (patch)
tree50c7efd2a39b2a08a9074d9e0a29c79338445a04 /run.sh
parent39c948094d40a67ee1e6b019636e77185655a5f4 (diff)
import from local directory
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..a126811
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+set -e
+
+echo "##########################################"
+echo "# Flashing bootloader"
+echo "##########################################"
+./bin/flash-target bootloader
+
+echo "##########################################"
+echo "# Flashing temporary HSM firmware"
+echo "##########################################"
+./bin/flash-target hsm
+./bin/reset
+sleep 5
+
+echo "##########################################"
+echo "# Uploading bitstream"
+echo "##########################################"
+
+./bin/cryptech_upload --fpga --username wheel
+
+echo "##########################################"
+echo "# Programming AVR"
+echo "##########################################"
+avrdude -c usbtiny -p attiny828 -U flash:w:tamper.hex
+
+echo "##########################################"
+echo "# Flashing official STM32 firmware"
+echo "##########################################"
+./bin/cryptech_upload --firmware --username wheel
+./bin/reset
+sleep 15
+
+echo "##########################################"
+echo "# Checking FPGA"
+echo "##########################################"
+./bin/cryptech_runcmd --username wheel "fpga show cores"
+