rt-thread
rt-thread copied to clipboard
[bsp]imxrt系列 usb主机驱动 获取描述符bug
https://github.com/RT-Thread/rt-thread/blob/5ff358fec6585f683b214f49e7d4707952cbdbfa/bsp/imxrt/libraries/drivers/drv_usbh.c
437行处
static uint8_t _ehci1_pipe_buf[64]; static uint8_t _ehci1_pipe_idx;
这是我的另一个4G上网设备 USB的描述符
使用bsp驱动获取描述符时 只能获取到前64byte 后面都是对前64byte的复制
09 02 90 00 05 01 00 e0 c8 08 0b 00 02 e0 01 03 05 09 04 00 00 01 e0 01 03 03 05 24 00 10 01 05 24 01 00 01 04 24 02 00 05 24 06 00 01 07 05 82 03 08 00 10 09 04 01 00 02 0a 00 00 04 07 05 81
09 02 90 00 05 01 00 e0 c8 08 0b 00 02 e0 01 03 05 09 04 00 00 01 e0 01 03 03 05 24 00 10 01 05 24 01 00 01 04 24 02 00 05 24 06 00 01 07 05 82 03 08 00 10 09 04 01 00 02 0a 00 00 04 07 05 81
09 02 90 00 05 01 00 e0 c8 08 0b 00 02 e0 01 03
我猜测实际上这个设备的控制通道大于64byte,一次性全读取144个字节的配置描述符会一起回来 但又因为buffer大小的限制只接收到了前64字节
所以将管道缓存提升到512 就可以避开这个问题
请看看怎么解决这个问题