-
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/cdc/ecm: fix High-Speed mode #19358
Merged
Merged
Conversation
This file contains 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
To be able to define configurations like EP data sizes depending on whether full-speed or high-speed USB device peripherals are used, the feature `periph_usbdev_hs` is introduced.
To be able to define configurations like EP data sizes depending on whether full-speed or high-speed USB device peripherals are used, the feature `HAS_PERIPH_USBDEV_HS` is introduced.
CDC ECM driver/netdev is only working in High-Speed mode if the EP data size is at least 512 byte.
gschorcht
requested review from
leandrolanzieri,
jia200x and
MrKevinWeiss
as code owners
March 7, 2023 10:38
github-actions
bot
added
Area: boards
Area: Board ports
Area: build system
Area: Build system
Area: drivers
Area: Device drivers
Area: Kconfig
Area: Kconfig integration
Area: sys
Area: System
Area: USB
Area: Universal Serial Bus
labels
Mar 7, 2023
gschorcht
added
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
labels
Mar 7, 2023
dylad
approved these changes
Mar 7, 2023
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.
Looks good to me.
I don't own these boards but it should be pretty straightforward.
bors merge |
Build succeeded: |
@dylad Thanks for reviewing. |
bors bot
added a commit
that referenced
this pull request
Mar 31, 2023
19437: boards: fix USB configuration for stm32f429i-disco r=bergzand a=gschorcht ### Contribution description This PR fixes the problem that CDC ECM is not working for `stm32f429i-disco`. With PR #19358, the EP data size for CDC ECM bulk endpoints was increased to 512 byte to fix the problem that CDC ECM was not working for boards with USB High-Speed peripherals. Module `periph_usbdev_hs` was introduced to indicate whether a high-speed peripheral is used. However, the `stm32f429i-disco` board uses a mixture of USB OTG HS peripheral together with the on-hip FS PHY. Using the USB OTG HS peripheral together with a FS-PHY and increasing the EP data size for the CDC ECM bulk endpoint to 512 bytes doesn't work. Therefore, module `periph_usbdev_hs` is not used for now to workaround the problem. Thus, the maximum number of EPs used is that of the USB OTG FS peripheral, which is only 4. This is not sufficient for this test application since the board uses `stdio_cdc_acm`. The board is therefore blacklisted. ### Testing procedure Use a `stm32f429i-disc1` or a `stm32f429i-disco` board and flash the test app: ``` USEMODULE=stdio_uart BOARD=stm32f429i-disco make -j8 -C tests/usbus_cdc_ecm flash ``` With this PR it should be possible to ping the board. ### Issues/PRs references Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
bors bot
added a commit
that referenced
this pull request
Mar 31, 2023
19438: usbus: Add support for full speed with high speed phy r=miri64 a=bergzand ### Contribution description This adds infrastructure around usbus and usbdev to query the speed of the USB link after enumeration. This as the maximum speed of the link might be slower than the maximum speed of the peripheral. This is the case with the stm32f429i-disco board that has a full speed phy coupled with the high speed peripheral. This also adds the necessary code to the cdc_ecm code to use the correct packet size. The allocated buffer size is not modified with this PR unfortunately. ### Testing procedure The `cdc_ecm` handler should work with a HS peripheral coupled with a FS phy. ### Issues/PRs references Fixes an issue caused by #19358 Co-authored-by: Koen Zandberg <koen@bergzand.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: boards
Area: Board ports
Area: build system
Area: Build system
Area: drivers
Area: Device drivers
Area: Kconfig
Area: Kconfig integration
Area: sys
Area: System
Area: USB
Area: Universal Serial Bus
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
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.
Contribution description
This PR provides some changes to fix the USBUS CDC ECM interface in High-Speed mode.
In High-Speed mode, the EP data size has to be at least 512 bytes instead of 64 Byte in Full-Speed mode. To be able to define configurations like EP data sizes depending on whether Full-Speed or High-Speed USB device peripherals are used, the feature
periph_usbdev_hs
/HAD_PERIPH_USBDEV_HS
is introduced.Testing procedure
Use
tests/usbus_cdc_ecm
and any board with USB HS connector, for example:ping
command works with this PR but doesn't work without this PR.Issues/PRs references