-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/usbus: handle exceeding number of endpoints #19362
sys/usbus: handle exceeding number of endpoints #19362
Conversation
204855e
to
b61513a
Compare
Please squash |
This PR #17086 will make this PR partially obsolete. Which one should be merged first? |
I am still not really convinced if an Ideally, the number of EPs needed should be known at compile time and a |
If, on the other hand, we do not use |
What if we introduce for each interface macros that define the number of EPs required? For example |
Sounds good to me. |
If you can provide the missing functions for |
Heya, thanks all for pushing this. I really don't have the time at this point to provide the missing implementation. I'd really appreciate it if somebody could add the missing bits. Thanks! |
PR #19371 provides compile time check for the static configuration in |
b61513a
to
30d409a
Compare
If the number of endpoints is not sufficient for an application, it should not be silently ignored and cause a non-working application. Rather, should cause an assertion as it is a configuration issue.
30d409a
to
1fa988d
Compare
Now where PR #17086 is merged, this PR is reduced to the dynamic check of exceeding number of EPs. |
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.
ACK.
bors merge |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
Build succeeded: |
Contribution description
This PR fixes issue #19359 for STM32 USB OTG cores partially:
kernel_panic
if the number of EPs is exhausted. This fixes the problem described in issue sys/usbus: usbus_cdc_ecm does not work together with usbus_cdc_acm for STM32 #19359 for USB cores with CID version 1.x, e.g. for STM32F439ZI FS interface (CID 1200) since they only have 4 IN and 4 OUT endpoints including the control endpoint EP0.If a feature is not supported, the device has to signal a STALL on the endpoint that should be used for the data phase in a control transaction. This means that for control read transactions the IN endpoint must signal a STALL and for control write transactions the OUT endpoint must signal a STALL. In former implementation, only the IN endpoint signaled a STALL independent on whether it was a control read or control write transaction. The change also fixes the problem that the enumeration stopped for about 5 seconds if moduleusb_reset_board
isn't used. The reason is that the host sends aSET LINE CODING
request to the CDC ACM interface and the device must signal a STALL on the OUT endpoint if it is not supported.Testing procedure
nucleo-f439zi
:ping
command can't be executed. With this PR, the application stops withkernel_panic
. Becausestdio_cdc_acm
is used which doesn't work in this case, thekernel_panic
has to be observed in debugger.nucleo-f767zi
:Issues/PRs references
Fixes issue #19359 patially.