Can't receive data on EP0 in control transfer for HID class

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

Can't receive data on EP0 in control transfer for HID class

Jump to solution
1,003 Views
chuckh
Contributor III

Hello,

My application is supposed to receive a 64 byte packet on EP0 in the form of a SET REPORT.  There is code in usb_framework.c in  USB_Control_Service() for class requests with non-zero size that calls _usb_device_recv_data().  However, when this function is called, my data buffer is not updated.  I added code to call _usb_device_get_transfer_status() after _usb_device_recv_data() and find that this function returns USB_STATUS_TRANSFER_IN_PROGRESS indefinitely.

Am I missing a call to another function to service the USB or perhaps there is something else I am missing?

Any help will be greatly appreciated.

0 Kudos
1 Solution
606 Views
chuckh
Contributor III

I figured out that the LONG_RECEIVE_TRANSACTION and LONG_SEND_TRANSACTION defines were messing me up.  Once I changed the Max Packet to 64 and removed these defines, it seems to be working fine.

View solution in original post

0 Kudos
2 Replies
606 Views
chuckh
Contributor III

It seems like the _usb_device_recv_data() sets up for the next receive, which I expect to be EP0 OUT transaction (Host to my device).  The USB sniffer shows this packet is acked, so where does it go in the stack?  Since it is on EP0, shouldn't I see this in the USB_Control_Service() function?

0 Kudos
607 Views
chuckh
Contributor III

I figured out that the LONG_RECEIVE_TRANSACTION and LONG_SEND_TRANSACTION defines were messing me up.  Once I changed the Max Packet to 64 and removed these defines, it seems to be working fine.

0 Kudos