- Драйвер ftdi для linux
- FTDI SIO, 8U232AM and 245 Linux USB serial driver
- Quick summary
- Ways to use the device
- POSIX serial programming
- libftdi
- Frequently Asked Questions
- How do I check to see if the driver loaded?
- My device is not recognised by the kernel. How do I manually load it?
- Caveat about new devices
- What are some debug techniques
- Turn debugging on for the driver.
- Using strace
- Why doesn’t setserial work as expected?
- Submitting patches for new VID/PIDs
- Old web site stuff
- Serial loopback tester.
- Non Standard Baudrates
- What ioctls are known to work
- References and useful links
- USBINFO for the devices I have
- The original FTDI_SIO I have
- The 8U232AM sample I have
- The 245 sample I have
- Acknowledgements
- Feedback
Драйвер ftdi для linux
This page contains the VCP drivers currently available for FTDI devices.
For D2XX Direct drivers, please click here .
Installation guides are available from the Installation Guides page of the Documents section of this site for selected operating systems.
| VCP Drivers |
This software is provided by Future Technology Devices International Limited «as is» and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall future technology devices international limited be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
FTDI drivers may be used only in conjunction with products based on FTDI parts.
FTDI drivers may be distributed in any form as long as license information is not modified.
If a custom vendor ID and/or product ID or description string are used, it is the responsibility of the product manufacturer to maintain any changes and subsequent WHCK re-certification as a result of making these changes.
For more detail on FTDI Chip Driver licence terms, please click here.
Currently Supported VCP Drivers:
Processor Architecture | |||||||||
Operating System | Release Date | x86 (32-bit) | x64 (64-bit) | PPC | ARM | MIPSII | MIPSIV | SH4 | Comments |
Windows* | 201 7 — 0 8-30 | 2.12.28 | 2.12.28 | — | — | — | — | — | WHQL Certified. Includes VCP and D2XX. Available as a setup executable Please read the Release Notes and Installation Guides. |
Linux | — | — | — | — | — | — | — | — | All FTDI devices now supported in Ubuntu 11.10, kernel 3.0.0-19 Refer to TN-101 if you need a custom VCP VID/PID in Linux VCP drivers are integrated into the kernel. |
Mac OS X 10.3 to 10.8 | 2012-08-10 | 2.2.18 | 2.2.18 | 2.2.18 | — | — | — | — | Refer to TN-105 if you need a custom VCP VID/PID in MAC OS |
Mac OS X 10.9 and above | 20 20 — 08 — 13 | — | 2.4.4 | — | — | — | — | — | This driver is signed by Apple |
Windows CE 4.2-5.2** | 2012-01-0 6 | 1.1.0.20 | — | — | 1.1.0.20 | 1.1.0.10 | 1.1.0.10 | 1.1.0.10 | |
Windows CE 6.0/7.0 | 2016-11-03 | 1.1.0.22 CE 6.0 CAT CE 7.0 CAT | — | — | 1.1.0.22 CE 6.0 CAT CE 7.0 CAT | 1.1.0.10 | 1.1.0.10 | 1.1.0.10 | For use of the CAT files supplied for ARM and x86 builds refer to AN_319 |
Windows CE 2013 | 2015-03-06 | 1.0.0 | 1.0.0 | VCP Driver Support for WinCE2013 |
*Includes the following version of of the Windows operating system: Windows 7, Windows Server 2008 R2 and Windows 8, 8.1, Windows server 2012 R2, Windows Server 2016 and Windows 10. Also, as Windows 8 RT is a closed system not allowing for 3rd party driver installation our Windows 8 driver will not support this variant of the OS. You must use the Windows RT build for this platform.
**includes the following versions of Windows CE 4.2-5.2 based operating systems: Windows Mobile 2003, Windows Mobile 2003 SE, Windows Mobile 5, Windows Mobile 6, Windows Mobile 6.1 ,Windows Mobile 6.5
No Longer Supported:
Processor Architecture | |||||||||
Operating System | Release Date | x86 (32-bit) | x64 (64-bit) | PPC | ARM | MIPSII | MIPSIV | SH4 | Comments |
Previous Windows Release | 2017-03-10 | 2.12.26 | 2.12.26 | WHQL Certified. Includes VCP and D2XX. Available as a setup executable Please read the Release Notes and Installation Guides. | |||||
Windows XP, Vista, Server 2003, Server 2008 | 2012-04-13 | 2.08.24 | 2.08.24 | — | — | — | — | — | WHQL Certified Also available as a setup executable Release notes This is FTDI’s final release before Microsoft stopped certifying drivers for these versions of Windows. |
Windows 2000 | 2009-10-22 | 2.06.00 | — | — | — | — | — | — | WHQL Certified Available as setup executable Release notes |
Windows 98/ME | 2004-11-25 | 1.09.06 | — | — | — | — | — | — | Does not support FT2232 or FT4232 devices |
Windows 98/ME | 2004-03-12 | 1.0.3 | — | — | — | — | — | — | Only supports FT2232D devices |
Mac OS 9 Mac OS 8 | 2004-05-18 | — | — | 1.0f4 | — | — | — | — | |
Mac OS X 10.9 and above | 20 15 -0 4 -1 5 | — | 2.3 | — | — | — | — | — | This driver is signed by Apple |
Linux | 2009-05-14 | 1.5.0 | 1.5.0 |
© Future Technology Devices International Ltd.
Источник
FTDI SIO, 8U232AM and 245 Linux USB serial driver
Quick summary
Use the most up to date linux kernel. This means 2.6.x or at least 2.4.30. Although the driver is marked experimental it’s not really. Most distros will include the driver by default. All comments in this page are based on 2.6.32.16 so there may be some minor differences.
If you have a device that is new or isn’t in the list of VID/PIDs you’ll need to do some work. See below about how to do that.
I (Bill Ryder) do not maintain this driver anymore. Every so often I will update this webpage. If you want to actively maintain the driver and look after this sourceforge site send me a mail at bill.ryder.nz@gmail.com
Ways to use the device
You can interact with the device in two ways.
- POSIX serial programming using the kernel driver described on this page. This method allows you to use off the shelf software like minicom.
- libftdi programming which is more flexible and which uses usermode tools (no kernel driver). This way gives you more flexibility but you will probably have to write your own code.
POSIX serial programming
I wrote the driver so I could talk to unix servers and my palm pilot using a usb serial interface from my laptop. For this to work you need a standard serial interface so you can use off the shelf tools like terminal emulators and palm pilot software.
man termios(3) is the correct man page for this style of programming.
Any serial application which talks to the device using just the termios interface will probably work.
The usual mistake people make is assuming they can just open the serial port and read and write to it without setting any serial communications parameters.
A good place to start learning this style of programming is to read the LDP Serial Progarmming Howto.
libftdi
This may be the best way for you to talk to the device if you are writing programs and need to do more than the serial interface was ever designed for:
The other advantage in using libftdi is that there’s no kernel programming involved.
Frequently Asked Questions
How do I check to see if the driver loaded?
You should see something like:
If you don’t you probably need to look at the following section.
Note the device name — ttyUSB0 — that is the device you point your serial program at (it’ll probably be /dev/ttyUSB0 in this case).
My device is not recognised by the kernel. How do I manually load it?
- Find the VID (Vendor ID) and PID (Product ID) for the device — use lsusb
- Manually modload the driver
The VID is 0403 — the PID is 6001
You should see the module in the lsmod list if modprobe worked:
You can also check dmesg
Caveat about new devices
The modprobe above will only work if the driver can figure out the chip type. When I wrote the driver there were only a few chip types. 2.6.17 supports 232RL versions for example. So if you have a new chip you may need to do some driver work!
Look in drivers/usb/serial/ftdi_sio.c in your kernel source tree. Look for things which set chip_type.
There are a lot more since I wrote the driver so some of the comments for that structure earlier on in the code are incorrect.
What are some debug techniques
Turn debugging on for the driver.
When you modprobe the driver you need to set the debug flag
There’ll be a lot of stuff dumped now that’s viewable with dmesg or in a log file (somewhere in /var/log depending on your distro).
To really understand what’s going on you’ll need to look at the source (ftdi_sio.c for the ftdi specific stuff).
Using strace
The other thing you will probably want to do is strace the application trying to talk to the device.
These are the appropriate options
I always use -tt -T so I can get timing information to see how long was spend in a system call.
You’ll be able to see what ioctls the application is using and what is failing.
Why doesn’t setserial work as expected?
setserial uses some special hardware specific ioctls which are not supported by the driver.
If you want to set things like baudrate, flow control etc using the ftdi serial driver you should use stty.
However. stty only has a limited set of baudrates. You’ll need to write your own software to set ‘unusual’ baudrates or just use libftdi library referenced earlier.
Submitting patches for new VID/PIDs
If you have a patch to submit (adding PIDs etc) please read Documentation/SubmittingPatches in your kernel source directory and submit it to the usb devel list and lmkl (linux kernel mailing)
For adding a new VID/PID you’ll probably only need to patch ftdi_sio_ids.h.
If it’s an unrecognised chip type you’ll need to edit ftdi_sio_id.h and ftdi_sio.c.
Old web site stuff
For my own sentimental reasons I’ve kept a copy of the original websites here.
Serial loopback tester.
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:
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 arguments:
- 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 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:
What ioctls are known to work
- 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. For this to work you might need to patch your kernel. This was true around
- This was the 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).
I’m sure I’ll never do this but I’m leaving the list here anyway.
- 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.
- Check break handling to see if the kernel actually will generate a break of the correct length. When I last looked there was a problem in the tty code where the timing was wrong. But that was about 4 years ago now (so wsa in 2006 or something)
References and useful links
- libftdi — An open source library to talk to FTDI chips using libusb. A good choice if you are writing your own code and want to talk to a device without using the limited serial programming interface.
- FTDI linux driver mailing list — ftdi driver specific. You can ask ftdi specific questions here. It’s pretty quiet though.
- linux-usb-devel sourceforge lists — anything linux-usb related. If you want to submit a patch this is where you’d send it (after reading the kernel docs about submitting patches!)
- Sourceforge FTDI SIO Project Page — this is the sourceforge page for this driver.
- 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. 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.
- Linux on Laptops — good place to go if you are running linux on a laptop and want to check compatibility or get hints for you particular laptop.
- FTDI Website — Future Technology Devices International Ltd. — the company that makes the chips.
USBINFO for the devices I have
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 original FTDI_SIO I have
The 8U232AM sample I have
The 245 sample I have
Acknowledgements
FTDI for making the specifications for the device available, and providing me with their new product when I started writing this.
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.
Thomas Jarosch for prompting me to actually update this page and for his libftdi work which has meant I don’t get hassled about things that shouldn’t really be done by a serial driver.
Feedback
Send me a mail for errors etc in this page — bill.ryder.nz@gmail.com
I’ll probably take months to fix it but it should get fixed.
Источник