0% found this document useful (0 votes)
237 views

FTDI Drivers Installation Guide For Linux

This document provides a summary of the steps to install FTDI drivers for FTDI devices used with Linux. It outlines installing the D2XX driver by extracting the driver files from a tar gzip archive and copying the shared object and static library files to the appropriate directories. It also describes how to compile and run sample D2XX applications to test the driver installation, including removing the built-in VCP driver, building examples for both the shared object and static libraries, and executing the sample programs.

Uploaded by

adrian.romero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
237 views

FTDI Drivers Installation Guide For Linux

This document provides a summary of the steps to install FTDI drivers for FTDI devices used with Linux. It outlines installing the D2XX driver by extracting the driver files from a tar gzip archive and copying the shared object and static library files to the appropriate directories. It also describes how to compile and run sample D2XX applications to test the driver installation, including removing the built-in VCP driver, building examples for both the shared object and static libraries, and executing the sample programs.

Uploaded by

adrian.romero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Application Note

AN_220

FTDI Drivers Installation Guide for


Linux

Version 1.1

Issue Date: 2016-04-05

The purpose of this application note is to provide users of FTDI chips with a simple procedure
to install FTDI drivers for FTDI devices used with Linux.

Use of FTDI devices in life support and/or safety applications is entirely at the user’s risk, and the
user agrees to defend, indemnify and hold FTDI harmless from any and all damages, claims, suits
or expense resulting from such use.

Future Technology Devices International Limited (FTDI)


Unit 1, 2 Seaward Place, Glasgow G41 1HH, United Kingdom
Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758
Web Site: http://ftdichip.com
Copyright © Future Technology Devices International Limited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

Table of Contents
1 Introduction ............................................................ 2
1.1 Overview.......................................................................... 2

2 Installing D2XX driver ............................................. 3


2.1 Linux Shared Object and Static Library Install ................... 3

3 Compiling and Running Sample D2XX Applications.... 4


3.1 Building and Running the Shared Object Examples ............ 4
3.2 Building and Running the Static Library Example ............... 5

4 Contact Information ................................................ 6


Appendix A – References ............................................. 7
Document References .............................................................. 7
Acronyms and Abbreviations .................................................... 7

Appendix B – List of Tables & Figures ........................... 8


List of Figures .......................................................................... 8

Appendix C – Revision History ...................................... 9

1
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

1 Introduction
The purpose of this application note is to provide users of FTDI chips with a simple procedure to
install FTDI drivers for FTDI devices using Linux.

1.1 Overview
FTDI has two types of drivers for all supported operating systems. These are the virtual COM port
driver (VCP) and the D2XX API drive r. Since the FTDI VCP driver is built into the Linux kernel, this
document will focus on the installation of the D2XX driver.

To ensure all FTDI devices have VCP driver support, FTDI recommends installing the latest kernel
release on the Linux system. In Linux, the VCP drivers will appear as /dev/ttyUSBx.

How to verify the built-in COM port:

Plug in a FTDI based design/module/cable


Open a terminal window, and enter
dmesg | grep FTDI <ret>
[10170.987708] USB Serial support registered for FTDI USB Serial Device
[10170.987915] ftdi_sio 9-1:1.0: FTDI USB Serial Device converter detected
[10170.991172] usb 9-1: FTDI USB Serial Device converter now attached to ttyUSB0
[10170.991219] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

In Linux, the VCP driver and D2XX driver are incompatible with each other. When a FTDI device is
plugged in, the VCP driver must be unloaded before a D2XX application can be run. Use the
remove module (rmmod) command to do this:

sudo rmmod ftdi_sio <ret>


sudo rmmod usbserial <ret>

When the FTDI device is power cycled or reset the VCP driver will be reloaded. The rmmod process
must be repeated each time this occurs. It is possible to write a simple script that unloads the VCP
driver before running the D2XX application.

2
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

2 Installing D2XX driver


Download the Linux D2XX driver from the FTDI D2XX driver web page. The driver files are
contained in a tar gzip file. This archive contains the D2XX driver and directory of sample code.
Most Linux distributions have utilities for extracting tar gzip archive files, such as the Archive
Manager in Ubuntu. Figure 2.1 shows a screen capture showing the contents of the tar gzip
archive. Click on Extract and save all the files to your desired target directory.

Figure 2.1 Contents of D2XX driver archive

As an alternative, you can use the Linux gunzip and tar –xvf commands to extract the driver files.
Open a Linux terminal window and enter

gunzip libftd2xx1.1.12.tar.gz <ret>


tar –xvf libftd2xx1.1.12.tar <ret>

Once the files have been extracted, change to the required architecture subdirectory (i386 for 32
bit systems, x86_64 for 64 bit systems, & arm926 for ARM v5 systems such as Raspberry Pi).

2.1 Linux Shared Object and Static Library Install


All driver files are copied and linked using the Linux sudo command for root permissions.

sudo cp /releases/build/arch/lib* /usr/local/lib <ret>


arch refers to CPU architecture: i386,x86_64,arm926
Make the following symbolic links and permission modifications in /usr/local/lib:

cd /usr/local/lib <ret>
sudo ln –s libftd2xx.so.1.1.12 libftd2xx.so <ret>
sudo chmod 0755 libftd2xx.so.1.1.12 <ret>

3
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

3 Compiling and Running Sample D2XX Applications


FTDI provides both Shared Object (.so) and Static linked (.a) D2XX libraries . Here are the
installation procedures for these libraries.

3.1 Building and Running the Shared Object Examples


To verify the D2XX driver install, compile and run the EEPROM read sample program. Make sure
the Linux system has the gcc compiler installed.

cd /examples <ret>
make –B <ret>
cd /examples/eeprom/read <ret>

