Errors compiling with USB-Blaster on linux

Trying to compile openocd-0.6.1.tar.gz and hitting errors.

First I installed libftd2xx1.1.12.tar.gz from FTDI site here

http://www.ftdichip.com/Drivers/D2XX.htm

Followed the read me then tried to compile OCD and got my first set of errors.

usb_blaster.c:99:20: error: ftd2xx.h: No such file or directory
usb_blaster.c:120: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ftdih'
usb_blaster.c: In function 'usb_blaster_buf_write':
usb_blaster.c:129: error: 'FT_STATUS' undeclared (first use in this function)

Did some searching and found I had to manually copy ftd2xx.h and WinTypes.h from the libftd2xx source directory to /usr/local/include/ That resolved that issue.

Next tried compiling with

./configure --enable-usb_blaster_ftd2xx 
make

and got this error

cc1: warnings being treated as errors
usb_blaster.c: In function 'usb_blaster_buf_write':
usb_blaster.c:138: error: implicit declaration of function 'ftd2xx_status_string'
usb_blaster.c:138: error: format '%s' expects type 'char *', but argument 6 has type 'int'

More searching and found this suggestion

./configure --enable-usb_blaster_ftd2xx --disable-werror
make -i

Trying that I get farther in the build but it still fails.

./.libs/libopenocd.a(usb_blaster.o): In function `usb_blaster_buf_write':
/home/debug1/openocd-0.6.1/src/jtag/drivers/usb_blaster.c:135: undefined reference to `FT_Write'
/home/debug1/openocd-0.6.1/src/jtag/drivers/usb_blaster.c:138: undefined reference to `ftd2xx_status_string'
./.libs/libopenocd.a(usb_blaster.o): In function `usb_blaster_quit':
/home/debug1/openocd-0.6.1/src/jtag/drivers/usb_blaster.c:487: undefined reference to `FT_Close'

Again more searching turned up this post

http://andrey.mikhalchuk.com/2009/06/03 … ation.html

Took a look at the libtool code included with 0.6.1 and it does not seem to match up with what is listed in his post. At this point kinda lost as to what to do next. Any ideas where I went wrong or hot to go about getting openocd to compile under linux with usb-blaster support???

firstly any reason why are you are using the closed src driver - just use libusb and build with --enable-usb_blaster_libftdi ?

Spen

When I was reading up on the two choices it was mentioned the closed source version was faster.

Was in the process this AM of trying the open source drivers from this post.

https://forum.sparkfun.com/viewtopic.php?f=18&t=32871

And it did compile better.

But not sure if fully working when I run openocd with “openocd -f interface.cfg”

where interface.cfg =

interface usb_blaster
usb_blaster_vid_pid 0x09FB 0x6001
adapter_khz 6
#adapter_nsrst_delay 200
#jtag_ntrst_delay 200

I get the following hang.

openocd -f interface.cfg 
Open On-Chip Debugger 0.6.1 (2012-10-24-09:39)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'usb_blaster' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
adapter speed: 6 kHz
Error: Translation from khz to jtag_speed not implemented
Error: Translation from khz to jtag_speed not implemented
Error: Translation from jtag_speed to khz not implemented
Info : adapter-specific clock speed value 0
Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -expected-id 0x21094049 ..."
Warn : AUTO auto0.tap - use "... -irlen 7"
Warn : gdb services need one or more targets defined

Not sure if it is something I have set up wrong or what. Trying to track down a good example of how to set up a simple 1 chip ring using openocd

I see no speed diff on linux, ftd2xx is a bit quicker on windose.

For info i fixed that bug with usb-blaster and ftd2xx - http://openocd.git.sourceforge.net/git/ … 12f478ee25

If you get the code from OpenOCD master the fix will be included.

when you can, try to use the inbuilt configs, eg. interface/altera-usb-blaster.cfg

Seems that this driver has not been updated for the speed settings, probably because it does not support changing speed.

you will need to tell OpenOCD about your target aswell.

Not sure how many people use this adapter so there may be other issues.

Spen