Compiling Urjtag Using CodeBlocks for Windows
How to compile Urjtag using codeblocks under Windows
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.
There is another documentation on cross-compiling Urjtag on a linux platform to run on a windows hosted environment: [Cross-Compile urJTAG for Windows]
We will be compiling UrJtag using CodeBlocks 10.05 under a Windows environment. The patched build will support BusBlaster V2.
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 and some files which was generated from ./configure.sh under cygwin or Linux. Download from here.
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, especially on config.h and sysdep.h files
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:
In the linker setting, put the directory where your ftd2xx.lib is located:
Testing and running on Windows
Run jtag.exe from C:\urjtag\src\apps\jtag\bin\Debug: (for Debug build)
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
Sysdep.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
vhdl_bison.c --> put in C:\urjtag\src\bsdl
vhdl_bison.h --> put in C:\urjtag\src\bsdl
vhdl_flex.c --> 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\
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.
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.
Files that need to be added to the urjtag directory, if source was taken fresh from urjtag repository:
Files above is already included here for this build (unpatched) (ready to compile)
Urjtag version 0.10 modified for CodeBlocks IDE:
Patches, BSDL, SVF
References and Resources
Some Notes and discussion on the Forum:
Tjtag & Robots