From 84d842a16f05dc2de368d5205bd63fab2d5987e9 Mon Sep 17 00:00:00 2001 From: Fede85 Date: Mon, 11 Mar 2013 01:01:02 +0100 Subject: changes in the script for upgrading the wifi shield --- .../scripts/ArduinoWifiShield_upgrade.sh | 44 +++++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) mode change 100644 => 100755 firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh (limited to 'firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh') diff --git a/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh b/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh old mode 100644 new mode 100755 index 5082392..d9a9e02 --- a/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh +++ b/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh @@ -1,8 +1,11 @@ #!/bin/sh -WIFI_FW_PATH="/hardware/arduino/firmwares/wifi-shield" +WIFI_FW_PATH="/hardware/arduino/firmwares/wifishield/binary" AVR_TOOLS_PATH="/hardware/tools/avr/bin" +TARGET_MICRO="at32uc3a1256" + + progname=$0 usage () { @@ -20,28 +23,49 @@ EOF upgradeHDmodule () { sleep 1 # Give time to the shield to end the boot echo "****Upgrade HD WiFi module firmware****\n" - dfu-programmer at32uc3a1256 erase - dfu-programmer at32uc3a1256 flash --suppress-bootloader-mem $WIFI_FW_PATH/wifi_dnld.hex - dfu-programmer at32uc3a1256 start - echo -n "\nRemove the J3 jumper then press the RESET button on the shield then type [ENTER] to upgrade the firmware of the shield..\n" + dfu-programmer $TARGET_MICRO erase + dfu-programmer $TARGET_MICRO flash --suppress-bootloader-mem $WIFI_FW_PATH/wifi_dnld.hex + dfu-programmer $TARGET_MICRO start + + if [ $? != 0 ] ; then + echo "\nError during device initialization, please close the J3 jumper and press the reset button.\nTry -h for help\n" + exit 1 # if the device is not recognized exit + fi + + echo -n "\nPress the RESET button on the shield then type [ENTER] to upgrade the firmware of the shield..\n" read readEnter } upgradeShield () { sleep 1 # Give time to the shield to end the boot echo "****Upgrade WiFi Shield firmware****\n" - dfu-programmer at32uc3a1256 erase - dfu-programmer at32uc3a1256 flash --suppress-bootloader-mem $WIFI_FW_PATH/wifiHD.hex - dfu-programmer at32uc3a1256 start + dfu-programmer $TARGET_MICRO erase + dfu-programmer $TARGET_MICRO flash --suppress-bootloader-mem $WIFI_FW_PATH/wifiHD.hex + dfu-programmer $TARGET_MICRO start + + if [ $? != 0 ] ; then + echo "\nError during device initialization, please close the J3 jumper and press the reset button.\nTry -h for help\n" + exit 1 # if the device is not recognized exit + fi + echo "\nDone. Remove the J3 jumper and press the RESET button on the shield." echo "Thank you!\n" } + cat <