-
Notifications
You must be signed in to change notification settings - Fork 73
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
Polling USB interrupt endpoints at 1 ms intervals doesn't work #40
Comments
Hi @wooyay, The Regarding the handling of the case STM32CubeU5/Middlewares/ST/usbx/common/usbx_stm32_host_controllers/ux_hcd_stm32_callback.c Lines 421 to 435 in c8fcb26
Regarding endpoint types Once again, the With regards, |
Hi @ALABSTM, I realise When interrupt endpoints are created the polling interval mask is calculated based on the interval given in the endpoint descriptor: STM32CubeU5/Middlewares/ST/usbx/common/usbx_stm32_host_controllers/ux_hcd_stm32_endpoint_create.c Lines 199 to 202 in c8fcb26
In the case of a typical Low Speed mouse with a endpoint polling interval of 10 ms ux_stm32_ed_interval_mask is calculated as 7, so the endpoint is polled every 8 frames. A Full Speed mouse with a endpoint polling interval of 1 ms sets ux_stm32_ed_interval_mask to 0 so it must be polled every frame.
Interrupt endpoints are typically submitted by the periodic scheduler which is triggered by the SOF interrupt. The periodic scheduler compares the current frame number against the interrupt mask to decide whether STM32CubeU5/Middlewares/ST/usbx/common/usbx_stm32_host_controllers/ux_hcd_stm32_periodic_schedule.c Lines 201 to 208 in c8fcb26
1 ms endpoints must be scheduled by the callback as stated in the comment. If the transfer completes with a NAK, the callback function is called with In the code from the callback handling |
Hi @wooyay, Many thanks for all these details. A report has been logged internally at the attention of our development teams. I will keep you updated. With regards, |
ST Internal Reference: 173341 |
Describe the set-up
Describe the bug (skip if none)
USB endpoints that declare a 1 ms polling interval are not correctly handled by the USBX STM32 host controller driver.
How to reproduce the bug (skip if none)
Note that this is not limited to Ux_Host_HID or HID devices. It affects any USB endpoint that sets a 1 ms periodic interval.
Additional context
Investigation shows that when the endpoint is created the interval mask is set as 0 as expected to force the scheduler to queue the host channel every frame. In
_ux_hcd_stm32_perioidic_schedule()
the scheduler mode is set:However,
HAL_HCD_HC_NotifyURBChange_Callback()
does not appear to handle the case whereurb_state == URB_NOTREADY
anded -> ux_stm32_ed_type == EP_TYPE_INTR
(and possiblyEP_TYPE_ISOC
) so the transmit request is never resubmitted.The text was updated successfully, but these errors were encountered: