cancel
Showing results for 
Search instead for 
Did you mean: 

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

gatadivijay
Associate II
Posted on May 03, 2017 at 16:29

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..

1 REPLY 1
Shail Shah
Associate II
Posted on December 21, 2017 at 06:29

Hello,

We are also facing the similar problem. code getting stuck in hcdc->TxState state in CDC_Transmit_FS function.

We are trying to send data from USB CDC to PC. Any help would be appreciated.