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.
Solved! Go to Solution.
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.
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?
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.