eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
148 stars 88 forks source link

USBX send same HID descriptor data for different interface #91

Closed HaoboGu closed 1 year ago

HaoboGu commented 1 year ago

Hello, I'm trying to use 2 interfaces in a HID class. My descriptor is like:

image

There are two hid reports, using 2 interfaces. I enabled 2 interfaces by calling ux_device_stack_class_register twice, with different ux_device_class_hid_parameter_report_address and interface_number:

  ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
     0, 0, &parameter1);

  ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
     0, 1, &parameter2);

USBX sends correct configuration descriptor, but wrong HID descriptor data.

The HID descriptor data for the first interface is correct, but for the second interface, USBX sends the same HID data with the length of second HID report.

The correct HID descriptor data for the first interface:

image

The wrong HID descriptor data for the second interface(this interface has two endpoints, this data appears twice):

image

Except HID descriptor for the second interface(Ignore vid and pid):

image
xiaocq2001 commented 1 year ago

I'm not able to reproduce the issue in latest code. Note in 6.1.8 release there is a fix about such issue: https://github.com/azure-rtos/usbx/releases/tag/v6.1.8_rel (HID descriptor search fix), file modification (common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c)

HaoboGu commented 1 year ago

fixed by updating to latest version, thanks!