app_usbd_cdc_acm_write takes more time to transfer

Hi team,

I'm streaming the sensor data through USB (using hterm) every 2.5ms.

i have configures USB as CDC and using virtual COM port.

In each iteration, i transfer 87 to 95 bytes which varies based on data.

The issue i'm facing is that sometimes app_usbd_cdc_acm_write() takes 153us and sometimes it takes 214us and rarely it takes 30ms to complete the transfer.

Completing the transfer i mean to receive APP_USBD_CDC_ACM_USER_EVT_TX_DONE event.

 app_usbd_cdc_acm_write() never returns any error code.

Could you help me understand why this time difference in transfer and how could i resolve it?

Parents
  • Hi

    Do you have any other USB devices connected while running this test? 

    If so, are you able to run a test without any other connected USB devices to see if the erratic write times disappear?

    The CDC class uses USB bulk transfers, which means you are not guaranteed bandwidth or latency, only data integrity (that all the data you send is received successfully, and in the same order). 

    Best regards
    Torbjørn

Reply
  • Hi

    Do you have any other USB devices connected while running this test? 

    If so, are you able to run a test without any other connected USB devices to see if the erratic write times disappear?

    The CDC class uses USB bulk transfers, which means you are not guaranteed bandwidth or latency, only data integrity (that all the data you send is received successfully, and in the same order). 

    Best regards
    Torbjørn

Children
Related