Search code examples
javaeclipsemakefilejava-native-interfaceftdi

How to compile ftd2xxj on arm-v7?


I have been successfully using the FTDI D2XX driver on arm-v7 from c++ and Python, but I now need to use java.

Also, I have successfully used the ftd2xxj JNI wrapper on Windows and OSX using this modified ftd2xxj project

Please bare in mind I am not very comfortable with JNI and Makefiles yet.

The issue is I can't seem to compile the ftd2xxj project from source. The OSX modified version relies on xcodebuild and I'm not sure how to convert that to cmake/Makefiles. (I did have a quick look at pbxbuild and buildtool but couldn't figure out how to use).

I have checked out the original ftd2xxj source code from sourceforge and imported the projects in eclipse, but I'm running into some issues:

The ftd2xxj Java project is referencing a javax.util project which isn't present in the repository and I wasn't sure where to find it. I assumed this might be related to javax.util.property.2_0.jar I spotted in the precompiled binaries. As a hacky workaround I created a blank javax.util project and added the .jar file to the project's requiring it to keep eclipse from complaining (but this is likely to mess up the original config).

In short: I can't compile the original ftd2xxj project (so far because of a missing javax.util project for the javax.util.properties library) and I would like to compile the project on arm-v7 (either with eclipse or Makefiles)

Any hints/tips on how I can compile the project ?

For reference here is the output from ant:

build-all:
build-application:
init:
     [echo] Start time: 25-November-2015 : 16:55:24
     [echo] Used JDK: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
     [echo] !!! Be sure to use a Java SDK !!!
     [echo] Project classpath: 
compile-application-release:
clean-application:
clean-application-docs:
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:216: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 36 source files to /Users/georgeprofenza/Documents/eclipse/ftd2xxj/target/application/bin
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:8: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/EEPROM.java:3: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:3: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/DeviceDescriptor.java:3: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/FTStatus.java:5: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:14: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:15: package javax.util.property does not exist
    [javac] import javax.util.property.Property;
    [javac]                           ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:16: package javax.util.property does not exist
    [javac] import javax.util.property.PropertyPersistenceManager;
    [javac]                           ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:25: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:59: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(defaultValue = " ")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:65: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.writeTimeout", defaultValue = "300")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:71: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.readTimeout", defaultValue = "300")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:77: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.latencyTimer", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:83: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.resetPipeRetryCount", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:89: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.usbReceiveBufferSize", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:95: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.usbTransmitBufferSize", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:142: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalStateException(Localizer.getLocalizedMessage(
    [javac]                                             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:155: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalStateException(Localizer.getLocalizedMessage(
    [javac]                                             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:302: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:347: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:454: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:545: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:608: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:657: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:661: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:695: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:770: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:774: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:780: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             logger.fine(Localizer.getLocalizedMessage(Device.class,
    [javac]                         ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:879: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:883: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:887: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             logger.fine(Localizer.getLocalizedMessage(Device.class,
    [javac]                         ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/EEPROM.java:33: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.EEPROM
    [javac]             throw new IllegalStateException(Localizer.getLocalizedMessage(
    [javac]                                             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:58: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:92: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:163: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:190: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/DeviceDescriptor.java:106: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.DeviceDescriptor
    [javac]             throw new InvalidDeviceDescriptorException(Localizer
    [javac]                                                        ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/FTStatus.java:146: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.FTStatus
    [javac]         return Localizer.getLocalizedMessage(FTStatus.class, status.toString());
    [javac]                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/FTStatus.java:164: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.FTStatus
    [javac]             String message = Localizer.getLocalizedMessage(FTStatus.class,
    [javac]                              ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:107: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]             logger.log(Level.SEVERE, Localizer.getLocalizedMessage(
    [javac]                                      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:129: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]         logger.config(Localizer.getLocalizedMessage(Service.class,
    [javac]                       ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:147: cannot find symbol
    [javac] symbol  : variable PropertyPersistenceManager
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]             PropertyPersistenceManager
    [javac]             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:150: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]             throw new RuntimeException(Localizer.getLocalizedMessage(
    [javac]                                        ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:103: cannot find symbol
    [javac] symbol: variable Localizer
    [javac]                             String title = Localizer.getLocalizedMessage(
    [javac]                                            ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:107: cannot find symbol
    [javac] symbol: variable Localizer
    [javac]                             String message = Localizer.getLocalizedMessage(
    [javac]                                              ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:147: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             text = Localizer.getLocalizedMessage(DevicesTreePanel.class,
    [javac]                    ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:151: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             text = Localizer.getLocalizedMessage(DevicesTreePanel.class,
    [javac]                    ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:211: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:223: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] 50 errors

BUILD FAILED
/Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:107: The following error occurred while executing this line:
/Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:112: The following error occurred while executing this line:
/Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:216: Compile failed; see the compiler error output for details.

Total time: 2 seconds

Update 1 I've made some progress with the original eclipse based project and managed to run the ant build from the ftd2xxj project, which seems to generate the JNI headers, but it doesn't seem to compile the JNI library. (I haven't spotted anything in the ant file that points to anything JNI related other than the JNI headers). It is still unclear what the recommended method of compiling the JNI library (now that the headers are ready).

I noticed there is a com.ftdichip.ftd2xx.linux.x86, which is referenced from the ftd2xxj, but I'm not sure how it's being used and if I would like to make com.ftdichip.ftd2xx.linux.armv7 folder, how would I do that ?

Update 2 I've noticed a problem eclipse flags for the com.ftdichip.ftd2xx project:

An API baseline has not been set for the current workspace Based on this answer I've set preferences to Warn instead of Error. I hope this won't cause major problems

I've made further progress with the eclipse projects and noticed something happening with the ftd2xx-native project. It tries to compile based on Makefiles, but it fails:

19:14:51 **** Incremental Build of configuration linux-i386 for project ftd2xxj-native ****
make all 
Building file: ../src/device.c
Invoking: GCC C Compiler
gcc -I/home/pi/eclipse/ftd2xxj-native/external/include -I/include -I/include/linux -O0 -Wall -c -fmessage-length=0 -fPIC -m32 -MMD -MP -MF"src/device.d" -MT"src/device.d" -o"src/device.o" "../src/device.c"
gcc: error: unrecognized command line option ‘-m32’
src/subdir.mk:39: recipe for target 'src/device.o' failed
make: *** [src/device.o] Error 1

19:14:51 Build Finished (took 246ms)

I noticed the -m32 flag, sub when I try to edit the src/subdir.mk file I get a warning the file is generated. I am still not sure how these Make files are generated. Any hints in this direction would be helpful

Update 3 I now notice the ftd2xxj-native is the JNI C project and there are some extra settings via Eclipse CDT. I can see the -m32 flags, but I'm unable to change the settings. I'm going through the CDT docs. Any hints/tips on configuring and compiling JNI projects via CDT will are appreciated


Solution

  • Turns out there were quite a things to setup. I compiled the project on a Raspberry PI 2 using eclipse 3.8.1 with CDT 8.5.0.

    Using this version resulted in a single API baseline error, which in Preferences > Plug-in Development > API Baselines can be set to Warning instead Error if any are missing.

    I had to change the JRE (J2SE01.5 used in the original project was missing) but java 7 openJDK and Oracle JDK 8 were present on the system.

    Most of the settings I was looking in terms of compiler flags were present in the ftd2xx-native project properties under C/C++ Build > Settings

    There are the settings I've used: C Compiler Includes

    /usr/lib/jvm/java-7-openjdk-armhf/include
    /usr/lib/jvm/java-7-openjdk-armhf/include/linux
    "${workspace_loc:/${ProjName}/external/include}"
    

    C Compiler Flags (Miscaleneous > Other Flags)

    -c -fmessage-length=0 -fPIC -march=armv7-a -mfloat-abi=hard -ftree-vectorize -Wno-psabi -pipe-c -fmessage-length=0 -fPIC -march=armv7-a -mfloat-abi=hard -ftree-vectorize -Wno-psabi -pipe
    

    C linker libraries (-l)

    jvm
    ftd2xx
    

    C linker library search paths(-L)

    /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/client
    "${workspace_loc:/${ProjName}/external}"
    

    I was originally using the java 7 openjdk path, but the client library vanished at some point (not sure if cleaning the c++ project had anything to do with that)

    Miscaleneous > Other Flags

    --no-undefined
    

    Shared library settings

    Shared is on (-shared) Shared object name

    lib${BuildArtifactFileName}.${MAJOR_VERSION}
    

    MAJOR_VERSION and MINOR_VERSION were defined in C/C++ Build > Build Variables (as Strings)

    Hope this helps anyone else trying to compile this JNI wrapper on a different platform

    I terms of using the libraries, it's worth taking note of the driver's readme file, especially the ones on unloading the serial driver and running java as sudo when using this library:

    If the message "FT_Open failed" appears: Perhaps the kernel automatically loaded another driver for the FTDI USB device.

    sudo lsmod
    
    If "ftdi_sio" is listed:
        Unload it (and its helper module, usbserial), as follows.
    
        sudo rmmod ftdi_sio
        sudo rmmod usbserial
    
    Otherwise, it's possible that libftd2xx does not recognise your 
    device's Vendor and Product Identifiers.  Call FT_SetVIDPID before
    calling FT_Open/FT_OpenEx/FT_ListDevices.