cancel
Showing results for 
Search instead for 
Did you mean: 

SOME BUGS to received more than 64 bytes of data on USB CDC ..I used STM32L4 series Controller

STAR
Associate II

When I transmit more than 64 bytes data then its working fine and received upto 64 bytes data its working fine. I read some Documents On internet but not got clear

when I pass 100 bytes of data from host so its not working.

#define USB_HS_MAX_PACKET_SIZE             512U

#define USB_FS_MAX_PACKET_SIZE              512U  //64U 

#define USB_MAX_EP0_SIZE                64U

int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len)

{

 /* USER CODE BEGIN 6 */

   USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]); 

   USBD_CDC_ReceivePacket(&hUsbDeviceFS);

 return (USBD_OK);

 /* USER CODE END 6 */

}

when I Changed the USB_MAX_EP0_SIZE =128 or 256 then USB got disable .....Kindly help me..

2 REPLIES 2
TDK
Guru

64-bytes per packet is a USB full-speed limitation/requirement. You can't change it.

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

Thank you TDK for your response .

But some times more than 64 bytes data received.

when I sent 80 bytes of data 5 to 8 times from host then it will received only ones. I used the Tera term for transmitting the data

If not possible to received more than 64 bytes data at a time then How can i received 100 bytes of data which is coming from Host. I am new in this development

Kindly help me.