Using the TivaWare USB library for CDC virtual COM port has problems with correctly transporting the SerialState notification of the UART status. According to the USB Universal Serial Bus Communication Class Subclass Specification for PSTN Devices, Revision 1.2, Section 6.5.4 SerialState, and Table 31: UART State Bitmap Values, the SerialState notification is supposed to send UART error indicators (overrun, parity error, and framing error) and signal states (BREAK, RI, DSR, and DCD) to the USB host.
However, using a modified version of the TivaWare "usb_dev_serial" example for the ek-tm4c123gxl (I actually run it on the Connected LaunchPad Evaluation Board EK-TM4C1294XL), the TivaWare USB library has two main problems:
1) The UART error signal indicators are never sent - they are sent from the example's CheckForSerialStateChange() function by calling the USBDCDCSerialStateChange() function, but the overrun, parity error, and framing error bits are always cleared on the data sent on the USB bus (the BREAK bit is correctly sent, but never cleared - see second item).
2) The serial signal states are correctly sent on the USB bus by the USBDCDCSerialStateChange() function when they are asserted, but they are never cleared when their signals are de-asserted. Therefore, the recipient cannot be notified when these signal states are no longer present.
The problem appears to be due to the following lines in the USBDCDCSerialStateChange() function: (file usbdcdc.c)
psInst->ui16SerialState |= (ui16State & USB_CDC_SERIAL_ERRORS); // merge in error bits
psInst->ui16SerialState &= ~USB_CDC_SERIAL_ERRORS; // save only state bits
psInst->ui16SerialState |= (ui16State & ~USB_CDC_SERIAL_ERRORS); // merge in state bits
I replaced those lines with the following line to get the expected operation:
psInst->ui16SerialState = ui16State;
With this change, UART error indicators are sent to the USB host and the serial signal states are correctly transported to the USB host as well.