jig: sync with nearly-final version
This is nearly the final version of the factory test jig. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
337e1a370c
commit
18178e4a71
@ -4,3 +4,23 @@ Install wiringpi to get the `gpio` command:
|
||||
```
|
||||
apt install wiringpi
|
||||
```
|
||||
|
||||
There are five LEDs on the front. The indicate which subsystems work.
|
||||
|
||||
1: An error occurred
|
||||
2: Test Error
|
||||
3: Test Error
|
||||
4: Test Error
|
||||
5: Tester is IDLE (also, tester is READY)
|
||||
|
||||
LEDs 2, 3, and 4 form a pattern that indicate which test failed:
|
||||
|
||||
Test name | 2 (Green) | 3 (Blue) | 4 (White) | Reason for Failure |
|
||||
====================+===========+===========+===========+====================+
|
||||
SPI Valid | | x | x | The SPI flash was not found, or was not the correct model |
|
||||
USB Communication | x | | | The FPGA isn't assembled correctly, the USB pullup isn't correct, or the crystal is bad |
|
||||
Load Test Bitstream | | | | The FPGA isn't assembled correctly |
|
||||
Test SPI | | x | | Not all four wires are connected between the FPGA and the SPI |
|
||||
Test RGB | x | x | | TOUCH2 or the RGB LED are not assembled correctly |
|
||||
Test Touch | | x | x | TOUCH1, TOUCH3, or TOUCH4 are not assembled correctly |
|
||||
Final Bitstream | | | x | The final program could not be loaded |
|
||||
|
@ -1,13 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
green_led=11
|
||||
yellow_led=9
|
||||
red_led=10
|
||||
led_1=19
|
||||
led_2=13
|
||||
led_3=6
|
||||
led_4=5
|
||||
led_5=0
|
||||
|
||||
all_off() {
|
||||
gpio -g write ${green_led} 0
|
||||
gpio -g write ${yellow_led} 0
|
||||
gpio -g write ${red_led} 0
|
||||
gpio -g write ${led_1} 0
|
||||
gpio -g write ${led_2} 0
|
||||
gpio -g write ${led_3} 0
|
||||
gpio -g write ${led_4} 0
|
||||
gpio -g write ${led_5} 0
|
||||
}
|
||||
|
||||
green_on() {
|
||||
@ -29,11 +33,49 @@ red_also_on() {
|
||||
gpio -g write ${red_led} 1
|
||||
}
|
||||
|
||||
led_on() {
|
||||
case $1 in
|
||||
1) gpio -g write ${led_1} on ;;
|
||||
2) gpio -g write ${led_2} on ;;
|
||||
3) gpio -g write ${led_3} on ;;
|
||||
4) gpio -g write ${led_4} on ;;
|
||||
5) gpio -g write ${led_5} on ;;
|
||||
esac
|
||||
}
|
||||
|
||||
led_off() {
|
||||
case $1 in
|
||||
1) gpio -g write ${led_1} off ;;
|
||||
2) gpio -g write ${led_2} off ;;
|
||||
3) gpio -g write ${led_3} off ;;
|
||||
4) gpio -g write ${led_4} off ;;
|
||||
5) gpio -g write ${led_5} off ;;
|
||||
esac
|
||||
}
|
||||
|
||||
gpio_setup() {
|
||||
gpio -g mode ${green_led} out
|
||||
gpio -g mode ${yellow_led} out
|
||||
gpio -g mode ${red_led} out
|
||||
green_on
|
||||
gpio -g mode ${led_1} out
|
||||
gpio -g mode ${led_2} out
|
||||
gpio -g mode ${led_3} out
|
||||
gpio -g mode ${led_4} out
|
||||
gpio -g mode ${led_5} out
|
||||
all_off
|
||||
led_on 5
|
||||
}
|
||||
|
||||
fail_test() {
|
||||
case $1 in
|
||||
load-tester-bitstream) ;;
|
||||
run-all-tests) led_on 2 ;;
|
||||
validate-spi) led_on 3 ; led_on 4 ;;
|
||||
test-spi) led_on 3 ;;
|
||||
test-rgbg) led_on 2 ; led_on 3 ;;
|
||||
test-rgbb) led_on 2 ; led_on 3 ;;
|
||||
test-rgbr) led_on 2 ; led_on 3 ;;
|
||||
test-touch) led_on 3 ; led_on 4 ;;
|
||||
load-final-bitstream) led_on 4 ;;
|
||||
verify-final-bitstream) led_on 4 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
gpio_setup
|
||||
@ -43,21 +85,29 @@ while read line
|
||||
do
|
||||
if echo "${line}" | grep -iq '^start'
|
||||
then
|
||||
yellow_on
|
||||
all_off
|
||||
failures=0
|
||||
elif echo "${line}" | grep -iq '^fail'
|
||||
then
|
||||
red_also_on
|
||||
if [ $failures -ne 1 ]
|
||||
then
|
||||
failures=1
|
||||
fail_test $(echo "${line}" | awk '{print $2}')
|
||||
fi
|
||||
led_on 1
|
||||
elif echo "${line}" | grep -iq '^finish'
|
||||
then
|
||||
led_on 5
|
||||
result=$(echo ${line} | awk '{print $3}')
|
||||
if [ ${result} -ge 200 -a ${result} -lt 300 ]
|
||||
then
|
||||
green_on
|
||||
led_on 5
|
||||
else
|
||||
red_on
|
||||
led_on 1
|
||||
fi
|
||||
elif echo "${line}" | grep -iq '^exit'
|
||||
then
|
||||
all_off
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
41
jig/bin/validate-spi.sh
Normal file
41
jig/bin/validate-spi.sh
Normal file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
infofile=/tmp/spi-info.txt
|
||||
rm -f $infofile
|
||||
fomu-flash -i | tee $infofile
|
||||
|
||||
# Manufacturer ID: Macronix (c2)
|
||||
# Memory model: MX25R1635F (28)
|
||||
# Memory size: 16 Mbit (15)
|
||||
# Device ID: 15
|
||||
|
||||
error_count=0
|
||||
if ! grep -q 'Manufacturer ID: Macronix (c2)' $infofile
|
||||
then
|
||||
echo -n "Unrecognized SPI manufacturer: "
|
||||
grep 'Manufacturer ID: ' $infofile
|
||||
error_count=$(($error_count+1))
|
||||
fi
|
||||
|
||||
if ! grep -q 'Memory model: MX25R1635F (28)' $infofile
|
||||
then
|
||||
echo -n "Unrecognized memory model: "
|
||||
grep 'Memory model: ' $infofile
|
||||
error_count=$(($error_count+1))
|
||||
fi
|
||||
|
||||
if ! grep -q 'Memory size: 16 Mbit (15)' $infofile
|
||||
then
|
||||
echo -n "Unrecognized memory size: "
|
||||
grep 'Memory size: ' $infofile
|
||||
error_count=$(($error_count+1))
|
||||
fi
|
||||
|
||||
if ! grep -q 'Device ID: 15' $infofile
|
||||
then
|
||||
echo -n "Unrecognized device id: "
|
||||
grep 'Device ID: ' $infofile
|
||||
error_count=$(($error_count+1))
|
||||
fi
|
||||
|
||||
exit $error_count
|
@ -1,5 +1,6 @@
|
||||
[Test]
|
||||
ExecStart=fomu-flash -f evt-tester-bitstream.bin
|
||||
ExecStart=fomu-flash -f pvt-tester-bitstream.bin
|
||||
Name=Load Tester Bitstream
|
||||
Description=Use fomu-flash to load the tester bitstream
|
||||
Requires=validate-spi
|
||||
Timeout=1
|
||||
|
5
jig/config/validate-spi.test
Normal file
5
jig/config/validate-spi.test
Normal file
@ -0,0 +1,5 @@
|
||||
[Test]
|
||||
ExecStart=./validate-spi.sh
|
||||
Name=Validate SPI
|
||||
Description=Validate that the SPI part number is what we expect
|
||||
Timeout=1
|
22
jig/exclave.service
Normal file
22
jig/exclave.service
Normal file
@ -0,0 +1,22 @@
|
||||
# copy this file to /etc/systemd/system
|
||||
# then run:
|
||||
# sudo systemctl start exclave
|
||||
# sudo systemctl stop exclave
|
||||
# sudo systemctl enable exclave
|
||||
|
||||
[Unit]
|
||||
Description=Exclave tester automation framework service
|
||||
After=network.target
|
||||
After=systemd-user-sessions.service
|
||||
|
||||
[Service]
|
||||
User=pi
|
||||
ExecStart=/home/pi/code/netv2-tests/run_exclave.sh
|
||||
#Restart=always
|
||||
#TimeoutSec=60 # I have no idea how to tell systemd the script has started...
|
||||
#RestartSec=10
|
||||
#StartTimeLimitInterval=60
|
||||
#StartLimitBurst=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user