CapableRobot / CapableRobot_USBHub_Firmware

https://www.crowdsupply.com/capable-robot-components/programmable-usb-hub
MIT License
9 stars 4 forks source link

Unsuccessful(?) firmware update #8

Closed grvvy closed 2 years ago

grvvy commented 2 years ago

I tried updating the firmware on one of my two hubs today per the instructions in the README:

$ ./usbhub_firmware.py circuitpython /media/jacob/CIRCUITPY/
CircuitPython Version : 6.3.0-dirty
    will be upgraded to version 5.3.0
... rebooting into CircuitPython Bootloader
... installing CircuitPython via UF2 file
... restoring code.py file
$ ./usbhub_firmware.py firmware /media/jacob/CIRCUITPY/
Updating : lib/capablerobot_usbhub.py
Updating : lib/capablerobot_ucs2113.py
Updating : lib/capablerobot_tlc59116.py
Updating : lib/capablerobot_eeprom.py
Updating : lib/adafruit_bus_device/i2c_device.py
Updating : lib/adafruit_bus_device/spi_device.py
Updating : lib/adafruit_bus_device/__init__.py
Skipping : code.py

I then unmounted the CIRCUITPY drive (Ubuntu 20.04 host) and cycled power to the device, and when I plug the device in via the host port, no lights come on and nothing happens in dmesg.

When I reconnect to host via MCU, the CIRCUITPY device reappears with /lib/ and other files, but I get this unmounted warning in dmesg:

[  +4.750759] usb 1-1.4: new full-speed USB device number 90 using xhci_hcd
[  +0.145114] usb 1-1.4: New USB device found, idVendor=04d8, idProduct=edb3, bcdDevice= 1.00
[  +0.000006] usb 1-1.4: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[  +0.000004] usb 1-1.4: Product: Programmable USB Hub
[  +0.000003] usb 1-1.4: Manufacturer: Capable Robot Components
[  +0.000003] usb 1-1.4: SerialNumber: 386A447E8464333502020205D41390FF
[  +0.028046] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
[  +0.005951] usb-storage 1-1.4:1.2: USB Mass Storage device detected
[  +0.000383] scsi host2: usb-storage 1-1.4:1.2
[  +0.012828] input: Capable Robot Components Programmable USB Hub Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.4/1-1.4:1.3/0003:04D8:EDB3.0053/input/input176
[  +0.064338] input: Capable Robot Components Programmable USB Hub Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.4/1-1.4:1.3/0003:04D8:EDB3.0053/input/input177
[  +0.000617] input: Capable Robot Components Programmable USB Hub Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.4/1-1.4:1.3/0003:04D8:EDB3.0053/input/input178
[  +0.000311] input: Capable Robot Components Programmable USB Hub as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.4/1-1.4:1.3/0003:04D8:EDB3.0053/input/input179
[  +0.000523] hid-generic 0003:04D8:EDB3.0053: input,hidraw9: USB HID v1.11 Keyboard [Capable Robot Components Programmable USB Hub] on usb-0000:00:14.0-1.4/input3
[  +0.933907] scsi host2: scsi scan: INQUIRY result too short (5), using 36
[  +0.000013] scsi 2:0:0:0: Direct-Access     Capable  Programmable USB 1.0  PQ: 0 ANSI: 2
[  +0.000830] sd 2:0:0:0: Attached scsi generic sg1 type 0
[  +0.004197] sd 2:0:0:0: [sdc] 4089 512-byte logical blocks: (2.09 MB/2.00 MiB)
[  +0.003191] sd 2:0:0:0: [sdc] Write Protect is off
[  +0.000007] sd 2:0:0:0: [sdc] Mode Sense: 03 00 00 00
[  +0.002712] sd 2:0:0:0: [sdc] No Caching mode page found
[  +0.000011] sd 2:0:0:0: [sdc] Assuming drive cache: write through
[  +0.043003]  sdc: sdc1
[  +0.052071] sd 2:0:0:0: [sdc] Attached SCSI removable disk
[  +0.843624] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

And trying to rerun the update commands shows skips:

$ ./usbhub_firmware.py circuitpython /media/jacob/CIRCUITPY/
CircuitPython Version : 5.3.0
    at specified release
$ ./usbhub_firmware.py firmware /media/jacob/CIRCUITPY/
Skipping : lib/capablerobot_usbhub.py
Skipping : lib/capablerobot_ucs2113.py
Skipping : lib/capablerobot_tlc59116.py
Skipping : lib/capablerobot_eeprom.py
Skipping : lib/adafruit_bus_device/i2c_device.py
Skipping : lib/adafruit_bus_device/spi_device.py
Skipping : lib/adafruit_bus_device/__init__.py
Skipping : code.py

Not entirely sure what's causing the device to not show up in host mode here. I'm not even getting a PWR LED when only the power cable is connected.

osterwood commented 2 years ago

I am so sorry for the issue here.

It looks like we neglected to add the CircuitPython release which shipped with new USB Hubs -- which is 6.3.0. So running the "upgrade" process actually downgraded your hub from 6.3.0 to 5.3.0. That downgraded CircuitPython release doesn't have the pin definition used for hardware revision detection (used by the new firmware), so the firmware is likely crashing upon boot.

I've pushed the 6.3.0 release asset to the repo, so the following should work to restore your hub:

git pull
./usbhub_firmware.py circuitpython PATH_TO_CIRCUITPY
./usbhub_firmware.py firmware --force PATH_TO_CIRCUITPY

Please let me know if you run into any issues with the process above.

grvvy commented 2 years ago

Cool, looks like that did the trick. Thanks!

osterwood commented 2 years ago

Glad to hear. Thanks so much for alerting me to the problem.