cancel
Showing results for 
Search instead for 
Did you mean: 

Can't recive more then 64 bytes of data from PC

DKola.1
Associate II

im working on modified CDC usb device in full speed mode and i cant recive fore then 64 bytes of data from PC. im using latest HAL drivers and release notes say USB RX lenght bugs are fixed, but i dont think so XD

1 ACCEPTED SOLUTION

Accepted Solutions

tnx for your answer. ive already found a issue with function USBD_CDC_ReceivePacket. it uses defined value as packet size argument which is CDC_EP_OUT_SIZE or something, if you woubd just use simple value not defined it works perfect

View solution in original post

7 REPLIES 7
JoniS
Senior

In a single transmit from pc or in total?​

What does your code look like which handles the receiving?

What do you mean by "modified cdc usb device"? How do you know it's not your modifications causing the issues.​

DKola.1
Associate II

yeah, it limits to 64 bytes bulk-out endpoint, also function USBD_LL_getrxdatasize returns wrong lenght of data from pc. modified because i ve made ccid class based on cdc class, cubemx doesnt support ccid class

Have you tried with usb High-speed?​ Last time i checked full speed was capped to 64bytes.

im using st32f407 discovery board so its only FS mode

Lubos KOUDELKA
ST Employee

Hello,

Packet size for full speed bulk transfers is limited to 64 bytes by USB specification. So with your hardware configuration (FS mode only) you won't be able to receive bigger packets. But still is feasible to receive longer messages in multiple packets. In your USB CDC device application CDC_Itf_Receive callback is called once you receive data from the host. Once you proceed receive data, function USBD_CDC_ReceivePacket is called to set USB peripheral to be able receive next data from USB host (PC in your case).

Best regards,

Lubos

tnx for your answer. ive already found a issue with function USBD_CDC_ReceivePacket. it uses defined value as packet size argument which is CDC_EP_OUT_SIZE or something, if you woubd just use simple value not defined it works perfect

Hi. I know it's been a couple of years since this post. I a similar issue for CCID class where I get the wrong length of incoming data(instead of 50bytes it some random number like 27432 or some ridiculous value). I do not see this CDC_EP_OUT_SIZE anywhere and I'm wondering if it was related to the wrong length.