diff --git a/module_dfu/host/windows/testdfu.bat b/module_dfu/host/windows/testdfu.bat new file mode 100644 index 00000000..e4a0d6fc --- /dev/null +++ b/module_dfu/host/windows/testdfu.bat @@ -0,0 +1,30 @@ +@echo off +ping 1.1.1.1 -n 1 -w 3000 > null +%1 info +echo *** DFU download new firmware 1 *** +%1 download %2 +ping 1.1.1.1 -n 1 -w 3000 > null +%1 info +echo *** DFU download new firmware 2 *** +%1 download %3 +ping 1.1.1.1 -n 1 -w 5000 > null +%1 info + +echo *** DFU upload firmware *** +%1 upload upload.bin +ping 1.1.1.1 -n 1 -w 3000 > null + +echo *** DFU revert to factory *** +%1 revertfactory +ping 1.1.1.1 -n 1 -w 3000 > null +%1 info + +echo *** DFU download uploaded firmware *** +%1 download upload.bin +ping 1.1.1.1 -n 1 -w 3000 > null +%1 info +echo *** DFU revert to factory *** +%1 revertfactory +ping 1.1.1.1 -n 1 -w 3000 > null +%1 info +echo DFU Test Complete! diff --git a/module_dfu/host/xmos_dfu_osx/testdfu.sh b/module_dfu/host/xmos_dfu_osx/testdfu.sh new file mode 100755 index 00000000..b481e25f --- /dev/null +++ b/module_dfu/host/xmos_dfu_osx/testdfu.sh @@ -0,0 +1,104 @@ +#! /bin/bash +################################################################################ + +function usage { + echo "USAGE: testdfu.sh device_pid device_string upgrade1 upgrade2" + echo " For example:" + echo " testdfu.sh XMOS_SMART_MIC_PLUS_BASE \"XMOS SmartMic\" upgrade1.bin upgrade2.bin" + echo " testdfu.sh 0x0008 \"xCORE\" upgrade1.bin upgrade2.bin" + exit 1 +} + +#find out were we are running from so we only exec this programs +PROGDIR=`dirname $0` + +#setup environment +export DYLD_LIBRARY_PATH=$PROGDIR:$DYLD_LIBRARY_PATH + +if [ "$1" != "" ]; then + device_pid=$1 +else + usage +fi + +if [ "$2" != "" ]; then + device_grep_string=$2 +else + usage +fi + +if [ "$3" != "" ]; then + update1=$3 +else + usage +fi + +if [ "$4" != "" ]; then + update2=$4 +else + usage +fi + +#basic check for binary +if [ ! -f $update1 ]; then + echo "FATAL: can't find update binary named $update1" + exit 1 +fi + +if [ ! -f $update2 ]; then + echo "FATAL: can't find update binary named $update2" + exit 1 +fi + +#------------------------------------------------------------------------------- +echo "" +echo DFU test +echo -------- +sleep 5 +echo "Version Read:" +system_profiler SPUSBDataType|grep -A10 "$device_grep_string" |grep Version + +echo "" +echo "*** DFU download new firmware 1 ***" +$PROGDIR/xmosdfu $device_pid --download $update1 +sleep 2 +echo "Version Read:" +system_profiler SPUSBDataType|grep -A10 "$device_grep_string" |grep Version + +echo "" +echo "*** DFU download new firmware 2 ***" +$PROGDIR/xmosdfu $device_pid --download $update2 +sleep 2 +echo "Version Read:" +system_profiler SPUSBDataType|grep -A10 "$device_grep_string" |grep Version + +echo "" +echo "*** DFU upload existing firmware ***" +$PROGDIR/xmosdfu $device_pid --upload upload.bin +sleep 2 +echo "Version Read:" +system_profiler SPUSBDataType|grep -A10 "$device_grep_string" |grep Version + +echo "" +echo "*** DFU revert to factory ***" +$PROGDIR/xmosdfu $device_pid --revertfactory +sleep 2 +echo "Version Read:" +system_profiler SPUSBDataType|grep -A10 "$device_grep_string" |grep Version + +echo "" +echo "*** DFU download uploaded firmware ***" +$PROGDIR/xmosdfu $device_pid --download upload.bin +sleep 2 +echo "Version Read:" +system_profiler SPUSBDataType|grep -A10 "$device_grep_string" |grep Version + +echo "" +echo "*** DFU revert to factory ***" +$PROGDIR/xmosdfu $device_pid --revertfactory +sleep 2 +echo "Version Read:" +system_profiler SPUSBDataType|grep -A10 "$device_grep_string" |grep Version +echo "" +echo DFU Test Complete! +