AnsweredAssumed Answered

Problem with Cube USB device transfer

Question asked by pi.ka on Nov 5, 2015
Latest reply on Dec 16, 2015 by brandt.thorsten.001
I am implementing new class driver for USB device. Basically this is PTP/MTP compatible class driver for device. I run into problem during USB transmission.  For now I have device descriptor configured and transferred to host - I can see one Interrupt endpoint and  two bulk endpoints correctly configured. Then what I (as a device) get from host is higher level OpenSession command which I get on OUT endpoint, and I respond with short message (12 bytes) on IN endpoint. This I can see in wireshark as 80 bytes URB _BULK out submit (64 bytes + openSession command), 64 bytes URB_BULK complete and 64 URB_BULK in submit, 76 URB_BULK in complete (64 bytes + 12 bytes of response). This gets transmitted correctly, now my host has the session open and tries to get some information about the device.
So again I get URB_BULK out with the request from host, I can see complete on USB bus, I send my response which  is 76 bytes long (larger then packet size for the endpoint which is set to 64 bytes) and I can have only 64 bytes sent through the endpoint. This is transfered correctly - host receives it, but there is no transmission of the rest of the data. Host receives only 64 bytes.

The application handles transfer in DataOut function (basically it is based on CDC class driver - so this is USBD_CDC_DataOut equivalent):

USBD_LL_GetRxDataSize();
Process_RXBuffer();
USBD_LL_Transmit();
USBD_LL_PrepareReceive();
return USBD_OK;

Process_RXBuffer handles the command processing and prepares the response in tx buffer.

I am working with STM32F429i-disco with USE_USB_HS_IN_FS set.
The transmission seems to be properly configured on STM side but the transmission does not get past initial block in transfers larger then 64 bytes. Is there some step I am missing to get transfer of data larger then maxpacket to be succesfull?

Outcomes