The name of the executable file is read.


Plug in the FTDI based device. Remove the VCP driver as described in section 1.1:

sudo rmmod ftdi_sio <ret>


sudo rmmod usbserial <ret>

Run the sample application:

sudo ./read <ret>

The read application will list the configuration descriptors of the attached FTDI device as follows:

opening port 0
ftHandle0 = 0x8e89220
Signature1 = 0
Signature2 = -1
Version = 2
VendorId = 0x0403
ProductId = 0x6001
Manufacturer = FTDI
ManufacturerId = FT
Description = USB-Serial Converter
SerialNumber = FTG5FL9U

4
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

3.2 Building and Running the Static Library Example


The static library example is simple to run and execute:

cd /release/examples/static <ret>
rm lib* <ret> (removes any previous library built for another target)
cp /usr/local/lib/libftd2xx.a . <ret>
make –B <ret>
sudo ./static_link

This application will write and read 16 bytes to port 0 of any FTDI USB ->UART device with a
loopback connector attached:

Device 0 Serial Number - FTVESNIO


Opened device FTVESNIO
FT_Read read 16 bytes
Closed device FTVESNIO

5
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

4 Contact Information

Head Office – Glasgow, UK Branch Office – Tigard, Oregon, USA

Future Technology Devices International Limited Future Technology Devices International Limited
Unit 1, 2 Seaward Place, Centurion Business Park (USA)
Glasgow G41 1HH 7130 SW Fir Loop
United Kingdom Tigard, OR 97223-8160
Tel: +44 (0) 141 429 2777 USA
Fax: +44 (0) 141 429 2758 Tel: +1 (503) 547 0988
Fax: +1 (503) 547 0987

E-mail (Sales) sales1@ftdichip.com E-mail (Sales) us.sales@ftdichip.com


E-mail (Support) support1@ftdichip.com E-mail (Support) us.support@ftdichip.com
E-mail (General admin1@ftdichip.com E-mail (General
us.admin@ftdichip.com
Enquiries) Enquiries)

Branch Office – Taipei, Taiwan Branch Office – Shanghai, China

Future Technology Devices International Limited Future Technology Devices International Limited
(Taiwan) (C hina)
2F, No. 516, Sec. 1, NeiHu Road Room 1103, No. 666 West Huaihai Road,
Taipei 114 Shanghai, 200052
Taiwan , R.O.C. C hina
Tel: +886 (0) 2 8791 3570 Tel: +86 21 62351596
Fax: +886 (0) 2 8791 3576 Fax: +86 21 62351595

E-mail (Sales) tw.sales1@ftdichip.com E-mail (Sales) cn.sales@ftdichip.com


E-mail (Support) tw.support1@ftdichip.com E-mail (Support) cn.support@ftdichip.com
E-mail (General E-mail (General
tw.admin1@ftdichip.com cn.admin@ftdichip.com
Enquiries) Enquiries)

Web Site

http://ftdichip.com

Distributor and Sales Representatives


Please visit the Sales Network page of the FTDI Web site for the contact details of our distributor(s) and sales
representative(s) in your country.

Sys tem and equipment manufacturers and des igners are responsible to ens ure that their s ystems, and any Future T ec hnology
D evic es I nternational L td (F T DI) devices inc orporated in their s ystems, meet all applicable s afety, regulatory and s ystem - level
performanc e requirements. A ll application-related information in this document (including application des c riptions , s ugges ted
FT D I devic es and other materia ls ) is provided for referenc e only. While FT D I has taken c are to as s ure it is ac c urate, this
information is s ubject to c ustomer c onfirmation, and FT D I dis c laims all liability for s ys tem des igns and for any applic ations
as s istance provided by FTD I. U se of F T DI devices in life s upport and/or s afety applications is entirely at the us er’s ris k, and the
us er agrees to defend, indemnify and hold harmles s FTDI from any and all damages , c laims , s uits or expens e res ulting from
s uc h us e. T his doc ument is s ubject to c hange without notic e. N o freedom to us e patents or other intellectual property rights is
implied by the public ation of this doc ument. N either the whole nor any part of the information c ontained in, or the produc t
des c ribed in this doc ument, may be adapted or reproduc ed in any material or electronic form without the prior written c ons ent
of the c opyright holder. Future T ec hnology D evic es I nternational L td, U nit 1 , 2 Seaward P lac e, C enturion Bus ines s P ark,
G las gow G 4 1 1 H H , U nited Kingdom. Sc otland Regis tered C ompany N umber: SC 1 3 6 6 4 0

6
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

Appendix A – References

Document References
Refer to the FTDI D2XX Programmers Guide for more information on the D2XX API.
D2XX Programmers Guide

Acronyms and Abbreviations


Terms Description

Make command Make is a script for compiling code examples.

Shared Object File (.so) Linux version of a Windows Dynamically Linked Library (dll)

Static File (.a) Linux version of a Windows static linked library

7
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

Appendix B – List of Tables & Figures

List of Figures

Figure 2.1 Contents of D2XX driver archive................................................................................... 3

8
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited
Application Note
AN_220 FTDI Drivers Installation Guide for Linux
V ers ion 1 .1

D oc ument Reference N o.: FT _000723 C learance No.: FT DI# 3 0 2

Appendix C – Revision History


Document Title: AN_220 FTDI Drivers Installation Guide for Linux
Document Reference No.: FT_000723
Clearance No.: FTDI# 302
Product Page: http://www.ftdichip.com/Drivers/D2XX.htm
Document Feedback: Send Feedback

Revision Changes Date

1.0 First Release 2012-07-11

1.1 Updated Release 2016-04-05

9
P roduc t Page
D oc ument Feedback C opyright © Future T echnology D evices I nternational L imited

You might also like