This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USBH_CDC_ACM_Receive never completes

Hello I have a USB communication between two STM32F769 µC. This works perfectly except in one case. When the amount of data is equal to the Bulk Maximum Endpoint Packet Size (64byte).

I have attached the eventlog of 2 transmissions. The first one works without problems. In the second one, it seems that the device wants to start another transfer with length 0. For some reason, this causes the host to never reach the ACM_Receive_done event.

Unfortunately, it is not clear to me whether this is an error in the USBH or USBD driver or whether I have configured something incorrectly. Maybe someone here can help me or knows a workaround.

18, 55.00062091, , id=0x0A02, 0x00000009 0x00000000
19, 55.00118750, USBD_Driver, EndpointTransfer, device=0 ep_addr=0x82 data=0x20039960 num=36
20, 55.00120335, USBD_CDC, ACM_WriteData, instance=0 len=36 result=36
21, 55.00122139, USBD_Driver, OnSignalEndpointEvent, device=0 ep_addr=0x82 event=ARM_USBD_EVENT_IN
22, 55.00124539, USBH_Driver, OnSignalPipeEvent, ctrl=0 pipe_hndl=0x40040560 event=ARM_USBH_EVENT_TRANSFER_COMPLETE
23, 55.00128160, USBD_Driver, EndpointTransferGetResult, device=0 ep_addr=0x82 num=36
24, 55.00132179, USBH_Driver, PipeTransferGetResult, ctrl=0 pipe_hndl=0x40040560 num=36
25, 55.00132825, USBH_CDC, ACM_ReceiveDone, instance=0 num=512
26, 55.00146280, USBH_CDC, ACM_Send, instance=0 num=15
27, 55.00146749, USBH_Core, PipeSend, pipe_handle=0x2003A084 len=15
28, 55.00148893, USBH_Driver, PipeTransfer, ctrl=0 pipe_hndl=0x40040540 packet=0x02 num=15
29, 55.00150943, USBD_Driver, OnSignalEndpointEvent, device=0 ep_addr=0x02 event=ARM_USBD_EVENT_OUT
30, 55.00152511, USBH_Driver, OnSignalPipeEvent, ctrl=0 pipe_hndl=0x40040540 event=ARM_USBH_EVENT_TRANSFER_COMPLETE
31, 55.00156479, USBD_Driver, EndpointTransferGetResult, device=0 ep_addr=0x02 num=15
32, 55.00158246, USBD_Driver, EndpointTransfer, device=0 ep_addr=0x02 data=0x20037760 num=64
33, 55.00159203, USBD_CDC, ACM_ReadData, instance=0 len=15 result=15
34, 55.00162583, USBH_Driver, PipeTransferGetResult, ctrl=0 pipe_hndl=0x40040540 num=15
35, 55.00163194, USBH_CDC, ACM_SendDone, instance=0 num=15
36, 55.00164870, USBH_CDC, ACM_GetStatus, instance=0 status=usbOK
37, 55.00170857, USBH_CDC, ACM_Receive, instance=0 num=512
38, 55.00171364, USBH_Core, PipeReceive, pipe_handle=0x2003A09C len=512
39, 55.00173923, USBH_Driver, PipeTransfer, ctrl=0 pipe_hndl=0x40040560 packet=0x03 num=512
40, 55.00177201, , id=0x0A02, 0x00000009 0x00000000
41, 55.00222110, USBD_Driver, EndpointTransfer, device=0 ep_addr=0x82 data=0x20039960 num=64
42, 55.00223702, USBD_CDC, ACM_WriteData, instance=0 len=64 result=64
43, 55.00227466, USBD_Driver, OnSignalEndpointEvent, device=0 ep_addr=0x82 event=ARM_USBD_EVENT_IN
44, 55.00234438, USBD_Driver, EndpointTransferGetResult, device=0 ep_addr=0x82 num=64
45, 55.00239225, USBD_Driver, OnSignalEndpointEvent, device=0 ep_addr=0x82 event=ARM_USBD_EVENT_IN
46, 55.00241658, USBH_Driver, OnSignalPipeEvent, ctrl=0 pipe_hndl=0x40040560 event=ARM_USBH_EVENT_TRANSFER_COMPLETE
47, 55.00243350, USBD_Driver, EndpointTransfer, device=0 ep_addr=0x82 data=0x20039960 num=0
48, 55.00245671, USBD_Driver, EndpointTransferGetResult, device=0 ep_addr=0x82 num=0
49, 55.00248261, USBH_Driver, PipeTransferGetResult, ctrl=0 pipe_hndl=0x40040560 num=64
50, 55.00250663, USBH_Driver, PipeTransfer, ctrl=0 pipe_hndl=0x40040560 packet=0x03 num=448

Parents
  • Hi Alexander,

    this might need a bit more investigation.

    I think your problem is related to Zero Length Packet.

    In device situation when there is a request to send 64 bytes and if that is same as maximum packet size for the IN endpoint then another packet of 0 size is sent after it to terminate the transfer.

    What is the maximum packet size for your bulk endpoint on the device?

    Best regards, Milorad

Reply
  • Hi Alexander,

    this might need a bit more investigation.

    I think your problem is related to Zero Length Packet.

    In device situation when there is a request to send 64 bytes and if that is same as maximum packet size for the IN endpoint then another packet of 0 size is sent after it to terminate the transfer.

    What is the maximum packet size for your bulk endpoint on the device?

    Best regards, Milorad

Children