# How to make udev ignore an FTDI interface?

## z0ny

Hello, there is an an OpenOCD USB JTAG programmer (FTDI2232) connected to my computer which has two serial ports. The first port is used for JTAG programming, the second one as a "real" serial port for debug messages. My problem is that OpenOCD won't recognize the JTAG port as long as the ftdi_sio module is loaded which on the other hand is required to use the second serial port for debugging.

So at the moment my procedure to get everything to work is: I connect the adapter to my computer, unload the ftdi_sio module, launch OpenOCD and then reload the ftdi_sio module. That way I can use both the JTAG port and the debug port. As it is quite inconvenient that way I thought of writing a udev rule that prevents the JTAG port from being assigned as a serial port. However, I can't get that to work unfortunately. udevadm reports the following for both devices:

```
  looking at device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/ttyUSB0/tty/ttyUSB0':

    KERNEL=="ttyUSB0"

    SUBSYSTEM=="tty"

    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/ttyUSB0':

    KERNELS=="ttyUSB0"

    SUBSYSTEMS=="usb-serial"

    DRIVERS=="ftdi_sio"

    ATTRS{latency_timer}=="16"

    ATTRS{port_number}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0':

    KERNELS=="5-1:1.0"

    SUBSYSTEMS=="usb"

    DRIVERS=="ftdi_sio"

    ATTRS{bInterfaceNumber}=="00"

    ATTRS{bAlternateSetting}==" 0"

    ATTRS{bNumEndpoints}=="02"

    ATTRS{bInterfaceClass}=="ff"

    ATTRS{bInterfaceSubClass}=="ff"

    ATTRS{bInterfaceProtocol}=="ff"

    ATTRS{modalias}=="usb:v0403p6010d0500dc00dsc00dp00icFFiscFFipFF"

    ATTRS{supports_autosuspend}=="0"

    ATTRS{interface}=="Dual RS232"

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1':

    KERNELS=="5-1"

    SUBSYSTEMS=="usb"

    DRIVERS=="usb"

    ATTRS{configuration}==""

    ATTRS{bNumInterfaces}==" 2"

    ATTRS{bConfigurationValue}=="1"

    ATTRS{bmAttributes}=="80"

    ATTRS{bMaxPower}==" 90mA"

    ATTRS{urbnum}=="15"

    ATTRS{idVendor}=="0403"

    ATTRS{idProduct}=="6010"

    ATTRS{bcdDevice}=="0500"

    ATTRS{bDeviceClass}=="00"

    ATTRS{bDeviceSubClass}=="00"

    ATTRS{bDeviceProtocol}=="00"

    ATTRS{bNumConfigurations}=="1"

    ATTRS{bMaxPacketSize0}=="8"

    ATTRS{speed}=="12"

    ATTRS{busnum}=="5"

    ATTRS{devnum}=="25"

    ATTRS{version}==" 2.00"

    ATTRS{maxchild}=="0"

    ATTRS{quirks}=="0x0"

    ATTRS{authorized}=="1"

    ATTRS{manufacturer}=="FTDI"

    ATTRS{product}=="Dual RS232"
```

```
  looking at device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1/ttyUSB1/tty/ttyUSB1':

    KERNEL=="ttyUSB1"

    SUBSYSTEM=="tty"

    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1/ttyUSB1':

    KERNELS=="ttyUSB1"

    SUBSYSTEMS=="usb-serial"

    DRIVERS=="ftdi_sio"

    ATTRS{latency_timer}=="16"

    ATTRS{port_number}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.1':

    KERNELS=="5-1:1.1"

    SUBSYSTEMS=="usb"

    DRIVERS=="ftdi_sio"

    ATTRS{bInterfaceNumber}=="01"

    ATTRS{bAlternateSetting}==" 0"

    ATTRS{bNumEndpoints}=="02"

    ATTRS{bInterfaceClass}=="ff"

    ATTRS{bInterfaceSubClass}=="ff"

    ATTRS{bInterfaceProtocol}=="ff"

    ATTRS{modalias}=="usb:v0403p6010d0500dc00dsc00dp00icFFiscFFipFF"

    ATTRS{supports_autosuspend}=="0"

    ATTRS{interface}=="Dual RS232"

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb5/5-1':

    KERNELS=="5-1"

    SUBSYSTEMS=="usb"

    DRIVERS=="usb"

    ATTRS{configuration}==""

    ATTRS{bNumInterfaces}==" 2"

    ATTRS{bConfigurationValue}=="1"

    ATTRS{bmAttributes}=="80"

    ATTRS{bMaxPower}==" 90mA"

    ATTRS{urbnum}=="23"

    ATTRS{idVendor}=="0403"

    ATTRS{idProduct}=="6010"

    ATTRS{bcdDevice}=="0500"

    ATTRS{bDeviceClass}=="00"

    ATTRS{bDeviceSubClass}=="00"

    ATTRS{bDeviceProtocol}=="00"

    ATTRS{bNumConfigurations}=="1"

    ATTRS{bMaxPacketSize0}=="8"

    ATTRS{speed}=="12"

    ATTRS{busnum}=="5"

    ATTRS{devnum}=="24"

    ATTRS{version}==" 2.00"

    ATTRS{maxchild}=="0"

    ATTRS{quirks}=="0x0"

    ATTRS{authorized}=="1"

    ATTRS{manufacturer}=="FTDI"

    ATTRS{product}=="Dual RS232"
```

So I added the following line to the freshly created file /etc/udev/rules.d/10-local.rules:

```
SUBSYSTEMS=="usb", ATTRS{interface}=="Dual RS232", ATTRS{bInterfaceNumber}=="00", OPTIONS="ignore_device", OPTIONS+="last_rule"
```

But whatever I try the device ttyUSB0 gets assigned in any case. Am I missing something?

Thanks in advance.

----------

