Skip to content

USB: CDC ACM

hasu@tmk edited this page Nov 20, 2020 · 11 revisions

TMK CDC Console

Blocking Problem

We have to check if host port is ready with DTR before using SendByte() and Flush(). The functions can block if host port is not ready. This works well with cutecom on Linux at least.

  // check if host port is ready with DTR(and RTS?)
  if ((CDC_device.State.ControlLineStates.HostToDevice & CDC_CONTROL_LINE_OUT_DTR) == 0)
      return false;
LUFA CDC Class Driver doc:

Another major oversight is that there is no mechanism for the host to notify the device that there is a data sink on the host side ready to accept data. This means that the device may try to send data while the host isn’t listening, causing lengthy blocking timeouts in the transmission routines. It is thus highly recommended that the virtual serial line DTR (Data Terminal Ready) signal be used where possible to determine if a host application is ready for data.

Widnows 10

TMK CDC console is not recoginized on Windows 10 while no issue on Linux.

LUFA CDC Class Driver doc:

One major issue with CDC-ACM is that it requires two Interface descriptors, which will upset most hosts when part of a multi-function "Composite" USB device. This is because each interface will be loaded into a separate driver instance, causing the two interfaces be become unlinked. To prevent this, you should use the "Interface Association Descriptor" addendum to the USB 2.0 standard which is available on most OSes when creating Composite devices.

Clone this wiki locally