Compile urJTAG for Windows

From DP

Revision as of 17:39, 18 January 2011 by Jamz (Talk | contribs)
Jump to: navigation , search

Contents

Introduction

Urjtag is a modern tool for communicating over JTAG with flash chips, CPU's etc. This version aimed at supporting Bus Blaster high speed JTAG/flash programmer development

We are going to cross-compile urJTAG from other platform, preferably, Linux, and also under Cygwin. The compiled version will run in native MS Windows.

Requirements

Before you can compile Urjtag for windows, You need to have to build a cross-compiler environment for your OS.

Download and install files from http://mingw-w64.sourceforge.net/:

For the Cygwin environment: download mingw-w32-1.0-bin_i686-cygwin-1.7.7-1_20110117.tar.bz2

and if you are using Linux download mingw-w32-1.0-bin_i686-linux_20110117.tar.bz2

Aside from these latest builds, You also need the following:

The latest Urjtag from the svn, which we will download later and the required windows libraries from ftdichip.com

Building the Cross Compile Environment

Fortunately the people behind MingGW-w64 has done it for you. All you have to do is uncompress the downloaded toolchain on a directory of you choice and add the "bin" path to your PATH environment variable.

Testing the build Environment

To test your cross-compile environment,

Create a simple hello.c

gcc -o hello hello.c

Flags and Parameters

Patching Urjtag

You can run the following syntax to patch the source from the svn repository.

patch -p0 -i path-to-patch-file

Cross Compiling Urjtag for windows

When everythings work well, Here is the sequence for cross-compilation: Download the latest Urjtag from the repositories:

svn co http://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk urjtag
Cd to your urjtag installation root
cd urjtag/urjtag


Run ./autogen to create makefiles for your system

./autogen.sh

Run the ./ configure along with its flags and parameters:


CFLAGS="-DJTAG_BIN_DIR=\\\"/\\\" -DJTAG_DATA_DIR=\\\"/data\\\"" LDFLAGS="-L/home/username/CDM20808/i386" LIBS="-lftd2xx" ./configure --enable-maintainer-mode --host=i586-mingw32msvc --with-ftd2xx="/home/username/CDM20808" --disable-werror --disable-nls --without-libusb --disable-silent-rules --enable-relocatable

Run Make
make


And find your Exe file in your src/apps/jtag directory.

Testing and Running on windows

Transfer the exe file created from the cross-compiler to a subdirectory and run the jtag.exe. You should see the following, along with the build no.:

Urjtagscreen.png


Some tricks

You may download the windows binary from the repository, install it and just replace the exe file with your build. don't forget to move the FTDI libraries into its own directories or include it in windows's path.

References

http://urjtag.sourceforge.net/

Credits