Commit c9c43f55 authored by Dusan Slavinec's avatar Dusan Slavinec

adding hardware test scripts

parent 54e3b3a7
Test scripts for FTRN AMC hardware test
Use with modified N.A.T. extender for backplane IO tests.
To start tests use command:
./ftrn_test.sh test_list_amc.txt
This diff is collapsed.
#!/bin/bash
echo "################################################################################" | tee resp.txt
echo "Check that Xilinx JTAG cable is connected to front panel JTAG connector" | tee -a resp.txt
echo " and DIP1 is in position ONU(USB) then press ENTER" | tee -a resp.txt
echo "Flashing CPLD" | tee -a resp.txt
source /opt/Xilinx/14.7/LabTools/settings64.sh
# call Impact script
impact -batch ./impact_cpld_flash.cmd | tee -a resp.txt
# if called from script copy log to report folder
if [[ -n $LOG_FOLDER ]]; then
cp _impactbatch.log $LOG_FOLDER/flash_cpld.txt
fi
RESULT=`cat _impactbatch.log | grep "Programming completed successfully"`
if [[ -n $RESULT ]]; then
printf "Programming completed successfully"| tee -a resp.txt
echo "PTS_STATUS: OK"| tee -a resp.txt
exit 0
else
echo "PTS_STATUS: Failed"| tee -a resp.txt
exit 64
fi
setMode -bscan
setCable -port usb21
setCableSpeed -speed 750000
Identify -inferir
assignFile -p 1 -file "microtca_prog1.jed"
assignFile -p 2 -file "5AGXMA3DF27.bsd"
program -p 1 -e -v
closecable
exit 0
This diff is collapsed.
#!/bin/bash
# $1 - path to pts folder
# $2 - configuration file name (without extension)
# $3 - if present, only load sof, not burning rpd
if [ $1 == 'h']
then
echo "$1 - path to pts folder"
echo "$2 - configuration file name (without extension)"
echo "$3 - if present, only load sof, do not burn rpd"
exit 113 # just showing help
fi
echo "################################################################################"
echo "Flashing FPGA"
echo "Checking JTAG chain"
export PATH=$PATH:/home/ftrn/intelFPGA/17.1/qprogrammer/bin:/home/ftrn/intelFPGA/17.1/qprogrammer/linux64/
echo "Detecting devices in JTAG chain"
RESP=`jtagconfig`
echo "Loading SOF to FPGA"
SOFPATH=$1/fpga/$2
quartus_pgm -c "USB-Blaster" -m jtag -o "p;$SOFPATH.sof@2"
sleep 3
TTY_USB=`$1/utils/find_ftrn_ttyUSB.sh`
echo "Done programming sof"
if [ -z $3 ]
then
echo "Burning rpd to FLASH"
eb-flash "dev/$TTY_USB" "$SOFPATH.rpd"
echo "Resetting FTRN"
eb-reset "dev/$TTY_USB"
fi
sleep 2
eb-info "dev/$TTY_USB"
echo "Done"
exit 0
#!/bin/bash
# $1 - path to pts folder
echo "################################################################################" | tee resp.txt
if [[ $1 == 'h']];
then
echo "$1 - path to pts folder" | tee -a resp.txt
exit 113 # just showing help
fi
echo "################################################################################" | tee -a resp.txt
echo "Configuring FPGA flash" | tee -a resp.txt
echo "Finding FTRN ttyUSBx" | tee -a resp.txt
TTY_USB=`$1/utils/find_ftrn_ttyUSB.sh`
if [[ -n $TTY_USB ]]; then
echo "Found FTRN ttyUSB : $TTY_USB" | tee -a resp.txt
else
echo "No FTRN ttyUSB device present. Check if Cypress microcontroller is programmed!" | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
fi
RESP=`eb-config dev/$TTY_USB 10 4`
echo "$RESP" | tee -a resp.txt
if [[ -n $RESP ]]; then
echo "FPGA flash configuration failed." | tee -a resp.txt
echo "PTS_STATUS: Failed." | tee -a resp.txt
exit 64
else
echo "FPGA flash configured. Power cycle the board!" | tee -a resp.txt
echo "PTS_OK: OK" | tee -a resp.txt
exit 0
fi
#!/bin/bash
# $1 - path to pts folder
# $2 - configuration file name (without extension)
echo "################################################################################" | tee resp.txt
if [[ $1 == 'h' ]] ;then
echo "$1 - path to pts folder" | tee -a resp.txt
echo "$2 - configuration file name (without extension)" | tee -a resp.txt
exit 113 # just showing help
fi
echo "################################################################################" | tee -a resp.txt
echo "Finding FTRN ttyUSBx" | tee -a resp.txt
TTY_USB=`$1/utils/find_ftrn_ttyUSB.sh`
if [[ -n $TTY_USB ]]; then
echo "Found FTRN ttyUSB : $TTY_USB" | tee -a resp.txt
else
echo "No FTRN ttyUSB device present. Check if Cypress microcontroller is programmed!" | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
fi
echo "Burning rpd to FLASH" | tee -a resp.txt
#RESP=`eb-flash "dev/$TTY_USB" "$2.rpd"`
#TEST=`echo $RESP | grep "Verifying"`
#TEST=`echo $TEST | grep "done"`
eb-flash "dev/$TTY_USB" "$2.rpd" | tee -a resp.txt
RESP=$(cat resp.txt)
TEST=`echo $RESP | grep "Verifying"`
TEST=`echo $TEST | grep "done"`
if [[ -z $TEST ]]; then
echo "Verify not ok. Loading FPGA flash failed." | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
else
echo "PTS_OK: Successfully burned FPGA flash." | tee -a resp.txt
fi
sleep 1
echo "Reseting FTRN. Loading FPGA from flash" | tee -a resp.txt
eb-reset "dev/$TTY_USB" | tee -a resp.txt
sleep 3
echo "Checking USB communication" | tee -a resp.txt
#RESP=`eb-info dev/$TTY_USB`
eb-info dev/$TTY_USB | tee -a resp.txt
RESP=$(cat resp.txt)
TEST=`echo $RESP | grep "5agxma3d4f27i3"`
if [[ -z $TEST ]]; then
echo "FPGA loading from flash failed. Could not read GW info." | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
else
echo "Successfully loaded FPGA from flash." | tee -a resp.txt
echo "PTS_STATUS: OK" | tee -a resp.txt
exit 0
fi
#!/bin/bash
# $1 - path to pts folder
# $2 - configuration file name
echo "################################################################################" | tee resp.txt
if [[ $1 == 'h' ]];then
echo "$1 - path to pts folder" | tee -a resp.txt
echo "$2 - configuration file name" | tee -a resp.txt
exit 113 # just showing help
fi
if [[ -z $2 ]]; then
SOFNAME="./microtca_control.sof"
else
SOFNAME="$2"
fi
echo "Check that Altera USB Blaster is connected to front panel JTAG connector" | tee -a resp.txt
echo " and DIP1 is in position ONU(USB) then press ENTER" | tee -a resp.txt
read -s -n 1
echo "Flashing FPGA" | tee -a resp.txt
export PATH=$PATH:/home/ftrn/intelFPGA/17.1/qprogrammer/bin:/home/ftrn/intelFPGA/17.1/qprogrammer/linux64/
echo "Detecting devices in JTAG chain" | tee -a resp.txt
jtagconfig | tee -a resp.txt
RESP=`cat resp.txt | grep "chain broken"`
if [[ -n $RESP ]]; then
echo "No Altera Device found in JTAG chain"
echo "PTS_STATUS: Failed"
exit 64
fi
echo "Loading SOF to FPGA" | tee -a resp.txt
quartus_pgm -c "USB-Blaster" -m jtag -o "p;$SOFNAME@2" | tee -a resp.txt
sleep 2
echo "Done programming sof" | tee -a resp.txt
sleep 2
echo "Checking for Cypress device" | tee -a resp.txt
CYPRESS=$(lsusb | grep "Cypress") | tee -a resp.txt
echo "Checking for OpenMoko device" | tee -a resp.txt
OPENMOKO=$(lsusb | grep "1d50:6062 OpenMoko") | tee -a resp.txt
if [[ -n $CYPRESS ]] && [[ -n $OPENMOKO ]]; then
echo "PTS_STATUS: Failed . FPGA flashed but Cypress not visible on USB bus." | tee -a resp.txt
exit 64
elif [[ -n $CYPRESS ]]; then
echo "FPGA loaded, Cypress visible on USB bus. Now flash Cypress microcontroller." | tee -a resp.txt
echo "PTS_STATUS: OK" | tee -a resp.txt
exit 0
else #
echo "FPGA loaded, OpenMoko visible on USB bus. Configure FPGA flash." | tee -a resp.txt
echo "PTS_STATUS: OK" | tee -a resp.txt
exit 0
fi
This diff is collapsed.
#!/bin/bash
# $1 - test list
TEST_LIST=$1
echo "Type in 6 digit serial from the sticker"
read -n 6 SN
echo " "
echo "To confirm serial $SN press Enter or Escape to finish"
read -s -n 1 ANS
echo " "
if [ "$ANS" == $'\e' ]; then
echo "END TEST: $(date)"
exit
fi
read -p "Check that fan is ON and blowing over FPGA. Press Enter" -n 1
read -p "Check that Display is attached to the board. Press Enter" -n 1
read -p "Check SFP is inserted and that WR fiber is connected to WR master. Press Enter" -n 1
read -p "Check LEMO cables are connected to IO1 and IO3. Press Enter" -n 1
#set paths
PTS=$(pwd)
export $PTS
TEST_LOG_DIR=/home/$(whoami)/Desktop/board_test_reports
TEST_DELIM1='###############################################################################';
TEST_DELIM2='-------------------------------------------------------------------------------';
# assemble folder name for the board with serial SN
SN_LOG_NAME="amc"
SN_LOG_NAME+="_sn-$SN"
echo "SN_LOG_NAME : $SN_LOG_NAME"
SN_LOG_FOLDER="$TEST_LOG_DIR/$SN_LOG_NAME"
if [[ -d $SN_LOG_FOLDER ]];then
echo "Using existing folder : $SN_LOG_FOLDER"
else
echo "Creating SN report folder : $SN_LOG_FOLDER"
mkdir $SN_LOG_FOLDER
fi
# assemble folder and file name for the test
TEST_START=`date +%s`
TEST_TIME=`date "+%y-%m-%d_%H-%M-%S"`
SN_TIME_LOG="$SN_LOG_NAME_$TEST_TIME"
echo "SN_TIME_LOG : $SN_TIME_LOG"
LOG_FOLDER+="$SN_LOG_FOLDER/$SN_TIME_LOG"
mkdir $LOG_FOLDER
echo "LOG_FOLDER : $LOG_FOLDER"
LOG_FILE="$LOG_FOLDER/$SN_TIME_LOG.log"
echo "LOG_FILE: $LOG_FILE"
# create log file
touch $LOG_FILE
date | tee $LOG_FILE
echo "SN : $SN" | tee -a $LOG_FILE
#TESTS
#------------------------------------------------------------------------------
# ';' is the delimiter here, and there are three fields on each line in the file
# IFS set below is restricted to the context of `read`, it doesn't affect any other code
while IFS=';' read -r cmd testname folder testfile param1 param2 param3; do
# process the fields
# if the line has less than three fields, the missing fields will be set to an empty string
# if the line has more than three fields, `field3` will get all the values, including the
# third field plus the delimiter(s)
# echo "$cmd : $testname : $folder : $testfile : $param1 : $param2 : $param3;"
if [ "$cmd" == "x" ];then # xecute command
echo $TEST_DELIM1 | tee -a $LOG_FILE
echo "START : $(date)" | tee -a $LOG_FILE
if [ "$param1" == "PTS" ];then
param1=$PTS
fi
TESTLOG=$LOG_FOLDER/$testfile
TESTLOG+="_out.txt"
testfile+=".sh"
printf "$testname\n" | tee -a $LOG_FILE #| tee -a $TESTLOG
cd $folder
rm -f resp.txt # delete previous test report
./$testfile $param1 $param2 $param3 < /dev/tty # | tee resp_main.txt
RESP=`cat resp.txt`
sleep 0.5
cd $PTS
printf "%s\n" "$RESP" > $TESTLOG
PTS_STATUS=`echo "$RESP" | grep "PTS_STATUS:"`
printf "%s\n" "$PTS_STATUS" | tee -a $LOG_FILE
printf "END : $(date)\n\n" | tee -a $LOG_FILE
if [[ $PTS_STATUS != 'PTS_STATUS: OK' ]]; then
printf "\nLast test failed. Press ENTER to continue or ESC to stop.\n" | tee -a $LOG_FILE
read -n 1 -s ANS < /dev/tty
if [ "$ANS" == $'\e' ]; then
TEST_END=`date +%s`
echo "Test finished at $((TEST_END-$TEST_START)) seconds."
echo "END TEST: $(date)" | tee -a $LOG_FILE
./pcie-wb/ftrninsmod.sh $PTS r
exit
fi
fi
fi
done < $TEST_LIST
TEST_END=`date +%s`
echo "Test complete in $((TEST_END-$TEST_START)) seconds."
echo "END TEST: $(date)" | tee -a $LOG_FILE
./pcie-wb/ftrninsmod.sh $PTS r
echo " "
#!/bin/bash
# $1 - FTRN Saflib name
echo "##########################################################" | tee resp.txt
saft-io-ctl $1 -n HWT_EN -d 0
# 0 F A 5
HSPS=("0" "F" "A" "5")
HSW_POS0=(" " "Low" "Low" "Low" "Low")
HSW_POS1=(" " "High" "High" "High" "High")
HSW_POS_5=(" " "High" "Low" "High" "Low")
HSW_POS_A=(" " "Low" "High" "Low" "High")
echo "CPLD Hex Switch test" | tee -a resp.txt
echo "----------------------------------------------------------------" | tee -a resp.txt
echo "Move CPLD HEX switch into position 5 and press ENTER" | tee -a resp.txt
read -s -n 1 ANS
POS=0
echo "Reading HEX SW position" | tee -a resp.txt
for (( j=1; j<=4;j++ )); do
RESP=`saft-io-ctl $1 -n HSWP$j | grep "Input:" | grep "${HSW_POS_5[$j]}"`
echo "HEXSW$j : $RESP"
if [[ -n $RESP ]]; then
let POS=$POS+1
fi
done
if [[ $POS = 4 ]]; then
echo "HEX switch position ok." | tee -a resp.txt
else
echo "HEX switch position readback not OK." | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
fi
echo "----------------------------------------------------------------" | tee -a resp.txt
echo "Move CPLD HEX switch into position A and press ENTER" | tee -a resp.txt
read -s -n 1 ANS
POS=0
echo "Reading HEX SW position" | tee -a resp.txt
for (( j=1; j<=4;j++ )); do
RESP=`saft-io-ctl $1 -n HSWP$j | grep "Input:" | grep "${HSW_POS_A[$j]}"`
echo "HEXSW$j : $RESP"
if [[ -n $RESP ]]; then
let POS=$POS+1
fi
done
if [[ $POS = 4 ]]; then
echo "HEX switch position ok." | tee -a resp.txt
else
echo "HEX switch position readback not OK." | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
fi
echo "----------------------------------------------------------------" | tee -a resp.txt
echo "----------------------------------------------------------------" | tee -a resp.txt
echo "FPGA Hex Switch test" | tee -a resp.txt
echo "----------------------------------------------------------------" | tee -a resp.txt
echo "Move FPGA HEX switch into position 5 and press ENTER" | tee -a resp.txt
read -s -n 1 ANS
POS=0
echo "Reading HEX SW position" | tee -a resp.txt
for (( j=1; j<=4;j++ )); do
RESP=`saft-io-ctl $1 -n HSWF$j | grep "Input:" | grep "${HSW_POS_5[$j]}"`
echo "HEXSW$j : $RESP"
if [[ -n $RESP ]]; then
let POS=$POS+1
fi
done
if [[ $POS = 4 ]]; then
echo "HEX switch position ok." | tee -a resp.txt
else
echo "HEX switch position readback not OK." | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
fi
echo "----------------------------------------------------------------" | tee -a resp.txt
echo "Move CPLD HEX switch into position A and press ENTER" | tee -a resp.txt
read -s -n 1 ANS
POS=0
echo "Reading HEX SW position" | tee -a resp.txt
for (( j=1; j<=4;j++ )); do
RESP=`saft-io-ctl $1 -n HSWF$j | grep "Input:" | grep "${HSW_POS_A[$j]}"`
echo "HEXSW$j : $RESP"
if [[ -n $RESP ]]; then
let POS=$POS+1
fi
done
if [[ $POS = 4 ]]; then
echo "HEX switch position ok." | tee -a resp.txt
else
echo "HEX switch position readback not OK." | tee -a resp.txt
echo "PTS_STATUS: Failed" | tee -a resp.txt
exit 64
fi
echo "----------------------------------------------------------------" | tee -a resp.txt
echo "Test finished!"
echo "PTS_STATUS: OK" | tee -a resp.txt
exit 0
#!/bin/bash
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
[[ "$devname" == "bus/"* ]] && continue
eval "$(udevadm info -q property --export -p $syspath)";
[[ -z "$ID_SERIAL" ]] && continue
RESP=`echo "/dev/$devname - $ID_SERIAL" | grep Helmholtzzentrum;`
if [ -n "$RESP" ]
then
RESP=`echo $RESP | grep ttyUSB;`
if [ -n "$RESP" ]
then
echo "$devname"
fi
fi
)
done
#!/bin/bash
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
[[ "$devname" == "bus/"* ]] && continue
eval "$(udevadm info -q property --export -p $syspath)";
[[ -z "$ID_SERIAL" ]] && continue
RESP=`echo "/dev/$devname - $ID_SERIAL" | grep FTDI;`
if [ -n "$RESP" ]
then
RESP=`echo $RESP | grep ttyUSB;`
if [ -n "$RESP" ]
then
echo "$devname"
fi
fi
)
done
#!/bin/bash
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
[[ "$devname" == "bus/"* ]] && continue
eval "$(udevadm info -q property --export -p $syspath)"
[[ -z "$ID_SERIAL" ]] && continue
echo "/dev/$devname - $ID_SERIAL" | grep ttyUSB
)
done
#!/bin/bash
# $1 - Path to PTS
# $3 - wishbone master
# $3 - USER RAM address
TEST=0
echo "################################################################################" | tee resp.txt
TTY_USB=`$1/utils/find_ftrn_ttyUSB.sh`;
echo "Found FTRN $TTY_USB" | tee -a resp.txt
USB_DATA=`eb-read dev/$TTY_USB 0x$3/4`
printf "Reading via USB: address 0x$3 : 0x%s\n" "$USB_DATA" | tee -a resp.txt
PCI_DATA=`eb-read dev/$2 0x$3/4`
printf "Reading via PCI: address 0x$3 : 0x%s\n\n" "$PCI_DATA" | tee -a resp.txt
if [ $USB_DATA == $PCI_DATA ]; then
let TEST=$TEST+1
fi
sleep 1
USB_DATA="c007babe"
printf "Writing via USB: address 0x$3 : 0x$USB_DATA\n" | tee -a resp.txt
eb-write dev/$TTY_USB 0x$3/4 0x$USB_DATA
PCI_DATA=`eb-read dev/$2 0x$3/4`
printf "Reading via PCI: address 0x$3 : 0x%s\n\n" "$PCI_DATA" | tee -a resp.txt
if [ $USB_DATA == $PCI_DATA ]; then
let TEST=$TEST+1
fi
sleep 1
PCI_DATA="deadbeef"
printf "Writing via PCI: address 0x$3 : 0x$PCI_DATA\n" | tee -a resp.txt
eb-write dev/$2 0x$3/4 0x$PCI_DATA
USB_DATA=`eb-read dev/$TTY_USB 0x$3/4`
printf "Reading via USB: address 0x$3 : 0x%s\n\n" "$USB_DATA" | tee -a resp.txt
if [ $USB_DATA == $PCI_DATA ]; then
let TEST=$TEST+1
fi
sleep 1
if [ $TEST -eq 3 ]; then
echo "PTS_STATUS: OK" | tee -a resp.txt
else
echo "Not all read/write were ok." | tee -a resp.txt
echo "PTS_STATUS: Failed." | tee -a resp.txt
fi
#!/bin/bash
# $1 - FTRN Saftlib name
echo "Enabling MTCA.4 PORT 12-15 test" | tee resp.txt
saft-io-ctl $1 -n LED_USR1 -d 1
saft-io-ctl $1 -n LED_USR2 -d 1
saft-io-ctl $1 -n LED_USR3 -d 0
saft-io-ctl $1 -n LED_USR4 -d 0
saft-io-ctl $1 -n HWT_EN -d 1
echo "Check that BLUE IO LEDs blink with then press ENTER else press ESC" | tee -a resp.txt
read -s -n 1 ANS
if [ "$ANS" = $'\e' ];then
echo "Binary count NOT visible on RED IO LEDs" | tee -a resp.txt
echo "PTS_STATUS: Failed (64)" | tee -a resp.txt
exit
else
echo "Binary count visible on RED IO LEDs" | tee -a resp.txt
fi
saft-io-ctl $1 -n LED_USR1 -d 0
saft-io-ctl $1 -n LED_USR2 -d 0
saft-io-ctl $1 -n LED_USR3 -d 0
saft-io-ctl $1 -n LED_USR4 -d 0
saft-io-ctl $1 -n LED_USR8 -d 0
saft-io-ctl $1 -n HWT_EN -d 0
saft-io-ctl $1 -n IO_CLKIN_EN -d 0
echo "--------------------------------------------------------------"
echo "PTS_STATUS: OK" | tee -a resp.txt
echo ""
#!/bin/bash
IOS="MTCA4_IO1 MTCA4_IO2 MTCA4_IO3 MTCA4_IO4 MTCA4_IO5 MTCA4_IO6 MTCA4_IO7 MTCA4_IO8 MTCA4_CLK1 MTCA4_CLK2 MTCA4_CLK3 MTCA4_CLK4 IO1 IO2 IO3 IO4 IO5 LIBERA_TR1 LIBERA_TR2 LIBERA_TR3 LIBERA_TR4"
saft-io-ctl ftrn -i | grep LEMO
echo "Connect LEMO1 to LEMO 3 then press ENTER"
echo "LEMO 1 out to LEMO 3 in, term off"
saft-io-ctl ftrn -o 0 -t 0 -d 0 -n IO3
saft-io-ctl ftrn -o 1 -t 0 -d 0 -n IO1
read -p "Check that LEVEL is 0V then press ENTER"
saft-io-ctl ftrn -o 1 -t 0 -d 1 -n IO1
read -p "Check that LEVEL is 3V then press ENTER"
saft-io-ctl ftrn -o 0 -t 1 -d 0 -n IO3
read -p "Termination enabled! Check that LEVEL dropped <3V then press ENTER"
saft-io-ctl ftrn -o 1 -t 0 -d 0 -n IO1
echo "LEMO 3 out to LEMO 1 in, term off"
saft-io-ctl ftrn -o 0 -t 0 -d 0 -n IO1
saft-io-ctl ftrn -o 1 -t 0 -d 0 -n IO3
read -p "Check that LEVEL is 0V then press ENTER"
saft-io-ctl ftrn -o 1 -t 0 -d 1 -n IO3
read -p "Check that LEVEL is 3V then press ENTER"
saft-io-ctl ftrn -o 0 -t 1 -d 0 -n IO1
read -p "Termination enabled! Check that LEVEL dropped <3V then press ENTER"
saft-io-ctl ftrn -o 1 -t 0 -d 0 -n IO3
echo "Connect LEMO2 to LEMO 4 then press ENTER"
echo "LEMO 2 out to LEMO 4 in, term off"
saft-io-ctl ftrn -o 0 -t 0 -d 0 -n IO4
saft-io-ctl ftrn -o 1 -t 0 -d 0 -n IO2
read -p "Check that LEVEL is 0V then press ENTER"
saft-io-ctl ftrn -o 1 -t 0 -d 1 -n IO2
read -p "Check that LEVEL is 3V then press ENTER"
saft-io-ctl ftrn -o 0 -t 1 -d 0 -n IO4
read -p "Termination enabled! Check that LEVEL dropped <3V then press ENTER"
saft-io-ctl ftrn -o 1 -t 0 -d 0 -n IO2
echo "LEMO 4 out to LEMO 2 in, term off"
saft-io-ctl ftrn -o 0 -t 0 -d 0 -n IO2