2.4. Compilation and installation

2.4.1. Installation of precompiled UrJTAG for Windows

By simply running UrJTAG-xxx.exe, the executable and data files will be installed in your Windows program folder, usually some place like C:\Program Files\UrJTAG. It comes ready with support for JTAG cables that are directly attached to a parallel port. However, if you work with Windows Vista and want access to the parallel port, a driver for it has to be installed separately. It is available from

http://www.highrez.co.uk/Downloads/InpOut32/

If you want to use UrJTAG with a JTAG cable attached to the USB port, actual cable drivers have to be installed beside UrJTAG itself. Usually, the cable vendor will provide the drivers. For example, drivers for Altera USB-Blaster come with their Quartus software. For FTDI-based cables, you need an INF file describing the cable and FTDIBUS.SYS and FTD2XX.DLL from FTDI (CDM drivers). If your cable shows up in the device manager without any warning sign, UrJTAG probably is able to talk to it.

Finally, UrJTAG additionally needs libusb-win32 to talk to some USB cables that are not based on FTDI chips (Xilinx Platform Cable USB, Segger J-Link). The so-called libusb-win32 filter driver is available from the project’s download page at Sourceforge:

http://libusb-win32.sourceforge.net/#downloads

2.4.2. Required software for compiling UrJTAG

To run autogen.sh, you need autoconf and automake, bison, pkg-config and a recent flex.

The distributed source tarball contains source pregenerated with a current flex version; flex therefore is only needed if you want to compile code checked out from our Subversion repository. Flex 2.5.4a as it comes with most but the very latest Cygwin release cannot build the scanners for BSDL and SVF. Building these files requires Flex 2.5.33 or newer. The configure script will compare the available Flex version against these preconditions and enables or disables the related features.

Furthermore, libtool should be available, and "devel" versions of the following packages:

2.4.3. Required libraries for USB support

For USB adapter support (including support for parallel port adapters attached to USB-to-parallel converters), one or more additional libraries are required.

Many USB JTAG adapters and USB-to-parallel converters are based on chips made by FTDI. To support these, either intra.net’s "libftdi" or FTDI’s "FTD2XX" library can be used.

On many modern Linux distributions, libftdi is available as a precompiled package and can be installed using the distribution’s package management system (e.g. "apt-get libftdi-dev" for Debian and Ubuntu). If it isn’t available or you don’t run Linux, you can get it from

Alternatively, you can use the FTD2XX library from the chip manufacturer FTDI. It is available for Linux and Windows. There’s more information about linking to that library in a Cygwin environment below.

All other USB JTAG adapters can be supported only if libusb is installed. There is a libusb-win32 variant that can be used in a Cygwin environment:

For specific notes regarding the use of these libraries in a Cygwin environment, see below.

2.4.4. Installing from source tar.gz

The installation follows the standard configure, make, make install scheme:

tar xzvf urjtag-x.y.tar.gz
cd urjtag-x.y
./configure
make
make install

2.4.5. Installing from Subversion repository

If you want to try the very newest version of UrJTAG…

svn co http://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk urjtag
cd urjtag/jtag
./autogen.sh
# ./configure done by autogen.sh; run it here with special options if needed
make
make install

2.4.6. Linking to FTD2XX.DLL in Cygwin environment

Before running configure, get the D2XX drivers from FTDI.

Unzip the archive into a directory of your choice (probably a choice without spaces in the name is better) and afterwards run configure with the "--with-ftd2xx" pointing to that directory, e.g.

./configure --with-ftd2xx="/cygdrive/c/temp/ftdi-cdm-drivers"

Configure should now report

jtag is now configured for
  ...
  Detected libftd2xx   : yes

2.4.7. Using LibUSB-Win32 in Cygwin environment

Before running configure, install the LibUSB-Win32 "filter" driver from SF.

Then point configure to the directory where LibUSB-Win32 was installed (it might give problems if the path contains spaces, as "Program Files" does!):

./configure --with-libusb="/cygdrive/c/Programme/LibUSB-Win32/"

2.4.8. Compiling with MinGW

UrJTAG may be compiled into a Windows executable using the MinGW compiler (http://www.mingw.org), or Cygwin GCC with the "-mno-cygwin" compiler flag.

This has the advantage over running in a Cygwin environment that you don’t need to install anything else but the jtag.exe (plus libraries like FTD2XX.dll or InpOut32.DLL that are required for device access under Windows in any case).

However, because support for MinGW is quite new in UrJTAG, it may lack some features (e.g. readline support) or run a little slower.

Because it seems to be easier to set up a Cygwin environment, we recommend using the Cygwin GCC with "-mno-cygwin" flag instead of using a MinGW setup:

CFLAGS="-mno-cygwin -O2" ./configure --with-ftd2xx=/tmp/cdm-drivers --with-inpout32

It is even possible to cross-compile and build the executable on a Linux host:

./configure --host=i586-mingw32msvc --with-ftd2xx=/tmp/cdm-drivers --with-inpout32
make

The "--with-inpout32" switch tells UrJTAG to use the InpOut32.DLL for access to parallel ports, because the Cygwin ioperm isn’t available for MinGW. The InpOut32 library is available from logix4u.net:

http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html

An version updated to work in Windows Vista and 64 bit Windows is available from highrez:

http://www.highrez.co.uk/Downloads/InpOut32/

2.4.9. Driver tailoring

The configure script enables all default bus, cable and lowlevel drivers. You can include and exclude specific drivers if required. For a list of parameters run

./configure --help

to figure out the appropriate --enable-bus, --enable-cable, and --enable-lowlevel options.

2.4.10. Building the BSDL subsystem

As mentioned above, building the BSDL lexer requires Flex 2.5.33 or newer. If the detected Flex version is not recent enough, configure will disable the BSDL subsystem. The detection result is summarized at the end of configure:

jtag is now configured for
  ...
  Build BSDL subsystem : yes

Flex is only required when you’re working on a check-out of the Subversion repository. In this case Flex has to be called to transform bsdl_flex.l to bsdl_flex.c. When you’re compiling from released sources, the local Flex version is not relevant since the output file of Flex is part of the tarball. I.e. even if the local Flex fails the check, the BSDL subsystem is enabled and will be compiled from the released C files.