# [SOLVED] udev: no population of /dev/ttyUSB* with ftdi_sio

## fdrcmoro

Hi,

I've been working with the single-board computer Gumstix. It's possible to open an usb serial console using ssh.

Before I was working with Ubuntu and once I plugged the usb cable the board was detected and /dev/ttyUSB* was populated. Then using kermit I could open the console and everything worked fine. 

Now I'm trying to do the same with Gentoo but I can't detect the device. I have kernel 2.6.34-gentoo-r12 and of course udev installed.

I know that I need the support for usb serial and ftdi so I recompiled the kernel adding these two modules built-in: that are the modules usbserial and ftdi_sio.

This is the output of tail -f /var/log/messages when I plug the device:

```

Nov 18 02:15:29 Leviathan kernel: [ 5476.771900] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004

Nov 18 02:15:29 Leviathan kernel: [ 5476.771909] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001803 POWER sig=j CSC CONNECT

Nov 18 02:15:29 Leviathan kernel: [ 5476.771916] hub 2-0:1.0: port 2, status 0501, change 0001, 480 Mb/s

Nov 18 02:15:29 Leviathan kernel: [ 5476.875013] hub 2-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x501

Nov 18 02:15:29 Leviathan kernel: [ 5476.926242] ehci_hcd 0000:00:1d.7: port 2 full speed --> companion

Nov 18 02:15:29 Leviathan kernel: [ 5476.926248] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 003801 POWER OWNER sig=j CONNECT

Nov 18 02:15:29 Leviathan kernel: [ 5476.926264] usb usb6: wakeup_rh (auto-start)

Nov 18 02:15:29 Leviathan kernel: [ 5476.926274] hub 2-0:1.0: port 2 not reset yet, waiting 50ms

Nov 18 02:15:29 Leviathan kernel: [ 5476.977019] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 003002 POWER OWNER sig=se0 CSC

Nov 18 02:15:29 Leviathan kernel: [ 5476.977042] hub 6-0:1.0: state 7 ports 2 chg 0000 evt 0004

Nov 18 02:15:29 Leviathan kernel: [ 5476.977050] uhci_hcd 0000:00:1d.0: port 2 portsc 0093,00

Nov 18 02:15:29 Leviathan kernel: [ 5476.977056] hub 6-0:1.0: port 2, status 0101, change 0001, 12 Mb/s

Nov 18 02:15:29 Leviathan kernel: [ 5477.081017] hub 6-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101

Nov 18 02:15:29 Leviathan kernel: [ 5477.183016] usb 6-2: new full speed USB device using uhci_hcd and address 12

Nov 18 02:15:29 Leviathan kernel: [ 5477.303009] usb 6-2: ep0 maxpacket = 8

Nov 18 02:15:29 Leviathan kernel: [ 5477.340285] usb 6-2: default language 0x0409

Nov 18 02:15:29 Leviathan kernel: [ 5477.369289] usb 6-2: udev 12, busnum 6, minor = 651

Nov 18 02:15:29 Leviathan kernel: [ 5477.369292] usb 6-2: New USB device found, idVendor=0403, idProduct=6001

Nov 18 02:15:29 Leviathan kernel: [ 5477.369295] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

Nov 18 02:15:29 Leviathan kernel: [ 5477.369298] usb 6-2: Product: FT232R USB UART

Nov 18 02:15:29 Leviathan kernel: [ 5477.369299] usb 6-2: Manufacturer: FTDI

Nov 18 02:15:29 Leviathan kernel: [ 5477.369301] usb 6-2: SerialNumber: A5003vq1

Nov 18 02:15:29 Leviathan kernel: [ 5477.369378] usb 6-2: usb_probe_device

Nov 18 02:15:29 Leviathan kernel: [ 5477.369382] usb 6-2: configuration #1 chosen from 1 choice

Nov 18 02:15:29 Leviathan kernel: [ 5477.372288] usb 6-2: adding 6-2:1.0 (config #1, interface 0)

Nov 18 02:15:29 Leviathan kernel: [ 5477.377326] drivers/usb/core/inode.c: creating file '012'

Nov 18 02:15:29 Leviathan kernel: [ 5477.377346] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004

```

With an Ubuntu live-cd everything works and this is the result of tail -f /var/log/messages:

```

Nov 17 00:24:05 ubuntu kernel: [  764.760290] usb 5-2: new full speed USB device using uhci_hcd and address 4

Nov 17 00:24:05 ubuntu kernel: [  764.980813] usb 5-2: configuration #1 chosen from 1 choice

Nov 17 00:24:05 ubuntu kernel: [  764.985447] ftdi_sio 5-2:1.0: FTDI USB Serial Device converter detected

Nov 17 00:24:05 ubuntu kernel: [  764.987437] ftdi_sio: Detected FT232RL

Nov 17 00:24:05 ubuntu kernel: [  764.988800] usb 5-2: FTDI USB Serial Device converter now attached to ttyUSB0

```

These are the results with the two systems (gentoo and ubuntu live-cd) of the command udevadm monitor

Gentoo:

```

KERNEL[1290043207.629323] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-2 (usb)

KERNEL[1290043207.637198] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0 (usb)

UDEV  [1290043207.638520] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-2 (usb)

UDEV  [1290043207.641153] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0 (usb)

```

Ubuntu live-cd:

```

UEVENT[1289953054.789078] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2 (usb)

UEVENT[1289953054.791688] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0 (usb)

UDEV  [1289953054.792747] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2 (usb)

UEVENT[1289953054.796976] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/usb_endpoint/usbdev5.2_ep81 (usb_endpoint)

UEVENT[1289953054.797018] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/usb_endpoint/usbdev5.2_ep02 (usb_endpoint)

UEVENT[1289953054.797043] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/usb_endpoint/usbdev5.2_ep00 (usb_endpoint)

UDEV  [1289953054.813212] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/usb_endpoint/usbdev5.2_ep00 (usb_endpoint)

UEVENT[1289953055.143694] add      /module/usbserial (module)

UEVENT[1289953055.144355] add      /bus/usb-serial (bus)

UEVENT[1289953055.144955] add      /bus/usb/drivers/usbserial (drivers)

UDEV  [1289953055.145631] add      /module/usbserial (module)

UDEV  [1289953055.145960] add      /bus/usb/drivers/usbserial (drivers)

UEVENT[1289953055.146104] add      /bus/usb-serial/drivers/generic (drivers)

UEVENT[1289953055.146302] add      /bus/usb/drivers/usbserial_generic (drivers)

UDEV  [1289953055.146369] add      /bus/usb-serial (bus)

UDEV  [1289953055.147515] add      /bus/usb-serial/drivers/generic (drivers)

UDEV  [1289953055.148119] add      /bus/usb/drivers/usbserial_generic (drivers)

UEVENT[1289953055.223765] add      /module/ftdi_sio (module)

UEVENT[1289953055.224014] add      /bus/usb-serial/drivers/ftdi_sio (drivers)

UDEV  [1289953055.224304] add      /module/ftdi_sio (module)

UEVENT[1289953055.224660] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/ttyUSB0 (usb-serial)

UDEV  [1289953055.225224] add      /bus/usb-serial/drivers/ftdi_sio (drivers)

UEVENT[1289953055.225249] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/ttyUSB0/tty/ttyUSB0 (tty)

UEVENT[1289953055.226199] add      /bus/usb/drivers/ftdi_sio (drivers)

UDEV  [1289953055.226734] add      /bus/usb/drivers/ftdi_sio (drivers)

UDEV  [1289953055.227856] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0 (usb)

UDEV  [1289953055.230478] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/usb_endpoint/usbdev5.2_ep81 (usb_endpoint)

UDEV  [1289953055.232888] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/usb_endpoint/usbdev5.2_ep02 (usb_endpoint)

UDEV  [1289953055.234447] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/ttyUSB0 (usb-serial)

UDEV  [1289953055.246308] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/ttyUSB0/tty/ttyUSB0 (tty)

```

KERNEL in the first output e UEVENT in the second should refer to the same thing: that is kernel uevent.

I managed by the following udev rule:

```

SSUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A5003vq1", SYMLINK+="gumstix"

```

to obtain a link in /dev/gumstix but when I run the kermit command this is the output:

```

> kermit -l /dev/gumstix 

/dev/bus/usb/006/013 is not a terminal device

can't open device

> ls -l /dev/gumstix 

lrwxrwxrwx 1 root root 15 18 nov 02.20 /dev/gumstix -> bus/usb/006/013

```

I read that usb detection should work in this way: detection of the two endpoints (IN and OUT) and bulk of the two endpoints in order to create the link in /dev/ttyUSB*. And I think this is what happens with Ubuntu.

Having a look at the kernel configuration these are the modules that I added.

```

Device Drivers  --->

  [*] USB support  --->

    <M>   USB Serial Converter support  --->   

      [*]   USB Generic Serial Driver 

      <M>   USB FTDI Single Port Serial Driver

      <M>   USB Fundamental Software Dongle Driver

```

I'm not sure of the Dongle Driver but I tryed both with and without it. In the test shown before all the modules were built-in; now I tryed to compile them as modules. All of them except for the Generic Serial Drive that is not possible to compile as module.

While the result of udevadm monitor is still the same, this is instead the result of the system log:

```

Nov 18 02:56:05 Leviathan kernel: [  788.233077] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004

Nov 18 02:56:05 Leviathan kernel: [  788.233086] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001803 POWER sig=j CSC CONNECT

Nov 18 02:56:05 Leviathan kernel: [  788.233093] hub 2-0:1.0: port 2, status 0501, change 0001, 480 Mb/s

Nov 18 02:56:05 Leviathan kernel: [  788.337011] hub 2-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x501

Nov 18 02:56:05 Leviathan kernel: [  788.388289] ehci_hcd 0000:00:1d.7: port 2 full speed --> companion

Nov 18 02:56:05 Leviathan kernel: [  788.388294] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 003801 POWER OWNER sig=j CONNECT

Nov 18 02:56:05 Leviathan kernel: [  788.388304] hub 2-0:1.0: port 2 not reset yet, waiting 50ms

Nov 18 02:56:05 Leviathan kernel: [  788.388314] usb usb6: wakeup_rh (auto-start)

Nov 18 02:56:05 Leviathan kernel: [  788.439020] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 003002 POWER OWNER sig=se0 CSC

Nov 18 02:56:05 Leviathan kernel: [  788.439044] hub 6-0:1.0: state 7 ports 2 chg 0000 evt 0004

Nov 18 02:56:05 Leviathan kernel: [  788.439052] uhci_hcd 0000:00:1d.0: port 2 portsc 0093,00

Nov 18 02:56:05 Leviathan kernel: [  788.439058] hub 6-0:1.0: port 2, status 0101, change 0001, 12 Mb/s

Nov 18 02:56:05 Leviathan kernel: [  788.543013] hub 6-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101

Nov 18 02:56:06 Leviathan kernel: [  788.645013] usb 6-2: new full speed USB device using uhci_hcd and address 7

Nov 18 02:56:06 Leviathan kernel: [  788.765007] usb 6-2: ep0 maxpacket = 8

Nov 18 02:56:06 Leviathan kernel: [  788.802274] usb 6-2: default language 0x0409

Nov 18 02:56:06 Leviathan kernel: [  788.831276] usb 6-2: udev 7, busnum 6, minor = 646

Nov 18 02:56:06 Leviathan kernel: [  788.831279] usb 6-2: New USB device found, idVendor=0403, idProduct=6001

Nov 18 02:56:06 Leviathan kernel: [  788.831281] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

Nov 18 02:56:06 Leviathan kernel: [  788.831284] usb 6-2: Product: FT232R USB UART

Nov 18 02:56:06 Leviathan kernel: [  788.831286] usb 6-2: Manufacturer: FTDI

Nov 18 02:56:06 Leviathan kernel: [  788.831287] usb 6-2: SerialNumber: A5003vq1

Nov 18 02:56:06 Leviathan kernel: [  788.831363] usb 6-2: usb_probe_device

Nov 18 02:56:06 Leviathan kernel: [  788.831367] usb 6-2: configuration #1 chosen from 1 choice

Nov 18 02:56:06 Leviathan kernel: [  788.834272] usb 6-2: adding 6-2:1.0 (config #1, interface 0)

Nov 18 02:56:06 Leviathan kernel: [  788.839307] drivers/usb/core/inode.c: creating file '007'

Nov 18 02:56:06 Leviathan kernel: [  788.839325] hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004

Nov 18 02:56:06 Leviathan kernel: [  788.845161] usbserial: Unknown symbol usb_autopm_put_interface

Nov 18 02:56:06 Leviathan kernel: [  788.847218] usbserial: Unknown symbol usb_autopm_get_interface

Nov 18 02:56:06 Leviathan kernel: [  788.848566] ftdi_sio: Unknown symbol usb_serial_port_softint

Nov 18 02:56:06 Leviathan kernel: [  788.848778] ftdi_sio: Unknown symbol usb_serial_handle_sysrq_char

Nov 18 02:56:06 Leviathan kernel: [  788.848926] ftdi_sio: Unknown symbol usb_serial_disconnect

Nov 18 02:56:06 Leviathan kernel: [  788.849424] ftdi_sio: Unknown symbol usb_serial_handle_break

Nov 18 02:56:06 Leviathan kernel: [  788.849718] ftdi_sio: Unknown symbol usb_serial_probe

Nov 18 02:56:06 Leviathan kernel: [  788.849797] ftdi_sio: Unknown symbol usb_serial_register

Nov 18 02:56:06 Leviathan kernel: [  788.849880] ftdi_sio: Unknown symbol usb_serial_deregister

```

It seems that I've got a problem with modules usbserial and ftdi_sio.

The functions:

usb_serial_port_softint

usb_serial_disconnect

usb_serial_probe

usb_serial_register

usb_serial_deregister

called by ftdi_sio are defined in drivers/usb/serial/usb-serial.c and include/linux/usb/serial.h, both present in my kernel sources. And I think these functions are part of the usbserial module.

The functions:

usb_serial_handle_break

usb_serial_handle_sysrq_char

also called by ftdi_sio are defined in drivers/usb/serial/generic.c and  include/linux/usb/serial.h. This time I guess I'm dealing with the usbserial_generic driver that is also used in Ubuntu (see the udevadm monitor executed with the live-cd shown above).

And finally the functions:

usb_autopm_put_interface

usb_autopm_get_interface

called by usbserial are defined in drivers/usb/core/driver.c e include/linux/usb.h. usbcore module?

I've also tryed to compile alle the usb features as module but no way to make it work.

In conclusion with my previous Ubuntu and with an Ubuntu live-cd the device is correctly detected and /dev/ttyUSB* is populated. With my Gentoo and a Gentoo live-cd I can't.

Any ideas?  :Smile: Last edited by fdrcmoro on Fri Nov 19, 2010 12:12 am; edited 1 time in total

----------

## fdrcmoro

Instead of a manual configuration I recompiled the kernel using Genkernel.

Now it works!

----------

