-
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
usbus: Add support for full speed with high speed phy #19438
Conversation
sys/usb/usbus/usbus.c
Outdated
} | ||
|
||
if (res < 0) { | ||
return 0; /* Misbehaving usbdev device not implementing any speed indication */ |
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.
Shouldn't it be an assert(false)
?
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.
probably better than softly failing yes.
49fa7bc
to
39bb057
Compare
58e2624
to
3881101
Compare
{ | ||
dwc2_usb_otg_fshs_t *usbdev = (dwc2_usb_otg_fshs_t *)dev; | ||
const dwc2_usb_otg_fshs_config_t *conf = usbdev->config; | ||
unsigned speed = (_device_regs(conf)->DSTS & USB_OTG_DSTS_ENUMSPD_Msk) >> USB_OTG_DSTS_ENUMSPD_Pos; |
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.
unsigned speed = (_device_regs(conf)->DSTS & USB_OTG_DSTS_ENUMSPD_Msk) >> USB_OTG_DSTS_ENUMSPD_Pos; | |
unsigned speed = (_device_regs(conf)->DSTS & USB_OTG_DSTS_ENUMSPD_Msk) >> | |
USB_OTG_DSTS_ENUMSPD_Pos; |
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.
Squash it directly. Please rebase and include the revert for PR #19437.
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.
Fixed, squashed and added two revert commits for the ones in #19437
3881101
to
b342f76
Compare
b342f76
to
8044e57
Compare
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 and works as expected.
bors merge |
bors cancel |
bors merge |
Build succeeded: |
@bergzand Thanks for contributing this fix. @miri64 Again, sorry for my confusion with the |
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