cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR Transmitting data over USB.

MR.11
Associate II

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.

1 REPLY 1
dbgarasiya
Senior II

The function which yor are using have already checking the , you just have to call Transmit function

don't worry anything else