Re: Breakage in ftdi_sio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 10, 2012 at 06:18:19PM +0100, Roland Ramthun wrote:
> Hello Johan,
> 
> I'm sending you this e-mail, because you are listed as the maintainer
> of the USB FTDI SIO Linux kernel driver drivers/usb/serial/ftdi_sio.c.

Please send bug reports directly to the linux-usb list (CCed).

> I just want to let you know, that recently some change seems to have
> broken the support for my FTDI FT232R USB UART driven relay board (the
> exact model is
> http://sigma-shop.com/product/67/usb-relay-controller-one-channel-pcb.html).
> 
> Usually these relays can be closed by issuing "echo -e '\xFF\x01\x01'
> > /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700f2N3-if00-port0" and
> > opened by issuing "echo -e '\xFF\x01\x00' >
> > /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700f2N3-if00-port0"

You really should not be using echo and redirection to write to a
serial port.

The protocol outlined in the documentation you link to is a three byte
one, but using the commands above you are, for example, generally actually
writing 5 bytes (the three bytes plus "\r\n") to the device. (This could
be avoided by adding -n to echo, but there are other reasons to not
write to the port this way.)

How do you set the baud rate (9600) by the way?

> After a kernel upgrade from 2.6.39 to 3.1 this doesn't work anymore.
> The relay/FTDI chip is recognized, the data gets sent (RX LED on relay
> is blinking), but the data seems to be invalid, as nothing happens.
> Switching back to 2.6.39 resolves the problem.
> 
> If I can assist you any further please let me know, though I'm not
> keen with driver programming/debugging.

Can you verify that your device stops working when moving from 2.6.39 to
3.1 if you use a simple program (e.g. in c) to initialise the port and
write the three bytes to the device?

And if that program indeed works with 2.6.39 but not with 3.1, could you
enable debugging when loading the usbserial and ftdi_sio modules, e.g.:

	modprobe usbserial debug=1
	modprobe ftdi_sio debug=1

and send us the logs when running your program on both kernels.

Thanks,
Johan

> Kind regards,
> Roland
> 
> localhost linux # dmesg | grep -i ftdi
> [    1.878243] USB Serial support registered for FTDI USB Serial Device
> [    1.879489] usbcore: registered new interface driver ftdi_sio
> [    1.880639] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
> [    3.690972] usb 7-2: Manufacturer: FTDI
> [    3.701748] ftdi_sio 7-2:1.0: FTDI USB Serial Device converter detected
> [    3.711757] usb 7-2: FTDI USB Serial Device converter now attached to ttyUSB0
> 
> 
> localhost linux # udevadm info --name=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700f2N3-if00-port0 --attribute-walk
> 
> Udevadm info starts with the device specified by the devpath and then
> walks up the chain of parent devices. It prints for every device
> found, all possible attributes in the udev rules key format.
> A rule to match, can be composed by the attributes of the device
> and the attributes from one single parent device.
> 
>   looking at device '/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/ttyUSB0/tty/ttyUSB0':
>     KERNEL=="ttyUSB0"
>     SUBSYSTEM=="tty"
>     DRIVER==""
> 
>   looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/ttyUSB0':
>     KERNELS=="ttyUSB0"
>     SUBSYSTEMS=="usb-serial"
>     DRIVERS=="ftdi_sio"
>     ATTRS{latency_timer}=="1"
>     ATTRS{port_number}=="0"
> 
>   looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0':
>     KERNELS=="7-2: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:v0403p6001d0600dc00dsc00dp00icFFiscFFipFF"
>     ATTRS{supports_autosuspend}=="1"
>     ATTRS{interface}=="FT232R USB UART"
> 
>   looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb7/7-2':
>     KERNELS=="7-2"
>     SUBSYSTEMS=="usb"
>     DRIVERS=="usb"
>     ATTRS{configuration}==""
>     ATTRS{bNumInterfaces}==" 1"
>     ATTRS{bConfigurationValue}=="1"
>     ATTRS{bmAttributes}=="a0"
>     ATTRS{bMaxPower}==" 90mA"
>     ATTRS{urbnum}=="57"
>     ATTRS{idVendor}=="0403"
>     ATTRS{idProduct}=="6001"
>     ATTRS{bcdDevice}=="0600"
>     ATTRS{bDeviceClass}=="00"
>     ATTRS{bDeviceSubClass}=="00"
>     ATTRS{bDeviceProtocol}=="00"
>     ATTRS{bNumConfigurations}=="1"
>     ATTRS{bMaxPacketSize0}=="8"
>     ATTRS{speed}=="12"
>     ATTRS{busnum}=="7"
>     ATTRS{devnum}=="2"
>     ATTRS{devpath}=="2"
>     ATTRS{version}==" 2.00"
>     ATTRS{maxchild}=="0"
>     ATTRS{quirks}=="0x0"
>     ATTRS{avoid_reset_quirk}=="0"
>     ATTRS{authorized}=="1"
>     ATTRS{manufacturer}=="FTDI"
>     ATTRS{product}=="FT232R USB UART"
>     ATTRS{serial}=="A700f2N3"
> 
>   looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb7':
>     KERNELS=="usb7"
>     SUBSYSTEMS=="usb"
>     DRIVERS=="usb"
>     ATTRS{configuration}==""
>     ATTRS{bNumInterfaces}==" 1"
>     ATTRS{bConfigurationValue}=="1"
>     ATTRS{bmAttributes}=="e0"
>     ATTRS{bMaxPower}=="  0mA"
>     ATTRS{urbnum}=="34"
>     ATTRS{idVendor}=="1d6b"
>     ATTRS{idProduct}=="0001"
>     ATTRS{bcdDevice}=="0301"
>     ATTRS{bDeviceClass}=="09"
>     ATTRS{bDeviceSubClass}=="00"
>     ATTRS{bDeviceProtocol}=="00"
>     ATTRS{bNumConfigurations}=="1"
>     ATTRS{bMaxPacketSize0}=="64"
>     ATTRS{speed}=="12"
>     ATTRS{busnum}=="7"
>     ATTRS{devnum}=="1"
>     ATTRS{devpath}=="0"
>     ATTRS{version}==" 1.10"
>     ATTRS{maxchild}=="2"
>     ATTRS{quirks}=="0x0"
>     ATTRS{avoid_reset_quirk}=="0"
>     ATTRS{authorized}=="1"
>     ATTRS{manufacturer}=="Linux 3.1.7-gentoo uhci_hcd"
>     ATTRS{product}=="UHCI Host Controller"
>     ATTRS{serial}=="0000:00:1d.1"
>     ATTRS{authorized_default}=="1"
> 
>   looking at parent device '/devices/pci0000:00/0000:00:1d.1':
>     KERNELS=="0000:00:1d.1"
>     SUBSYSTEMS=="pci"
>     DRIVERS=="uhci_hcd"
>     ATTRS{vendor}=="0x8086"
>     ATTRS{device}=="0x3a65"
>     ATTRS{subsystem_vendor}=="0x1734"
>     ATTRS{subsystem_device}=="0x114d"
>     ATTRS{class}=="0x0c0300"
>     ATTRS{irq}=="22"
>     ATTRS{local_cpus}=="3"
>     ATTRS{local_cpulist}=="0-1"
>     ATTRS{modalias}=="pci:v00008086d00003A65sv00001734sd0000114Dbc0Csc03i00"
>     ATTRS{dma_mask_bits}=="32"
>     ATTRS{consistent_dma_mask_bits}=="32"
>     ATTRS{enable}=="1"
>     ATTRS{broken_parity_status}=="0"
>     ATTRS{msi_bus}==""
> 
>   looking at parent device '/devices/pci0000:00':
>     KERNELS=="pci0000:00"
>     SUBSYSTEMS==""
>     DRIVERS==""
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux