1
votes

I have two programs on two different machines, Windows and Linux.

They expect to communicate via a com port. Until now, we used an USB to UART bridge on the Linux machine, with its driver, to do the communication. Windows listed the device as a COM port and on the linux side we had a tty device for the Linux application to connect to.

Now, on the new board revision which I'm working with, that chip is no longer present. I'd like to maintain both programs unaltered. I understand that I could configure a usb driver on Linux to act as a virtual com without any additional HW (CDC ACM?) and that would do the trick. Am I correct? If that's the case, which driver should I use?

1

1 Answers

1
votes

On the Linux side, you would need USB configured for peripheral mode. For the software side of things, see the gadget configfs documentation and the PDF from the talk by Matt Porter.

Since you want Serial USB CDC ACM, have a look at gadget serial.

There is a library libusbg allows to use the USB Gadget ConfigFS through a C API. This can be useful if embedded software needs to dynamically control USB functions provided by a device. The library also provides two utilities called gadget-import and gadget-export. This utilities allow to export a hand-crafted USB Gadget to a schema file and reimport it. You can craft a systemd service to use this schema automatically at boot.