Skip to content

Reset hub port on enumeration failure #3000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
tannewt opened this issue Feb 26, 2025 · 0 comments
Open
1 task done

Reset hub port on enumeration failure #3000

tannewt opened this issue Feb 26, 2025 · 0 comments

Comments

@tannewt
Copy link
Collaborator

tannewt commented Feb 26, 2025

Operating System

Linux

Board

Fruit Jam

Firmware

CircuitPython with PICO PIO USB Host

What happened ?

Device fails to enumerate.

How to reproduce ?

Enumerate a thrustmaster joystick full speed device connected through a ch334 hub. Also seen with an 8bitdo controller.

When setting the device address the device correctly sees the pack and acks. However if the host doesn't read the ack correctly, the transfer fails and is retried. It perpetually fails because the device is now at the assigned address, not 0.

So, when retrying enumeration we should also issue a reset on the port to reset the device.

This may be related to #2163. We should also check the hub status during enumeration in case the device tries to reset.

Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)

Set Address = 1
[1:0] Set Address: 00 05 01 00 00 00 00 00 
 on EP 00 with 8 bytes: OK
REPL to disable.
code.py output:
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 2/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 3/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED, xferred_bytes = 0
00 05 01 00 00 00 00 00 

Enumeration attempt 1
[1:0] Set Address: 00 05 01 00 00 00 00 00 
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 1/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 2/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 3/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED, xferred_bytes = 0
00 05 01 00 00 00 00 00 

Enumeration attempt 2
[1:0] Set Address: 00 05 01 00 00 00 00 00 
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 1/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 2/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 3/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED, xferred_bytes = 0
00 05 01 00 00 00 00 00 

Enumeration attempt 3
[1:0] Set Address: 00 05 01 00 00 00 00 00 
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 1/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 2/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED 3/3, retrying
on EP 00 with 0 bytes: FAILED
[1:0] Control FAILED, xferred_bytes = 0
00 05 01 00 00 00 00 00 

Screenshots

No response

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant