Skip to content

Fix host issue with with turnaround (inter-packet) timing #179

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hathach
Copy link
Contributor

@hathach hathach commented Apr 29, 2025

USB 2.0 specs 7.1.18 specify 2 bit time for inter-packet, especially when switching bus direction.
image

This is essential when we overlock mcu to higher clock such as 240/264 Mhz. We basically send handshake too fast after EOP and give device no time to capture the bus correcly. This also occurs with some slow device such as LS gamepad in adafruit/circuitpython#10243

turnaround delay is done in cycle which is conveniently = 4 pp->clk_div_/fsls_tx.div_int. Since we also have overhead, I think it is best to do 1.5 bit time for LS and 1 bit time for FS.

I also notice that we mistakenly send SOF instead of Keep-alive on the LS bus, therefore fix it as well.

@tannewt @FoamyGuy @ladyada Please try to see if this fixes your issue with gamepad (direct attached) and 264Mhz overclocked with hub + mouse + keyboard on fruit jam

…after received data from device

host: send keep-alive packet instead of SOF on lowspeed bus
@hathach hathach force-pushed the fix-lowspeed-turraround branch from 1173833 to 791bce4 Compare April 29, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant