Question
STM32L496VG USB CDC(VCP) Receive function
Posted on July 04, 2018 at 05:13
Hello guys. I configure the CDC on CubeMX. But the function CDC_Receive_FS receive1 byte each. That is, if I transmit 12345678 then I receive only 8.
I have to modify the function like this:
uint8_t UserDataReceive[100];
uint16_t i = 0;
static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len)
{
/* USER CODE BEGIN 6 */
USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]);
memcpy(UserDataReceive + i, Buf, *Len);
++i;
//
USBD_CDC_ReceivePacket(&hUsbDeviceFS);
return (USBD_OK);
/* USER CODE END 6 */
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
In an array uint8_t UserRxBufferFS[APP_RX_DATA_SIZE] I receive such bytes when sending 12345678:
[0] - 0x38
[1] - 0x41
[2] - 0x6D.
Why? Please help!
I would like to take all of the transmitted packet, and not one byte processing. Can somewhere the settings for the life of the package are available?
#stm32l #vcp #cdc