libftdi and openocd

Ubuntu 12.4 64-bit: i compiled and installed libusb-1.0.9 and libftdi1-1.0, example/find_all_pp found my BeagleBone (FT2232-based adapter) with no problems after I ran it with sudo. However, openocd -f board/ti_beaglebone.cfg gives me Error: The specified debug interface was not found (ft2232). Where should I start looking into it?

More information: I reconfigured openocd to use ftd2xx library, the open-source one was getting me nowhere:

./configure --enable-ft2232_ftd2xx --enable-ftdi --enable-ulink --with-ftd2xx-linux-tardir=/home/user/Downloads/release --with-ftd2xx-lib=static --enable-verbose --enable-verbose-jtag-io

I also had to change cortex_a to cortex_a8 in am335x.cfg, there were two instances, changing first one in ‘target create’ was necessary, but second one in ‘$_TARGETNAME congigure’ made no difference.

Now openocd recognizes the beaglebone but hangs after the last message:

Info : device: 6 “2232H”

Info : deviceID: 67330064

Info : SerialNumber: TIWFBHRAA

Info : Description: BeagleBone/XDS100V2 A

Info : max TCK change to: 30000 kHz

Info : clock speed 1000 kHz

Error: couldn’t read enough bytes from FT2232 device (0 < 81)

Error: couldn’t read from FT2232

in procedure ‘runtest’

Error: JTAG scan chain interrogation failed: all ones

Error: Check JTAG interface, timings, target power, etc.

Error: Trying to use configured scan chain anyway…

Info : inter: 0.000182, inter2: 0.000182 end: 0.000183

Warn : Bypassing JTAG setup events due to errors

I guess now I need to snoop JTAG signals with an analyser:

TCK is pulsed 640 times. TDI is set by the adapter to all ‘1’, which is probably a problem with the openocd code or config files.

TDO from the CPU shows more life, ‘1111 0100 0000 0010 0010 1001 1101 0000’. Config files try to set IR to 7 (111000) through TDI which is not happening, and read DR as 89 (10010001), but there is no such bit pattern in the TDO stream.

After this and about 25 seconds later there is a correct transaction to write 3F into IR. That piece somehow works.

What should I look for next?

My setup (Fedora 18 32 bit, libusbx, libftdi, openocd 0.6.1) is very different from yours. The only thing I noticed that might be pertinent:

My machine didn’t even recognize the beaglebone until I used a very short USB cable. About 2’. Nothing at all from dmesg with a 6’ cable. With the 2’ cable openocd seems to work ok with the stock ti_beaglebone.cfg.

Try to verify if kernel module ftdio_sio is loaded, I have a similar problem when ftdio_sio was loaded. With can remove temporarly with

sudo modprobe -r ftdio_sio