Larger USB Packet Sizes on USB-CDC FS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Larger USB Packet Sizes on USB-CDC FS

1,487 Views
jblackston
Contributor II

I had a quick question about the CDC data transfer. I know if you have USB-FS chip your payload size is 64 Bytes. But I was wondering if someone had example code of showing how to handle larger payloads like 128 byte or 256 bytes.  On the PC side I'm able to just send out like 128 bytes and I just keep reading in on the firmware side in payload chunks of 64 bytes till I read in my 128 bytes and that works. Sending out to the PC do I send 64 bytes and then the null and keep doing that till I'm done sending out my full payload of like 128 bytes? or can I just keep sending out my data and then at the end of it all send the null?

 

I was just hoping someone might have implemented the logic for this and it could possibly save me some time trying to figure it out.

Labels (1)
0 Kudos
1 Reply

865 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Jason,

With the usb_device_cdc_acm_send(), the device can send out the data of arbitrary length. If the total length of data is multiple of the endpoint's maxPacketSize, then a zero length packet should be appended after all of the data has been sent out.

Please refer to "USB Stack Device Reference Manual.pdf" in the folder of KSDK/docs/usb for more details.


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos