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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1,441 Views
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?

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

1,354 Views
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 Kudos
Reply