USB is a rather complex protocol. Its main advantage in computer history was that it promised to offer a useful replacement for legacy parallel and serial ports. In comparison though, USB is terribly complex, but it does not suffer the typical shortcomings of its predecessors and has some nice, built-in advantages: Hot plugging, device self description, automatic driver matching etc.
Keeping that in mind, it’s a bit surprising that the number-one mode of communication in embedded DIY projects that support USB is – a virtual serial port. This approach combines the complexity of USB with the inflexibility of serial ports. The worst of both worlds!
For certain purposes, serial ports are nice: Quick and dirty communication, debugging etc. So we’re happy to announce that our USB software stack now includes a virtual serial port implementation (USB CDC class, Abstract Control Model) – if you’re curious to see one of the weirdest USB class specifications, have a look at the USB CDC specification at USB.org.
To see it in action, compile and install the cdcleetifier example. Then replug your device. On Macs and Linux systems, it should appear as a serial device in the /dev subdirectory. Connect it to a serial terminal to see the old serial glory of the eighties (on a Mac, you may use “screen /dev/cu.usbserialV1.1” – quit with “ctrl-a k y”). Type some text – the example will turn your text into V3RY C00L l33TSP3AK on the fly.
We haven’t tested it on Windows yet, but it seems to require an additional (quite useless) configuration (*.inf ?) file that basically states that this serial device is a serial device (if someone manages to get it running, we would be happy to hear from you).