Skip to content

Polling USB interrupt endpoints at 1 ms intervals doesn't work #40

@wooyay

Description

@wooyay

Describe the set-up

  • STM32U575I-EV evaluation board
  • STM32CubeU5 1.4.0
  • STM32CubeIDE 1.14.1

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)

  1. Program the Ux_Host_HID example to the board and configure the board jumpers.
  2. Attach a Low Speed mouse to the host port and observe expected behaviour - interrupt endpoint is polled every 8 ms with data being returned when available.
  3. Attach a Full Speed mouse with an endpoint that has a 1 ms pollinig interval to the host port. The interrupt endpoint stops being polled after the first NAK.

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:

/* If it's scheduled each SOF/uSOF, the request should be submitted
* immediately after packet is done. This is performed in callback.  */
if (ed -> ux_stm32_ed_interval_mask == 0)
  ed -> ux_stm32_ed_sch_mode = 0;

However, HAL_HCD_HC_NotifyURBChange_Callback() does not appear to handle the case where urb_state == URB_NOTREADY and ed -> ux_stm32_ed_type == EP_TYPE_INTR (and possibly EP_TYPE_ISOC) so the transmit request is never resubmitted.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginternal bug trackerIssue confirmed and logged into the internal bug tracking systemprojectsProjects-related (demos, applications, examples) issue or pull-request.usbUniversal Serial Bus

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions