I've started exploring the use of presenting a CDC ACM interface on the USB port of a WGM160P board (EFM32GG11). I based my code on `ex_usbd_cdc_acm_terminal.c` in SSv4.
It's been working well, but I was surprised to see the device appear as a `/dev/tty.usbmodemXXX` on macOS and `/dev/ttyACMx` on Linux instead of `/dev/tty.usbserialXXX` or `/dev/ttyUSBx` (respectively) like an FTDI USB serial adapter. On the plus side, it's recognized with the built-in `usbser.inf` driver on Windows 10 and appears as a COM port, just like the FTDI adapter.
Since I'm exposing a serial interface and am not actually a modem (and don't accept AT commands), is there any way to tweak my CDC/ACM configuration to appear as a `tty.usbserialXXX` or `ttyUSBx` device on those operating systems?
I tried changing from `USBD_CDC_COMM_PROTOCOL_AT_V250` to `USBD_CDC_COMM_PROTOCOL_NONE`, and even trying alternate values passed to `USBD_ACM_SerialAdd()`, but to no avail.
I'm still looking into whether it actually matters on macOS and Linux. As of yet, I've only run into a problem with a system that wasn't expecting the `/dev/ttyACMx` device name, but it should be possible to update it to check both `/dev/ttyUSBx` and `/dev/ttyACMx`.
I'm not familiar with the FTDI solution, but I can say for our similar USB-UART bridge solutions, we have dedicated device drivers for our CP210x on mac and linux, and so these devices aren't actually CDC ACM class devices. I suspect there is a similar its a similar story for FTDI. This is done, at least for us, so we can use a lower-overhead protocol than the full CDC ACM spec.
For our MCU firmware examples though, I think by enumerating as a CDC ACM class device the naming on linux is always going to be ttyACMx based on the default udev rules. On Mac from a quick search it sounds like the name is assigned by the device driver for the given device, so I'm assuming this uxbmodemXXX is given by the MacOS default CDC ACM driver.
This enumeration as a CDC ACM class device is also how the device is going to be recognized by the given os's default CDC driver, so I don't think that this will be a problem for functionally getting serial communication over USB for either platform.
If you still need or want to test against your existing code that uses /dev/ttyUSBx, on linux I know that you can't actually reassign a device address once enumerated, but you can create a symbolic link to alias the address name. We have an existing article on how to do this for our USB-to-UART bridge devices, and similar logic should apply here:
I don't think this is possible to change on mac without writing/modifying a driver.