1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-12-19 03:20:44 +02:00
wernermisc/m1rc3/norruption/2/aloop
2011-10-09 23:01:45 -03:00

59 lines
780 B
Bash
Executable File

#!/bin/bash
TTY=/dev/ttyUSB0
DIR=${1:-.}
boot()
{
make -C ../../../m1/jtag-boot boot
}
xterm -e "flterm --log $DIR/log --port $TTY --kernel boot.4e53273.bin" &
n=0
while true; do
n=`expr $n + 1`
echo ===== $n =====
labsw ch1=0 ch2=0
sleep 2
labsw ch1=1 ch2=1
sleep 1
bs=`./bootsts`
if [ "$bs" = "0x0001" ]; then
boot
sleep 10
echo echo === $n === `date` >$TTY
sleep 5
continue
fi
echo bootsts = $bs >$DIR/stat$n
./getstby $DIR/corrupt$n.bin
boot
# 1.0-4.3 seconds
sleep 2
echo '\033serialboot' >$TTY
# >= 7.9 seconds
sleep 9
echo -n a >$TTY
# takes about 3 seconds
sleep 4
./putstby standby.fpg
diff -u <(hexdup -C standby.fpg) \
<(hexdump -C $DIR/corrupt$n.bin) >$DIR/diff$n
done