23
Copyright © 2007 Future Technology Devices International Ltd. Future Technology Devices International Ltd. Mac OS X Installation Guide

Mac OS X Installation Guide - FTDI

Embed Size (px)

Citation preview

Page 1: Mac OS X Installation Guide - FTDI

Copyright © 2007 Future Technology Devices International Ltd.

Future Technology DevicesInternational Ltd.

Mac OS X Installation Guide

Page 2: Mac OS X Installation Guide - FTDI

Table of Contents

Part I Welcome to the Mac OS X Installation Guide 2

Part II VCP Drivers 3

................................................................................................................................... 31 Installing VCP Drivers

................................................................................................................................... 82 Uninstalling VCP Drivers

Part III D2XX Drivers 10

................................................................................................................................... 101 Installing D2XX Drivers

................................................................................................................................... 112 Uninstalling D2XX Drivers

................................................................................................................................... 123 Multiple VIDs/PIDs

................................................................................................................................... 134 Configuration Settings

Part IV VCP Troubleshooting 14

................................................................................................................................... 141 How do I know what my deviceID is?

................................................................................................................................... 152 The device does not appear in the /dev directory or the text "New Port Detected"

is not displayed in SystemPreferences-Network

................................................................................................................................... 163 The device cannot be accessed even though the deviceID is supported in

FTDIUSBSerialDriver

................................................................................................................................... 174 How do I open a Terminal window?

Part V D2XX Troubleshooting 18

................................................................................................................................... 181 I can't open a port even though the installation has been successful

................................................................................................................................... 192 After running an application two or three times, communication stops

................................................................................................................................... 203 Problems upgrading to the latest D2XX driver

Part VI Revision History 21

Index 22

Mac OS X Installation GuideI

Copyright © 2007 Future Technology Devices International Ltd.

Page 3: Mac OS X Installation Guide - FTDI

2Welcome to the Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

1 Welcome to the Mac OS X Installation GuideThis document describes the procedure for installing the Mac OS X FTDIUSBSerial driver forFTDI's FT2232C, FT232BM, FT245BM, FT8U232AM and FT8U245AM devices. The driver isavailable for free download from the Drivers section of the FTDI web site.

Page 4: Mac OS X Installation Guide - FTDI

3 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

2 VCP Drivers

2.1 Installing VCP Drivers

Download the driver from the VCP Drivers section of the FTDI web site and save it to the harddisk. The driver is now available in disk image (.dmg) format. Run the installer by double clickingon the FTDIUSBSerialDriver.dmg icon.

Click Continue to proceed with the installation and follow the instructions on screen.

When the installation is complete, reboot the computer.

Page 5: Mac OS X Installation Guide - FTDI

4VCP Drivers

Copyright © 2007 Future Technology Devices International Ltd.

When the computer has rebooted, plug in the device. If the device is installed properly, you willsee entries in the /dev directory:

/dev/cu.usbserial-xxxxxxxx/dev/tty.usbserial-xxxxxxxx

where xxxxxxxx is either the device's serial number or, for unserialized devices, a location stringthat depends on which USB port your device is connected to. Note that for FT2232C devices portA is denoted by the serial number appended with "A" and port B is designated by the serial numberappended with "B".

/dev can be accessed through the Terminal application. The Terminal application can be launchedby selecting Go > Applications > Utilities > Terminal. Type the following lines in the Terminalwindow to produce the file list:

cd /devls-l

If you run the application System Preferences and select Network (Go > Applications > SystemPreferences > Network), you should see the text "New Port Detected".

Page 6: Mac OS X Installation Guide - FTDI

5 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

Click OK and select Network Port Configurations from the Show list. The new port can be enabledfrom this screen by checking the On box and clicking Apply Now.

Page 7: Mac OS X Installation Guide - FTDI

6VCP Drivers

Copyright © 2007 Future Technology Devices International Ltd.

At this point, it is possible to exit Network and use the device as a COM port. If you wish to set thedevice up a a modem for an Internet connection, select the new port from the Show list to displaythe window below. Please note that the FT2232C device has two ports available and these mustbe configured separately.

Page 8: Mac OS X Installation Guide - FTDI

7 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

Entries for this screen are specific to the Internet account for each user. If you do not know therequired details, contact your Internet service provider.

