How to build OpenOCD for windows

Open source ARM Debugger

Moderator: phalanx

JoeEE
Posts: 13
Joined: Sat Jun 20, 2009 4:43 pm
Location: San Diego Ca

Finally got a solution

Post by JoeEE » Fri Jul 03, 2009 8:02 am

The issue I was having was largely do to McAffee virus protect
it looks like this needs to be disabled during $ ./bootstrap

This was on both computers where this problem was happening.

See also
https://lists.berlios.de/pipermail/open ... 09079.html

Best regards,

Joe

rekisum
Posts: 23
Joined: Mon Aug 28, 2006 1:34 am

Post by rekisum » Fri Jul 17, 2009 6:50 am

Hi Michael,

can you please post clearly (again) where to copy the ftd2xx.lib -> libftd2xx.a to?
I copied it to the /i386 and /amd64 directories, also as to /cygwin/lib and cygwin/lib/mingw.

I also copied th ftd2xx.h to usr/include and usr/include/mingw.
Still get the error:

checking for ftd2xx.lib exists (win32)... checking whether ftd2xx library works.
.. configure: error: Cannot build & run test program using ftd2xx.lib

Maybe its not a good idea to do a compile in the configure script, where you don't get any error or warning messages that could help you to find the problem.
I really did try for hours now! :(

async
Posts: 23
Joined: Sat Jul 25, 2009 7:37 am

Post by async » Tue Aug 04, 2009 4:01 pm

removed.
Last edited by async on Fri Aug 07, 2009 4:13 pm, edited 1 time in total.

dougm84
Posts: 15
Joined: Thu Jul 30, 2009 7:26 am

Post by dougm84 » Wed Aug 05, 2009 6:45 am

I'm curious, how do I compiler for the libftdi driver (--enable-ft2232_libftdi) - what files do I need to download, if any, aside from the SVN openocd sourcecode.

async
Posts: 23
Joined: Sat Jul 25, 2009 7:37 am

Post by async » Wed Aug 05, 2009 6:54 pm

mifi,

Thanks for the very nice tutorial. I finally was able to complile OpenOCD for Windows with the ftd2xx drivers! I have a few comments based on my experience compiling OpenOCD using your tutorial.

1) When installing Cygwin, in addition to the standard installation you need to have all of the following installed also:
-devel: autoconf, automake, gcc-core, libtool, subversion, make
-libs: ioperm, popt

2) When running the ./configure scripts, you must have an the exact same ftd2xx device installed on your computer (by way of previously connecting a device and installing the exact version of the ftd2xx drivers you are compiling with). Otherwise the check and test for ftd2xx.lib will fail and you will get an error like this:

Code: Select all

checking for ftd2xx.lib exists (win32)... checking whether ftd2xx library works. 
.. configure: error: Cannot build & run test program using ftd2xx.lib 
Thanks again for this nice tutorial!

dougm84
Posts: 15
Joined: Thu Jul 30, 2009 7:26 am

Post by dougm84 » Fri Aug 07, 2009 6:12 am

async wrote: 2) When running the ./configure scripts, you must have an the exact same ftd2xx device installed on your computer (by way of previously connecting a device and installing the exact version of the ftd2xx drivers you are compiling with). Otherwise the check and test for ftd2xx.lib will fail and you will get an error like this:

Code: Select all

checking for ftd2xx.lib exists (win32)... checking whether ftd2xx library works. 
.. configure: error: Cannot build & run test program using ftd2xx.lib 
Thanks again for this nice tutorial!
I'm getting this problem, but am having trouble installing ftd2xx to a device - is it compatible with the Olimex ARM-USB-OCD?

EDIT: ftd2xx or libftdi, heh. I've an Olimex ARM-USB-OCD or an Amontec Tiny

async
Posts: 23
Joined: Sat Jul 25, 2009 7:37 am

Post by async » Fri Aug 07, 2009 4:07 pm

The Olimex OCD device is compatible with the FTD driver. It comes on the disk that ships with the Olimex OCD.

To be sure you have a clean driver instalation, FTD has a utility calledFTDClean on the page below. Run that to remove all the ftd drivers on your computer. Then reinstall your device with the latest FTD drivers from thier website. This will remove any confusion as to what driver you are actually using.

http://www.ftdichip.com/Resources/Utilities.htm

pieterc
Posts: 31
Joined: Thu Aug 30, 2007 9:29 am

Post by pieterc » Thu Aug 27, 2009 2:32 am

Hi everyone,

In case my post gets bumped down, I want to remind everyone that I have created a step by step (expanded) guide to build OpenOCD 0.2.0 for Windows using Cygwin (a Linux-like environment for Windows). It is linked against FTDI's proprietary (non-GPL) FTD2XX Driver to support FT2232x based JTAG interfaces.

Visit:
http://piconomic.berlios.de/build_openocd.html

Best regards,
Pieter

vaclavpe
Posts: 5
Joined: Thu Oct 08, 2009 4:35 am

Post by vaclavpe » Fri Oct 09, 2009 12:50 am

Hello Pieter,

is it possible to compile OpenOcd without Cygwin? I have just MinGW compiler. Or, does anybody have a Makefile for MinGW as "./configure" does not work ?

I currently use OpenOcd version built by Martin Thomas and there is no need to have Cygwin. There is no cygwin.dll near openocd.exe. So it must be somehow possible to build OpenOcd without Cygwin...

pieterc
Posts: 31
Joined: Thu Aug 30, 2007 9:29 am

Post by pieterc » Fri Oct 09, 2009 9:25 am

