libftdi Archives

Subject: ftdi_eeprom hangs opening FT2232H device

From: Daniel Kirkham <dk2@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sat, 28 Apr 2012 17:45:47 +1000
Hello,

I'm trying to get my DLP-2232H module (FT2232H plus 93LC46) working with libftdi, initially to rewrite the EEPROM so that the device starts one of the two channels in UART mode. 
Long term, my application will probably work with just the stock linux driver (ftdi_sio) but I will need to use MPSSE to program a CPLD in place, and so need to get libftdi working with the device.

But to my initial problem. I've downloaded the libftdi tree from git, found what I believe are the appropriate development libraries and compiled. But when I run either ftdi_eeprom, or examples/eeprom the programs hang indefinitely apparently trying to fully claim the device.

For instance: from strace ./ftdi_eeprom --read-eeprom example.conf
... lots deleted ... finding USB device V=0x0403, P=0x6010
open("/dev/bus/usb/004/009", O_RDWR)    = 5
write(4, "\1"..., 1)                    = 1
read(3, "\1"..., 1)                     = 1
open("/sys/bus/usb/devices/4-5/descriptors", O_RDONLY) = 6
read(6, "\22\1\0\2\0\0\0@\3\4\20`\0\7\1\2\3\1"..., 18) = 18
close(6)                                = 0
open("/dev/bus/usb/004/009", O_RDONLY)  = 6
lseek(6, 18, SEEK_SET)                  = 18
read(6, "\t\0027\0\2\1\0\200"..., 8)    = 8
close(6)                                = 0
open("/dev/bus/usb/004/009", O_RDONLY)  = 6
lseek(6, 18, SEEK_SET)                  = 18
read(6, "\t\0027\0\2\1\0\200\365\t\4\0\0\2\377\377\377\2\7\5\201\2\0\2\0\7\5\2\2\0\2\0\t"..., 55) = 55
close(6)                                = 0
ioctl(5, USBDEVFS_IOCTL, 0xbfcfdde4)    = -1 ENODATA (No data available)
open("/sys/bus/usb/devices/4-5/bConfigurationValue", O_RDONLY) = 6
read(6, "1\n"..., 4)                    = 2
close(6)                                = 0
ioctl(5, USBDEVFS_CLAIMINTERFACE, 0xbfcfddf4) = 0
clock_gettime(CLOCK_MONOTONIC, {753230, 510908473}) = 0
ioctl(5, USBDEVFS_SUBMITURB, 0x813b900) = 0
clock_gettime(CLOCK_MONOTONIC, {753230, 511055664}) = 0
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLOUT}], 2, 5000) = 1 ([{fd=5, revents=POLLOUT}])
ioctl(5, USBDEVFS_REAPURBNDELAY, 0xbfcfdc7c) = 0
timerfd_settime(-1, 0, {it_interval={0, 0}, it_value={0, 0}}, NULL) = -1 EBADF (Bad file descriptor)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLOUT}], 2, 60000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLOUT}], 2, 60000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLOUT}], 2, 60000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLOUT}], 2, 60000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLOUT}], 2, 60000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=5, events=POLLOUT}], 2, 60000^C <unfinished ...>

The problem may lie inside libusb, but I figured there may be greater knowledge of FTDI devices in this forum.

I'm linked against libusb1.0:
ldd ./ftdi_eeprom --read-eeprom example.conf
./ftdi_eeprom:
linux-gate.so.1 =>  (0xb77b1000)
libftdi.so.2 => /home/kirkham/src/libftdi/libftdi/src/libftdi.so.2 (0xb77a2000)
libconfuse.so.0 => /usr/lib/libconfuse.so.0 (0xb778c000)
libusb-1.0.so.0 => /lib/libusb-1.0.so.0 (0xb777f000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7639000)
librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb7630000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7617000)
/lib/ld-linux.so.2 (0xb77b2000)

Interestingly, I can run an old version of ftdi_eeprom (based on libusb-0.1) and read the EEPROM, but that version appears to lack recent libftdi additions to cope with the EEPROM format required by the FT2232H, so I can't use it to write the EEPROM.

My development system is basically Debian squeeze on Intel hardware, kernel 2.6.26-2-686 #1 SMP, which automatically loads up ftdi_sio and usbserial to service the FT2232. Unloading these modules does not fix the problem. 

Many thanks for any assistance.

Daniel Kirkham
Melbourne, Australia
(minor contributor to libftdi back in 2004)


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread