ItsRiprod / DeskThing

Desk Thing: The Discord Thing, Trello Thing, The Weather Thing, The Macro Thing, Just not The Car Thing anymore
MIT License
151 stars 6 forks source link

Input/Output Error when trying to enter burn mode #22

Closed mbledkowski closed 1 month ago

mbledkowski commented 1 month ago

Hello, I did exactly what the instructions for flashing says. However, when I run superbird_tool with --burn-mode flag, I get the following error:

Spotify Car Thing (superbird) toolkit, v0.1.5, by Car-Thing-Hax-Community
     https://github.com/Car-Thing-Hax-Community/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Entering USB Burn Mode
writing /home/mble/.build/carthing/superbird-tool/images/superbird.bl2.encrypted.bin at 0xfffa0000
 writing to: 0xfffa0000
Traceback (most recent call last):
  File "/home/mble/.build/carthing/superbird-tool/superbird_tool.py", line 361, in <module>
    dev.bl2_boot(str(IMAGES_PATH.joinpath('superbird.bl2.encrypted.bin')), str(IMAGES_PATH.joinpath('superbird.bootloader.img')))
  File "/home/mble/.build/carthing/superbird-tool/superbird_device.py", line 275, in bl2_boot
    self.send_file(bl2_file, self.ADDR_BL2, chunk_size=4096, append_zeros=True)
  File "/home/mble/.build/carthing/superbird-tool/superbird_device.py", line 270, in send_file
    self.write(address, file_data, chunk_size, append_zeros)
  File "/home/mble/.build/carthing/superbird-tool/superbird_device.py", line 246, in write
    self.device.writeLargeMemory(address, data, chunk_size, append_zeros)
  File "/usr/local/lib/python3.12/site-packages/pyamlboot/pyamlboot.py", line 238, in writeLargeMemory
    self._writeLargeMemory(address+offset, data[offset:offset+writeLength], \
  File "/usr/local/lib/python3.12/site-packages/pyamlboot/pyamlboot.py", line 212, in _writeLargeMemory
    self.dev.ctrl_transfer(bmRequestType = 0x40,
  File "/usr/local/lib/python3.12/site-packages/usb/core.py", line 1082, in ctrl_transfer
    ret = self._ctx.backend.ctrl_transfer(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/usb/backend/libusb1.py", line 893, in ctrl_transfer
    ret = _check(self.lib.libusb_control_transfer(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/Output Error

Best regards, Maciej Błędkowski

mbledkowski commented 1 month ago

Few additional thing: I am on latest Fedora Workstation (Linux). Device is correctly detected:

Spotify Car Thing (superbird) toolkit, v0.1.5, by Car-Thing-Hax-Community
     https://github.com/Car-Thing-Hax-Community/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Found device booted in USB Mode (buttons 1 & 4 held at boot)
mbledkowski commented 1 month ago

I have tried flashing on Windows; with a similar effect:

mble@neptune MINGW64 ~/.build/superbird-tool (main)
$ python superbird_tool.py --find_device
Spotify Car Thing (superbird) toolkit, v0.1.5, by Car-Thing-Hax-Community
     https://github.com/Car-Thing-Hax-Community/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Found device booted in USB Mode (buttons 1 & 4 held at boot)

mble@neptune MINGW64 ~/.build/superbird-tool (main)
$ python superbird_tool.py --burn_mode
Spotify Car Thing (superbird) toolkit, v0.1.5, by Car-Thing-Hax-Community
     https://github.com/Car-Thing-Hax-Community/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Device is not booted to the correct mode!
     need to power on while holding buttons 1 & 4 to enter USB Mode
Operation took: 0.06600141525268555

mble@neptune MINGW64 ~/.build/superbird-tool (main)
$ python superbird_tool.py --burn_mode
Spotify Car Thing (superbird) toolkit, v0.1.5, by Car-Thing-Hax-Community
     https://github.com/Car-Thing-Hax-Community/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Entering USB Burn Mode
writing C:\Users\mble\.build\superbird-tool\images\superbird.bl2.encrypted.bin at 0xfffa0000
 writing to: 0xfffa0000
Traceback (most recent call last):
  File "C:\Users\mble\.build\superbird-tool\superbird_tool.py", line 361, in <module>
    dev.bl2_boot(str(IMAGES_PATH.joinpath('superbird.bl2.encrypted.bin')), str(IMAGES_PATH.joinpath('superbird.bootloader.img')))
  File "C:\Users\mble\.build\superbird-tool\superbird_device.py", line 275, in bl2_boot
    self.send_file(bl2_file, self.ADDR_BL2, chunk_size=4096, append_zeros=True)
  File "C:\Users\mble\.build\superbird-tool\superbird_device.py", line 270, in send_file
    self.write(address, file_data, chunk_size, append_zeros)
  File "C:\Users\mble\.build\superbird-tool\superbird_device.py", line 246, in write
    self.device.writeLargeMemory(address, data, chunk_size, append_zeros)
  File "C:\Users\mble\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyamlboot\pyamlboot.py", line 238, in writeLargeMemory
    self._writeLargeMemory(address+offset, data[offset:offset+writeLength], \
  File "C:\Users\mble\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyamlboot\pyamlboot.py", line 219, in _writeLargeMemory
    ep.write(data[offset:offset+blockLength], 1000)
  File "C:\Users\mble\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 408, in write
    return self.device.write(self, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mble\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\core.py", line 989, in write
    return fn(
           ^^^
  File "C:\Users\mble\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\backend\libusb1.py", line 837, in bulk_write
    return self.__write(self.lib.libusb_bulk_transfer,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mble\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\backend\libusb1.py", line 938, in __write
    _check(retval)
  File "C:\Users\mble\AppData\Local\Programs\Python\Python312\Lib\site-packages\usb\backend\libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 32] Pipe error

mble@neptune MINGW64 ~/.build/superbird-tool (main)
$ python superbird_tool.py --find_device
Spotify Car Thing (superbird) toolkit, v0.1.5, by Car-Thing-Hax-Community
     https://github.com/Car-Thing-Hax-Community/superbird-tool
     Forked from https://github.com/bishopdynamics/superbird-tool

Found device booted in USB Mode (buttons 1 & 4 held at boot)

This suggest, that the issue is probably hardware related

mbledkowski commented 1 month ago

Turns out, it was a cable issue all along