I use Cygwin to build OpenOCD, but the final binary is not dependent on Cygwin DLLs, because of the CC="gcc -mno-cygwin" parameter, i.e. it is MingW in the end.

If you want to use MinGW, maybe you should look at the following post?
viewtopic.php?t=17598

Best regards,
Pieter

bobcousins
Posts: 34
Joined: Sun Oct 11, 2009 4:22 am

Post by bobcousins » Mon Oct 12, 2009 7:58 am

vaclavpe wrote:Hello Pieter,

is it possible to compile OpenOcd without Cygwin? I have just MinGW compiler. Or, does anybody have a Makefile for MinGW as "./configure" does not work ?

I currently use OpenOcd version built by Martin Thomas and there is no need to have Cygwin. There is no cygwin.dll near openocd.exe. So it must be somehow possible to build OpenOcd without Cygwin...
Hi,

I think if you use the "msys" package you will be able to run configure, I have used this in the past. Msys includes a shell interpreter and the utilities required to run configure scripts.

Update:

I have built a libusb OpenOCD using a Mingw/Msys build route, no Cygwin involved.

There were a few wrinkles in the configure scripts, since some of the packages have moved on. Importantly, "libusb-config" is no longer present in libusb32, I think it can be spoofed with a batch file that simply outputs the libusb version number (I used a DOS exe which loads libusb0.dll and gets the version in fact).

It's also worth noting that the latest OpenOCD source is now in the GIT repository mastered at SourceForge; the SVN mirror at Berlios is no longer maintained. You either need a git client, or can download a snapshot of the tree as a tarball.

mackinroj
Posts: 3
Joined: Wed Oct 21, 2009 11:33 pm

Post by mackinroj » Wed Oct 21, 2009 11:39 pm

Hey Mifi,
Myself sandra and I am starting to build openOCD revision 2535 on my windows vista laptop.thanks for giving tips and coding here it will be easy for us.but after installation some
errors ar coming i dont understand why this are running. can you please help me.
stay connected.

Thanks..
Where there is a will,there is way..

mwoo769
Posts: 17
Joined: Wed Feb 03, 2010 7:59 pm
Location: UNSW

Re: How to build OpenOCD for windows

Post by mwoo769 » Tue Mar 02, 2010 6:07 pm

I am having a problem with one of the first few steps

the step where i use the line

Code: Select all

svn checkout svn://svn.berlios.de/openocd/trunk trunk
in the folder /home/openocd
response is

Code: Select all

svn: No access allowed to this repository
Regards

stefmaster
Posts: 11
Joined: Thu Mar 11, 2010 7:45 am

Re: How to build OpenOCD for windows

Post by stefmaster » Thu Mar 11, 2010 8:23 am

mwoo769 wrote:...

Code: Select all

svn checkout svn://svn.berlios.de/openocd/trunk trunk
...
Hello,

the sources are now in a GIT repository. Check out this page:
http://openocd.git.sourceforge.net/git/ ... ;a=summary

There you can download the sources as a snapshot or you can use GIT

Regards

aukcspore
Posts: 2
Joined: Wed Mar 10, 2010 7:11 pm

Re: How to build OpenOCD for windows

Post by aukcspore » Fri Mar 12, 2010 1:59 am

Thank you for much for laying out the steps for building OpenOCD.

ONE BIG QUESTION: DOES THE USB (any FTDI based ) JTAG BE INSTALLED BEFORE I CAN BUILD OPENOCD?

I am using Cygwin (running under Window Vista) and installed it according to
http://piconomic.berlios.de/build_openo ... ILD_PROCES

Following the steps in the first 2 post of this thread:
However I failed to build OpenOCD.
1. ./bootstrap as mentioned does not work for me.
The screen shows:
bash: ./bootstrap: No such file or directory.

2. ./configure --enable-maintainer-mode --disable-werror --disable-shared --enable-parport --enable-parport_giveio --enable-ft2232_libftdi CC="gcc -mno-cygwin"

after a long string of text output.... window vista reported that conftest.exe failed or stop working.
Cygwin console output is:
checking Build & Link with libftdi.....configure:error:Cannot build and run test program using libftdi.

Window Vista complained about conftest.exe program stop: see below:

Apparently according to the Windows Vista report: libusb0.dll is at fault. I did a directory search on my PC and found libsub0.dll in \libusb-win32-device-bin-0.1.12.2\bin I wonder if this is the problem and I need to install a FTDI device to cause this libusb0.dll to be installed and recognised by the Windows. If I don't have a FTDI device installed can I still get configure to work by putting libusb0.dll into somewhere in the windows system directory. If this possible I hope someone can me point to the right directory.

Before this I tried building Openocd with ftd2xxx. which also ended in failure. But someone was saying that I need to have a real FTDI device installed before I can build openocd. I before I get a JTAG device I want to be sure I can compile the tools to use it. So I gave up this FTDI lib and go for the libsub + libftdi combo.

I hope somebody can help. I had been doing building thing for a quite awhile.

Regards


Window Vista failure details:
Problem signature:
Problem Event Name: APPCRASH
Application Name: conftest.exe
Application Version: 0.0.0.0
Application Timestamp: 4b99f097
Fault Module Name: libusb0.dll
Fault Module Version: 6.0.6002.18005
Fault Module Timestamp: 49e03821
Exception Code: c0000135
Exception Offset: 00009eed
OS Version: 6.0.6002.2.2.0.768.3
Locale ID: 18441
Additional Information 1: 9d13
Additional Information 2: 1abee00edb3fc1158f9ad6f44f0f6be8
Additional Information 3: 9d13
Additional Information 4: 1abee00edb3fc1158f9ad6f44f0f6be8

Post Reply