it is nice idea to compile under Ubuntu. Please Mr. “gibbon1” can you provide your command line args. for ./configure script for your example? Thank you.
Second, after you start the bash, make sure PATH has nothing but /usr/bin in it. If you have some packages that might have tools with the same name in the PATH, it will give you all sorts of weird build errors. Once I removed all of those, the build went pretty smooth.
A mistake in the above text: Do not edit *.in files; In a correctly-running automake, they are regenerated from the Makefile.am files.
My cygwin build environment installs the wrong version of aclocal.m4; before running make, I have to replace it with the one from the distribution files for openocd, and touch it so the make doesn’t replace it. After that, the make complains but finishes.
I also found out more about the available options. I haven’t tried them; YMMV.
The “ftd2xx” clauses, above get and use the proprietary but certified windows driver from FTDI, provider of the JTAG IC. Substituting “ftdi” into those commands with the 0.6.1 version of openocd is supposed to invoke the open-source asynchronous driver for the FTDI chip(s).
Also, it appears that the cygwin installer can install a MingW64 compiler that enables an option to cross-compile for 64-bit windows.
Has anyone had any success building OpenOCD 0.7.0 from the Git repo of late? I am trying to build it using the D2XX drivers and libusbx. I am trying to build from the Git repo because I need access to the latest TI ICDI on the LM4F devkit(s).
If I do not configure openocd with JLink and TI ICDI support enabled, everything works. But if I enable either JLink or TI ICDI support, the configuration and build seem to complete fine, but when I run openocd I get nothing on stdout, it just returns without doing anything.
This is the first time I have really tried to build OpenOCD cross-compiling under Cygwin for MinGW so it is quite possible I am not putting things where they belong.
Unfortunantly, the problem isn’t the build. I can presumably build it just fine. I configure OpenOCD and then run ‘make’ and ‘make install’ and get no errors. I get an executable and as far as I can tell any libraries that it builds and requires. When I run the executable I don’t see any output…no error message, no fault message, no unable to load library message, nothing but nothing. When I execute “openocd --version” I also get nothing.
Regarding installing the libraries to the correct location…that I do not know. As far as I can tell I have simply because during configuration everything is found, but it is possible that I haven’t done something correctly. All of my steps (downloading the various libraries, extracting, copying them to required locations, configuration, build, etc) can be found in the gist I posted at https://gist.github.com/4599885 (it is the actual script I used to try and build OpenOCD).
I am using the MinGW environment that is found in the Cygwin packages:
gcc-mingw (20040810-1)
gcc-mingw-core (20050522-3)
gcc-mingw-g++ (20050522-3)
mingw-binutils (2.21-1)
mingw-gcc-core (4.5.2-1)
mingw-pthreads (20110507-1)
mingw-runtime (3.20-1)
Hmm…looks like you are using a different MinGW? I’ll try using mingw64-i686 and see if that changes anything. I just assumed that the ones I installed where the generic version…the meta-packages, but maybe not?
Well, just install i686-w64-mingw32 and I get the same thing (I updated the script in the gist to copy things to /usr/i686-w64-mingw32/sys-root/mingw).
If I was to cross-compile under linux for windows, would I follow the same steps simply specify a different ‘–build’ option when configuring OpenOCD? I haven’t found any good information that indicates HOW to install libusbx properly when using MinGW to cross-compile.
I actually did build it without the ‘–enable-jlink’ and ‘–enable-ti-icdi’ options and it worked fine then.
I went ahead and installed MinGW on a Mint Linux virtual machine and took my same script, updated it to use the Mint/Ubuntu MinGW installation (i.e. simply changed the location that the libraries where getting copied to to /usr/i686-w64-mingw32/…) and things are now working. Copied over the build executable to my main Windows installation and it seems to be running…though I do now have another issue.
When trying to debug a Stellaris LM4F232 devkit from TI using OpenOCD, I can connect and reset the board and I can single instruction step through the boot process but I get mostly instruction errors. I can the exact same board and debug it using a JLink using the JLink GDB server (same remote GDB client ‘arm-none-eabi-gdb’) and when I single instruction step and decode the instructions (‘display/i $pc’) I get correctly disassembled instructions.
cmeyer:
I actually did build it without the ‘–enable-jlink’ and ‘–enable-ti-icdi’ options and it worked fine then.
I went ahead and installed MinGW on a Mint Linux virtual machine and took my same script, updated it to use the Mint/Ubuntu MinGW installation (i.e. simply changed the location that the libraries where getting copied to to /usr/i686-w64-mingw32/…) and things are now working. Copied over the build executable to my main Windows installation and it seems to be running…though I do now have another issue.
That’s good news
cmeyer:
When trying to debug a Stellaris LM4F232 devkit from TI using OpenOCD, I can connect and reset the board and I can single instruction step through the boot process but I get mostly instruction errors. I can the exact same board and debug it using a JLink using the JLink GDB server (same remote GDB client ‘arm-none-eabi-gdb’) and when I single instruction step and decode the instructions (‘display/i $pc’) I get correctly disassembled instructions.
Am I missing a configuration option?
Not so good, OpenOCD will only return the info requested by gdb - just a thought but try adding the following to your gdb init, it could be related to the memory map returned by OpenOCD.
set mem inaccessible-by-default off
If this does not help perhaps better move to a new thread.
Now copy the file libusb-win32-device-bin-0.1.12.2\include\usb.h
to the following directories:
c:\cygwin\usr\include
c:\cygwin\usr\include\mingw
Even you must copy the library libusb-win32-device-bin-0.1.12.2\lib\gcc\libusb.a
to the following directories:
c:\cygwin\lib
c:\cygwin\lib\mingw
Hello,
I am trying to build OpenOCD for Olimex USB-TINY-H. I installed Cygwin, but the install directory doesn’t contain C:\Cygwin\lib\mingw and C:\cygwin\include\mingw. So where do I copy the files. Please share ur views. Thanks
I try to build openOCD on cygWin. The bootstrap and configure seems ok and the building goes quite well.
Till it comes by the linking of the Ulink.o. It gives an error of undefined roundf() but the -lm is on the command line. If i build a small program with roundf() it works.
I found systems which are testing the roundf() in the configure and are linking the roundf if necessary.
Update:
Everything is working now and build with cygWin. I had sbrk (memory allocation) errors of aclocal with Msys so I moved to cygWin. To make it build with the current cygWin installer (9 July 2014) you have to do some more steps then the tutorials are showing which can be found on the internet. You have to select some more packages (like pkg-config) which aren’t apparently no longer installed by default. Symlink the aclocal and automake version 1.13 and apply the workaround as above.
Copy installed mingw to msys to “local” directory (this is easiest way : ), copy OpenOCD sources to msys\home\User.
Run msys console, go to source dir and run
./bootstrap
``` and got something like
User@MaxL ~/OpenOCD_src/code
$ ./bootstrap
aclocal
libtoolize --automake --copy
autoconf
autoheader
automake --gnu --add-missing --copy
Makefile.am:23: warning: wildcard $(srcdir: non-POSIX variable name
Makefile.am:23: (probably a GNU make extension)
Setting up submodules
Bootstrap complete. Quick build instructions:
./configure …
Download libraries: [http://citylan.dl.sourceforge.net/proje ... .14-win.7z](http://citylan.dl.sourceforge.net/project/libusbx/releases/1.0.14/Windows/libusbx-1.0.14-win.7z) and [http://sourceforge.net/projects/libusb- ... t/download](http://sourceforge.net/projects/libusb-win32/files/latest/download) .
Take libusbx-1.0.14-win\MinGW32\static\libusb-1.0.a and put to msys+7za+wget+svn+git+mercurial+cvs-rev13\msys\local\lib
Take libusb-win32-bin-1.2.6.0\libusb-win32-bin-1.2.6.0\lib\gcc\libusb.a and put to same location
Create a new file "libusb-1.0.pc" with next content:
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: libusb-1.0
Description: C API for USB device access from Linux userspace
Version: 1.0.18
Libs: -L${libdir} -lusb
Cflags: -I${includedir}
Put it to msys\local\lib\pkgconfig (create if not exists)
Do in console
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Put header \libusbx-1.0.14-win\include\libusbx-1.0\libusb.h to msys\local\include
Run configure:
OpenOCD need only library libusb-1.0, but for for some reason it try to link old version libusb (not 1.0). LDFLAGS need to link proper version - libusb-1.0.
after configure have got
OpenOCD configuration summary
MPSSE mode of FTDI based devices yes (auto)
ST-Link JTAG Programmer yes
TI ICDI JTAG Programmer yes (auto)
Keil ULINK JTAG Programmer yes (auto)
Altera USB-Blaster II Compatible yes (auto)
Versaloon-Link JTAG Programmer yes (auto)
Segger J-Link JTAG Programmer yes
OSBDM (JTAG only) Programmer yes (auto)
eStick/opendous JTAG Programmer yes (auto)
Andes JTAG Programmer yes
USBProg JTAG Programmer no
Raisonance RLink JTAG Programmer no
Olimex ARM-JTAG-EW Programmer no
CMSIS-DAP Compliant Debugger no
and run
make
after make check openocd.exe in /home/User/OpenOCD_src/code/src
do ```
make install
and collect new openocd:
openocd.exe you cat take in /home/User/OpenOCD_src/code/src, scripts and other in msys\share\openocd.