From 58f55fc63060bbbc51661028098358fd9750e987 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 30 Oct 2015 15:52:03 +0800 Subject: [PATCH] artiq_flash: check that xc3sprog is found. closes #162 --- artiq/frontend/artiq_flash.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/artiq/frontend/artiq_flash.sh b/artiq/frontend/artiq_flash.sh index 155fcb422..94773ec9b 100755 --- a/artiq/frontend/artiq_flash.sh +++ b/artiq/frontend/artiq_flash.sh @@ -166,9 +166,17 @@ fi set +e xc3sprog -c $CABLE -R > /dev/null 2>&1 -if [ "$?" != "0" ] +STATUS=$? +set -e +if [ "$STATUS" == "127" ] then - echo "Flashing failed. Maybe you do not have permission to access the USB device?" + echo "xc3sprog not found. Please install it or check your PATH." + exit +fi +if [ "$STATUS" != "0" ] +then + echo "Failed to connect to FPGA." + echo "Maybe you do not have permission to access the USB device?" echo "To fix this you might want to add a udev rule by doing:" echo "$ sudo cp $ARTIQ_PREFIX/misc/$UDEV_RULES /etc/udev/rules.d" echo "Then unplug/replug your device and try flashing again" @@ -177,7 +185,6 @@ then echo "Please make sure you used the correct -t option (currently: $BOARD)" exit fi -set -e if [ ! -z "$FILENAME" ] then