Skip to main content
Visitor II
October 13, 2020
Solved

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

  • October 13, 2020
  • 3 replies
  • 4061 views

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

    This topic has been closed for replies.
    Best answer by DKola.1

    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

    3 replies

    Visitor II
    October 13, 2020

    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.1Author
    Visitor II
    October 14, 2020

    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

    Visitor II
    October 14, 2020

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

    DKola.1Author
    Visitor II
    October 14, 2020

    im using st32f407 discovery board so its only FS mode

    ST Employee
    October 15, 2020

    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

    DKola.1AuthorAnswer
    Visitor II
    October 15, 2020

    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

    Visitor II
    August 19, 2023

    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.