libftd2xx problem in Raspberry Pi


23 posts
by anat » Tue Sep 11, 2012 12:12 am
Hello forumers,

I installed libftd2xx in
http://www.ftdichip.com/Drivers/D2XX.htm
There is a build for Raspberry Pi. And I followed the steps in README carefully.

However, when I run an example "./read". I got the following error message:
error while loading shared libraries: libftd2xx.so: cannot open shared object file: No such file or directory"

I am using the Official Raspbian (Debian wheezy). Please advice.

Best regards,
Anat
Posts: 12
Joined: Mon Aug 27, 2012 12:45 am
by mentom » Tue Sep 11, 2012 2:22 pm
Hi everyone, I have the same problem with Raspbian and Kernel version 3.2.27+, while I made it working fine with Slackware Arm (kernel version 2.6).
Any ideas?
Posts: 6
Joined: Tue Sep 11, 2012 2:16 pm
by dmaunder » Fri Sep 14, 2012 8:37 am
I am also have the exact same issue on the Debian Wheezy distro.
Posts: 7
Joined: Fri Sep 14, 2012 8:12 am
by ProblemSolver » Sat Sep 15, 2012 10:43 pm
Same problem here...

Has anyone found a way around this?

Does it work on other distros than Wheezy?
Posts: 1
Joined: Sat Sep 15, 2012 10:20 pm
by mentom » Wed Sep 19, 2012 4:19 pm
I tryed armed slack and it worked... I think it could be a problem due to library dynamic linking...
Posts: 6
Joined: Tue Sep 11, 2012 2:16 pm
by mentom » Thu Sep 20, 2012 9:37 am
I was thinkin... Maybe it's a problem due to hard-float in Raspbian? Armed Slack doesn't support this feature and ftd2xx driver works fine!
Posts: 6
Joined: Tue Sep 11, 2012 2:16 pm
by obcd » Thu Sep 20, 2012 10:12 am
You could try the softfloat wheezy download and see if it makes a difference.
Another thing you can try is setting the usb speed to 1.1 in /boot/cmdline.txt.
I have ftdi devices that simply make the Pi hang if you access them. On usb 1.1 speed, they work fine.
Adding dwc_otg.speed=1 to /boot/cmdline.txt and rebooting should do the trick. It's no solution but it would be interesting to see if it fixes your problem.
Posts: 890
Joined: Sun Jul 29, 2012 9:06 pm
by mentom » Thu Sep 20, 2012 1:01 pm
Thanks obcd, I tred settig the usb speed =1 but it didn't work... I'll try with softfloat wheezy, but I'm quite sure it's a problem of the dynamic linker... I'll investigate...
Posts: 6
Joined: Tue Sep 11, 2012 2:16 pm
by mentom » Fri Sep 21, 2012 10:08 am
Typing:
Code: Select all
ldd 'myexec'


I have:

Code: Select all
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x40223000)
   libftd2xx.so => not found
   libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x4014a000)
   libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x40081000)
   libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x400f2000)
   libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x4022c000)
   libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x4011b000)
   /lib/ld-linux-armhf.so.3 (0x40039000)


When I compile my software I define the run time path for the library using "-L. -lftd2xx -Wl,-rpath /usr/local/lib".

I also tried putting d2xx libraries in /usr/lib and in /lib with no results... Any idea?

Typing
Code: Select all
ldconfig -v


I have:
Code: Select all
/usr/local/lib:
   libftd2xx.so -> libftd2xx.so.1.1.12

So libftd2xx.so is where it's supposed to be, but my dynamic linked executable can't find it even if I defined the run time path... I'm getting mad... :?
Posts: 6
Joined: Tue Sep 11, 2012 2:16 pm
by mentom » Fri Sep 21, 2012 4:03 pm
I finally installed Debian Wheezy (no hard-float), it works like a charm... But I can't understand why ftdi libraries can't work with raspbian...
Posts: 6
Joined: Tue Sep 11, 2012 2:16 pm
by dmaunder » Mon Sep 24, 2012 12:13 pm
The latest Raspbian build now includes support for my FTDI USB device, the Raven from www.rainforestautomation.com, so I no longer need the FTDI D2xx drivers.
Posts: 7
Joined: Fri Sep 14, 2012 8:12 am
by anat » Wed Sep 26, 2012 1:26 am
The FTDI technical support in Taiwan kindly compiled a new FTD2XX for the Raspbian image. They allow me to distribute the driver while the new driver will be posted on their website soon.
http://www.mediafire.com/?7ioe9ear30yhn73
Posts: 12
Joined: Mon Aug 27, 2012 12:45 am
by winstonma » Thu Nov 01, 2012 4:17 am
I used the ftdi_sio driver before. Now I followed the step on the official web site and use the d2xx driver.

I downloaded the d2xx package (Link) and followed the steps on the readme file (Link). However the library doesn't work. After finding the correct library online I tried to run the C program in the d2xx package.

I ran the read program (release/examples/EEPROM/read/read). It provided me the information below:
Library version = 0x10112
Opening port 0
FT_Open succeeded. Handle is 0xcd240
FT_GetDeviceInfo succeeded. Device is type 5.
FT_EE_Read succeeded.

