Question
USB CDC VCP help to receive Data from PC
Posted on July 09, 2013 at 20:09
Hello everybody (This about USB VCP)
i started an application to send and receive data from PC to STM32F4 discovery i used the titorial provided by STmicro, but the problem i'm not able to sent to the STM32F4Discovery (PC to STM32), only from Discovery to PCi use this function to send to PC, she work fine, but i can't find how receive data from PC, anything can help me.
The function blow provide to send Data to PC ----------------------------------------------------------------------------------------------------------------static uint16_t VCP_DataTx (uint8_t* Buf, uint32_t Len)
{
if (linecoding.datatype == 7)
{
APP_Rx_Buffer[APP_Rx_ptr_in] = USART_ReceiveData(EVAL_COM1) & 0x7F;
}
else if (linecoding.datatype == 8)
{
APP_Rx_Buffer[APP_Rx_ptr_in] = USART_ReceiveData(EVAL_COM1);
}
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;
} #usb-vcp-need-receive-function
