AnsweredAssumed Answered

Hi, Facing USB Write issue when USB traffic is more.

Question asked by g.vijay on May 3, 2017
Latest reply on Dec 21, 2017 by Shail Shah

Hi,

 

We are using STM32F072C8 device and we are using USB CDC Interface when communicating with PC.

 

When USB bus traffic is low everything is working fine.

 

But when USB bus traffic is heavy we observed during USB CDC Write the Tx state showing always busy.

Not get recovering from here due to USB Write is Blocking and our application gets  hanging.

 

We are using the USB CDC drivers generated by STM32CUBE app.

 

uint8_t CDC_Transmit_FS(uint8_t *buf,uint8_t Length)
{
uint8_t result = USBD_OK;
unsigned int l_len;

USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDevice_0->pClassData;
// if USB is busy then return
if(hcdc->TxState != 0)
{
return USBD_BUSY;//It is hanging here.
 

 

Please can you suggest  what to we check and what to do..

Outcomes