AnsweredAssumed Answered

stm32f207 usb only multiple of 64 bytes can be send

Question asked by easylwl.easylwl on Apr 10, 2013
Latest reply on Dec 6, 2014 by galyant.sergey
change by stm32 usb device VCP example:
my send function:
uint16_t VCP_DataTx (uint8_t* Buf, uint32_t Len)
{
 uint8_t i;
 for (i=0;i<64;i++)    //only multiple of 64 bytes can be send
  {
 APP_Rx_Buffer[APP_Rx_ptr_in] = g_ucaHeartbeat[i];
 APP_Rx_ptr_in++;
  
   /* To avoid buffer overflow */
   if(APP_Rx_ptr_in == APP_RX_DATA_SIZE)
   {
     APP_Rx_ptr_in = 0;
   } 
  }
return USBD_OK;
}

the  usbd_cdc_core.c function
DCD_EP_Tx (pdev,
               VL8461_IN_EP,
               (uint8_t*)&APP_Rx_Buffer[USB_Tx_ptr],
               USB_Tx_length);   

//the USB_Tx_length must be 64 ??
please help

Outcomes