Skip to main content
Visitor II
January 20, 2020
Question

ERROR Transmitting data over USB.

  • January 20, 2020
  • 1 reply
  • 565 views

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.

    This topic has been closed for replies.

    1 reply

    Visitor II
    January 25, 2020

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

    don't worry anything else