cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding USB Packet Size changes

bsn_14
Associate II

Hello there, I'm using USB CDC application. I'm in a situation of receiving more than 250 bytes of data from the Windows(QT). Now my doubt is when the data is more than 64 bytes the USB FS it'll not consider right.
But i revised some websites from there i came to know that "you can send larger than 64 bytes the usb will take care for multiplying the packets". But in my case it was not working. Later from our STM community i came to know that by changing this " CDC_DATA_FS_MAX_PACKET_SIZE" to larger number we can achieve receiving large number of packets.
initially CDC_DATA_FS_MAX_PACKET_SIZE is 64U. Now I've changed to 256U. 

Now it's working fine, but i don't know about later. Does it cause any problems?

1 REPLY 1
Gyessine
ST Employee

hello @bsn_14 

Despite not encountering any issues when replicating your case on my end, I recommend manipulating the internal buffer size for data reception. Most STM32 products support buffer sizes larger than 250 bytes, which allows you to handle bigger data chunks efficiently while letting the USB controller manage packetization according to the USB FS protocol.

BR

Gyessine