aboutsummaryrefslogtreecommitdiff
path: root/run.sh
blob: 3c4454a5d81f6b08a75e376a3e093996edeaacb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

set -e

echo "##########################################"
echo "# Flashing bootloader"
echo "##########################################"
./bin/flash-target firmware/bootloader

echo "##########################################"
echo "# Flashing temporary cli-test HSM firmware"
echo "##########################################"
./bin/flash-target firmware/cli-test
./bin/reset

echo "##########################################"
echo "# Sleeping after reset"
echo "##########################################"
sleep 5

echo "##########################################"
echo "# Uploading bitstream"
echo "##########################################"

./bin/cryptech_upload --fpga --username ct

echo "##########################################"
echo "# Programming AVR"
echo "##########################################"
avrdude -c usbtiny -p attiny828 -U flash:w:firmware/tamper.hex

echo "##########################################"
echo "# Flashing official STM32 firmware"
echo "##########################################"
./bin/cryptech_upload --firmware --username ct
./bin/reset
sleep 15

echo "##########################################"
echo "# Checking FPGA"
echo "##########################################"
./bin/cryptech_runcmd --username wheel "fpga show cores"