USBHID driver packet send fails when multiple message sent on one endpoint

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USBHID driver packet send fails when multiple message sent on one endpoint

1,436 次查看
Vishal_Panchal
Contributor I

While sending more than one packet on same endpoint using USB_DeviceHidSend(), sometimes packet is not sent out on USB.

While, as per description of USB_DeviceHidSend(), 
 " Currently, only one transfer request can be supported for one specific endpoint. If there is a specific requirement to support multiple transfer requests for one specific endpoint, the application should implement a queue in the application level. The subsequent transfer could begin only when the previous transfer is done (get notification through the endpoint callback). "

So, I have implement a queue based on ringbuffer to store the packets. And I am sending those stored packets whenever I receive the response kUSB_DeviceHidEventSendResponse via USB_DeviceHidInterruptIn.

Is it correct implementation to avoid usbhid packet send failure?

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

1,349 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Vishal_Panchal,

Yes, it is correct to implement a queue to handled these individual transfer requests as to make sure that the subsequent transfer begings only after the previous one is done.

There may be several ways to implement this. A relayed topic was covered, for example, on the following thread.

https://community.nxp.com/t5/MCUXpresso-SDK/K22-USB-device-CDC-and-HID-problem/m-p/817565

I hope that this helps!

Regards,
Gustavo

0 项奖励
回复