-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
MAX3421E NAK retry handling next frame #2543
Conversation
…FRAME as official option
I finished work now and It's ready for review and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you very much of the PR. Though I made some changes to
- always en-force max NAK with default = 1. IMO, this should work best for most people. We can increase to 2,3 should it has issue with throughput in the future
- add tuh_configure() cfgid to allow changing this behavior. This can only be used to change other max3421 behavior such as interrupt level polarity, edge in the future.
- add ep's hxfr
tested and confirmed it only send 1 token per frame, previously it would send around 6 IN token for the bulkd endpoint
@hathach It doesn't work if cfg->max3421.max_nak is the maximum value. |
That is ok max attempt can also be inferred as no nak limit as well. To be honest a usb frame will probably hold less than 10 retries due to back and forth spi transactions PS: though we could add a check in the tuh_configure() to limit it to |
@hathach I think, it's a little bit confusing, when last "attempt" is not a real attempt but instead used as suspend state. |
This PR is intended to fix the problem as discussed in #2510 / issue #2541
The change means that in the case of a NAK, the transfer will only be repeated in the next frame (triggered by frame IRQ).
The 1st commit of PR is a first draft (not for merging) as a basis for further discussion and testing.