Page 9: Mac OS X Installation Guide - FTDI

8VCP Drivers

Copyright © 2007 Future Technology Devices International Ltd.

2.2 Uninstalling VCP Drivers

To remove the drivers from Mac OS X, the user must be logged on as root. Root is a reservedusername that has the privileges required to access all files.

Start a Terminal session (Go > Applications > Utilities > Terminal) and enter the followingcommands at the command prompt:

cd /System/Library/Extensionsrm -r FTDIUSBSerialDriver.kext

cd /Library/Receiptsrm -r FTDIUSBSerialDriver.kext

The driver will then be removed from the system.

To remove the port from the system, run the application SystemPreferences and select Network.Selecting Network Port Configurations from the Show menu will display the port as greyed out.Select the uninstalled port and click Delete. Confirm the deletion to remove the port.

Page 10: Mac OS X Installation Guide - FTDI

9 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

Page 11: Mac OS X Installation Guide - FTDI

10D2XX Drivers

Copyright © 2007 Future Technology Devices International Ltd.

3 D2XX Drivers

3.1 Installing D2XX Drivers

Download the driver from the D2XX Drivers section of the FTDI web site and save it to the harddisk. The driver is provided in disk image (.dmg) format. Mount the disk image by double clickingon the PPC D2XX0.1.0.dmg icon for Power PC users or the Universal D2XX0.1.0.dmg icon forIntel Mac users.

· Start a Terminal session (Go > Applications > Utilities > Terminal)

· Copy libftd2xx.0.1.0.dylib to the /usr/local/lib directory (cp Desktop/D2XX/bin/libftd2xx.0.1.0/usr/local/lib)

· Change directory to the /usr/local/lib (cd /usr/local/lib)

· Create a symbolic link to the library (ln -sf libftd2xx.0.1.0.dylib libftd2xx.dylib)

Samples written in C are provided to show how to use the library and verify the installation. Theseare command line based applications that must be executed from the Terminal window. Tocompile and run the samples perform the following steps (these assume you have copied all of thedistribution files to the desktop and installed the library as per the Installation section above):

· Open a Terminal window (Go > Applications > Utilities > Terminal).

· Change directory to the root samples directory (cd Desktop/D2XX/Samples).

· Build the samples by typing "make" then return. If you have issues at this stage revisit theinstallation section above to ensure the library is correctly installed. Read the error messagesand try to determine the source of the problem. If you still have issues then contact supportdetailing your issue with as much information as possible.

· To run an application, have a suitable FTDI device with default VID (0x0403) and PID (0x6001)and change to the Simple directory (cd Simple) then type "./simple" followed by return (makesure the dot and the forward slash precede the simple command).

· If you have issues at this stage then consult the troubleshooting section later in this document. Ifthe troubleshooting section doesn't help then contact support with your problem details.

Page 12: Mac OS X Installation Guide - FTDI

11 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

3.2 Uninstalling D2XX Drivers

To uninstall the D2XX driver, simply delete the library and the symbolic link:

· Start a Terminal session (Go > Applications > Utilities > Terminal)

· Change directory to the /usr/local/lib (cd /usr/local/lib)

· Delete the library (rm libftd2xx.0.1.0.dylib)

· Delete the symbolic link (rm libftd2xx.dylib)

Page 13: Mac OS X Installation Guide - FTDI

12D2XX Drivers

Copyright © 2007 Future Technology Devices International Ltd.

3.3 Multiple VIDs/PIDs

The current library has a default VID/PID table embedded within to determine if a particular devicewill be opened/accessed by the library. This table contains FTDI's own VID and PIDs, therefore ifyou use FTDI default VID and PIDs this will not concern your application.

There may be a situation when this is not suitable for a particular application such as custom VIDsand/or PIDs. The FT_SetVIDPID API call can cater for single instances of VID/PID variations,however there is a method to include your own range of VID/PIDs with a custom table.

· Using xcode, open the LibTable.xcodeproj in the LibTable folder

· Edit the ftdi_table.c file to include your own VIDs/PIDs

· Recompile the library

· Copy the resultant binary to the /usr/local/lib directory

