Compiling Urjtag Using CodeBlocks for Windows

From DP

Revision as of 18:15, 15 February 2011 by Jamz (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation , search

Contents

How to compile Urjtag using codeblocks under Windows

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.

The is another documentation on cross-compiling Urjtag on a linux platform to run on a windows hosted environment.

Objective

We will be compiling UrJtag using CodeBlocks 10.05 under a Windows environment. This build will support BusBlaster V2.

Requirements

1. You must have CodeBlocks 10.05 installed or download it from www.codeblocks.org

2. The latest UrJtag source from the subversion http://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk

3. Latest Patches for the Bus Blaster V2.

4. Latest FTD2XX drivers for windows from FTDIChips.com

5. Patch utility from http://gnuwin32.sourceforge.net/packages/patch.htm

6. Config.h file which was generated from autogen.sh under cygwin or Linux

Create/Modify Config.h and other files

The distribution source of UrJtag does not have a config.h file. It is generated when you run ./configure under linux or cygwin.

Save time by using a modified config.h file along with other files: Download from here

Examine and remove or remark some lines that suite your needs.

Using CodeBlocks for Windows

CodeBlocks should be configure first to make Urjtag to compile successfully:

In Project->Build Option->Project Build option The selected compiler should be "GNU GCC Compiler" which is the default.

In Project->Build option->Project Build Option->search Directories tab, add this line by line:

Urjtagsearchdir.png


In the linker setting, put the directory where your ftdi2xx.lib is located:

Urjtaglinkersetting.png

Testing and running on Windows

Patching Urjtag

Once you have a succesfully compile, you can then patch it, and recompile.

patch -p0 -i ./patch-file

Some tricks and Notes

The directory for urjtag should be in C:\urjtag.

If you want some shortcuts, you can download the files from the svn, which contains the following files:

Config.h --> put in c:\urjtag

Sysdef.h --> put in C:\urjtag

urjtag.h --> put in C:\urjtag\include\urjtag

bsdl_config.h -->put in C:\urjtag\src\bsdl

bsdl_bison.h --> put in C:\urjtag\src\bsdl

bsdl_flex.c --> put in C:\urjtag\src\bsdl

bsdl_flex.h --> put in C:\urjtag\src\bsdl

svf_bison.h --> put in C:\urjtag\src\svf\

svf_bison.c --> put in C:\urjtag\src\svf\

svf_flex.c --> put in C:\urjtag\src\svf\

vhdl_bison.c --> put in C:\urjtag\src\bsdl

vhdl_bison.h --> put in C:\urjtag\src\bsdl

jtag.cbp --> put in c:\urjtag\src\apps\jtag\

jtag.layout --> put in c:\urjtag\src\apps\jtag\

bsdl2jtag.cbp --> put in c:\urjtag\src\apps\bsdl2jtag\

bsdl2jtag.layout --> put in c:\urjtag\src\apps\bsdl2jtag\


Both jtag.c and bsdl2jtag.c from their apps directory should be renamed main.c respectively. Open the jtag.cbp in Codeblocks and hit compile to create jtag.exe. Do the same with the bsdl2jtag.cbp which will create bsdl2jtag.exe

For further shortcut to compile Urjtag, the whole source, build 1872, with the included project files is here.

Unzip and place it in your c:\urjtag directory.

All you need to do is load the project file and compile.

TroubleShooting

Always check for the build log file. if there are complains regarding the missing *.o files, chances are the files are not added to the project. It may appear with a broken folder sign. You need to remove it from the project and add it again.

Download Files

Patches, BSDL, SVF

http://dangerousprototypes.com/forum/viewtopic.php?f=37&t=1655&start=45#p15771

References and Resources

UrJtag Website:

http://urjtag.sourceforge.net/

CodeBlocks Website:

http://www.codeblocks.org/

Some Notes and discussion on the Forum:

http://www.dangerousprototypes.com/forum/viewtopic.php?f=37&t=1606#p17910

Credits

Tjtag & Robots