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 DISCONNECT THE HDMI CABLES BEFORE STARTING AND
48 DO NOT POWER OFF OR DISCONNECT THE DEVICE WHILE THIS OPERATION IS IN PROGRESS!
51 Are you sure you want to flash '$file' onto the CEC adapter?
52 Type 'do it!' if you're sure. Anything else will cancel the operation.
56 if [ ! "$confirmation" == "do it!" ]; then
66 _check_bootloader_device
72 echo "Erasing the previous firmware"
73 sudo dfu-programmer at90usb162 erase
75 echo "Flashing the new firmware"
76 sudo dfu-programmer at90usb162 flash
"$file"
80 ===============================================================================
84 Remove the USB cable from the device and reconnect it to use the new firmware.
92 programmer
=`which dfu-programmer`
93 if [ -z "$programmer" ]; then
94 echo "dfu-programmer was not found in your path, installing"
95 sudo apt-get
install -y dfu-programmer
98 programmer
=`which dfu-programmer`
99 if [ -z "$programmer" ]; then
100 echo "ERROR: failed to find dfu-programmer"
108 ===============================================================================
109 Pulse-Eight CEC Adapter firmware flash tool
110 ===============================================================================