Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9230367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:48:29+00:00 2026-06-18T05:48:29+00:00

We have a USB device controlled by FTDI’s D2XX drivers. It’s currently controlled from

  • 0

We have a USB device controlled by FTDI’s D2XX drivers. It’s currently controlled from a Windows machine via a Python interface and as a fun project I tried moving the control to a Raspberry Pi (about 1/10th the cost of a PC, not including the OS cost).

There were many hurdles to clear, but after a few weeks I finally found all the answers and got it working. The answers were spread across several forums so as a thank you to the Stack Overflow community I thought I’d consolidate them here.

First, the project required:

  • An operating system: I picked up the latest “Wheezy” Raspbian (hard-float 2012-12-16) from the Raspberry Pi webpage. This included Python.
  • The FTDI D2XX drivers to talk to our FTDI device.
  • A Python interface to the D2XX driver. I used PyUSB
  • Our Python script

I downloaded the Wheezy distribution and used Win32DiskImager to write to a 4 GB SD card. The Raspberry Pi booted with no problems. I then unpacked the D2XX library (libftd2xx.so) and installed it into /usr/local/lib.

PyUSB (1.6) currently is tested only against Windows, but they provide the source code. It’s pretty straightforward to compile a copy for Raspberry Pi. Basically, modify setup.py to link to the libftd2xx.so library (no need to copy it). Also edit d2xx/_d2xx.c to comment out the routines with no Linux implementation (currently ftobj_Rescan, ftobj_Reload ftobj_GetComPortNumber). Copy WinTypes.h and ftd2xx.h from the FTDI D2XX driver download (in the release) directory into ftdi-win32 and run python setup.py install which will compile and install the Python module.

Once all that was done I wrote a simple Python script to talk to the FTDI chip. Note you need to run via sudo.

import d2xx
jd = d2xx.open(0)
pd = jd.eeRead()
print pd

The d2xx module could not seem to find the libftd2xx.so file. So, I tweaked the setup.py script to link to the static copy of the library, libftd2xx.a. Voila, I had my first clue of the problem: The D2XX library was built using soft-float, and my Wheezy distribution was configured to use floating point registers. That is, the gcc on my system generated code that was binary incompatible with the D2XX libraries and would not allow them to be linked to.

To fix this I downloaded the soft-float debian “wheezy” distribution (2012-08-08) and wrote to the 4 GB SD card. This time the image would not boot. After looking around I found this helpful answer. In short, there’s a problem with the boot image for the soft-float so that for some Raspberry Pi boards, it won’t boot. The solution is to replace the start.elf file on the soft-float distribution with one that does work e.g. a copy from the hard-float Raspbian image. Fortunately, the SD card has two partitions: a FAT one and an ext3(?) one. The boot image is on the FAT partition, so it was trivial to pop the hard-float SD card into a Windows box, copy the start.elf file, pop in the soft-float SD card and update its start.elf with the hard-float one. After that, the Raspberry Pi booted no problem.

After installing FTDI’s D2XX drivers and building a d2xx Python module from PyUSB, I tried the test script again. Again it failed. The d2xx module could read the libftd2xx.so library no problem, but for some reason could just not talk to the device.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:48:30+00:00Added an answer on June 18, 2026 at 5:48 am

    I wasn’t sure where the problem lay: Was it PyUSB, an issue with FTDI’s libftd2xx.so or some issue with the Debian distribution?

    With the FTDI package there’s a test, under release/examples/EEPROM/read. You must build it, but that’s simply a matter of typing make. Running it (via sudo), it failed to open the USB device, so clearly it wasn’t PyUSB. After poking around, I found a reference to a driver, ftdi_sio, and that it could conflict with other D2XX drivers. So, using lsmod, I saw ftdi_sio was already installed by default, so I ran rmmod ftdi_sio. After that, everything worked. The read command should show something like this:

    Library version = 0x10112
    Opening port 0
    FT_Open succeeded.  Handle is 0xf7d240
    FT_GetDeviceInfo succeeded.  Device is type 4.
    FT_EE_Read succeeded.
    Signature1 = 0
    Signature2 = -1
    Version = 1
    VendorId = 0x0407
    ProductId = 0x6009
    Manufacturer = MagicIncorporated
    ManufacturerId = wo
    Description = MyCompany Test Board
    SerialNumber = testit_028
    MaxPower = 44
    PnP = 1
    SelfPowered = 0
    RemoteWakeup = 1
    2232RC:
    -------
        Rev5 = 0x1
        IsoInA = 0x0
        IsoInB = 0x0
        IsoOutA = 0x0
        IsoOutB = 0x0
        PullDownEnable5 = 0x0
        SerNumEnable5 = 0x0
        USBVersionEnable5 = 0x0
        USBVersion5 = 0x110
        AIsHighCurrent = 0x0
        BIsHighCurrent = 0x0
        IFAIsFifo = 0x0
        IFAIsFifoTar = 0x0
        IFAIsFastSer = 0x0
        AIsVCP = 0x0
        IFBIsFifo = 0x0
        IFBIsFifoTar = 0x0
        IFBIsFastSer = 0x0
        BIsVCP = 0x0
    Returning 0
    

    I also switched from PyUSB to ftd2xx, because it’s pure python, but it wasn’t strictly necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to interface with a USB audio device from user land.
I have an USB device based on FTDI chip. Sometimes, its driver get stuck.
We have a usb device and the drivers (.inf, libusb.dll, libusb.sys) and can install
I am trying to read data from a HID device. I have a USB
I'm using python to interface a hardware usb sniffer device with the python API
I have a USB GSM device which I use for Internet connection as well
I have to simulate a USB Device for automation and testing purposes (in Linux).
I have a .sh script that automounts any usb device that is plugged in.
My app will be running from a USB key which have specific information like
I have a USB device that I'm attempting to communicate to with my Android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.