-
Notifications
You must be signed in to change notification settings - Fork 997
machine/atsamd21,atsamd51,nrf52840: correct USB CDC #1007
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This line appears to have caused the regression. What is it supposed to be doing?
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.
Interesting. I added to send a zlp when the other cases were not handled, which seemed to correct an issue with the USB enumeration on Windows 10, based on a comment from @sago35
Removing that line gets it to work on Linux and macOS, but does not work on Windows 10. I suppose that means we need to further investigate what Windows in sending as the initial request.
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.
I made a proposal for sendZlp() below and in the comments that follow.
However, I'm not sure that this idea is correct.
#884 (comment)
The samd51 I'm trying has five USB Device EndPoint Interrupt Flags.
https://www.mouser.com/datasheet/2/268/60001507A-1130176.pdf
P.1161.
I did an additional check on atsamd51 and USB-CDC worked if you called sendZlp() on TRCPT0.
It may be better to process TRCPT0 as follows.
My environment is Windows 10 + PyPortal (samd51).
sago35@f80cc33.
Since sendZlp() clears the bottom 12 bits of PCKSIZE, it assumes that BYTE_COUNT = 0.
The PCKSIZE is described on P.1197.
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.
URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR, which probably exists only in Windows, needs to be handled well.
Maybe a careful reading of the Aruduino and circuitpython sources will solve the problem.
#884 (comment)
Uh oh!
There was an error while loading. Please reload this page.
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.
https://github.com/adafruit/ArduinoCore-samd/blob/master/cores/arduino/USB/USBCore.cpp#L928
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.
This process is not in machine_atsamd51.go.
On the else side, sendZlp () may not be necessary or should not be called.
https://github.com/adafruit/ArduinoCore-samd/blob/master/cores/arduino/USB/USBCore.cpp#L951
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.
Please see #1013 I think you have the right idea @sago35