Skip to main content
Explorer
March 18, 2024
Question

Question regarding virtual COM port communication using CDC

  • March 18, 2024
  • 1 reply
  • 2263 views

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.

    1 reply

    Super User
    March 18, 2024

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

    Explorer
    March 18, 2024

    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?

    Super User
    March 18, 2024

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