Here is my first attempt in building OpenOCD using cygwin. It appears to work for me (at least). YMMV.
Most steps were taken from the article:
https://forum.sparkfun.com/viewtopic.php?f=18&t=11221
Since the article is fairly old few steps had to be changed. So here is the sequence:
1. Download CYGWIN from here:
http://cygwin.com/install.html
Here is direct download link.
http://cygwin.com/setup.exe
After download rename it into cygwin_setup.exe so later you will remember what this file is.
2. Install CYGWIN.
The way the setup operates it downloads all required packages from the Cygwin repository. By default it installs the bare minimum required to run it on Windows. If anything is missing it can be installed later. When installing select "internet" as the source so you will always get the latest packages.
The following additional applications will be required on top of bare-bone install:
- autoconf: Wrapper scripts for autoconf commands
- automake: Wrapper scripts for automake and aclocals
- gcc: C compiler upgrade helper
- libtool: A shared library generation tool
- make: The GNU version of the 'make' utility
- subversion: A version control system
You will pick them from "development" package by changing from "skip" to "install" with mouse click at the proper item during installation. If you miss anything setup can be re-run again. Setup keeps track of what was installed - next time you will see installed packages marked as "keep".
Setup creates (by default) the "c:\cygwin" directory in the root of your harddrive. Inside you should see other directories like bin, dev, etc, home, lib, tmp, usr, var.
Setup also creates (make sure you enable it) a desktop icon. To start Cygwin you just click on the icon. It will bring-up a terminal window (command-like window) which essentially emulates Linux on Windows system. This is where we will build it.
3. Download FT2232 driver (for Windows) from here:
http://www.ftdichip.com/Drivers/D2XX.htm
Create directory "openocd" under "c:\cygwin\home";
Create directory "ftd2xx" under "c:\cygwin\home\openocd";
Create directory "trunk" under "c:\cygwin\home\openocd";
Extract downloaded ZIP file (currentl version named as "CDM 2.08.24 WHQL Certified.zip" ) into "c:\cygwin\home\openocd\ftd2xx" directory. You shoud see amd64, i386 and other directories right below "c:\cygwin\home\openocd\ftd2xx".
4. Download source code for 0.6.0 version (openocd-0.6.0.zip) from here:
http://sourceforge.net/projects/openocd/files/openocd/0.6.0/
Extract it somwhere. You will have bunch of files & folders under "openocd-0.6.0" directory. Move all these folders/files from "openocd-0.6.0" to "c:\cygwin\home\openocd\trunk". You must see all these files right below "c:\cygwin\home\openocd\trunk".
5. It's time to build it.
Start CYGWIN by clickin on the icon.
In CYGWIN window type at the prompt (back-slash is opposite from Windows):
cd c:/cygwin/home/openocd/trunk
Hit return.
Type:
./bootstrap
This particular command did not work for me. I just kept it here since the original instructions had it. It appears that it is not important.
Type:
./configure --enable-maintainer-mode --disable-werror --disable-shared --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=/home/openocd/ftd2xx
Type:
make
6. After it is all done openocd.exe file will be in "C:\cygwin\home\openocd\trunk\src" directory.
Copy it into any directory as you wish (I choose c:\OPENOCD_060). Copy also cygwin1.dll into same directory. It can be found in "c:\cygwin\bin".
All done.
When I run it with STR711 config file on STR711 board from OLIMEX (
https://www.olimex.com/Products/ARM/ST/STR-H711/) I am getting the the following:
C:\OPENOCD_060>openocd -f str7xx.cfg
Open On-Chip Debugger 0.6.0 (2012-09-27-10:02)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 10 kHz
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
Info : device: 6 "2232H"
Info : deviceID: 67340952
Info : SerialNumber: TIVQP462A
Info : Description: TIAO USB Multi-Protocol Adapter A
Info : max TCK change to: 30000 kHz
Info : clock speed 10 kHz
Info : JTAG tap: str711.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0
f0, ver: 0x3)
Info : Embedded ICE version 1
Info : str711.cpu: hardware has 2 breakpoint/watchpoint units
Here is the build result if someone is interested:
http://www.mediafire.com/?ve3og4ici038m0d
A word about config files. Current version does not support a lot of commands from old ones. Appropriate changes have to be made.
Last word about the build. It was done on Windows 7 64-bit. Tested on Windows 7 with modified (hacked) Amontec drivers.
When tested on Windows XP with TIAO drivers it hangs during checking target via JTAG. Once JTAG disconnected the openocd resumes. I still need to sort out what the issue is. Meanwhile if anyone tries my build please post comments. This thing kind of wears me out.