Signature1 = 0
Signature2 = -1
Version = 2
VendorId = 0x0403
ProductId = 0x6001
Manufacturer = FTDI
ManufacturerId = AM
Description = FT232R USB UART
SerialNumber = AM01FBFO
MaxPower = 90
PnP = 0
SelfPowered = 0
RemoteWakeup = 1
232R:
-----
UseExtOsc = 0x0
HighDriveIOs = 0x0
EndpointSize = 0x40
PullDownEnableR = 0x0
SerNumEnableR = 0x1
InvertTXD = 0x0
InvertRXD = 0x0
InvertRTS = 0x0
InvertCTS = 0x0
InvertDTR = 0x0
InvertDSR = 0x0
InvertDCD = 0x0
InvertRI = 0x0
Cbus0 = 0x3
Cbus1 = 0x2
Cbus2 = 0x0
Cbus3 = 0x1
Cbus4 = 0x5
RIsD2XX = 0x0
Returning 0

Then I looped the program in a bash script (while true; do ./read; sleep 2; done). After 5 minutes the system crashed with the same DMA error.
Code: Select all
ERROR::handle_hc_chhltd_intr_dma:2113: handle_hc_chhltd_intr_dma: Channel 1, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000402, intsts 0x06600001
Posts: 11
Joined: Tue Jun 05, 2012 10:01 am
by winstonma » Tue Nov 06, 2012 9:38 am
Hi all,

I posted a kernel request on github.
https://github.com/raspberrypi/linux/issues/40

And the fix is being submitted and compiled. I updated the kernel (to version #257) and the dma issue is gone.

Please use rpi-update to update your kernel. And see if it works for you guys. Good luck.
Posts: 11
Joined: Tue Jun 05, 2012 10:01 am
by McP » Mon Nov 12, 2012 1:52 am
Am just starting a project w/a ver. 2 RP (512MB) board. Have loaded and updated
latest version of wheesy; but am still having problems getting RP to recognize my
Rainforest Raven USB stick (FTDI-based: Vendor 0403, Product 8a28). Appears to
know about (0403, 8a28) as it correctly lists vendor and product string. But, does
not create a new ttyUSBx as on other non-PI wheesy systems. Any suggestions
would be appreciated.

Thanks
Posts: 4
Joined: Mon Nov 12, 2012 1:41 am
by gsh » Mon Nov 12, 2012 12:26 pm
The strings come from the device, so that doesn't tell you whether the driver was loaded....

What do you get out of dmesg? Is it just the plug / unplug message or do you get messages from the FTDI driver?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 782
Joined: Sat Sep 10, 2011 11:43 am
by McP » Tue Nov 13, 2012 8:31 pm
Thanks for the reply. Have not yet looked at dmesg..will do so. I assume it does not matter
that device discovery is being done during boot. Pi reboots whenever I try to hot plug the
usb stick - expect that's due to a power supply glitch.

I did add a udev rule that allowed "something" to load - at least I see the name I gave it show up in
ls /dev. I also included the "RUN+= modprobe ftdio_sio" that I saw mentioned on another
thread. But the driver does not think its a "tty" device. Sudo stty commands are flagged as
"operation not permitted". Have been comparing notes with same ops on a x86 wheesy
VM I installed for a sanity check. The Rainforest device installs correctly on that system
and udev rule is only needed to fix the permissions issue to allow user-level access.

Cheers.
Posts: 4
Joined: Mon Nov 12, 2012 1:41 am
by McP » Wed Nov 14, 2012 3:10 am
Gordon,

Have looked at dmesg. When I only have the rainforest device installed, I get the
following relevant entries:

[ 3.087484] usb 1-1.3: new full speed USB device number 4 using dwc_otg
[ 3.214734] usb 1-1.3: New USB device found, idVendor=0403, idProduct=8a28
[ 3.224252] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3.234157] usb 1-1.3: Product: RFA-Z106-RA-PC RAVEn v2.3.21
[ 3.242317] usb 1-1.3: Manufacturer: Rainforest

The device shows up in the /dev directory under the name I gave it in the udev rule; but, you're
correct that nothing seems to be coming from the ftdi driver.

When I plug in a FTDI ttl serial cable along with the rainforest usb sitck, I get the following:

