-
Notifications
You must be signed in to change notification settings - Fork 1.7k
USB: CDC ACM
Using LUFA CDC Class driver
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;
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.
TMK CDC console is not recoginized on Windows 10 while no issue on Linux.
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.