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

endpoint will mistakenly enter stall state while sending descritor #94

Closed xuzihan351 closed 1 year ago

xuzihan351 commented 1 year ago

ux_device_stack_descriptor_send:+404

  /* Ensure we have the correct language page.  */
  if (_ux_utility_short_get(string_framework) == request_index)

In some cases, host will send GET_STRING_DESCRTIPTOR setup packet with wIndex(the request_index var) == 0x0000, because of the code before, the stack will not be able to find a valid string and will generate a endpoint stall.

xiaocq2001 commented 1 year ago

As described in USB spec, image

Zero wIndex case is not for string descriptor (reset to zero for other descriptors), we need to consider if it should be implemented.