[ 3.109442] usb 1-1.2: new full speed USB device number 4 using dwc_otg
[ 3.223648] usb 1-1.2: New USB device found, idVendor=0403, idProduct=6001
[ 3.233198] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.243091] usb 1-1.2: Product: TTL232R-3V3
[ 3.249792] usb 1-1.2: Manufacturer: FTDI
[ 3.256163] usb 1-1.2: SerialNumber: FTDCKJ63
[ 3.347496] usb 1-1.3: new full speed USB device number 5 using dwc_otg
[ 3.474992] usb 1-1.3: New USB device found, idVendor=0403, idProduct=8a28
[ 3.484389] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3.494173] usb 1-1.3: Product: RFA-Z106-RA-PC RAVEn v2.3.21
[ 3.502303] usb 1-1.3: Manufacturer: Rainforest
[ 4.650120] EXT4-fs (mmcblk0p2): recovery complete
[ 4.900067] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 4.913250] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 4.923212] Freeing init memory: 200K
[ 9.036477] usbcore: registered new interface driver usbserial
[ 9.158757] USB Serial support registered for generic
[ 9.283561] usbcore: registered new interface driver usbserial_generic
[ 9.376656] usbserial: USB Serial Driver core
[ 9.454947] USB Serial support registered for FTDI USB Serial Device
[ 9.571115] ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected
[ 9.637696] usb 1-1.2: Detected FT232RL
[ 9.644167] usb 1-1.2: Number of endpoints 2
[ 9.717443] usb 1-1.2: Endpoint 1 MaxPacketSize 64
[ 9.724734] usb 1-1.2: Endpoint 2 MaxPacketSize 64
[ 9.797426] usb 1-1.2: Setting MaxPacketSize 64
[ 9.828454] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0
[ 9.840747] usbcore: registered new interface driver ftdi_sio
[ 9.848928] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

I see some log messages from ftdi_sio driver and I can also open and manipulate
its device (/dev/ttyUSB0). So, its able to discover the FTDI serial converter on the
FTDI serial cable but not on the Rainforest usb stick. As far as I know, the major
difference is the idProduct value for the two devices. The odd thing is that the x86
wheesy disto gives me the following when I add the Rainforest usb stick:

--------X86 Wheesy system -------------
[ 243.362419] usb 2-2.1: new full-speed USB device number 6 using uhci_hcd
[ 243.474187] usb 2-2.1: New USB device found, idVendor=0403, idProduct=8a28
[ 243.474189] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 243.474191] usb 2-2.1: Product: RFA-Z106-RA-PC RAVEn v2.3.21
[ 243.474193] usb 2-2.1: Manufacturer: Rainforest
[ 243.538662] ftdi_sio 2-2.1:1.0: FTDI USB Serial Device converter detected
[ 243.538689] usb 2-2.1: Detected FT232RL
[ 243.538691] usb 2-2.1: Number of endpoints 2
[ 243.538692] usb 2-2.1: Endpoint 1 MaxPacketSize 64
[ 243.538694] usb 2-2.1: Endpoint 2 MaxPacketSize 64
[ 243.538695] usb 2-2.1: Setting MaxPacketSize 64
[ 243.541030] usb 2-2.1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 332.498236] usb 2-2: USB disconnect, device number 5
[ 332.498239] usb 2-2.1: USB disconnect, device number 6
[ 332.498380] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0

I know this is a bit of comparing apples to oranges; but apparently, the FTDI serial converter
is not "recognized" on the present PI config. Do I need to list it in some udev-related config file? Again, any comments that would shed light on this would be appreciated.

Cheers
Posts: 4
Joined: Mon Nov 12, 2012 1:41 am
by McP » Thu Nov 15, 2012 3:04 am
Well, problem solved. Suspected that my problem was that ftdi_sio
did not know the vendor and product id for this device (0403, 8a28).
Discovered that you can pass additional id's at module install time.
Tried to add RUN+="modprobe ftdi_sio vendor=0x0403 product=0x8a28"
to the udev rule. But, apparently its too late at the point where that
rule gets executed.

So, I added "ftdi_sio vendor=0x0403 product=0x8a28" to the
/etc/module file. So, the ftdi_sio module gets loaded at boot time
and it grabs an additional id from its command line. When it
discovers the USB stick later in boot process, the id has been added
and the driver recognizes it. All seems soooo simple after 6+ hrs of
google-ing!

Don't know if this id is in the latest version of the driver. If it is, then
I must not be updating kernel properly. Is it simply "sudo apt_get update" ?

BTW, still need to add user account to dialout group and add a udev rule like
ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a28", MODE="0666"
to get the permissions of the /dev/ttyUSB0 correct for non-root users.

Cheers
Posts: 4
Joined: Mon Nov 12, 2012 1:41 am
by luc_antolinos » Tue Sep 17, 2013 7:48 am
mentom wrote:I was thinkin... Maybe it's a problem due to hard-float in Raspbian? Armed Slack doesn't support this feature and ftd2xx driver works fine!

Add -mhard-float to you compilations flags.
Works for me.
Posts: 1
Joined: Tue Sep 17, 2013 7:46 am
by Ande88 » Fri Aug 08, 2014 12:29 pm
I still have the same problem as the threadopener with Raspbian Kernel V 3.12.22+ und the V1.1.12 of libftd2xx. Did anybody found why the driver not works on Raspbian and how to solve the problem?
Posts: 1
Joined: Fri Aug 08, 2014 11:21 am
by worthdog » Thu Aug 28, 2014 7:43 pm
Me too. Has anybody found a solution to this issue ?
Posts: 2
Joined: Thu Aug 28, 2014 7:42 pm
by worthdog » Fri Aug 29, 2014 7:13 pm
Thanks anat - the files you had worked for me
Posts: 2
Joined: Thu Aug 28, 2014 7:42 pm