USB CDC ZLP with high speed device in full speed bus

Efim Monjak 6 Reputation points
2022-08-10T09:04:23.253+00:00

Hi,

we use a high speed USB device connected other USB 1.1 hub to Windows 10 PC. The PC use generic USB driver and create a VCP. It looks like the max. packet size for CDC transmitt is still 512 bytes. Therefore, the sending of the strings with the 64 characters length is not completed with ZLP.

Sending a string with 512 characters works correctly.

Any ideas how to trigger the sending of a ZLP from VCP?

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,926 Reputation points
    2022-08-11T15:48:23.197+00:00

    Hi there,

    Try to reproduce the error by sending a packet of bytes whose length is a multiple of 64 bytes using USBD_CDC_SetTxBuffer/USBD_CDC_TransmitPacket functions.

    The maximum packet length for full-speed USB communication is 64 bytes. So the data will be transferred in chunks of 64 bytes and needs to be reassembled on the other end.

    USB CDC is based on bulk transfer endpoints and implements a data stream (also known as pipe), not a message stream. It's basically a stream of bytes. So if you send 200 bytes, do not expect any indication of where the 200 bytes end. Such information is not transmitted.

    https://github.com/STMicroelectronics/STM32CubeF3/issues/2

    -------------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

  2. Efim Monjak 6 Reputation points
    2022-08-12T07:32:31.017+00:00

    @Limitless Technology

    Hi,

    thank you for response.
    Unfortunately, the description was too imprecise. It is about the data transfer from the PC to the device. The software only has access to the virtual COM port.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.