cancel
Showing results for 
Search instead for 
Did you mean: 

Doubts Regarding USB CDC in STM32F407

deepakelango05
Associate II

I am recently working on USB CDC in STM32F407 and i have the following doubts:

  1. Based on my understanding 64  bytes can be send using CDC_Transmit_FS, so can we give a array of some size which is greater than 2KBytes and DO we need to do any chunking here ?
  2. Is the data send via USB CDC is always 64 bytes or can we configure it if yes How can we configure it to transmit more bytes?
  3. So CDC_Recevice_FS in usb_cdc_if.c is a application hook function which is called for every 64 byte. Is these configurable let us say i want to call these function only when 2KBytes is received?
  4. What is the maximum data that can be received and send using USB_CDC Functions.
1 REPLY 1
TDK
Super User

1) The peripheral will do the chunking. Send it as much as you want. The operation needs to be complete before you call CDC_Transmit_FS again.

2) N/A

3) No. You get called on every packet received. Each packet will be up to 64 bytes. Shove it into a buffer if that's what you need. After you return from CDC_Receive_FS, the data is stale and effectively lost.

4) See previous answers.

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