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).

Posted in USB.

2 thoughts on “USB progress: Virtual serial port finally working

  1. Hey …
    first of all, I really like the anykey 😉 I got one at FrOSCon last year and finally found the time
    to play around with it a bit. Sadly it seems that none of the USB examples are working with my Linux machine — the anykey doesn’t even enumerate and the LED isn’t lit when it should be (in the usbkeyboard example). So … I am wondering if you got any idea what it could be or where I should look further into.

    Thanks for the anykey, and have fun with your projects!

    Reply
  2. There seems to be a very strange issue with very few of the boards that seem not to enumerate with the software USB stack (seems to be not related to Linux). Unfortunately, we did not have the USB stack ready at FrOSCon, so we could not test that by then. I have one board here that has the same problem, but I could not figure out the exact reason for this strange behaviour yet. For some weird reasons, the hardware USB stack works (for flashing) and it seems that only very few boards are affected (and I could not measure any difference between working boards non-working versions). Anyway, you can send us an email so we can replace your board.

    Reply

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

Time limit is exhausted. Please reload the CAPTCHA.