Hello,
here is a short tutorial how to build openocd for windows.
(Tested with SVN version 2348 of OpenOCD)
An other build instruction can be found at the piconomic
project here: http://piconomic.berlios.de/build_openocd.html
Install cygwin, but you need some additional tools from the
development package like:
-
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 og the ‘make’ utility
-
subversion: A version control system
In case you want to build openocd for the FT2232 interface,
you need the driver from FTDI too. Which can be found here:
http://www.ftdichip.com/Drivers/D2XX.htm
I assumed you have installed cygwin and downloaded the ftdi driver.
Extract the ftdi driver in the following directory /home/openocd.
This will create an extra folder inside /home/openocd called:
“CDM 2.04.06 WHQL Certified”
I do not like the spaces in the name here, please rename this
folder too “ftd2xx”:
/home/openocd/ftd2xx
Now we need the opencd source, change into /home/openocd and
use the following svn command:
svn checkout svn://svn.berlios.de/openocd/trunk trunk
Now the openocd source will be loaded and stored in the
folder “trunk”. You will now have two folders under /home/openocd like:
/home/openocd/trunk
/home/openocd/ftd2xx
Change into /home/openocd/trunk. Here we will build openocd
for a FT2232 interface now.
Type in the following commands:
./bootstrap
If you want to build a cygwin based openocd type now:
./configure --enable-maintainer-mode --disable-werror --disable-shared --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=/home/openocd/ftd2xx
but if you want to build a mingw based openocd type:
./configure --enable-maintainer-mode --disable-werror --disable-shared --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=/home/openocd/ftd2xx CC="gcc -mno-cygwin"
In case you want to create a debug version of OpenOCD you must add the following line to the configure command:
CFLAGS=“-O0 -g -Wall”
The new command will look like for a cygwin debug build:
./configure --enable-maintainer-mode --disable-werror --disable-shared --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=/home/openocd/ftd2xx CFLAGS="-O0 -g -Wall"
and here the command for a mingw debug build:
./configure --enable-maintainer-mode --disable-werror --disable-shared --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=/home/openocd/ftd2xx CC="gcc -mno-cygwin" CFLAGS="-O0 -g -Wall"
After the configure step OpenOCD can be build with the
following command:
make
The executable “openocd.exe” will be created in the following folder:
/home/openocd/trunk/src
Even you can build the html docs with:
make html
The pdf of the documentation can be build with:
make pdf
but here you must have tex installed too.
Best regards,
Michael