If you have trouble with the above procedure (don't know what xcode is or can't compile the library)then contact support with your VID/PID requests and we will provide you with a binary to use.Current workload will ultimately impact on the time we can provide you with a library therefore it isadvised to provided us with the details at your earliest possible convenience.

Page 14: Mac OS X Installation Guide - FTDI

13 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

3.4 Configuration Settings

Configuration settings are considered advanced features and are only needed in certain raresituations. Only alter these settings if it has been suggested by FTDI support or you know exactlywhat you are doing.

The D2XX configuration file MUST be called ftd2xx.cfg. This is a simple text file containing varioussettings and allows for expansion in the future. The file is read on an FT_Open/FT_OpenEx only.3 sections are available for settings:

· Global· VID/PID· Unique

An example of the ftd2xx.cfg file is included in the package and each section should be selfexplanatory. The [Globals] section applies to all devices, the [VID_0403&PID_6001] applies todevices of only VID and PID 0x0403 and 0x6001. The unique settings apply to only those devicesof a particular serial number - in the case of the supplied example, [FT000001].

The configuration file must reside in /usr/local/lib or the /usr/lib folder.

Multithreaded WriteIt has been noted during beta testing that some multithreaded applications can lock up during writecommunication with the devices. This is due to a conflict in the application run loop and the writerun loop. To prevent lockup with a multithreaded application use the 31

st bit

(ConfigFlags=0x40000000) in the configuration file. This will enable an alternative FT_Write thathas its own thread and will not conflict with the current thread run loop operation.

USB Reset After OpenIt is always recommended that you close a file handle obtained by FT_Open/FT_OpenEx beforeexiting an application. Side effects of not closing the handle with the multithreaded setting (asillustrated above) can be future communication with the device fails (always test this prior toenabling this setting). The Sample applications demonstrate a method of trapping an abnormalexit (control C operation) and closing each handle in turn. If this is not possible then you mayrequire the reset after open bit set in the configuration file. This is bit 32(ConfigFlags=0x80000000).Warning - USB reset after open forces USB reset which in turn re-enumerates devices on the USBbus which can result in loss of data and a break in communication. In most cases it isrecommended this is NOT used and is only included to cater for the very rare instances thatrequire it. Even though this can be set as a device specific option it is essentially a globaloperation. Thorough testing is strongly recommended before using this setting as it may affectother USB non-FTDI devices on the USB bus.

Page 15: Mac OS X Installation Guide - FTDI

14VCP Troubleshooting

Copyright © 2007 Future Technology Devices International Ltd.

4 VCP Troubleshooting

4.1 How do I know what my deviceID is?

Launch the System Profiler utility, or Apple System Profiler for earlier versions of OS X. This canbe accessed by going to the Finder and selecting Applications from the Go menu, then open theUtilities folder.

Select USB under Hardware in the pane to the left and then select the appropriate device from theUSB Device Tree. In the screen shot below (from OS 10.3), the device has a deviceID given by:

Vendor Name: FTDIPrioduct ID: 24577 ($6001)

A Vendor Name of FTDI is equivalent to a Vendor ID of 1027 ($0403).

If the device does not work after installing the driver, it is likely to be because the PID is notsupported by the driver. If this is the case, contact FTDI Support with the PID that needs to beadded to the driver. If the VID is not 0x0403, it is likely that the device is not an FTDI device andwe cannot support it.

Page 16: Mac OS X Installation Guide - FTDI

15 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

4.2 The device does not appear in the /dev directory or the text "NewPort Detected" is not displayed in SystemPreferences-Network

FTDIUSBSerialDriver does not support your deviceID (VID and PID). Disable the EEPROM so thatthe device reverts to its default deviceID, then replug.

To get support for your deviceID built into FTDIUSBSerialDriver, contact FTDI quoting yourdeviceID and a description of your device.

Page 17: Mac OS X Installation Guide - FTDI

16VCP Troubleshooting

Copyright © 2007 Future Technology Devices International Ltd.

4.3 The device cannot be accessed even though the deviceID issupported in FTDIUSBSerialDriver

An ownership or permissions problem is preventing the system from making the device accessible.

Check that the driver is owned by root and wheel. The most common symptom is the group forFTDIUSBSerialDriver is not wheel. To change the group, login as root and perform the followingscript in a Terminal window (Go > Applications > Utilities > Terminal):

