SourceForge Logo

FTDI SIO, 8U232AM and 245 Linux USB Serial Converter Driver

Five Second Summary

Use the most up to date linux kernel. This means 2.6.x or at least 2.4.30. The driver is included. I only ever use 2.6.x kernels so if you are using 2.4.x you are on your own. The driver is marked experimental at the moment. But I'm going to change that because it isn't experimental any more.

Also note that I (Bill Ryder) do not maintain this driver anymore. Every so often I will update this webpage though. If you want to actively maintain the driver and look after this sourceforge site send me a mail at bill dot ryder dot nz at gmail dot com.

  • ftdi linux mailing list - ftdi-usb-sio-devel@lists.sourceforge.net. To subscribe go to ftdi-usb=sio sourceforge lists
  • linux usb mailing list - submit patches here - linux-usb-devel@lists.sourceforge.net - to subscribe or view archives go to linux-usb-devel sourceforge lists
  • Sourceforge FTDI SIO Project Page
  • The linux usb web site is the place to go for anything to do with usb and linux.
  • If you haven't done serial programming on linux before read the LDP Serial Progarmming Howto.
  • Introduction

    This page contains information about the Linux driver for FTDI USB to serial converters (SIO application of the FT8U100AX and the 8U232AM) and the USB to parallel converter (245) which uses the same software interface as the serial devices.

    The original device I have is called the USC-1000. I bought it from Dick Smith in New Zealand. It is catalogue number XH4214. It has a DB25 on one side and a USB connector on the other. A image of the label on the box is here.

    FTDI do not support this driver but have provided all the assistance and information needed to implement it. They have also provided sample devices for driver testing.

    The driver is no longer marked experimental because many people have used it and it seems to behave as expected. However as with all open source software you should USE IT AT YOUR OWN RISK.

    It has been used (with a hack) to talk to a 500kbps SICK laser (but you MUST have a RS422 version, or a converter). NOTE This hack is now out of date as the driver version 1.2.1 (available in the 2.4.20 kernels and from the sourceforge download site) has reworked the baudrate portion of the driver (thanx to Kuba Ober) so you should be able to use some ioctls etc to set special baudrates. Please see the driver source for details or the description below.

    I have also included a perl script for use with testing a serial port with a loopback plug.

    If you want to learn how to do serial programming for the device in C see the references section below.

    Utilities

    Serial loopback tester.

    Download serial_loopback.pl.gz

    This will work with two RS232 (or backtoback 245) devices or with a loopback plug on the RS232 end. See the script for the loopback plug assumed configuration.

    The program tests simple writes of any size using simple data. It will optionally check hardware lines, send a break, and time runs to get throughput figures.

    NOTE: it requires the Benchmark::Timer module available from CPAN - read the script for details.

    If when you try to run serial_loopback.pl you see something like:

    syntax error at /usr/lib/perl5/5.6.1/i386-linux/features.ph line 149, near ") ("
    syntax error at /usr/lib/perl5/5.6.1/i386-linux/features.ph line 155, near "}"
    Compilation failed in require at /usr/lib/perl5/5.6.1/i386-linux/sys/ioctl.ph line 5.
    Compilation failed in require at serial_loopback.pl line 42.
    
    You will need to fix broken .ph files - read the serial_loopback script for details about how to do this.

    Run it with -x for help.

    Tests the following ioctls:

    TIOCMGET, TIOCMBIS, TIOCMSET, TIOCMBIC
    For the following args
    TIOCM_DSR, TIOM_CD, TIOC_CTS, TIOC_RI, and TIOC_DTR and TIOC_RTS

    Baudrate changes and BREAK setting are also tested.

    Non Standard Baudrates

    Thanx to Kuba Ober the driver now supports non-standard baudrates using the TIOCSSERIAL interface. I haven't tested this myself so I reproduce Kuba's documentation (slightly edited) he added to the patch below:
    	 * 1. Standard baud rates are set in tty->termios->c_cflag
    	 * 2. If these are not enough, you can set any speed using alt_speed as follows:
    	 *    - set tty->termios->c_cflag speed to B38400
    	 *    - set your real speed in tty->alt_speed; it gets ignored when
    	 *      alt_speed==0, (or)
    	 *    - call TIOCSSERIAL ioctl with (struct serial_struct) set as follows:
    	 *      flags & ASYNC_SPD_MASK == ASYNC_SPD_[HI, VHI, SHI, WARP], this just
    	 *      sets alt_speed to (HI: 57600, VHI: 115200, SHI: 230400, WARP: 460800)
    	 * 3. You can also set baud rate by setting custom divisor as follows
    	 *    - set tty->termios->c_cflag speed to B38400
    	 *    - call TIOCSSERIAL ioctl with (struct serial_struct) set as follows:
    	 *      o flags & ASYNC_SPD_MASK == ASYNC_SPD_CUST
    	 *      o custom_divisor set to baud_base / your_new_baudrate
    

    What Works

  • TIOCMGET, TIOCMBIS, TIOCMSET, TIOCMBIC
    For the following args:
    TIOCM_DSR, TIOM_CD, TIOC_CTS, TIOC_RI, and TIOC_DTR and TIOC_RTS
  • HUPCL
  • TIOCSBRK (BREAK). Tested with kermit. 0.25s break OK. Note that for this to work you need to apply this patch to drivers/char/tty_io.c.
  • Baud rate setting and reading (if the device is open by multiple processes the baudrate read results are undefined).
  • Bugs

    None known at the moment

    To Do

  • Check TIOCSSERIAL and TIOCGSERIAL implementation from Kuba and add it to the loopback tester
  • Perhaps Implement TCGETA TCSETA* (TCSETS and TCGETS* works by virtue of higher layers - perhaps the 'A's do too?)
  • Implement hangup (requires a check of the status bytes to see if CD is dropped and if the line is currently not in CLOCAL send a hangup)
  • Test modem behaviour
  • Integrate BERT testing in the loopback program from code provided by J Sheahan.
  • /proc/bus/usb/devices output

    This section reproduces the usb device output from /proc/bus/usb/devices assuming you compiled the usbdevfs into the kernel and have mounted it.

    The FTDI_SIO I have:

    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
    B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0000 ProdID=0000 Rev= 0.00
    S:  Product=USB UHCI Root Hub
    S:  SerialNumber=ece0
    C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  5 Spd=12  MxCh= 0
    D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0403 ProdID=8372 Rev= 0.01
    S:  Manufacturer=FTDI
    S:  Product=FTDI EVALUATION USB <-> Serial
    S:  SerialNumber=FTDI2090
    C:* #Ifs= 1 Cfg#= 1 Atr=20 MxPwr= 60mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial
    E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
    

    The 8U232AM sample I have

    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
    B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0000 ProdID=0000 Rev= 0.00
    S:  Product=USB UHCI Root Hub
    S:  SerialNumber=ece0
    C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
    D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0403 ProdID=6001 Rev= 2.00
    S:  Manufacturer=FTDI
    S:  Product=FT8U232AM EVALUATION KIT
    S:  SerialNumber=FT9LM012
    C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 50mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial
    E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
    

    The 245 sample I have

    T:  Bus=01 Lev=02 Prnt=09 Port=01 Cnt=01 Dev#= 10 Spd=12  MxCh= 0
    D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0403 ProdID=6001 Rev= 2.00
    S:  Manufacturer=FTDI
    S:  Product=USB <-> Serial
    S:  SerialNumber=12345678
    C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 90mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial
    E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    T:  Bus=01 Lev=02 Prnt=09 Port=03 Cnt=02 Dev#= 11 Spd=12  MxCh= 0
    D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0403 ProdID=6001 Rev= 2.00
    S:  Manufacturer=FTDI
    S:  Product=USB <-> Serial
    S:  SerialNumber=12345678
    C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 90mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial
    E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    

    References

  • Linux-usb website. - This has links to the relavent mailing lists and lots of documentation
  • Linux on Laptops - essential page if you run on a laptop.
  • LDP Serial Progarmming Howto. Be sure to read the list of supported ioctls above to figure out what will work with the driver. Don't forget the serial devices are called /dev/ttyUSB0 (or some other number) for this device.
  • Acknowledgements

    FTDI for making the specifications for the device available, and providing me with their new product.

    Greg Kroah-Hartman and other members of the USB development team for hints, sample code for me to steal and updating the driver when I don't have time to do it and it is urgent.

    Kuba Ober for the June_2002 patch (even though he sent it to me in February 2002 - sorry about that).

    Sourceforge for providing such a great resource.

    Ian Abbot for helping people out all the time on the ftdi list and still paying attention to this driver.

    Feedback

    For driver status questions, debugging etc please use the mailing list

    For webpage feedback etc to me please send mail to bill.ryder.nz at gmail dot com.

    Page generated using Genpage - Version: 1.0.7 October 2006.