2020-01-20 03:24 AM
Hi, I generated the code using cubeMX I'm trying to transmit the data over USB continuously, but i'm getting USBD_busy ERROR so to avoid this error I was checking the TxState value to transmit the next data. But still im missing some data. How do I solve this issue. Please someone help me in debugging this issue. Thank you.
while (1)
{
while(((USBD_CDC_HandleTypeDef*)(hUsbDeviceFS.pClassData))->TxState!=0);
CDC_Transmit_FS(data0,4);
while(((USBD_CDC_HandleTypeDef*)(hUsbDeviceFS.pClassData))->TxState!=0);
CDC_Transmit_FS(data1,4);
}
I tried to use this same code in call back function (interrupt based FD CAN receive) but here i was not able to see the COM port.
2020-01-25 02:59 AM
The function which yor are using have already checking the , you just have to call Transmit function
don't worry anything else