cd /system/library/extensionschgrp -R wheel FTDIUSBSerialDriver.kext

Reboot for the change to take effect.

Page 18: Mac OS X Installation Guide - FTDI

17 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

4.4 How do I open a Terminal window?

A Terminal window can be started by selecting

Go > Applications > Utilities > Terminal

The terminal window is equivalent to a DOS prompt in Windows.

Page 19: Mac OS X Installation Guide - FTDI

18D2XX Troubleshooting

Copyright © 2007 Future Technology Devices International Ltd.

5 D2XX Troubleshooting

5.1 I can't open a port even though the installation has beensuccessful

This is possibly due to the FTDI serial driver holding the port with your VID and PID. Solution is touninstall the serial driver . To completely eradicate the possibility of this occurring in future, it isrecommended a new VID and PID is used to distinguish between devices.

Another possibility is an incorrect VID/PID. Try changing your application to use the FT_SetVIDPIDAPI call to quickly determine if this is the case.

8

Page 20: Mac OS X Installation Guide - FTDI

19 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

5.2 After running an application two or three times, communicationstops

It is always recommended that you close a file handle obtained by FT_Open/FT_OpenEx beforeexiting an application. Side effects of not closing the handle with the multithreaded setting (asillustrated above) can be future communication with the device fails (always test this prior toenabling this setting). The Sample applications demonstrate a method of trapping an abnormalexit (control C operation) and closing each handle in turn.

If you cannot find a work around then try setting the USB Reset After Open bit in the ftd2xx.cfgfile but only as a last resort.

13

Page 21: Mac OS X Installation Guide - FTDI

20D2XX Troubleshooting

Copyright © 2007 Future Technology Devices International Ltd.

5.3 Problems upgrading to the latest D2XX driver

Upgrading the D2XX library can cause problems, such as a reported bug fix does not appear to befixed. This is most likely related to the application executable pointing to a previous version of thelibrary.

To determine which D2XX library your application is using perform the following steps (examples inbrackets assume you have copied all of the files to the desktop and successfully compiled thesamples as described in the Samples section):

· Open a Terminal window (Go > Applications > Utilities > Terminal).

· Change directory to the application executable folder (cd Desktop/D2XX/Samples/Simple)

· Use otool to determine the library path (otool -L simple). The following text is an example of whatis displayedsimple:

/usr/local/lib/libftd2xx.0.1.0.dylib (compatibility version 0.1.0, current version 0.1.0)/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.6)

· As illustrated the, simple application is pointing to libftd2xx.0.1.0.dylib.

· To alter the library so that the simple sample points to use the install_name_tool (e.ginstall_name_tool -change /usr/local/lib/libftd2xx.0.1.0.dylib /usr/local/lib/libftd2xx.dylib simple).Please note you may need to change user mode to perform this function depending on the filepermissions set on the executable.

· Run the otool (illustrated in step 3 above) to confirm that the library pointed to by the applicationhas changed and is correct.

Page 22: Mac OS X Installation Guide - FTDI

21 Mac OS X Installation Guide

Copyright © 2007 Future Technology Devices International Ltd.

6 Revision History

Version Release Date Comments

1.0 December 2004 Initial release

1.1 January 2005 Screen shots addedRoot username explainedExpander information addedUninstallation section addedFT2232C device driver addedDeviceID topic added under Troubleshooting

1.2 March 2005 Additional explanations included for Terminal application andport configurationTerminal topic added in Troubleshooting

2.0 October 2005 Updated to describe installation of version 2 driverReferences to FT2232CUSBSerialDriver removed asFTDIUSBSerialDriver now supports all devicesRe-enumeration script references removed as no longerrequired

2.1 October 2006 Included instructions for the new D2XX driver

2.2 February 2007 Included reference to /Library/Receipts in VCP uninstallinstructions.

Page 23: Mac OS X Installation Guide - FTDI

Index

- D -DeviceID 14, 15

- I -Installation 2

Introduction 2

- M -Mac OS X 2, 3, 8, 10, 11, 13, 14, 15, 16, 17, 20

- P -PID 15

- V -VID 15

- W -Welcome 2

Index 22

Copyright © 2007 Future Technology Devices International Ltd.