greatscottgadgets / facedancer

Implement your own USB device in Python, supported by a hardware peripheral such as Cynthion or GreatFET
BSD 3-Clause "New" or "Revised" License
780 stars 116 forks source link

GreatFET One: host mode: failed to read data from endpoint 1 #74

Open 0xZm1t53r opened 1 year ago

0xZm1t53r commented 1 year ago

Device: GreatFET One Target device: Khadas VIM3 board in fastboot mode (any other device in fastboot mode will work) Running code:

from facedancer import FacedancerUSBHostApp

# Enumerate and configure the attached device.
u = FacedancerUSBHostApp(verbose=3)
u.initialize_device(assign_address=1, apply_configuration=1)

# Print the device state.
print("Device initialized: ")
print("\tDevice is: {}".format("Connected" if u.device_is_connected() else "Disconnected"))

# Print information about the attached device...
print("Attached device: {}".format(u.get_device_descriptor()))

u.send_on_endpoint(1, b"getvar:version\x00")
u.read_from_endpoint(1, expected_read_size=64)

The execution stalls at u.read_from_endpoint(1, expected_read_size=64). Debug analysis indicates that self._get_read_status() doesn't return a 'complete' status. USB Analyzer shows that the response was send: usb-log

Did I skip any setup actions, or is the problem caused by a different factor?

antoinevg commented 9 months ago

Your code looks good, I'm trying to reproduce this on my side but I don't have access to a Khadas VIM3 board.

Have you come across any other device(s) that are failing?