0

I have board with CP2105. It is usb-to-serial bridge with two uart interfaces on one usb port. I've read some guides, and documentation of UDEV, but I'm stuck on creating symlinks for them. I want them to have serial ID in name. The problem is that it does not work, even with simple rules.

My rule, that should do what I want:

ACTION=="add", SUBSYSTEM=="tty", \
    ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea70",
    ENV{ID_MODEL}=="CP2105_Dual_USB_to_UART_Bridge_Controller", \
    SYMLINK+="CP2105$env{ID_USB_INTERFACE_NUM}-$env{ID_SERIAL_SHORT}"

Simpler attempt, that should add two symlinks with different number at the end:

ACTION=="add", SUBSYSTEM=="tty", ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea70", SYMLINK+="CP2105%n"

I also have one rule, that works, but does something else (prevents some other driver from writing to this device):

SUBSYSTEM=="usb", ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea70", ENV{ID_MM_DEVICE_IGNORE}="1"

My udevadm info output for first device:

udevadm info -q all /dev/ttyUSB0
P: /devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if00-port0
S: serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.0-port0 /dev/serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.0/ttyUSB0/tty/ttyUSB0
E: ID_BUS=usb
E: ID_MM_CANDIDATE=1
E: ID_MODEL=CP2105_Dual_USB_to_UART_Bridge_Controller
E: ID_MODEL_ENC=CP2105\x20Dual\x20USB\x20to\x20UART\x20Bridge\x20Controller
E: ID_MODEL_FROM_DATABASE=CP210x UART Bridge
E: ID_MODEL_ID=ea70
E: ID_PATH=pci-0000:00:14.0-usb-0:5.3:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5_3_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0100
E: ID_SERIAL=Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E
E: ID_SERIAL_SHORT=0087144E
E: ID_TYPE=generic
E: ID_USB_DRIVER=cp210x
E: ID_USB_INTERFACES=:ff0000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Silicon_Labs
E: ID_VENDOR_ENC=Silicon\x20Labs
E: ID_VENDOR_FROM_DATABASE=Cygnal Integrated Products, Inc.
E: ID_VENDOR_ID=10c4
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=5571337818

And the second one:

udevadm info -q all /dev/ttyUSB1
P: /devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.1/ttyUSB1/tty/ttyUSB1
N: ttyUSB1
S: serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if01-port0
S: serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.1-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:5.3:1.1-port0 /dev/serial/by-id/usb-Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E-if01-port0
E: DEVNAME=/dev/ttyUSB1
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.3/3-5.3:1.1/ttyUSB1/tty/ttyUSB1
E: ID_BUS=usb
E: ID_MM_CANDIDATE=1
E: ID_MODEL=CP2105_Dual_USB_to_UART_Bridge_Controller
E: ID_MODEL_ENC=CP2105\x20Dual\x20USB\x20to\x20UART\x20Bridge\x20Controller
E: ID_MODEL_FROM_DATABASE=CP210x UART Bridge
E: ID_MODEL_ID=ea70
E: ID_PATH=pci-0000:00:14.0-usb-0:5.3:1.1
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5_3_1_1
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0100
E: ID_SERIAL=Silicon_Labs_CP2105_Dual_USB_to_UART_Bridge_Controller_0087144E
E: ID_SERIAL_SHORT=0087144E
E: ID_TYPE=generic
E: ID_USB_DRIVER=cp210x
E: ID_USB_INTERFACES=:ff0000:
E: ID_USB_INTERFACE_NUM=01
E: ID_VENDOR=Silicon_Labs
E: ID_VENDOR_ENC=Silicon\x20Labs
E: ID_VENDOR_FROM_DATABASE=Cygnal Integrated Products, Inc.
E: ID_VENDOR_ID=10c4
E: MAJOR=188
E: MINOR=1
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=5570324399

Can anybody help?

1

It turned out, that I had to change two things. First I had to make number from filename with my rules higher (I changed it from 52 to 70). Second, I noticed, that ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea70" didn't work, as there was no attributes avaliable for checking for subsysem tty. I changed it to proper environmental variables, and ended with this rule:

SUBSYSTEM=="tty", \
    ENV{ID_MODEL}=="CP2105_Dual_USB_to_UART_Bridge_Controller", \
    ENV{ID_VENDOR_ID}=="10c4", ENV{ID_MODEL_ID}=="ea70", \
    SYMLINK+="ttyCP2105-$env{ID_USB_INTERFACE_NUM}-$env{ID_SERIAL_SHORT}"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.