<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.ethernut.de/nutwiki/index.php?action=history&amp;feed=atom&amp;title=Hardware%2FEIR%2FJTAG</id>
		<title>Hardware/EIR/JTAG - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.ethernut.de/nutwiki/index.php?action=history&amp;feed=atom&amp;title=Hardware%2FEIR%2FJTAG"/>
		<link rel="alternate" type="text/html" href="http://www.ethernut.de/nutwiki/index.php?title=Hardware/EIR/JTAG&amp;action=history"/>
		<updated>2026-04-28T22:50:59Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://www.ethernut.de/nutwiki/index.php?title=Hardware/EIR/JTAG&amp;diff=391&amp;oldid=prev</id>
		<title>Harald: Created page with &quot;&lt;div id=&quot;content&quot;&gt;  = EIR JTAG =  To our knowledge the best low cost solution so far is to use [http://openocd.sourceforge.net/ OpenOCD] with any FT2232 based adapter hardware...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.ethernut.de/nutwiki/index.php?title=Hardware/EIR/JTAG&amp;diff=391&amp;oldid=prev"/>
				<updated>2017-07-13T08:59:02Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div id=&amp;quot;content&amp;quot;&amp;gt;  = EIR JTAG =  To our knowledge the best low cost solution so far is to use [http://openocd.sourceforge.net/ OpenOCD] with any FT2232 based adapter hardware...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div id=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= EIR JTAG =&lt;br /&gt;
&lt;br /&gt;
To our knowledge the best low cost solution so far is to use [http://openocd.sourceforge.net/ OpenOCD] with any FT2232 based adapter hardware. OpenOCD will work on many platforms and several adapters from different vendors are available, which are using the FTDI chip. Some products are listed at the end of this page.&lt;br /&gt;
&lt;br /&gt;
We are using the [[../turtelizer/index.html|Turtelizer 2]]. However, its JTAG connector follows the AVR 10-pin layout. A special adapter is required to connect it to the 20-pin standard connector that is used on the EIR board.&lt;br /&gt;
&lt;br /&gt;
== Installing OpenOCD on Windows ==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' You must have the USB driver available before attaching your JTAG adapter to a USB port.&lt;br /&gt;
&lt;br /&gt;
OpenOCD binaries for Windows (including USB drivers) are available on [http://www.freddiechopin.info/ Freddie Chopin's homepage].&lt;br /&gt;
&lt;br /&gt;
A special version for the Turtelizer 2 can be found on our [[../../download/index.html|download page]].&lt;br /&gt;
&lt;br /&gt;
Connect one end of the USB cable to the PC USB port and the other to the USB connector on the JTAG adapter. Windows will automatically detect the new Turtelizer hardware. Concurrently the first screen of the ''Found New Hardware Wizard'' appears. Follow the instruction. Make sure that the option ''Specify a location'' is selected and deselect all others. Officially supported drivers are located in the subdirectory ''driver'' within the OpenOCD installation directory. You should also consult the documentation which is available for your specific adapter.&lt;br /&gt;
&lt;br /&gt;
The following screenshots show the Turtelizer 2 driver installation.&lt;br /&gt;
&lt;br /&gt;
[[../../../img/ftdi01.png|[[File:../../../img/ftdi01-tn.png|80x23px|FTDI USB Driver Installation Step 1]]]][[../../../img/ftdi02.png|[[File:../../../img/ftdi02-tn.png|100x77px|FTDI USB Driver Installation Step 2]]]][[../../../img/ftdi03.png|[[File:../../../img/ftdi03-tn.png|100x77px|FTDI USB Driver Installation Step 3]]]][[../../../img/ftdi04.png|[[File:../../../img/ftdi04-tn.png|100x77px|FTDI USB Driver Installation Step 4]]]][[../../../img/ftdi05.png|[[File:../../../img/ftdi05-tn.png|90x45px|FTDI USB Driver Installation Step 5]]]][[../../../img/ftdi06.png|[[File:../../../img/ftdi06-tn.png|100x77px|FTDI USB Driver Installation Step 6]]]][[../../../img/ftdi07.png|[[File:../../../img/ftdi07-tn.png|100x77px|FTDI USB Driver Installation Step 7]]]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[../../../img/ftdi08.png|[[File:../../../img/ftdi08-tn.png|80x23px|FTDI USB Driver Installation Step 8]]]][[../../../img/ftdi09.png|[[File:../../../img/ftdi09-tn.png|100x77px|FTDI USB Driver Installation Step 9]]]][[../../../img/ftdi10.png|[[File:../../../img/ftdi10-tn.png|100x77px|FTDI USB Driver Installation Step 10]]]][[../../../img/ftdi11.png|[[File:../../../img/ftdi11-tn.png|100x77px|FTDI USB Driver Installation Step 11]]]][[../../../img/ftdi12.png|[[File:../../../img/ftdi12-tn.png|90x45px|FTDI USB Driver Installation Step 12]]]][[../../../img/ftdi13.png|[[File:../../../img/ftdi13-tn.png|100x77px|FTDI USB Driver Installation Step 13]]]][[../../../img/ftdi14.png|[[File:../../../img/ftdi14-tn.png|100x77px|FTDI USB Driver Installation Step 14]]]]&lt;br /&gt;
&lt;br /&gt;
== Installing OpenOCD on Linux ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The OpenOCD source code can be retrieved from the SVN repository at [http://developer.berlios.de/svn/?group_id=4148 developer.berlios.de/svn].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ svn co -r 423 svn://svn.berlios.de/openocd/trunk openocd-r423&amp;lt;/pre&amp;gt;&lt;br /&gt;
The included README file contains a detailed description. A few essential tools are required to create the binaries. The following commands may be used on Debian to make sure that all tools are available:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ sudo apt-get install build-essential&lt;br /&gt;
$ sudo apt-get install automake&lt;br /&gt;
$ sudo apt-get install autoconf&amp;lt;/pre&amp;gt;&lt;br /&gt;
If not already installed, we further need the FTDI support library. There are two variants, we chose the one supplied by FTDI:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ wget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz&lt;br /&gt;
$ tar -zxf libftd2xx0.4.13.tar.gz&lt;br /&gt;
$ sudo cp *.h /usr/local/include/&lt;br /&gt;
$ sudo cp libftd2xx.so.0.4.13 /usr/local/lib/&lt;br /&gt;
$ cd /usr/local/lib/&lt;br /&gt;
$ sudo ln -s libftd2xx.so.0.4.13 libftd2xx.so&lt;br /&gt;
$ sudo ln -s libftd2xx.so.0.4.13 libftd2xx.so.0&lt;br /&gt;
$ cd /usr/lib/&lt;br /&gt;
$ ln -s /usr/local/lib/libftd2xx.so.0.4.13 libftd2xx.so.0&lt;br /&gt;
/etc/fstab (sudo):&lt;br /&gt;
none /proc/bus/usb usbdevfs defaults,mode=0666 0 0&lt;br /&gt;
(use usbfs in 2.6 kernels, 'uname -a')&lt;br /&gt;
$ sudo mount -a&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the next step we can build OpenOCD, using&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ cd openocd-r423/&lt;br /&gt;
$ ./bootstrap&lt;br /&gt;
$ ./configure  --enable-ft2232_ftd2xx&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following entry should appear in /proc/bus/usb/devices after plugging in the Turtelizer 2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0&lt;br /&gt;
D:  Ver= 2.00 Cls=00(&amp;amp;gt;ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1&lt;br /&gt;
P:  Vendor=0403 ProdID=bdc8 Rev= 5.00&lt;br /&gt;
S:  Manufacturer=egnite&lt;br /&gt;
S:  Product=Turtelizer JTAG/RS232 Adapter&lt;br /&gt;
S:  SerialNumber=TLQ08BET&lt;br /&gt;
C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA&lt;br /&gt;
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)&lt;br /&gt;
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms&lt;br /&gt;
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms&lt;br /&gt;
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)&lt;br /&gt;
E:  Ad=83(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms&lt;br /&gt;
E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Installing OpenOCD on Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
Right now we do not have a binary package for OS X. Thus, we need to build OS X from the source code. If not already done, download Xcode from&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://developer.apple.com/tools/xcode/ developer.apple.com/tools/xcode/] and install it. Xcode contains all the GNU tools, which are needed to create the OpenOCD binary from the source code.&lt;br /&gt;
&lt;br /&gt;
[[../../../img/ftdi-d2xx-mount.png|[[File:../../../img/ftdi-d2xx-mountth.png|128x76px|FTDI Disk Image]]]] Download the Mac OS X driver from&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ftdichip.com/Drivers/D2XX.htm www.ftdichip.com/Drivers/D2XX.htm]&amp;lt;br /&amp;gt;&lt;br /&gt;
The driver is packed in a disk image file. Double click it to mount the image.&lt;br /&gt;
&lt;br /&gt;
To install the driver, execute the following commands in a Terminal window:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ cd /Volumes/PPC\ D2XX/D2XX/&lt;br /&gt;
$ sudo mkdir -p /usr/local/lib /usr/local/include&lt;br /&gt;
$ sudo cp bin/libftd2xx.0.1.0.dylib /usr/local/lib/&lt;br /&gt;
$ sudo ln -sf /usr/local/lib/libftd2xx.0.1.0.dylib /usr/local/lib/libftd2xx.dylib&lt;br /&gt;
$ sudo cp bin/ftd2xx.h /usr/local/include/&lt;br /&gt;
$ sudo cp Samples/WinTypes.h /usr/local/include/&amp;lt;/pre&amp;gt;&lt;br /&gt;
Retrieve the OpenOCD source code from the SVN repository at [http://developer.berlios.de/svn/?group_id=4148 developer.berlios.de/svn]. For this, open Terminal and enter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ svn co -r 423 svn://svn.berlios.de/openocd/trunk openocd-r423&amp;lt;/pre&amp;gt;&lt;br /&gt;
Building and installing OpenOCD for OS X is similar to Linux. In a Terminal window enter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ cd openocd-r423/&lt;br /&gt;
$ ./bootstrap&lt;br /&gt;
$ ./configure  --enable-ft2232_ftd2xx&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Flashing the Firmware ==&lt;br /&gt;
&lt;br /&gt;
In order to familliarize yourself with flashing firmware into the EIR, we will go step by step through the whole process.&lt;br /&gt;
&lt;br /&gt;
You should create a new empty folder to work with. Everything goes into it, and every command you enter has to be run out of this folder.&lt;br /&gt;
&lt;br /&gt;
First copy your binary into the folder. In this document we suggest you use the internetradio, which can be downloaded as a sample with the following link:&amp;lt;br /&amp;gt;&lt;br /&gt;
[[../../../arc/eir-bin_1_1_0.bin|eir-bin_1_1_0.bin]]&lt;br /&gt;
&lt;br /&gt;
Second download the configfile for OpenOCD. If you're not using the Turtlelizer2 you need to modify it.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[../../../arc/eirocd.cfg|eirocd.cfg]]&lt;br /&gt;
&lt;br /&gt;
Now connect the Turtleizer2 with the special adapter and the special adapter to the EIR.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[../../../img/chain.png|[[File:../../../img/chain_thumb.png|chain setup]]]]&lt;br /&gt;
&lt;br /&gt;
We start with erasing the old firmware. On the EIR board connect pins 34 and 36 of K3 (Port C) using a 2.54 mm jumper. Press the reset button and remove the jumper. This activates the SAM-BA boot loader.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[../../../img/jumper.png|[[File:../../../img/jumper_thumb.png|Firmware löschen]]]]&lt;br /&gt;
&lt;br /&gt;
To get access to our board with OpenOCD, we need to start OpenOCD with the proper config file. OpenOCD usually looks for a file called openocd.cfg, because you might use some of our other products too, we gave it names that resemble the specific product. To load config files with a different name use -f or --file if you like. Now we open our preferred command line interpreter, CLI for short (maybe you call it Dos-Box, Text Terminal, Shell, Console...), and enter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ openocd -f eirocd.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because OpenOCD blocks our last CLI we need to start another one. After, we've sucessfully started OpenOCD, we need to connect through OpenOCD to the board with Telnet using localhost and the port specified in eirocd.cfg.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;$ telnet 127.0.0.1 4444&amp;lt;/pre&amp;gt;&lt;br /&gt;
The CPU is already running, so we need to pause it with ''halt''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;&amp;amp;gt; halt&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now we need to detect flash bank 0. This can be done with ''flash'' probe which has the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;flash probe &amp;amp;lt;bank&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because we want to detect bank 0 we do:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;&amp;amp;gt; flash probe 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
We need to write the binary eir-bin_1_1_0.bin to bank 0 at offset 0. According to the syntax of the command ''flash write_bank''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;flash write_bank &amp;amp;lt;bank&amp;amp;gt; &amp;amp;lt;file&amp;amp;gt; &amp;amp;lt;offset&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
this should work:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;&amp;amp;gt; flash write_bank 0 eir-bin_1_1_0.bin 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
The at91sam7 has 2 boot modes, booting from ROM and booting from Flash, so we neet to set the boot mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;at91sam7 gpnvm &amp;amp;lt;bank&amp;amp;gt; &amp;amp;lt;bit&amp;amp;gt; &amp;amp;lt;set|clear&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
| boot mode&lt;br /&gt;
| flag&lt;br /&gt;
|-&lt;br /&gt;
| Flash&lt;br /&gt;
| set&lt;br /&gt;
|-&lt;br /&gt;
| ROM&lt;br /&gt;
| clear&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;&amp;amp;gt; at91sam7 gpnvm 0 2 set&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally to get the EIR to boot from Flash just reset it.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
=== JTAG Adapters ===&lt;br /&gt;
&lt;br /&gt;
We intentionally do not recommend any specific adapter for the EIR. Before buying one, make sure, that it fully supports your operating system and the AT91SAM7SE512 CPU.&lt;br /&gt;
&lt;br /&gt;
[http://www.amontec.com/ www.amontec.com]&amp;lt;br /&amp;gt;&lt;br /&gt;
Amontec is specialized on JTAG adapters, most of them are officially supported by OpenOCD.&lt;br /&gt;
&lt;br /&gt;
[http://microcontrollershop.com/ microcontrollershop.com]&amp;lt;br /&amp;gt;&lt;br /&gt;
MicroController Pros Corporation runs an online shop, which offers a large variety of JTAG adapters from different vendors.&lt;br /&gt;
&lt;br /&gt;
[http://www.olimex.com/ www.olimex.com]&amp;lt;br /&amp;gt;&lt;br /&gt;
Olimex is well known for its low prices. They offer two different JTAG adapters.&lt;br /&gt;
&lt;br /&gt;
[http://www.signalyzer.com/ www.signalyzer.com]&amp;lt;br /&amp;gt;&lt;br /&gt;
Xverve Technologies Inc. offers the Signalyzer Tool.&lt;br /&gt;
&lt;br /&gt;
[http://www.zylin.com/zy1000.html www.zylin.com]&amp;lt;br /&amp;gt;&lt;br /&gt;
If you are fed up with software installation und USB driver mess, the ZY1000 is probably for you. It is actually a small Linux system, running OpenOCD internally. You can directly connect to it via TCP/IP, for example, using a common webbrowser. Of course, this luxury has its price.&lt;br /&gt;
&lt;br /&gt;
Return to the [[index.html|EIR project page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Harald</name></author>	</entry>

	</feed>