Skip to content
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

Fix some bugs #438

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix some bugs #438

wants to merge 3 commits into from

Conversation

gyojir
Copy link

@gyojir gyojir commented Jan 8, 2019

1 . Do not reset Global Items rptSize and rptCount on Main Items
In Report Descriptor parsing, Global Item will remain after the Main Item.

2 . Do not flip toggle value on Toggle Error
In MAX3421E Programming Guide p13

By ACK-ing the transfer and not updating its own toggle bit, the SIE causes the peripheral to complement its toggle bit, thus forcing the data toggle mechanism back into sync.

In short, there is no need to flip on a toggle error.
With this fix my Logitech Gamepad F310 is now working.

3 . Fix reading of data with offset
Reading of multiple bytes of data probably got bugged, so I fixed it.

@Lauszus
Copy link
Collaborator

Lauszus commented Feb 4, 2019

@felis since this is part of the code it would be good if you could verify this?

tmk added a commit to tmk/USB_Host_Shield_2.0 that referenced this pull request Oct 31, 2020
On the error data should be ignored and do nothing on
data toggle bit.

felis#438

----
If the IN data was error-free but there was a data toggle mismatch (the
DATA0 or DATA1 PID send by the peripheral did not match the endpoint
toggle value), the SIE sends the ACK handshake, but it does not
complement the data toggle or assert the RCVDAVIRQ. The SIE sets HRSL =
0110 (Toggle Error) for this condition. This situation would happen if
the peripheral received a corrupted ACK handshake from the previous IN
transfer. In this case the host ignores the data in the RCVDATA FIFO,
because it represents data that the peripheral mistakenly resent when it
missed the last ACK handshake. By ACK-ing the transfer and not updating
its own toggle bit, the SIE causes the peripheral to complement its
toggle bit, thus forcing the data toggle mechanism back into sync.
----
MAX3421 Programming Guide p.13
tmk added a commit to tmk/USB_Host_Shield_2.0 that referenced this pull request Oct 31, 2020
On the error data should be ignored and do nothing on
data toggle bit.

felis#438

----
If the IN data was error-free but there was a data toggle mismatch (the
DATA0 or DATA1 PID send by the peripheral did not match the endpoint
toggle value), the SIE sends the ACK handshake, but it does not
complement the data toggle or assert the RCVDAVIRQ. The SIE sets HRSL =
0110 (Toggle Error) for this condition. This situation would happen if
the peripheral received a corrupted ACK handshake from the previous IN
transfer. In this case the host ignores the data in the RCVDATA FIFO,
because it represents data that the peripheral mistakenly resent when it
missed the last ACK handshake. By ACK-ing the transfer and not updating
its own toggle bit, the SIE causes the peripheral to complement its
toggle bit, thus forcing the data toggle mechanism back into sync.
----
MAX3421 Programming Guide p.13
@doctea
Copy link

doctea commented Feb 18, 2022

This seems to solve the problem I mention in YuuichiAkagawa/USBH_MIDI#73 that prevented MIDI data and MIDI clock from working on the Arturia Beatstep!

@YuuichiAkagawa YuuichiAkagawa mentioned this pull request Jan 30, 2024
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.

3 participants