From 401379667e6ae3a9ed856371866b245a21fde64e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 15 Apr 2013 14:40:25 -0500 Subject: [PATCH] Properly report device programming errors --- fpga/xilinx/programmer/program_device.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fpga/xilinx/programmer/program_device.sh b/fpga/xilinx/programmer/program_device.sh index 364330f..3e8bfb6 100755 --- a/fpga/xilinx/programmer/program_device.sh +++ b/fpga/xilinx/programmer/program_device.sh @@ -11,6 +11,17 @@ fi UNIQUEID=$(date "+%s%N") DEVICETYPE=$(bitdevice $1) SVFFILE=/tmp/${UNIQUEID}.svf +if [[ $? != 0 ]]; then + exit 1 +fi bit2svf $1 $SVFFILE $DEVICETYPE +if [[ $? != 0 ]]; then + rm -f $SVFFILE + exit 1 +fi xsvf-rpi -v -s $SVFFILE +if [[ $? != 0 ]]; then + rm $SVFFILE + exit 1 +fi rm $SVFFILE