Menu

BinaryInstallation

Stephen Davies

Binary Installation

This page describes the configuration process for the yad2xx libraries. Basically, where to copy them.

First time developers should simply download (and virus check) the prebuilt binaries. Experienced developers that are building from source will want to perform these tasks after they have run the Maven install script.

FTDI Driver

Start out by installing the FTDI D2XX driver for your operating system.

YAD2XX Libraries

Users of this project need to understand that a Java Native Interface consists of two files. The first is the projects Java library, yad2xxJava-*.jar. The JAR file contains compiled Java bytecode and is platform independent. You need to download this and make it available on your projects CLASSPATH.

The second download file is a Java native library and is platform dependent. You will need to choose between the Windows x64 or OS X versions. This file contains the platform dependent implementation code (native code). It's a layer of code written in C that adapts the D2XX library so that its functions can be called by Java.

Native Library - Windows x64

On Windows x64 (I've tested on Windows 7) you should download, virus scan, and copy FTDIInterface.dll to c:\windows\system32.

The current FTDI CDM (Combined Driver Model) contains D2XX and VCP drivers. By default both are enabled. This means the FTDI device will be 'owned' by Windows as a COM port. Open the Windows Device Manager to verify.

To use the device via its D2XX driver you need to perform the following using the Device Manager:

1) Expand the item 'Universal SerialBus controllers'
2) Select the nested item 'USB Serial Converter'
3) Right mouse click (open context menu) then left mouse click on 'Properties', this opens a dialog window
4) Select the 'Advanced' tab
5) Uncheck the 'Load VCP' option
6) Exit the dialog window

This will disable the VCP driver, leaving the D2XX driver as the sole interface. Unplug the device and restart Windows.

Native Library - OS X (Yosemite and earlier)

Copy libFTDIInterface.jnilib to /usr/lib/java.

Native Library - OS X (El Capitan and later)

Apple have tightened up their operating system security and /usr/lib is no longer writable. Copy libFTDIInterface.jnilib to /Library/Java/Extensions.

JAR File

From 0.3 onward there are two project JAR files. Project sample code runs from the command line and is based on Apache Commons CLI i.e. it uses another open source library. If you're not sure which JAR file to use then select the 'with-dependencies' version. This makes things easier as all the required classes are packaged in a single library.

If you can live without the sample code then use the smaller JAR file.

First Steps

Insert your device and try running the sample program 'ListDevices'.

$ java -cp yad2xxJava-0.3-with-dependencies.jar net.sf.yad2xx.samples.ListDevices

This runs the ListDevices sample program which reports on the attached FTDI devices and their capabilities:

FTDI Device List
----------------

Got 2 devices
Dev 0:
    Flags=2 (isOpen: false isHighSpeed: true)
    Type=6 (FT_DEVICE_2232H)
    ID=40384e0
    locID=140f1
    SerialNumber=000001A
    Description=My JTAG A
    ftHandle=0

Dev 1:
    Flags=2 (isOpen: false isHighSpeed: true)
    Type=6 (FT_DEVICE_2232H)
    ID=40384e0
    locID=140f2
    SerialNumber=000001B
    Description=My JTAG B
    ftHandle=0

If this doesn't work then recheck the steps outlined above.

If all else fails raise a ticket.


Related

Wiki: Home