Skip to content

Commit b92937b

Browse files
committed
Merge branch 'wifishield-bugfix'
2 parents 8a3240e + 83dbd39 commit b92937b

39 files changed

+21489
-1962
lines changed

hardware/arduino/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh

100644100755
+34-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/sh
22

3-
WIFI_FW_PATH="/hardware/arduino/firmwares/wifi-shield"
3+
WIFI_FW_PATH="/hardware/arduino/firmwares/wifishield/binary"
44
AVR_TOOLS_PATH="/hardware/tools/avr/bin"
55

6+
TARGET_MICRO="at32uc3a1256"
7+
8+
69
progname=$0
710

811
usage () {
@@ -20,28 +23,49 @@ EOF
2023
upgradeHDmodule () {
2124
sleep 1 # Give time to the shield to end the boot
2225
echo "****Upgrade HD WiFi module firmware****\n"
23-
dfu-programmer at32uc3a1256 erase
24-
dfu-programmer at32uc3a1256 flash --suppress-bootloader-mem $WIFI_FW_PATH/wifi_dnld.hex
25-
dfu-programmer at32uc3a1256 start
26-
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"
26+
dfu-programmer $TARGET_MICRO erase
27+
dfu-programmer $TARGET_MICRO flash --suppress-bootloader-mem $WIFI_FW_PATH/wifi_dnld.hex
28+
dfu-programmer $TARGET_MICRO start
29+
30+
if [ $? != 0 ] ; then
31+
echo "\nError during device initialization, please close the J3 jumper and press the reset button.\nTry -h for help\n"
32+
exit 1 # if the device is not recognized exit
33+
fi
34+
35+
echo -n "\nPress the RESET button on the shield then type [ENTER] to upgrade the firmware of the shield..\n"
2736
read readEnter
2837
}
2938

3039
upgradeShield () {
3140
sleep 1 # Give time to the shield to end the boot
3241
echo "****Upgrade WiFi Shield firmware****\n"
33-
dfu-programmer at32uc3a1256 erase
34-
dfu-programmer at32uc3a1256 flash --suppress-bootloader-mem $WIFI_FW_PATH/wifiHD.hex
35-
dfu-programmer at32uc3a1256 start
42+
dfu-programmer $TARGET_MICRO erase
43+
dfu-programmer $TARGET_MICRO flash --suppress-bootloader-mem $WIFI_FW_PATH/wifiHD.hex
44+
dfu-programmer $TARGET_MICRO start
45+
46+
if [ $? != 0 ] ; then
47+
echo "\nError during device initialization, please close the J3 jumper and press the reset button.\nTry -h for help\n"
48+
exit 1 # if the device is not recognized exit
49+
fi
50+
3651
echo "\nDone. Remove the J3 jumper and press the RESET button on the shield."
3752
echo "Thank you!\n"
3853
}
3954

55+
4056
cat <<EOF
4157
4258
Arduino WiFi Shield upgrade
4359
=========================================
44-
Disclaimer: to access to the USB devices correctly, the dfu-programmer needs to be used as root. Run this script as root.
60+
Instructions:
61+
62+
To access to the USB devices correctly, the dfu-programmer needs to have the root permissions.
63+
64+
You can upgrade the firmware of the antenna togheter with the shield firmware or only the shield firmware
65+
if there aren't changes on the antenna firmware.
66+
67+
Use the '-h' parameter for help
68+
=========================================
4569
4670
EOF
4771

@@ -90,7 +114,7 @@ if [ $USER = 'root' ] ; then #check if the current user is root
90114
esac
91115
done
92116
else
93-
echo "You are not root!\n"
117+
echo "Please retry running the script as root.\n"
94118
fi
95119

96120
shift $(($OPTIND - 1))
Binary file not shown.

0 commit comments

Comments
 (0)