This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USBD CDC establishing connection has huge latency

Hi, 

I have implemented the USBD CDC ACM driver into my firmware. What stands out is the latency as soon as the event 

APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN 

triggers, my terminal emulator takes some time to actually establish the connection (i.e. until the communication channel can actually be used)

This must be related to the firmware since this happens on a macOS Terminal emulator as much as on a Windows emulator.

What's happening in the background here?

BR
Parents
  • I found somewhat of a solution or rather the inhibitory factor.

    CDC will apparently stall after suspending and resuming the port if there's no continuous stream of data being written (at least in the beginning)

    I put a for loop at the end of the initialisation which just sends a hundred empty strings over USB which leads to just milliseconds before my computer and other devices recognize the device as such. 

    connecting itself is similar. in my main state machine I have a case that says as long as Im not connected, send an empty string once in a while. 

    This is obviously kind of a dirty solution but since it doesn't interfere with business logic Ill leave it like this for now

Reply
  • I found somewhat of a solution or rather the inhibitory factor.

    CDC will apparently stall after suspending and resuming the port if there's no continuous stream of data being written (at least in the beginning)

    I put a for loop at the end of the initialisation which just sends a hundred empty strings over USB which leads to just milliseconds before my computer and other devices recognize the device as such. 

    connecting itself is similar. in my main state machine I have a case that says as long as Im not connected, send an empty string once in a while. 

    This is obviously kind of a dirty solution but since it doesn't interfere with business logic Ill leave it like this for now

Children
No Data
Related