Skip to main content
Associate III
Mar 18, 2024 12:13 AM UTC
Question

Question regarding virtual COM port communication using CDC

This is a question regarding virtual COM port communication using CDC.
A STM32F412 Discovery with CDC installed is connected to a Windows PC, and 70 bytes of data is sent from the PC via serial communication.
However, when receiving with CDC_Receive_FS, it is divided into 64 bytes of data and 6 bytes of data.
If I change the Define definition, can I receive 70 bytes of data without being split?

This topic has been closed for replies.

3 replies

TDK
Mar 18, 2024 2:51 AM UTC

No, 64 bytes is the limit on the packet size in the USB FS protocol. It cannot be changed. 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate III
Mar 18, 2024 3:44 AM UTC

Thank you for your response.
I see, I understand. Does this constraint naturally affect CDC_Transmit_FS as well?

If I do CDC_Transmit_FS(&sendData[0], 70); and then run serialport1.Read(receiveData,0,70) on the PC side (C#), it seems to be received in one time...

Does this mean that it just looks that way?

TDK
Mar 18, 2024 12:33 PM UTC

Yes, transmitted data is also subject to the same limitation. Packets are created in 64-byte chunks after the call to CDC_Transmit_FS.

"If you feel a post has answered your question, please click ""Accept as Solution""."