5 echo "Usage: $0 /path/to/firmware.hex"
8 _check_bootloader_device
()
10 cec_adapter
=`lsusb | grep "03eb:2ffa" | wc -l`
11 if [ $cec_adapter -eq 0 ]; then
13 cec_adapter
=`lsusb | grep "03eb:2ffa" | wc -l`
16 if [ $cec_adapter -eq 0 ]; then
17 echo "ERROR: failed to find any CEC adapter in bootloader mode"
26 echo "Instructing the CEC adapter to enter bootloader mode"
27 cec_adapter
=`lsusb | grep "2548:1001" | wc -l`
28 if [ $cec_adapter -gt 0 ]; then
29 echo "bl" | cec-client
-s -d 2
30 echo "Waiting for the device to reinitialise"
39 if [ ! -f "$file" ]; then
40 echo "ERROR: firmware file '$file' does not exist"
45 Flash '$file' onto the CEC adapter
47 DO NOT POWER OFF OR DISCONNECT THE DEVICE WHILE THIS OPERATION IS IN PROGRESS!
50 Are you sure you want to flash '$file' onto the CEC adapter?
51 Type 'do it!' if you're sure. Anything else will cancel the operation.
55 if [ ! "$confirmation" == "do it!" ]; then
65 _check_bootloader_device
71 echo "Erasing the previous firmware"
72 sudo dfu-programmer at90usb162 erase
74 echo "Flashing the new firmware"
75 sudo dfu-programmer at90usb162 flash
"$file"
79 ===============================================================================
83 Remove the USB cable from the device and reconnect it to use the new firmware.
91 programmer
=`which dfu-programmer`
92 if [ -z "$programmer" ]; then
93 echo "dfu-programmer was not found in your path, installing"
94 sudo apt-get
install -y dfu-programmer
97 programmer
=`which dfu-programmer`
98 if [ -z "$programmer" ]; then
99 echo "ERROR: failed to find dfu-programmer"
107 ===============================================================================
108 Pulse-Eight CEC Adapter firmware flash tool
109 ===============================================================================