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
154 stars 89 forks source link

怎么获取USB设备的生产商? #55

Closed LiuChenghu closed 2 years ago

LiuChenghu commented 2 years ago

获得了imanufacturer、iproduct、iserialnumber,如何通过这些索引获取字符串?

xiaocq2001 commented 2 years ago

You can try ux_host_stack_device_string_get.

LiuChenghu commented 2 years ago

你好,我使用ux_host_stack_device_string_get来获取,但是里面的参数范围不知道怎么用,我大致用这样的方式读了一下,发现下面图中的问题,不是连续字符串。请问一下这个函数该怎么用? image

LiuChenghu commented 2 years ago

还想请教一个问题,就是我使用USBX,识别到U盘后,过一会就一直进HAL_HCD_IRQHandler里面,其他程序无法执行,该如何排查问题?

xiaocq2001 commented 2 years ago
/*    device                                Pointer to device instance    */
/*    descriptor_buffer                     Pointer to a buffer to fill   */
/*                                          LANGID or STRING descriptor   */
/*    length                                Length of buffer              */
/*    language_id                           0 to obtain LANGID descriptor */
/*                                          valid language ID to obtain   */
/*                                          string descriptor             */
/*    string_index                          Index of the string           */

For returned descriptor, please refer to section 9.6.7 String of USB 2.0 spec.

xiaocq2001 commented 2 years ago

If your program keep interrupted and runs in HAL_HCD_IRQHandler, please check if some interrupt is not correctly handled so it keeps triggering interrupt.

xiaocq2001 commented 2 years ago

No feedback long time, closing.