
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://armadeus.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SSinyagin</id>
		<title>ArmadeusWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://armadeus.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SSinyagin"/>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=Special:Contributions/SSinyagin"/>
		<updated>2026-04-05T23:47:25Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6607</id>
		<title>APF Enclosure</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6607"/>
				<updated>2009-06-03T21:34:15Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* APF Enclosure requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== APF Enclosure requirements ==&lt;br /&gt;
&lt;br /&gt;
Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.&lt;br /&gt;
&lt;br /&gt;
# Modular structure: the base fixes the APF27_Dev board, and the walls and the top are interchangeable, fitting different i/o interfaces (mandatory)&lt;br /&gt;
# Room for expansion: think of future boards of the same dimensions (160x200mm) (mandatory)&lt;br /&gt;
# Optional side board with 8 or 10 RJ45 sockets, and wiring inside the enclosure to freely connect them to ADC, FPGA, or GPIO pins&lt;br /&gt;
# Top cover in two variants: 1) solid; 2) LCD touchscreen and a few buttons&lt;br /&gt;
# The LCD cover should be designed so that the flat cable is not twisted (current LCD adapter does not easily fit on top of the board because of the flat cable)&lt;br /&gt;
# Optional internal USB hub and enough room for 1-2 USB dongles (3G modem, for example)&lt;br /&gt;
# Material: plastic, in order to let WiFi and 3G radio signal inside (mandatory)&lt;br /&gt;
# Optional 5*AA (6?) battery compartment below the base (and probably a battery controller to switch to low-power or shut down the system on low voltage)&lt;br /&gt;
# Optional side board with WiFi antenna mounting screw&lt;br /&gt;
# Optional internal 2.5&amp;quot; SATA disk over a USB adapter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://doodle.com/mq4c3zeibvzg7rmz  Here's a poll where you can express the importance of each option.]&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6606</id>
		<title>APF Enclosure</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6606"/>
				<updated>2009-06-03T21:33:53Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* APF Enclosure requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== APF Enclosure requirements ==&lt;br /&gt;
&lt;br /&gt;
Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.&lt;br /&gt;
&lt;br /&gt;
# Modular structure: the base fixes the APF27_Dev board, and the walls and the top are interchangeable, fitting different i/o interfaces (mandatory)&lt;br /&gt;
# Room for expansion: think of future boards of the same dimensions (160x200mm) (mandatory)&lt;br /&gt;
# Optional side board with 8 or 10 RJ45 sockets, and wiring inside the enclosure to freely connect them to ADC, FPGA, or GPIO pins&lt;br /&gt;
# Top cover in two variants: 1) solid; 2) LCD touchscreen and a few buttons&lt;br /&gt;
# The LCD cover should be designed so that the flat cable is not twisted (current LCD adapter does not easily fit on top of the board because of the flat cable)&lt;br /&gt;
# Optional internal USB hub and enough room for 1-2 USB dongles (3G modem, for example)&lt;br /&gt;
# Material: plastic, in order to let WiFi and 3G radio signal inside (mandatory)&lt;br /&gt;
# Optional 5*AA (6?) battery compartment below the base (and probably a battery controller to switch to low-power or shut down the system on low voltage)&lt;br /&gt;
# Optional side board with WiFi antenna mounting screw&lt;br /&gt;
# Optional internal 2.5&amp;quot; SATA disk over a USB adapter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://doodle.com/mq4c3zeibvzg7rmz | Here's a poll where you can express the importance of each option.]&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6604</id>
		<title>APF Enclosure</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6604"/>
				<updated>2009-06-03T21:19:33Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* APF Enclosure requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== APF Enclosure requirements ==&lt;br /&gt;
&lt;br /&gt;
Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.&lt;br /&gt;
&lt;br /&gt;
# Modular structure: the base fixes the APF27_Dev board, and the walls and the top are interchangeable, fitting different i/o interfaces (mandatory)&lt;br /&gt;
# Room for expansion: think of future boards of the same dimensions (160x200mm) (mandatory)&lt;br /&gt;
# Optional side board with 8 or 10 RJ45 sockets, and wiring inside the enclosure to freely connect them to ADC, FPGA, or GPIO pins&lt;br /&gt;
# Top cover in two variants: 1) solid; 2) LCD touchscreen and a few buttons&lt;br /&gt;
# The LCD cover should be designed so that the flat cable is not twisted (current LCD adapter does not easily fit on top of the board because of the flat cable)&lt;br /&gt;
# Optional internal USB hub and enough room for 1-2 USB dongles (3G modem, for example)&lt;br /&gt;
# Material: plastic, in order to let WiFi and 3G radio signal inside (mandatory)&lt;br /&gt;
# Optional 5*AA (6?) battery compartment below the base (and probably a battery controller to switch to low-power or shut down the system on low voltage)&lt;br /&gt;
# Optional side board with WiFi antenna mounting screw&lt;br /&gt;
# Optional internal 2.5&amp;quot; SATA disk over a USB adapter&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6603</id>
		<title>APF Enclosure</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6603"/>
				<updated>2009-06-03T21:16:47Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* APF Enclosure requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== APF Enclosure requirements ==&lt;br /&gt;
&lt;br /&gt;
Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.&lt;br /&gt;
&lt;br /&gt;
# Modular structure: the base fixes the APF27_Dev board, and the walls and the top are interchangeable, fitting different i/o interfaces (mandatory)&lt;br /&gt;
# Room for expansion: think of future boards of the same dimensions (160x200mm) (mandatory)&lt;br /&gt;
# Optional side board with 8 or 10 RJ45 sockets, and wiring inside the enclosure to freely connect them to ADC, FPGA, or GPIO pins&lt;br /&gt;
# Top cover in two variants: 1) solid; 2) LCD touchscreen and a few buttons&lt;br /&gt;
# The LCD cover should be designed so that the flat cable is not twisted (current LCD adapter does not easily fit on top of the board because of the flat cable)&lt;br /&gt;
# Optional internal USB hub and enough room for 1-2 USB dongles (3G modem, for example)&lt;br /&gt;
# Material: plastic, in order to let WiFi and 3G radio signal inside (mandatory)&lt;br /&gt;
# Optional 5*AA (6?) battery compartment below the base (and probably a battery controller to switch to low-power or shut down the system on low voltage)&lt;br /&gt;
# Optional side board with WiFi antenna mounting screw&lt;br /&gt;
# Optional 2.5&amp;quot; SATA disk over a USB adapter&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6602</id>
		<title>APF Enclosure</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6602"/>
				<updated>2009-06-03T20:57:51Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* APF Enclosure requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== APF Enclosure requirements ==&lt;br /&gt;
&lt;br /&gt;
Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.&lt;br /&gt;
&lt;br /&gt;
# Modular structure: the base fixes the APF27_Dev board, and the walls and the top are interchangeable, fitting different i/o interfaces (mandatory)&lt;br /&gt;
# Room for expansion: think of future boards of the same dimensions (160x200mm) (mandatory)&lt;br /&gt;
# Optional side board with 8 or 10 RJ45 sockets, and wiring inside the enclosure to freely connect them to ADC, FPGA, or GPIO pins&lt;br /&gt;
# Top cover in two variants: 1) solid; 2) LCD touchscreen and a few buttons&lt;br /&gt;
# The LCD cover should be designed so that the flat cable is not twisted (current LCD adapter does not easily fit on top of the board because of the flat cable)&lt;br /&gt;
# Optional internal USB hub and enough room for 1-2 USB dongles (3G modem, for example)&lt;br /&gt;
# Material: plastic, in order to let WiFi and 3G radio signal inside (mandatory)&lt;br /&gt;
# Optional 5*AA (6?) battery compartment below the base (and probably a battery controller to switch to low-power or shut down the system on low voltage)&lt;br /&gt;
# Optional side board with WiFi antenna mounting screw&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6599</id>
		<title>APF Enclosure</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6599"/>
				<updated>2009-06-03T18:57:25Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* APF Enclosure requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== APF Enclosure requirements ==&lt;br /&gt;
&lt;br /&gt;
Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.&lt;br /&gt;
&lt;br /&gt;
* Modular structure: the base fixes the APF27_Dev board, and the walls and the top are interchangeable, fitting different i/o interfaces&lt;br /&gt;
* Room for expansion: think of future boards of the same dimensions (160x200mm)&lt;br /&gt;
* Optional side board with 8 or 10 RJ45 sockets, and wiring inside the enclosure to freely connect them to ADC, FPGA, or GPIO pins&lt;br /&gt;
* Top cover in two variants: 1) solid; 2) LCD touchscreen and a few buttons&lt;br /&gt;
* The LCD cover should be designed so that the flat cable is not twisted (current LCD adapter does not easily fit on top of the board because of the flat cable)&lt;br /&gt;
* Optional internal USB hub and enough room for 1-2 USB dongles (3G modem, for example)&lt;br /&gt;
* Material: plastic, in order to let WiFi and 3G radio signal inside&lt;br /&gt;
* Optional 4*AA battery compartment below the base (and probably a battery controller to switch to low-power or shut down the system on low voltage)&lt;br /&gt;
* Optional side board with WiFi antenna mounting screw&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6598</id>
		<title>APF Enclosure</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=APF_Enclosure&amp;diff=6598"/>
				<updated>2009-06-03T18:55:19Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: New page: == APF Enclosure requirements ==  Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.  * Modular structure: the base fixes th...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== APF Enclosure requirements ==&lt;br /&gt;
&lt;br /&gt;
Here's a preliminary list of requirements for an enclosure for APF27_Dev board and probably some other APF boards.&lt;br /&gt;
&lt;br /&gt;
* Modular structure: the base fixes the APF27_Dev board, and the walls and the top are interchangeable, fitting different i/o interfaces&lt;br /&gt;
* Room for expansion: think of future boards of the same dimensions (160x200mm)&lt;br /&gt;
* Optional side board with 8 or 10 RJ45 sockets, and wiring inside the enclosure to freely connect them to ADC, FPGA, or GPIO pins&lt;br /&gt;
* Top cover in two variants: 1) solid; 2) LCD touchscreen and a few buttons&lt;br /&gt;
* The LCD cover should be designed so that the flat cable is not twisted (current LCD adapter does not easily fit on top of the board because of the flat cable)&lt;br /&gt;
* Optional internal USB hub and enough room for 1-2 USB dongles (3G modem, for example)&lt;br /&gt;
* Material: plastic, in order to let WiFi and 3G radio signal inside&lt;br /&gt;
* Optional 4*AA battery compartment below the base (and probably a battery controller to switch to low-power or shut down the system on low voltage)&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6362</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6362"/>
				<updated>2009-04-26T11:12:56Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* Using OpenOCD and GDB or DDD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
JTAG interface is useful in debugging some complicated issues with U-Boot, like [http://txlab.wordpress.com/2009/04/25/big-endian-for-imx27-found-the-problem/ this example here], and also FPGA debugging with ChipScope.&lt;br /&gt;
&lt;br /&gt;
However, most of the debugging functionality is provided from within Armadeus BSP without the need for JTAG interface.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
* 68 Ohm resistor&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - VREF (+2.8v)&lt;br /&gt;
| J9 pin 2 OR J19 pin 39 with a 68 ohm resistor inline&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 11  - RTCK&lt;br /&gt;
| (optional) J22 pin 2 (TCK_OWIRE)&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nSRST&lt;br /&gt;
| (optional) wired to apf27 R76 on cpu side: http://www.armadeus.com/_downloads/apf27/hardware/apf27_V1.2_top_assembly.pdf &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Probe ==&lt;br /&gt;
&lt;br /&gt;
The examples below are tested with [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configure the board for JTAG ==&lt;br /&gt;
&lt;br /&gt;
If the APF27 board is equipped with FPGA, the FPGA chip MUST be powered before using JTAG. At the power-up,  FPGA is low powered by cutting down the VCCAUX and VCCINT supplies until some data is loaded to FPGA. The simplest way to activate the FPGA chip is to enable the U-Boot ''firmware_autoload'' feature. Under U-Boot, set the environment variable ''firmware_autoload'' to 1 and save the environment variables to enable the FPGA on reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv firmware_autoload 1&lt;br /&gt;
BIOS&amp;gt; saveenv &lt;br /&gt;
Saving Environment to NAND...&lt;br /&gt;
Erasing Nand...&lt;br /&gt;
Erasing at 0xe0000 -- 100% complete.&lt;br /&gt;
Writing to Nand... done&lt;br /&gt;
BIOS&amp;gt; reset&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install and configuring OpenOCD to work with a jtagkey==&lt;br /&gt;
&lt;br /&gt;
yet to be done. First it requires 2 libraries libusb and libftdi (libftd2xxx from ftdi).&lt;br /&gt;
download and install the latest libftdi: http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;./configure&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then openocd: http://developer.berlios.de/projects/openocd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; ./bootstrap&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;./configure --enable-ft2232_libftdi&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basic tests show that cable works as expected. You can use the following configuration file with jtagkey and openocd.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
telnet_port 4444&lt;br /&gt;
gdb_port 3333&lt;br /&gt;
# GDB can also flash my flash!&lt;br /&gt;
gdb_memory_map enable&lt;br /&gt;
gdb_flash_program enable&lt;br /&gt;
gdb_breakpoint_override hard&lt;br /&gt;
&lt;br /&gt;
interface ft2232&lt;br /&gt;
ft2232_device_desc &amp;quot;Amontec JTAGkey&amp;quot;&lt;br /&gt;
ft2232_layout jtagkey&lt;br /&gt;
ft2232_vid_pid 0x0403 0xcff8&lt;br /&gt;
jtag_khz 6000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# The APF27 board has a IMX27 chip and one fpga spartan3 200k&lt;br /&gt;
#source [find board/apf27.cfg]&lt;br /&gt;
#source [find target/imx27.cfg]&lt;br /&gt;
reset_config trst_and_srst&lt;br /&gt;
&lt;br /&gt;
set  _CHIPNAME imx27&lt;br /&gt;
set  _ENDIAN little&lt;br /&gt;
&lt;br /&gt;
# The bs tap&lt;br /&gt;
set _BSTAPID 0x1b900f0f&lt;br /&gt;
jtag newtap $_CHIPNAME bs \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_BSTAPID&lt;br /&gt;
&lt;br /&gt;
# The CPU tap&lt;br /&gt;
set _CPUTAPID 0x07926121&lt;br /&gt;
jtag newtap $_CHIPNAME cpu \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID&lt;br /&gt;
&lt;br /&gt;
set _TARGETNAME [format &amp;quot;%s.cpu&amp;quot; $_CHIPNAME]&lt;br /&gt;
target create $_TARGETNAME arm926ejs \&lt;br /&gt;
    -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure \&lt;br /&gt;
  -work-area-virt 0xffff4c00 -work-area-phys 0xffff4c00 \&lt;br /&gt;
  -work-area-size  0x8000 -work-area-backup 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arm7_9 dcc_downloads enable&lt;br /&gt;
#endof target/imx27.cfg&lt;br /&gt;
&lt;br /&gt;
jtag newtap xc3s200a.fpga fpga \&lt;br /&gt;
	-irlen 6 \&lt;br /&gt;
	-irmask 0x3f \&lt;br /&gt;
	-ircapture 0x9 \&lt;br /&gt;
	-expected-id 0x2218093&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure -event reset-init { apf27_init }&lt;br /&gt;
&lt;br /&gt;
proc apf27_init { } {&lt;br /&gt;
	# This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
	# reset the board correctly&lt;br /&gt;
	#reset run&lt;br /&gt;
	#reset halt&lt;br /&gt;
&lt;br /&gt;
        # reset keeping fpga alive&lt;br /&gt;
 	soft_reset_halt &lt;br /&gt;
	halt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	mww 0x10000000 0x20040304&lt;br /&gt;
	mww 0x10020000 0x00000000&lt;br /&gt;
	mww 0x10000004 0xDFFBFCFB&lt;br /&gt;
	mww 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
	sleep 100&lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027818 0x0000080F &lt;br /&gt;
	mww 0xD8001010 0x0000000C &lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027828 0x55555555 &lt;br /&gt;
	mww 0x10027830 0x55555555 &lt;br /&gt;
	mww 0x10027834 0x55555555 &lt;br /&gt;
	mww 0x10027838 0x00005005 &lt;br /&gt;
	mww 0x1002783C 0x15555555 &lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x92100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xB2100000 &lt;br /&gt;
	mwb 0xA0000033 0xDA&lt;br /&gt;
	mwb 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x82126080 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
launch openocd with this config file and test the connection from a telnet terminal to send commands reset, soft_reset_halt, halt.&lt;br /&gt;
Without the nSRST line wired to the board it is still possible to reset the apf27 with the reset button. ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; openocd&lt;br /&gt;
&lt;br /&gt;
6000 kHz&lt;br /&gt;
dcc downloads are enabled&lt;br /&gt;
Info : JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Warn : no tcl port specified, using default port 6666&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and from another terminal:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;  telnet 127.0.0.1 4444 &lt;br /&gt;
&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; reset&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
&lt;br /&gt;
&amp;gt; soft_reset_halt&lt;br /&gt;
requesting target halt and executing a soft reset&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x000000d3 pc: 0x00000000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x200000d3 pc: 0xaff20bb8&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; reset init&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Firstly, check if your BDI2000 is rev C (see on the back of the probe, near the serial number). If your probe is A or B, it does not support target supply voltage less than 3.0 V. In this cas, there might be a solution putting a serial resistor, see above [[#Building a JTAG connector for apf27Dev board|Building a JTAG connector for apf27Dev board]].&lt;br /&gt;
&lt;br /&gt;
The BDI2000 probe comes with a firmware (bdiGDB) that make one able to connect directly GDB (GNU debugger) to the BDI2000 via ethernet. In the following example, we use a precompiled GDB from CodeSourcery. But any GDB configured for an ARM target might work.&lt;br /&gt;
&lt;br /&gt;
You can use the following configuration file with BDI2000. It has been built like OpenOCD configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; bdiGDB configuration for ARMadeus APF27 board&lt;br /&gt;
; ---------------------------------------------&lt;br /&gt;
; Jonathan ILIAS-PILLET&lt;br /&gt;
;&lt;br /&gt;
; Many settings translated from OpenOCD's one, thanks to SSinyagin and Jorasse&lt;br /&gt;
[INIT]&lt;br /&gt;
&lt;br /&gt;
; to be done : memory map&lt;br /&gt;
&lt;br /&gt;
;This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
; reset the board correctly&lt;br /&gt;
&lt;br /&gt;
wm32 0x10000000 0x20040304&lt;br /&gt;
wm32 0x10020000 0x00000000&lt;br /&gt;
wm32 0x10000004 0xDFFBFCFB&lt;br /&gt;
wm32 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
delay 100&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027818 0x0000080F&lt;br /&gt;
wm32 0xD8001010 0x0000000C&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027828 0x55555555&lt;br /&gt;
wm32 0x10027830 0x55555555&lt;br /&gt;
wm32 0x10027834 0x55555555&lt;br /&gt;
wm32 0x10027838 0x00005005&lt;br /&gt;
wm32 0x1002783C 0x15555555&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x92100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xA2100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xB2100000&lt;br /&gt;
wm8 0xA0000033 0xDA&lt;br /&gt;
wm8 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x82126080&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       1                   ; JTAG clock 1 = 16 MHz, 6 = 200KHz (last setting used only for testing)&lt;br /&gt;
WAKEUP      200                 ; millisecond to wait after a reset to let target start&lt;br /&gt;
SCANPRED    1 6                 ; JTAG chain starts with FGPA (spartan3), it has a 6 bits Instruction Register&lt;br /&gt;
SCANSUCC    1 4                 ; i.MX27 JTAG Controller, not used but present in the JTAG chain&lt;br /&gt;
TRST        OPENDRAIN           ; pullup provided by iMX27 (§7.4 JTAG Controller Pin List)&lt;br /&gt;
RESET       NONE&lt;br /&gt;
ENDIAN      LITTLE              ; memory model is little endian&lt;br /&gt;
;VECTOR      CATCH 0x1f          ; not used now&lt;br /&gt;
BREAKMODE   HARD                ; hardware breakpoints&lt;br /&gt;
;BREAKMODE   SOFT 0xDFFFDFFF     ;SOFT or HARD, ARM / Thumb break code&lt;br /&gt;
BDIMODE     AGENT&lt;br /&gt;
&lt;br /&gt;
[HOST]&lt;br /&gt;
DEBUGPORT   2001                ; TCP port to connect GDB to&lt;br /&gt;
FORMAT      ELF                 ; format of image files&lt;br /&gt;
LOAD        MANUAL              ; load code manually after reset&lt;br /&gt;
PROMPT      APF27&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[FLASH]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[REGS]&lt;br /&gt;
FILE    reg926e.def&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the optionnal register file below :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Register definition for ARM926E&lt;br /&gt;
;===============================&lt;br /&gt;
;&lt;br /&gt;
; name: user defined name of the register&lt;br /&gt;
; type: the type of the register&lt;br /&gt;
;       GPR     general purpose register&lt;br /&gt;
;       CP15    CP15 register&lt;br /&gt;
;       MM      memory mapped register&lt;br /&gt;
;       DMMx    direct memory mapped register with offset&lt;br /&gt;
;               x = 1..4&lt;br /&gt;
;               the base is defined in the configuration file&lt;br /&gt;
;               e.g. DMM1 0x02200000&lt;br /&gt;
; addr: the number, adddress or offset of the register&lt;br /&gt;
; size  the size of the register (8,16 or 32)&lt;br /&gt;
;&lt;br /&gt;
;name           type    addr            size&lt;br /&gt;
;-------------------------------------------&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
; CP15 Registers&lt;br /&gt;
;&lt;br /&gt;
;  Register Numbers for 926E:&lt;br /&gt;
;  +-------+-------+-------+-------+&lt;br /&gt;
;  | | | | | | | | | | | | | | | | |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;  |-|opc_1|-|opc_2|  CRm  |  nbr  |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
id              CP15    0x0000          32      ;ID code&lt;br /&gt;
cache           CP15    0x0100          32      ;Cache type&lt;br /&gt;
tcm             CP15    0x0200          32      ;TCM status&lt;br /&gt;
control         CP15    0x0001          32      ;Control&lt;br /&gt;
ttb             CP15    0x0002          32      ;Translation table base&lt;br /&gt;
dac             CP15    0x0003          32      ;Domain access control&lt;br /&gt;
dfsr            CP15    0x0005          32      ;Data fault status&lt;br /&gt;
ifsr            CP15    0x0105          32      ;Inst fault status&lt;br /&gt;
far             CP15    0x0006          32      ;Fault address&lt;br /&gt;
;&lt;br /&gt;
fcsr            CP15    0x000d          32      ;Fast context switch PID&lt;br /&gt;
context         CP15    0x010d          32      ;Context ID&lt;br /&gt;
;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we want to connect GDB to the BDI probe. Here are the IP addresses choosen for the example :&lt;br /&gt;
* 192.168.5.1 is the host, where GDB runs&lt;br /&gt;
* 192.168.5.2 is the BDI2000's address&lt;br /&gt;
&lt;br /&gt;
GDB command and its output should looks like this :&lt;br /&gt;
 (gdb) target remote 192.168.5.2:2001&lt;br /&gt;
 Remote debugging using 192.168.5.2:2001&lt;br /&gt;
 0xaff20cb4 in ?? ()&lt;br /&gt;
&lt;br /&gt;
== Using OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
Now we can use OpenOCD / JTAG to boot a new U-Boot image:&lt;br /&gt;
&lt;br /&gt;
* Reset the target manually&lt;br /&gt;
&lt;br /&gt;
* Run OpenOCD&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 openocd -f openocd.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start a telnet session from another terminal&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 telnet localhost 4444&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Halt the CPU and configure the DDRAM controler&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; soft_reset_halt&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;gt; reset init&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Load the U-Boot image to RAM&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; load_image /home/{mydir}/armadeus/buildroot/project_build_armv5te/apf27/u-boot-1.3.4/u-boot-nand.bin 0xA0000000&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Assert a breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; bp 0xa0000010 4 hw&lt;br /&gt;
 breakpoint added at address 0xa0000010&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run U-Boot up to the breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; resume 0xa0000000&lt;br /&gt;
 target state: halted&lt;br /&gt;
 target halted in ARM state due to breakpoint, current mode: Supervisor&lt;br /&gt;
 cpsr: 0x600000d3 pc: 0xa0000010&lt;br /&gt;
 MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD is operational...&lt;br /&gt;
&lt;br /&gt;
== Debugging U-Boot with OpenOCD and GDB on APF27 ==&lt;br /&gt;
&lt;br /&gt;
The booting procedure of apf27 is as follows:&lt;br /&gt;
# the NAND_SPL loader reads the u-boot image from NAND flash to 0xA0000000 (nand_spl/board/armadeus/apf27/start.S)&lt;br /&gt;
# The SPL loader gives control to the U-boot startup (cpu/arm926ejs/start.S)&lt;br /&gt;
# The startup code gives control to the board-specific initialization code (lowlevel_init in board/armadeus/apf27/lowlevel_init.S)&lt;br /&gt;
# The startup code relocates the image to its base address (TEXT_BASE=0xAFF00000)&lt;br /&gt;
# The startup code gives control to start_armboot() in lib_arm/board.c&lt;br /&gt;
# U-boot reads the environment and does its booting job.&lt;br /&gt;
&lt;br /&gt;
If you plan to debug a new U-boot image with JTAG, you have to prevent it from resetting FPGA (GPIO port F). By default, the startup code resets the FPGA ports to their initial state, and that disconnects our JTAG adapter, because FPGA chip is part of the chain.&lt;br /&gt;
&lt;br /&gt;
Comment out the following lines in the patched U-boot code in buildroot/project_build_armv5te/apf27/u-boot-1.3.4:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
###  cpu/arm926ejs/start.S lines 185-186&lt;br /&gt;
/*        bl coloured_LED_init&lt;br /&gt;
        bl red_LED_on */&lt;br /&gt;
&lt;br /&gt;
### board/armadeus/apf27/lowlevel_init.S lines 113-126&lt;br /&gt;
/* PORTF */&lt;br /&gt;
/*    writel( DR(PORTF), CFG_DR_F_VAL)&lt;br /&gt;
    writel( OCR1(PORTF), CFG_OCR1_F_VAL)&lt;br /&gt;
    writel( OCR2(PORTF), CFG_OCR2_F_VAL)&lt;br /&gt;
    writel( ICONFA1(PORTF), CFG_ICFA1_F_VAL)&lt;br /&gt;
    writel( ICONFA2(PORTF), CFG_ICFA2_F_VAL)&lt;br /&gt;
    writel( ICONFB1(PORTF), CFG_ICFB1_F_VAL)&lt;br /&gt;
    writel( ICONFB2(PORTF), CFG_ICFB2_F_VAL)&lt;br /&gt;
    writel( ICR1(PORTF), CFG_ICR1_F_VAL)&lt;br /&gt;
    writel( ICR2(PORTF), CFG_ICR2_F_VAL)&lt;br /&gt;
    writel( IMR(PORTF), CFG_IMR_F_VAL)&lt;br /&gt;
    writel( DDIR(PORTF), CFG_DDIR_F_VAL)&lt;br /&gt;
    writel( GPR(PORTF), CFG_GPR_F_VAL)&lt;br /&gt;
    writel( PUEN(PORTF), CFG_PUEN_F_VAL)&lt;br /&gt;
    writel( GIUS(PORTF), CFG_GIUS_F_VAL) */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the new U-boot image. This example disables optimization and stores the build commands into a logfile. From Armadeus BSP root folder,&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
make u-boot-clean &amp;amp;&amp;amp; (make OPTFLAGS=-O0 | tee loglog) &amp;amp;&amp;amp; cp -v buildroot/binaries/apf27/apf27-u-boot.bin /tftpboot/ &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reset the board and press any key to get U-Boot prompt in the serial console.&lt;br /&gt;
&lt;br /&gt;
Launch OpenOCD (we assume the JTAG adapter is already connected). It should report finding of 3 devices:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
openocd -f apf27-openocd.cfg &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure out which address to use for the first breakpoint. The build process has created the file ''u-boot.map'' which lists all the addresses of all global symbols. In this example, the address of start_armboot() is 0xaff01630:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
[root@lab0 u-boot-1.3.4]# grep start_armboot u-boot.map &lt;br /&gt;
lib_arm/libarm.a(board.o)     cpu/arm926ejs/start.o (start_armboot)&lt;br /&gt;
                0x00000000aff01630                start_armboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Telnet to the OpenOCD console and install the breakpoint at the address of interest. It is important to issue &amp;quot;halt&amp;quot; and &amp;quot;resume&amp;quot;:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
[root@lab0 armadeus]# telnet localhost 4444 &lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x000000d3 pc: 0xaff20c4c&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; bp 0xaff01630 4 hw&lt;br /&gt;
breakpoint added at address 0xaff01630&lt;br /&gt;
&lt;br /&gt;
&amp;gt; resume&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the original u-boot image continues to function. Load our test image into the memory and launch it:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv ipaddr 192.168.1.5; setenv serverip 192.168.1.40; tftpboot 0xA0000000 apf27-u-boot.bin; go 0xA0000000&lt;br /&gt;
FEC ETHERNET: Link is up - 100/Full&lt;br /&gt;
TFTP from server 192.168.1.40; our IP address is 192.168.1.5&lt;br /&gt;
Filename 'apf27-u-boot.bin'.&lt;br /&gt;
Load address: 0xa0000000&lt;br /&gt;
Loading: ###########################&lt;br /&gt;
done&lt;br /&gt;
Bytes transferred = 392232 (5fc28 hex)&lt;br /&gt;
## Starting application at 0xA0000000 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here our breakpoint should fire, and the following should be seen in OpenOCD telnet session:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to breakpoint, current mode: Supervisor&lt;br /&gt;
cpsr: 0x200000d3 pc: 0xaff01630&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the breakpoint. Note that there is a very limited number of hardware breakpoints (3?) and you can't set up too many of them.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
rbp 0xaff01630&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can launch GDB or its graphical interface DDD and connect it to our paused bootloader:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 ddd --debugger buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In GDB command window, load the symbol table and connect to OpenOCD:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
(gdb) add-symbol-file u-boot 0xaff00000&lt;br /&gt;
add symbol table from file &amp;quot;u-boot&amp;quot; at&lt;br /&gt;
	.text_addr = 0xaff00000&lt;br /&gt;
(gdb) target remote localhost:3333&lt;br /&gt;
start_armboot () at board.c:304&lt;br /&gt;
/home/armadeus-be/buildroot/project_build_armv5te/apf27/u-boot-1.3.4/lib_arm/board.c:304:8383:beg:0xaff01630&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DDD code display window should show the start_armboot() entry point. Now you can follow with the debugging as usual.&lt;br /&gt;
&lt;br /&gt;
Hint: in order to get back to start_armboot(), you don't have to reset the board. Disconnect GDB from OpenOCD, then in OpenOCD telnet window, set the program counter back to the start address of start_armboot(), and then re-attach GDB.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
* TRST does not stop the CPU&lt;br /&gt;
&lt;br /&gt;
Most probably the FPGA chip went offline during the U-Boot initialization and didn't come online. &lt;br /&gt;
&lt;br /&gt;
* FPGA chip is not visible when OpenOCD detcts the TAPs.&lt;br /&gt;
&lt;br /&gt;
FPGA chip is in low power mode at startup. Load some data in the fpga to enable it in jtag chain.&lt;br /&gt;
&lt;br /&gt;
* From Bootstrap mode FPGA and CPU are not accessible.&lt;br /&gt;
&lt;br /&gt;
Yes, be sure to remove the bootstrap jumper to be able to use jtag. There is a small hardware modification to fix it but this change will disable the low power features.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* http://www.amontec.com/&lt;br /&gt;
* http://www.abatron.ch/products/debugger-support/gnu-support.html&lt;br /&gt;
* http://www.intra2net.com/opensource/ftdi/&lt;br /&gt;
* http://openocd.berlios.de/web/&lt;br /&gt;
* http://www.gnu.org/software/gdb/&lt;br /&gt;
* http://www.gnu.org/software/ddd/&lt;br /&gt;
* http://www.denx.de/wiki/view/DULG/DebuggingUBoot&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6361</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6361"/>
				<updated>2009-04-26T10:25:48Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
JTAG interface is useful in debugging some complicated issues with U-Boot, like [http://txlab.wordpress.com/2009/04/25/big-endian-for-imx27-found-the-problem/ this example here], and also FPGA debugging with ChipScope.&lt;br /&gt;
&lt;br /&gt;
However, most of the debugging functionality is provided from within Armadeus BSP without the need for JTAG interface.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
* 68 Ohm resistor&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - VREF (+2.8v)&lt;br /&gt;
| J9 pin 2 OR J19 pin 39 with a 68 ohm resistor inline&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 11  - RTCK&lt;br /&gt;
| (optional) J22 pin 2 (TCK_OWIRE)&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nSRST&lt;br /&gt;
| (optional) wired to apf27 R76 on cpu side: http://www.armadeus.com/_downloads/apf27/hardware/apf27_V1.2_top_assembly.pdf &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Probe ==&lt;br /&gt;
&lt;br /&gt;
The examples below are tested with [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configure the board for JTAG ==&lt;br /&gt;
&lt;br /&gt;
If the APF27 board is equipped with FPGA, the FPGA chip MUST be powered before using JTAG. At the power-up,  FPGA is low powered by cutting down the VCCAUX and VCCINT supplies until some data is loaded to FPGA. The simplest way to activate the FPGA chip is to enable the U-Boot ''firmware_autoload'' feature. Under U-Boot, set the environment variable ''firmware_autoload'' to 1 and save the environment variables to enable the FPGA on reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv firmware_autoload 1&lt;br /&gt;
BIOS&amp;gt; saveenv &lt;br /&gt;
Saving Environment to NAND...&lt;br /&gt;
Erasing Nand...&lt;br /&gt;
Erasing at 0xe0000 -- 100% complete.&lt;br /&gt;
Writing to Nand... done&lt;br /&gt;
BIOS&amp;gt; reset&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install and configuring OpenOCD to work with a jtagkey==&lt;br /&gt;
&lt;br /&gt;
yet to be done. First it requires 2 libraries libusb and libftdi (libftd2xxx from ftdi).&lt;br /&gt;
download and install the latest libftdi: http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;./configure&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then openocd: http://developer.berlios.de/projects/openocd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; ./bootstrap&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;./configure --enable-ft2232_libftdi&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basic tests show that cable works as expected. You can use the following configuration file with jtagkey and openocd.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
telnet_port 4444&lt;br /&gt;
gdb_port 3333&lt;br /&gt;
# GDB can also flash my flash!&lt;br /&gt;
gdb_memory_map enable&lt;br /&gt;
gdb_flash_program enable&lt;br /&gt;
gdb_breakpoint_override hard&lt;br /&gt;
&lt;br /&gt;
interface ft2232&lt;br /&gt;
ft2232_device_desc &amp;quot;Amontec JTAGkey&amp;quot;&lt;br /&gt;
ft2232_layout jtagkey&lt;br /&gt;
ft2232_vid_pid 0x0403 0xcff8&lt;br /&gt;
jtag_khz 6000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# The APF27 board has a IMX27 chip and one fpga spartan3 200k&lt;br /&gt;
#source [find board/apf27.cfg]&lt;br /&gt;
#source [find target/imx27.cfg]&lt;br /&gt;
reset_config trst_and_srst&lt;br /&gt;
&lt;br /&gt;
set  _CHIPNAME imx27&lt;br /&gt;
set  _ENDIAN little&lt;br /&gt;
&lt;br /&gt;
# The bs tap&lt;br /&gt;
set _BSTAPID 0x1b900f0f&lt;br /&gt;
jtag newtap $_CHIPNAME bs \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_BSTAPID&lt;br /&gt;
&lt;br /&gt;
# The CPU tap&lt;br /&gt;
set _CPUTAPID 0x07926121&lt;br /&gt;
jtag newtap $_CHIPNAME cpu \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID&lt;br /&gt;
&lt;br /&gt;
set _TARGETNAME [format &amp;quot;%s.cpu&amp;quot; $_CHIPNAME]&lt;br /&gt;
target create $_TARGETNAME arm926ejs \&lt;br /&gt;
    -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure \&lt;br /&gt;
  -work-area-virt 0xffff4c00 -work-area-phys 0xffff4c00 \&lt;br /&gt;
  -work-area-size  0x8000 -work-area-backup 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arm7_9 dcc_downloads enable&lt;br /&gt;
#endof target/imx27.cfg&lt;br /&gt;
&lt;br /&gt;
jtag newtap xc3s200a.fpga fpga \&lt;br /&gt;
	-irlen 6 \&lt;br /&gt;
	-irmask 0x3f \&lt;br /&gt;
	-ircapture 0x9 \&lt;br /&gt;
	-expected-id 0x2218093&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure -event reset-init { apf27_init }&lt;br /&gt;
&lt;br /&gt;
proc apf27_init { } {&lt;br /&gt;
	# This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
	# reset the board correctly&lt;br /&gt;
	#reset run&lt;br /&gt;
	#reset halt&lt;br /&gt;
&lt;br /&gt;
        # reset keeping fpga alive&lt;br /&gt;
 	soft_reset_halt &lt;br /&gt;
	halt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	mww 0x10000000 0x20040304&lt;br /&gt;
	mww 0x10020000 0x00000000&lt;br /&gt;
	mww 0x10000004 0xDFFBFCFB&lt;br /&gt;
	mww 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
	sleep 100&lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027818 0x0000080F &lt;br /&gt;
	mww 0xD8001010 0x0000000C &lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027828 0x55555555 &lt;br /&gt;
	mww 0x10027830 0x55555555 &lt;br /&gt;
	mww 0x10027834 0x55555555 &lt;br /&gt;
	mww 0x10027838 0x00005005 &lt;br /&gt;
	mww 0x1002783C 0x15555555 &lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x92100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xB2100000 &lt;br /&gt;
	mwb 0xA0000033 0xDA&lt;br /&gt;
	mwb 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x82126080 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
launch openocd with this config file and test the connection from a telnet terminal to send commands reset, soft_reset_halt, halt.&lt;br /&gt;
Without the nSRST line wired to the board it is still possible to reset the apf27 with the reset button. ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; openocd&lt;br /&gt;
&lt;br /&gt;
6000 kHz&lt;br /&gt;
dcc downloads are enabled&lt;br /&gt;
Info : JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Warn : no tcl port specified, using default port 6666&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and from another terminal:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;  telnet 127.0.0.1 4444 &lt;br /&gt;
&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; reset&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
&lt;br /&gt;
&amp;gt; soft_reset_halt&lt;br /&gt;
requesting target halt and executing a soft reset&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x000000d3 pc: 0x00000000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x200000d3 pc: 0xaff20bb8&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; reset init&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Firstly, check if your BDI2000 is rev C (see on the back of the probe, near the serial number). If your probe is A or B, it does not support target supply voltage less than 3.0 V. In this cas, there might be a solution putting a serial resistor, see above [[#Building a JTAG connector for apf27Dev board|Building a JTAG connector for apf27Dev board]].&lt;br /&gt;
&lt;br /&gt;
The BDI2000 probe comes with a firmware (bdiGDB) that make one able to connect directly GDB (GNU debugger) to the BDI2000 via ethernet. In the following example, we use a precompiled GDB from CodeSourcery. But any GDB configured for an ARM target might work.&lt;br /&gt;
&lt;br /&gt;
You can use the following configuration file with BDI2000. It has been built like OpenOCD configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; bdiGDB configuration for ARMadeus APF27 board&lt;br /&gt;
; ---------------------------------------------&lt;br /&gt;
; Jonathan ILIAS-PILLET&lt;br /&gt;
;&lt;br /&gt;
; Many settings translated from OpenOCD's one, thanks to SSinyagin and Jorasse&lt;br /&gt;
[INIT]&lt;br /&gt;
&lt;br /&gt;
; to be done : memory map&lt;br /&gt;
&lt;br /&gt;
;This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
; reset the board correctly&lt;br /&gt;
&lt;br /&gt;
wm32 0x10000000 0x20040304&lt;br /&gt;
wm32 0x10020000 0x00000000&lt;br /&gt;
wm32 0x10000004 0xDFFBFCFB&lt;br /&gt;
wm32 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
delay 100&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027818 0x0000080F&lt;br /&gt;
wm32 0xD8001010 0x0000000C&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027828 0x55555555&lt;br /&gt;
wm32 0x10027830 0x55555555&lt;br /&gt;
wm32 0x10027834 0x55555555&lt;br /&gt;
wm32 0x10027838 0x00005005&lt;br /&gt;
wm32 0x1002783C 0x15555555&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x92100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xA2100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xB2100000&lt;br /&gt;
wm8 0xA0000033 0xDA&lt;br /&gt;
wm8 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x82126080&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       1                   ; JTAG clock 1 = 16 MHz, 6 = 200KHz (last setting used only for testing)&lt;br /&gt;
WAKEUP      200                 ; millisecond to wait after a reset to let target start&lt;br /&gt;
SCANPRED    1 6                 ; JTAG chain starts with FGPA (spartan3), it has a 6 bits Instruction Register&lt;br /&gt;
SCANSUCC    1 4                 ; i.MX27 JTAG Controller, not used but present in the JTAG chain&lt;br /&gt;
TRST        OPENDRAIN           ; pullup provided by iMX27 (§7.4 JTAG Controller Pin List)&lt;br /&gt;
RESET       NONE&lt;br /&gt;
ENDIAN      LITTLE              ; memory model is little endian&lt;br /&gt;
;VECTOR      CATCH 0x1f          ; not used now&lt;br /&gt;
BREAKMODE   HARD                ; hardware breakpoints&lt;br /&gt;
;BREAKMODE   SOFT 0xDFFFDFFF     ;SOFT or HARD, ARM / Thumb break code&lt;br /&gt;
BDIMODE     AGENT&lt;br /&gt;
&lt;br /&gt;
[HOST]&lt;br /&gt;
DEBUGPORT   2001                ; TCP port to connect GDB to&lt;br /&gt;
FORMAT      ELF                 ; format of image files&lt;br /&gt;
LOAD        MANUAL              ; load code manually after reset&lt;br /&gt;
PROMPT      APF27&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[FLASH]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[REGS]&lt;br /&gt;
FILE    reg926e.def&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the optionnal register file below :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Register definition for ARM926E&lt;br /&gt;
;===============================&lt;br /&gt;
;&lt;br /&gt;
; name: user defined name of the register&lt;br /&gt;
; type: the type of the register&lt;br /&gt;
;       GPR     general purpose register&lt;br /&gt;
;       CP15    CP15 register&lt;br /&gt;
;       MM      memory mapped register&lt;br /&gt;
;       DMMx    direct memory mapped register with offset&lt;br /&gt;
;               x = 1..4&lt;br /&gt;
;               the base is defined in the configuration file&lt;br /&gt;
;               e.g. DMM1 0x02200000&lt;br /&gt;
; addr: the number, adddress or offset of the register&lt;br /&gt;
; size  the size of the register (8,16 or 32)&lt;br /&gt;
;&lt;br /&gt;
;name           type    addr            size&lt;br /&gt;
;-------------------------------------------&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
; CP15 Registers&lt;br /&gt;
;&lt;br /&gt;
;  Register Numbers for 926E:&lt;br /&gt;
;  +-------+-------+-------+-------+&lt;br /&gt;
;  | | | | | | | | | | | | | | | | |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;  |-|opc_1|-|opc_2|  CRm  |  nbr  |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
id              CP15    0x0000          32      ;ID code&lt;br /&gt;
cache           CP15    0x0100          32      ;Cache type&lt;br /&gt;
tcm             CP15    0x0200          32      ;TCM status&lt;br /&gt;
control         CP15    0x0001          32      ;Control&lt;br /&gt;
ttb             CP15    0x0002          32      ;Translation table base&lt;br /&gt;
dac             CP15    0x0003          32      ;Domain access control&lt;br /&gt;
dfsr            CP15    0x0005          32      ;Data fault status&lt;br /&gt;
ifsr            CP15    0x0105          32      ;Inst fault status&lt;br /&gt;
far             CP15    0x0006          32      ;Fault address&lt;br /&gt;
;&lt;br /&gt;
fcsr            CP15    0x000d          32      ;Fast context switch PID&lt;br /&gt;
context         CP15    0x010d          32      ;Context ID&lt;br /&gt;
;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we want to connect GDB to the BDI probe. Here are the IP addresses choosen for the example :&lt;br /&gt;
* 192.168.5.1 is the host, where GDB runs&lt;br /&gt;
* 192.168.5.2 is the BDI2000's address&lt;br /&gt;
&lt;br /&gt;
GDB command and its output should looks like this :&lt;br /&gt;
 (gdb) target remote 192.168.5.2:2001&lt;br /&gt;
 Remote debugging using 192.168.5.2:2001&lt;br /&gt;
 0xaff20cb4 in ?? ()&lt;br /&gt;
&lt;br /&gt;
== Using OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
Now we can use OpenOCD / JTAG to boot a new U-Boot image:&lt;br /&gt;
&lt;br /&gt;
* Reset the target manually&lt;br /&gt;
&lt;br /&gt;
* Run OpenOCD&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 openocd -f openocd.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start a telnet session from another terminal&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 telnet localhost 4444&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Halt the CPU and configure the DDRAM controler&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; soft_reset_halt&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;gt; reset init&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Load the U-Boot image to RAM&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; load_image /home/{mydir}/armadeus/buildroot/project_build_armv5te/apf27/u-boot-1.3.4/u-boot-nand.bin 0xA0000000&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Assert a breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; bp 0xa0000010 4 hw&lt;br /&gt;
 breakpoint added at address 0xa0000010&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run U-Boot up to the breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; resume 0xa0000000&lt;br /&gt;
 target state: halted&lt;br /&gt;
 target halted in ARM state due to breakpoint, current mode: Supervisor&lt;br /&gt;
 cpsr: 0x600000d3 pc: 0xa0000010&lt;br /&gt;
 MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD is operational...&lt;br /&gt;
&lt;br /&gt;
== Using OpenOCD and GDB or DDD ==&lt;br /&gt;
&lt;br /&gt;
You can use GDB or DDD with OpenOCD. First you will have to start OpenOCD and stop the CPU issuing a halt and a reset init on the telnet terminal as described before.&lt;br /&gt;
&lt;br /&gt;
* Now you can start a GDB session on another terminal:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* or a DDD session:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 ddd --debugger buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote connect to the target&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 (gdb) target remote localhost:3333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* load a U-Boot ELF image&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 (gdb) load u-boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... http://www.denx.de/wiki/view/DULG/DebuggingUBoot&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
* TRST does not stop the CPU&lt;br /&gt;
&lt;br /&gt;
Most probably the FPGA chip went offline during the U-Boot initialization and didn't come online. &lt;br /&gt;
&lt;br /&gt;
* FPGA chip is not visible when OpenOCD detcts the TAPs.&lt;br /&gt;
&lt;br /&gt;
FPGA chip is in low power mode at startup. Load some data in the fpga to enable it in jtag chain.&lt;br /&gt;
&lt;br /&gt;
* From Bootstrap mode FPGA and CPU are not accessible.&lt;br /&gt;
&lt;br /&gt;
Yes, be sure to remove the bootstrap jumper to be able to use jtag. There is a small hardware modification to fix it but this change will disable the low power features.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* http://www.amontec.com/&lt;br /&gt;
* http://www.abatron.ch/products/debugger-support/gnu-support.html&lt;br /&gt;
* http://www.intra2net.com/opensource/ftdi/&lt;br /&gt;
* http://openocd.berlios.de/web/&lt;br /&gt;
* http://www.gnu.org/software/gdb/&lt;br /&gt;
* http://www.gnu.org/software/ddd/&lt;br /&gt;
* http://www.denx.de/wiki/view/DULG/DebuggingUBoot&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6360</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6360"/>
				<updated>2009-04-26T10:18:45Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
JTAG interface is useful in debugging some complicated issues with U-Boot, like [http://txlab.wordpress.com/2009/04/25/big-endian-for-imx27-found-the-problem/ this example here], and also FPGA debugging with ChipScope.&lt;br /&gt;
&lt;br /&gt;
However, most of the debugging functionality is provided from within Armadeus BSP without the need for JTAG interface.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
* 68 Ohm resistor&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - VREF (+2.8v)&lt;br /&gt;
| J9 pin 2 OR J19 pin 39 with a 68 ohm resistor inline&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 11  - RTCK&lt;br /&gt;
| (optional) J22 pin 2 (TCK_OWIRE)&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nSRST&lt;br /&gt;
| (optional) wired to apf27 R76 on cpu side: http://www.armadeus.com/_downloads/apf27/hardware/apf27_V1.2_top_assembly.pdf &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Probe ==&lt;br /&gt;
&lt;br /&gt;
The examples below are tested with [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configure the board for JTAG ==&lt;br /&gt;
&lt;br /&gt;
If the APF27 board is equipped with FPGA, the FPGA chip MUST be powered before using JTAG. At the power-up,  FPGA is low powered by cutting down the VCCAUX and VCCINT supplies until some data is loaded to FPGA. The simplest way to activate the FPGA chip is to enable the U-Boot ''firmware_autoload'' feature. Under U-Boot, set the environment variable ''firmware_autoload'' to 1 and save the environment variables to enable the FPGA on reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv firmware_autoload 1&lt;br /&gt;
BIOS&amp;gt; saveenv &lt;br /&gt;
Saving Environment to NAND...&lt;br /&gt;
Erasing Nand...&lt;br /&gt;
Erasing at 0xe0000 -- 100% complete.&lt;br /&gt;
Writing to Nand... done&lt;br /&gt;
BIOS&amp;gt; reset&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install and configuring OpenOCD to work with a jtagkey==&lt;br /&gt;
&lt;br /&gt;
yet to be done. First it requires 2 libraries libusb and libftdi (libftd2xxx from ftdi).&lt;br /&gt;
download and install the latest libftdi: http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;./configure&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then openocd: http://developer.berlios.de/projects/openocd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; ./bootstrap&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;./configure --enable-ft2232_libftdi&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basic tests show that cable works as expected. You can use the following configuration file with jtagkey and openocd.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
telnet_port 4444&lt;br /&gt;
gdb_port 3333&lt;br /&gt;
# GDB can also flash my flash!&lt;br /&gt;
gdb_memory_map enable&lt;br /&gt;
gdb_flash_program enable&lt;br /&gt;
gdb_breakpoint_override hard&lt;br /&gt;
&lt;br /&gt;
interface ft2232&lt;br /&gt;
ft2232_device_desc &amp;quot;Amontec JTAGkey&amp;quot;&lt;br /&gt;
ft2232_layout jtagkey&lt;br /&gt;
ft2232_vid_pid 0x0403 0xcff8&lt;br /&gt;
jtag_khz 6000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# The APF27 board has a IMX27 chip and one fpga spartan3 200k&lt;br /&gt;
#source [find board/apf27.cfg]&lt;br /&gt;
#source [find target/imx27.cfg]&lt;br /&gt;
reset_config trst_and_srst&lt;br /&gt;
&lt;br /&gt;
set  _CHIPNAME imx27&lt;br /&gt;
set  _ENDIAN little&lt;br /&gt;
&lt;br /&gt;
# The bs tap&lt;br /&gt;
set _BSTAPID 0x1b900f0f&lt;br /&gt;
jtag newtap $_CHIPNAME bs \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_BSTAPID&lt;br /&gt;
&lt;br /&gt;
# The CPU tap&lt;br /&gt;
set _CPUTAPID 0x07926121&lt;br /&gt;
jtag newtap $_CHIPNAME cpu \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID&lt;br /&gt;
&lt;br /&gt;
set _TARGETNAME [format &amp;quot;%s.cpu&amp;quot; $_CHIPNAME]&lt;br /&gt;
target create $_TARGETNAME arm926ejs \&lt;br /&gt;
    -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure \&lt;br /&gt;
  -work-area-virt 0xffff4c00 -work-area-phys 0xffff4c00 \&lt;br /&gt;
  -work-area-size  0x8000 -work-area-backup 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arm7_9 dcc_downloads enable&lt;br /&gt;
#endof target/imx27.cfg&lt;br /&gt;
&lt;br /&gt;
jtag newtap xc3s200a.fpga fpga \&lt;br /&gt;
	-irlen 6 \&lt;br /&gt;
	-irmask 0x3f \&lt;br /&gt;
	-ircapture 0x9 \&lt;br /&gt;
	-expected-id 0x2218093&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure -event reset-init { apf27_init }&lt;br /&gt;
&lt;br /&gt;
proc apf27_init { } {&lt;br /&gt;
	# This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
	# reset the board correctly&lt;br /&gt;
	#reset run&lt;br /&gt;
	#reset halt&lt;br /&gt;
&lt;br /&gt;
        # reset keeping fpga alive&lt;br /&gt;
 	soft_reset_halt &lt;br /&gt;
	halt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	mww 0x10000000 0x20040304&lt;br /&gt;
	mww 0x10020000 0x00000000&lt;br /&gt;
	mww 0x10000004 0xDFFBFCFB&lt;br /&gt;
	mww 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
	sleep 100&lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027818 0x0000080F &lt;br /&gt;
	mww 0xD8001010 0x0000000C &lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027828 0x55555555 &lt;br /&gt;
	mww 0x10027830 0x55555555 &lt;br /&gt;
	mww 0x10027834 0x55555555 &lt;br /&gt;
	mww 0x10027838 0x00005005 &lt;br /&gt;
	mww 0x1002783C 0x15555555 &lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x92100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xB2100000 &lt;br /&gt;
	mwb 0xA0000033 0xDA&lt;br /&gt;
	mwb 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x82126080 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
launch openocd with this config file and test the connection from a telnet terminal to send commands reset, soft_reset_halt, halt.&lt;br /&gt;
Without the nSRST line wired to the board it is still possible to reset the apf27 with the reset button. ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; openocd&lt;br /&gt;
&lt;br /&gt;
6000 kHz&lt;br /&gt;
dcc downloads are enabled&lt;br /&gt;
Info : JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Warn : no tcl port specified, using default port 6666&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and from another terminal:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;  telnet 127.0.0.1 4444 &lt;br /&gt;
&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; reset&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
&lt;br /&gt;
&amp;gt; soft_reset_halt&lt;br /&gt;
requesting target halt and executing a soft reset&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x000000d3 pc: 0x00000000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x200000d3 pc: 0xaff20bb8&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; reset init&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Firstly, check if your BDI2000 is rev C (see on the back of the probe, near the serial number). If your probe is A or B, it does not support target supply voltage less than 3.0 V. In this cas, there might be a solution putting a serial resistor, see above [[#Building a JTAG connector for apf27Dev board|Building a JTAG connector for apf27Dev board]].&lt;br /&gt;
&lt;br /&gt;
The BDI2000 probe comes with a firmware (bdiGDB) that make one able to connect directly GDB (GNU debugger) to the BDI2000 via ethernet. In the following example, we use a precompiled GDB from CodeSourcery. But any GDB configured for an ARM target might work.&lt;br /&gt;
&lt;br /&gt;
You can use the following configuration file with BDI2000. It has been built like OpenOCD configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; bdiGDB configuration for ARMadeus APF27 board&lt;br /&gt;
; ---------------------------------------------&lt;br /&gt;
; Jonathan ILIAS-PILLET&lt;br /&gt;
;&lt;br /&gt;
; Many settings translated from OpenOCD's one, thanks to SSinyagin and Jorasse&lt;br /&gt;
[INIT]&lt;br /&gt;
&lt;br /&gt;
; to be done : memory map&lt;br /&gt;
&lt;br /&gt;
;This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
; reset the board correctly&lt;br /&gt;
&lt;br /&gt;
wm32 0x10000000 0x20040304&lt;br /&gt;
wm32 0x10020000 0x00000000&lt;br /&gt;
wm32 0x10000004 0xDFFBFCFB&lt;br /&gt;
wm32 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
delay 100&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027818 0x0000080F&lt;br /&gt;
wm32 0xD8001010 0x0000000C&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027828 0x55555555&lt;br /&gt;
wm32 0x10027830 0x55555555&lt;br /&gt;
wm32 0x10027834 0x55555555&lt;br /&gt;
wm32 0x10027838 0x00005005&lt;br /&gt;
wm32 0x1002783C 0x15555555&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x92100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xA2100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xB2100000&lt;br /&gt;
wm8 0xA0000033 0xDA&lt;br /&gt;
wm8 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x82126080&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       1                   ; JTAG clock 1 = 16 MHz, 6 = 200KHz (last setting used only for testing)&lt;br /&gt;
WAKEUP      200                 ; millisecond to wait after a reset to let target start&lt;br /&gt;
SCANPRED    1 6                 ; JTAG chain starts with FGPA (spartan3), it has a 6 bits Instruction Register&lt;br /&gt;
SCANSUCC    1 4                 ; i.MX27 JTAG Controller, not used but present in the JTAG chain&lt;br /&gt;
TRST        OPENDRAIN           ; pullup provided by iMX27 (§7.4 JTAG Controller Pin List)&lt;br /&gt;
RESET       NONE&lt;br /&gt;
ENDIAN      LITTLE              ; memory model is little endian&lt;br /&gt;
;VECTOR      CATCH 0x1f          ; not used now&lt;br /&gt;
BREAKMODE   HARD                ; hardware breakpoints&lt;br /&gt;
;BREAKMODE   SOFT 0xDFFFDFFF     ;SOFT or HARD, ARM / Thumb break code&lt;br /&gt;
BDIMODE     AGENT&lt;br /&gt;
&lt;br /&gt;
[HOST]&lt;br /&gt;
DEBUGPORT   2001                ; TCP port to connect GDB to&lt;br /&gt;
FORMAT      ELF                 ; format of image files&lt;br /&gt;
LOAD        MANUAL              ; load code manually after reset&lt;br /&gt;
PROMPT      APF27&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[FLASH]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[REGS]&lt;br /&gt;
FILE    reg926e.def&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the optionnal register file below :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Register definition for ARM926E&lt;br /&gt;
;===============================&lt;br /&gt;
;&lt;br /&gt;
; name: user defined name of the register&lt;br /&gt;
; type: the type of the register&lt;br /&gt;
;       GPR     general purpose register&lt;br /&gt;
;       CP15    CP15 register&lt;br /&gt;
;       MM      memory mapped register&lt;br /&gt;
;       DMMx    direct memory mapped register with offset&lt;br /&gt;
;               x = 1..4&lt;br /&gt;
;               the base is defined in the configuration file&lt;br /&gt;
;               e.g. DMM1 0x02200000&lt;br /&gt;
; addr: the number, adddress or offset of the register&lt;br /&gt;
; size  the size of the register (8,16 or 32)&lt;br /&gt;
;&lt;br /&gt;
;name           type    addr            size&lt;br /&gt;
;-------------------------------------------&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
; CP15 Registers&lt;br /&gt;
;&lt;br /&gt;
;  Register Numbers for 926E:&lt;br /&gt;
;  +-------+-------+-------+-------+&lt;br /&gt;
;  | | | | | | | | | | | | | | | | |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;  |-|opc_1|-|opc_2|  CRm  |  nbr  |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
id              CP15    0x0000          32      ;ID code&lt;br /&gt;
cache           CP15    0x0100          32      ;Cache type&lt;br /&gt;
tcm             CP15    0x0200          32      ;TCM status&lt;br /&gt;
control         CP15    0x0001          32      ;Control&lt;br /&gt;
ttb             CP15    0x0002          32      ;Translation table base&lt;br /&gt;
dac             CP15    0x0003          32      ;Domain access control&lt;br /&gt;
dfsr            CP15    0x0005          32      ;Data fault status&lt;br /&gt;
ifsr            CP15    0x0105          32      ;Inst fault status&lt;br /&gt;
far             CP15    0x0006          32      ;Fault address&lt;br /&gt;
;&lt;br /&gt;
fcsr            CP15    0x000d          32      ;Fast context switch PID&lt;br /&gt;
context         CP15    0x010d          32      ;Context ID&lt;br /&gt;
;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we want to connect GDB to the BDI probe. Here are the IP addresses choosen for the example :&lt;br /&gt;
* 192.168.5.1 is the host, where GDB runs&lt;br /&gt;
* 192.168.5.2 is the BDI2000's address&lt;br /&gt;
&lt;br /&gt;
GDB command and its output should looks like this :&lt;br /&gt;
 (gdb) target remote 192.168.5.2:2001&lt;br /&gt;
 Remote debugging using 192.168.5.2:2001&lt;br /&gt;
 0xaff20cb4 in ?? ()&lt;br /&gt;
&lt;br /&gt;
== Using OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
Now we can use OpenOCD / JTAG to boot a new U-Boot image:&lt;br /&gt;
&lt;br /&gt;
* Reset the target manually&lt;br /&gt;
&lt;br /&gt;
* Run OpenOCD&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 openocd -f openocd.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start a telnet session from another terminal&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 telnet localhost 4444&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Halt the CPU and configure the DDRAM controler&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; soft_reset_halt&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;gt; reset init&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Load the U-Boot image to RAM&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; load_image /home/{mydir}/armadeus/buildroot/project_build_armv5te/apf27/u-boot-1.3.4/u-boot-nand.bin 0xA0000000&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Assert a breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; bp 0xa0000010 4 hw&lt;br /&gt;
 breakpoint added at address 0xa0000010&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run U-Boot up to the breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; resume 0xa0000000&lt;br /&gt;
 target state: halted&lt;br /&gt;
 target halted in ARM state due to breakpoint, current mode: Supervisor&lt;br /&gt;
 cpsr: 0x600000d3 pc: 0xa0000010&lt;br /&gt;
 MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD is operational...&lt;br /&gt;
&lt;br /&gt;
== Using OpenOCD and GDB or DDD ==&lt;br /&gt;
&lt;br /&gt;
You can use GDB or DDD with OpenOCD. First you will have to start OpenOCD and stop the CPU issuing a halt and a reset init on the telnet terminal as described before.&lt;br /&gt;
&lt;br /&gt;
* Now you can start a GDB session on another terminal:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* or a DDD session:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 ddd --debugger buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote connect to the target&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 (gdb) target remote localhost:3333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* load a U-Boot ELF image&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 (gdb) load u-boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... http://www.denx.de/wiki/view/DULG/DebuggingUBoot&lt;br /&gt;
&lt;br /&gt;
== Open issues ==&lt;br /&gt;
&lt;br /&gt;
* TRST does not stop the CPU&lt;br /&gt;
&lt;br /&gt;
TRST and SRST together reset the CPU &lt;br /&gt;
&lt;br /&gt;
* FPGA chip is not visible when OpenOCD detcts the TAPs.&lt;br /&gt;
&lt;br /&gt;
FPGA chip is in low power mode at startup. Load some data in the fpga to enable it in jtag chain.&lt;br /&gt;
&lt;br /&gt;
* From Bootstrap mode FPGA and CPU are not accessible.&lt;br /&gt;
&lt;br /&gt;
Yes, be sure to remove the bootstrap jumper to be able to use jtag. There is a small hardware modification to fix it but this change will disable the low power features.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* http://www.amontec.com/&lt;br /&gt;
* http://www.abatron.ch/products/debugger-support/gnu-support.html&lt;br /&gt;
* http://www.intra2net.com/opensource/ftdi/&lt;br /&gt;
* http://openocd.berlios.de/web/&lt;br /&gt;
* http://www.gnu.org/software/gdb/&lt;br /&gt;
* http://www.gnu.org/software/ddd/&lt;br /&gt;
* http://www.denx.de/wiki/view/DULG/DebuggingUBoot&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6359</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6359"/>
				<updated>2009-04-26T10:06:48Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
JTAG interface is useful in debugging some complicated issues with U-Boot, like [http://txlab.wordpress.com/2009/04/25/big-endian-for-imx27-found-the-problem/ this example here], and also FPGA debugging with ChipScope.&lt;br /&gt;
&lt;br /&gt;
However, most of the debugging functionality is provided from within Armadeus BSP without the need for JTAG interface.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
* 68Ohm resistor&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - VREF (+2.8v)&lt;br /&gt;
| J9 pin 2 OR J19 pin 39 with a 68 ohm resistor inline&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 11  - RTCK&lt;br /&gt;
| (optional) J22 pin 2 (TCK_OWIRE)&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nSRST&lt;br /&gt;
| (optional) wired to apf27 R76 on cpu side: http://www.armadeus.com/_downloads/apf27/hardware/apf27_V1.2_top_assembly.pdf &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Probe ==&lt;br /&gt;
&lt;br /&gt;
I'm using the [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configure the board for JTAG ==&lt;br /&gt;
&lt;br /&gt;
In case of an APF27 equipped with a FPGA it MUST be powered before using the jtag. At startup the fpga is low power by cutting down the VCCAUX and VCCINT supplies until some data are loaded in the fpga. The simplest way to activate the fpga is to enable the U-Boot firmware_autoload feature. Under U-Boot set the environment variable firmware_autoload to 1 and save the environment variables to enable the fpga on reset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
BIOS&amp;gt; setenv firmware_autoload 1&lt;br /&gt;
BIOS&amp;gt; saveenv &lt;br /&gt;
Saving Environment to NAND...&lt;br /&gt;
Erasing Nand...&lt;br /&gt;
Erasing at 0xe0000 -- 100% complete.&lt;br /&gt;
Writing to Nand... done&lt;br /&gt;
BIOS&amp;gt; reset&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install and configuring OpenOCD to work with a jtagkey==&lt;br /&gt;
&lt;br /&gt;
yet to be done. First it requires 2 libraries libusb and libftdi (libftd2xxx from ftdi).&lt;br /&gt;
download and install the latest libftdi: http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.15.tar.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;./configure&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then openocd: http://developer.berlios.de/projects/openocd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; ./bootstrap&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;./configure --enable-ft2232_libftdi&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;make&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;sudo make install&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basic tests show that cable works as expected. You can use the following configuration file with jtagkey and openocd.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
telnet_port 4444&lt;br /&gt;
gdb_port 3333&lt;br /&gt;
# GDB can also flash my flash!&lt;br /&gt;
gdb_memory_map enable&lt;br /&gt;
gdb_flash_program enable&lt;br /&gt;
gdb_breakpoint_override soft&lt;br /&gt;
&lt;br /&gt;
interface ft2232&lt;br /&gt;
ft2232_device_desc &amp;quot;Amontec JTAGkey&amp;quot;&lt;br /&gt;
ft2232_layout jtagkey&lt;br /&gt;
ft2232_vid_pid 0x0403 0xcff8&lt;br /&gt;
jtag_khz 6000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# The APF27 board has a IMX27 chip and one fpga spartan3 200k&lt;br /&gt;
#source [find board/apf27.cfg]&lt;br /&gt;
#source [find target/imx27.cfg]&lt;br /&gt;
reset_config trst_and_srst&lt;br /&gt;
&lt;br /&gt;
set  _CHIPNAME imx27&lt;br /&gt;
set  _ENDIAN little&lt;br /&gt;
&lt;br /&gt;
# The bs tap&lt;br /&gt;
set _BSTAPID 0x1b900f0f&lt;br /&gt;
jtag newtap $_CHIPNAME bs \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_BSTAPID&lt;br /&gt;
&lt;br /&gt;
# The CPU tap&lt;br /&gt;
set _CPUTAPID 0x07926121&lt;br /&gt;
jtag newtap $_CHIPNAME cpu \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID&lt;br /&gt;
&lt;br /&gt;
set _TARGETNAME [format &amp;quot;%s.cpu&amp;quot; $_CHIPNAME]&lt;br /&gt;
target create $_TARGETNAME arm926ejs \&lt;br /&gt;
    -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure \&lt;br /&gt;
  -work-area-virt 0xffff4c00 -work-area-phys 0xffff4c00 \&lt;br /&gt;
  -work-area-size  0x8000 -work-area-backup 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arm7_9 dcc_downloads enable&lt;br /&gt;
#endof target/imx27.cfg&lt;br /&gt;
&lt;br /&gt;
jtag newtap xc3s200a.fpga fpga \&lt;br /&gt;
	-irlen 6 \&lt;br /&gt;
	-irmask 0x3f \&lt;br /&gt;
	-ircapture 0x9 \&lt;br /&gt;
	-expected-id 0x2218093&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure -event gdb-attach { reset init }&lt;br /&gt;
$_TARGETNAME configure -event reset-init { apf27_init }&lt;br /&gt;
&lt;br /&gt;
proc apf27_init { } {&lt;br /&gt;
	# This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
	# reset the board correctly&lt;br /&gt;
	#reset run&lt;br /&gt;
	#reset halt&lt;br /&gt;
&lt;br /&gt;
        # reset keeping fpga alive&lt;br /&gt;
 	soft_reset_halt &lt;br /&gt;
	halt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	mww 0x10000000 0x20040304&lt;br /&gt;
	mww 0x10020000 0x00000000&lt;br /&gt;
	mww 0x10000004 0xDFFBFCFB&lt;br /&gt;
	mww 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
	sleep 100&lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027818 0x0000080F &lt;br /&gt;
	mww 0xD8001010 0x0000000C &lt;br /&gt;
&lt;br /&gt;
	# ========================================&lt;br /&gt;
	#  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
	# ========================================&lt;br /&gt;
	mww 0x10027828 0x55555555 &lt;br /&gt;
	mww 0x10027830 0x55555555 &lt;br /&gt;
	mww 0x10027834 0x55555555 &lt;br /&gt;
	mww 0x10027838 0x00005005 &lt;br /&gt;
	mww 0x1002783C 0x15555555 &lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x92100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xA2100000 &lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
	mww 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0xB2100000 &lt;br /&gt;
	mwb 0xA0000033 0xDA&lt;br /&gt;
	mwb 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
	mww 0xD8001000 0x82126080 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
launch openocd with this config file and test the connection from a telnet terminal to send commands reset, soft_reset_halt, halt.&lt;br /&gt;
Without the nSRST line wired to the board it is still possible to reset the apf27 with the reset button. ;-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt; openocd&lt;br /&gt;
&lt;br /&gt;
6000 kHz&lt;br /&gt;
dcc downloads are enabled&lt;br /&gt;
Info : JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Info : JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
Info : JTAG Tap/device matched&lt;br /&gt;
Warn : no tcl port specified, using default port 6666&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and from another terminal:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;  telnet 127.0.0.1 4444 &lt;br /&gt;
&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; reset&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: xc3s400a.fpga.fpga tap/device found: 0x02220093 (Manufacturer: 0x049, Part: 0x2220, Version: 0x0)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
&lt;br /&gt;
&amp;gt; soft_reset_halt&lt;br /&gt;
requesting target halt and executing a soft reset&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x000000d3 pc: 0x00000000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x200000d3 pc: 0xaff20bb8&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&lt;br /&gt;
&amp;gt; reset init&lt;br /&gt;
JTAG tap: imx27.bs tap/device found: 0x1b900f0f (Manufacturer: 0x787, Part: 0xb900, Version: 0x1)&lt;br /&gt;
JTAG Tap/device matched&lt;br /&gt;
JTAG tap: imx27.cpu tap/device found: 0x07926121 (Manufacturer: 0x090, Part: 0x7926, Version: 0x0)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Firstly, check if your BDI2000 is rev C (see on the back of the probe, near the serial number). If your probe is A or B, it does not support target supply voltage less than 3.0 V. In this cas, there might be a solution putting a serial resistor, see above [[#Building a JTAG connector for apf27Dev board|Building a JTAG connector for apf27Dev board]].&lt;br /&gt;
&lt;br /&gt;
The BDI2000 probe comes with a firmware (bdiGDB) that make one able to connect directly GDB (GNU debugger) to the BDI2000 via ethernet. In the following example, we use a precompiled GDB from CodeSourcery. But any GDB configured for an ARM target might work.&lt;br /&gt;
&lt;br /&gt;
You can use the following configuration file with BDI2000. It has been built like OpenOCD configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; bdiGDB configuration for ARMadeus APF27 board&lt;br /&gt;
; ---------------------------------------------&lt;br /&gt;
; Jonathan ILIAS-PILLET&lt;br /&gt;
;&lt;br /&gt;
; Many settings translated from OpenOCD's one, thanks to SSinyagin and Jorasse&lt;br /&gt;
[INIT]&lt;br /&gt;
&lt;br /&gt;
; to be done : memory map&lt;br /&gt;
&lt;br /&gt;
;This setup puts RAM at 0xA0000000&lt;br /&gt;
&lt;br /&gt;
; reset the board correctly&lt;br /&gt;
&lt;br /&gt;
wm32 0x10000000 0x20040304&lt;br /&gt;
wm32 0x10020000 0x00000000&lt;br /&gt;
wm32 0x10000004 0xDFFBFCFB&lt;br /&gt;
wm32 0x10020004 0xFFFFFFFF&lt;br /&gt;
&lt;br /&gt;
delay 100&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- initial reset&lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027818 0x0000080F&lt;br /&gt;
wm32 0xD8001010 0x0000000C&lt;br /&gt;
&lt;br /&gt;
; ========================================&lt;br /&gt;
;  Configure DDR on CSD0 -- wait 5000 cycle &lt;br /&gt;
; ========================================&lt;br /&gt;
wm32 0x10027828 0x55555555&lt;br /&gt;
wm32 0x10027830 0x55555555&lt;br /&gt;
wm32 0x10027834 0x55555555&lt;br /&gt;
wm32 0x10027838 0x00005005&lt;br /&gt;
wm32 0x1002783C 0x15555555&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001004 0x00695728&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x92100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xA2100000&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
wm32 0xA0000F00 0x0&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0xB2100000&lt;br /&gt;
wm8 0xA0000033 0xDA&lt;br /&gt;
wm8 0xA2000000 0x00&lt;br /&gt;
&lt;br /&gt;
wm32 0xD8001000 0x82126080&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       1                   ; JTAG clock 1 = 16 MHz, 6 = 200KHz (last setting used only for testing)&lt;br /&gt;
WAKEUP      200                 ; millisecond to wait after a reset to let target start&lt;br /&gt;
SCANPRED    1 6                 ; JTAG chain starts with FGPA (spartan3), it has a 6 bits Instruction Register&lt;br /&gt;
SCANSUCC    1 4                 ; i.MX27 JTAG Controller, not used but present in the JTAG chain&lt;br /&gt;
TRST        OPENDRAIN           ; pullup provided by iMX27 (§7.4 JTAG Controller Pin List)&lt;br /&gt;
RESET       NONE&lt;br /&gt;
ENDIAN      LITTLE              ; memory model is little endian&lt;br /&gt;
;VECTOR      CATCH 0x1f          ; not used now&lt;br /&gt;
BREAKMODE   HARD                ; hardware breakpoints&lt;br /&gt;
;BREAKMODE   SOFT 0xDFFFDFFF     ;SOFT or HARD, ARM / Thumb break code&lt;br /&gt;
BDIMODE     AGENT&lt;br /&gt;
&lt;br /&gt;
[HOST]&lt;br /&gt;
DEBUGPORT   2001                ; TCP port to connect GDB to&lt;br /&gt;
FORMAT      ELF                 ; format of image files&lt;br /&gt;
LOAD        MANUAL              ; load code manually after reset&lt;br /&gt;
PROMPT      APF27&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[FLASH]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[REGS]&lt;br /&gt;
FILE    reg926e.def&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the optionnal register file below :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Register definition for ARM926E&lt;br /&gt;
;===============================&lt;br /&gt;
;&lt;br /&gt;
; name: user defined name of the register&lt;br /&gt;
; type: the type of the register&lt;br /&gt;
;       GPR     general purpose register&lt;br /&gt;
;       CP15    CP15 register&lt;br /&gt;
;       MM      memory mapped register&lt;br /&gt;
;       DMMx    direct memory mapped register with offset&lt;br /&gt;
;               x = 1..4&lt;br /&gt;
;               the base is defined in the configuration file&lt;br /&gt;
;               e.g. DMM1 0x02200000&lt;br /&gt;
; addr: the number, adddress or offset of the register&lt;br /&gt;
; size  the size of the register (8,16 or 32)&lt;br /&gt;
;&lt;br /&gt;
;name           type    addr            size&lt;br /&gt;
;-------------------------------------------&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
; CP15 Registers&lt;br /&gt;
;&lt;br /&gt;
;  Register Numbers for 926E:&lt;br /&gt;
;  +-------+-------+-------+-------+&lt;br /&gt;
;  | | | | | | | | | | | | | | | | |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;  |-|opc_1|-|opc_2|  CRm  |  nbr  |&lt;br /&gt;
;  +-+-----+-+-----+-------+-------+&lt;br /&gt;
;&lt;br /&gt;
;&lt;br /&gt;
id              CP15    0x0000          32      ;ID code&lt;br /&gt;
cache           CP15    0x0100          32      ;Cache type&lt;br /&gt;
tcm             CP15    0x0200          32      ;TCM status&lt;br /&gt;
control         CP15    0x0001          32      ;Control&lt;br /&gt;
ttb             CP15    0x0002          32      ;Translation table base&lt;br /&gt;
dac             CP15    0x0003          32      ;Domain access control&lt;br /&gt;
dfsr            CP15    0x0005          32      ;Data fault status&lt;br /&gt;
ifsr            CP15    0x0105          32      ;Inst fault status&lt;br /&gt;
far             CP15    0x0006          32      ;Fault address&lt;br /&gt;
;&lt;br /&gt;
fcsr            CP15    0x000d          32      ;Fast context switch PID&lt;br /&gt;
context         CP15    0x010d          32      ;Context ID&lt;br /&gt;
;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we want to connect GDB to the BDI probe. Here are the IP addresses choosen for the example :&lt;br /&gt;
* 192.168.5.1 is the host, where GDB runs&lt;br /&gt;
* 192.168.5.2 is the BDI2000's address&lt;br /&gt;
&lt;br /&gt;
GDB command and its output should looks like this :&lt;br /&gt;
 (gdb) target remote 192.168.5.2:2001&lt;br /&gt;
 Remote debugging using 192.168.5.2:2001&lt;br /&gt;
 0xaff20cb4 in ?? ()&lt;br /&gt;
&lt;br /&gt;
== Using OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
Now we can use OpenOCD / JTAG to boot a new U-Boot image:&lt;br /&gt;
&lt;br /&gt;
* Reset the target manually&lt;br /&gt;
&lt;br /&gt;
* Run OpenOCD&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 openocd -f openocd.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start a telnet session from another terminal&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 telnet localhost 4444&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Halt the CPU and configure the DDRAM controler&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; soft_reset_halt&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;gt; reset init&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Load the U-Boot image to RAM&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; load_image /home/{mydir}/armadeus/buildroot/project_build_armv5te/apf27/u-boot-1.3.4/u-boot-nand.bin 0xA0000000&lt;br /&gt;
 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Assert a breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; bp 0xa0000010 4 hw&lt;br /&gt;
 breakpoint added at address 0xa0000010&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run U-Boot up to the breakpoint&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;gt; resume 0xa0000000&lt;br /&gt;
 target state: halted&lt;br /&gt;
 target halted in ARM state due to breakpoint, current mode: Supervisor&lt;br /&gt;
 cpsr: 0x600000d3 pc: 0xa0000010&lt;br /&gt;
 MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD is operational...&lt;br /&gt;
&lt;br /&gt;
== Using OpenOCD and GDB or DDD ==&lt;br /&gt;
&lt;br /&gt;
You can use GDB or DDD with OpenOCD. First you will have to start OpenOCD and stop the CPU issuing a halt and a reset init on the telnet terminal as described before.&lt;br /&gt;
&lt;br /&gt;
* Now you can start a GDB session on another terminal:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* or a DDD session:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 ddd --debugger buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-gdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote connect to the target&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 (gdb) target remote localhost:3333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* load a U-Boot ELF image&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 (gdb) load u-boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... http://www.denx.de/wiki/view/DULG/DebuggingUBoot&lt;br /&gt;
&lt;br /&gt;
== Open issues ==&lt;br /&gt;
&lt;br /&gt;
* TRST does not stop the CPU&lt;br /&gt;
&lt;br /&gt;
TRST and SRST together reset the CPU &lt;br /&gt;
&lt;br /&gt;
* FPGA chip is not visible when OpenOCD detcts the TAPs.&lt;br /&gt;
&lt;br /&gt;
FPGA chip is in low power mode at startup. Load some data in the fpga to enable it in jtag chain.&lt;br /&gt;
&lt;br /&gt;
* From Bootstrap mode FPGA and CPU are not accessible.&lt;br /&gt;
&lt;br /&gt;
Yes, be sure to remove the bootstrap jumper to be able to use jtag. There is a small hardware modification to fix it but this change will disable the low power features.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* http://www.amontec.com/&lt;br /&gt;
* http://www.abatron.ch/products/debugger-support/gnu-support.html&lt;br /&gt;
* http://www.intra2net.com/opensource/ftdi/&lt;br /&gt;
* http://openocd.berlios.de/web/&lt;br /&gt;
* http://www.gnu.org/software/gdb/&lt;br /&gt;
* http://www.gnu.org/software/ddd/&lt;br /&gt;
* http://www.denx.de/wiki/view/DULG/DebuggingUBoot&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6243</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6243"/>
				<updated>2009-03-29T18:13:21Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* Open issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nRST&lt;br /&gt;
| ---&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Adapter ==&lt;br /&gt;
&lt;br /&gt;
I'm using the [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configuring OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
yet to be done. Basic tests show that cable works as expected, but board-specific settings need some more time to figure out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
telnet_port 4444&lt;br /&gt;
gdb_port 3333&lt;br /&gt;
# GDB can also flash my flash!&lt;br /&gt;
gdb_memory_map enable&lt;br /&gt;
gdb_flash_program enable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
interface ft2232&lt;br /&gt;
ft2232_device_desc &amp;quot;Amontec JTAGkey&amp;quot;&lt;br /&gt;
ft2232_layout jtagkey&lt;br /&gt;
ft2232_vid_pid 0x0403 0xcff8&lt;br /&gt;
jtag_khz 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reset_config trst_only combined&lt;br /&gt;
jtag_ntrst_delay 200&lt;br /&gt;
&lt;br /&gt;
set  _CHIPNAME imx27&lt;br /&gt;
set  _ENDIAN little&lt;br /&gt;
&lt;br /&gt;
# The bs tap&lt;br /&gt;
set _BSTAPID 0x1b900f0f&lt;br /&gt;
jtag newtap $_CHIPNAME bs \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_BSTAPID&lt;br /&gt;
&lt;br /&gt;
# The CPU tap&lt;br /&gt;
set _CPUTAPID 0x07926121&lt;br /&gt;
jtag newtap $_CHIPNAME cpu \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID&lt;br /&gt;
&lt;br /&gt;
set _TARGETNAME [format &amp;quot;%s.cpu&amp;quot; $_CHIPNAME]&lt;br /&gt;
target create $_TARGETNAME arm926ejs \&lt;br /&gt;
    -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure \&lt;br /&gt;
  -work-area-virt 0xffff4c00 -work-area-phys 0xffff4c00 \&lt;br /&gt;
  -work-area-size  0x8000 -work-area-backup 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arm7_9 dcc_downloads enable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jtag newtap xc3s200a.fpga fpga \&lt;br /&gt;
	-irlen 6 \&lt;br /&gt;
	-irmask 0x3f \&lt;br /&gt;
	-ircapture 0x9 \&lt;br /&gt;
	-expected-id 0x2218093&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Open issues ==&lt;br /&gt;
&lt;br /&gt;
* TRST does not stop the CPU&lt;br /&gt;
* FPGA chip is not visible when OpenOCD detcts the TAPs.&lt;br /&gt;
&lt;br /&gt;
most probably pull-up resistors are needed.&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6242</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6242"/>
				<updated>2009-03-29T18:11:15Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* Configuring OpenOCD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nRST&lt;br /&gt;
| ---&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Adapter ==&lt;br /&gt;
&lt;br /&gt;
I'm using the [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configuring OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
yet to be done. Basic tests show that cable works as expected, but board-specific settings need some more time to figure out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
telnet_port 4444&lt;br /&gt;
gdb_port 3333&lt;br /&gt;
# GDB can also flash my flash!&lt;br /&gt;
gdb_memory_map enable&lt;br /&gt;
gdb_flash_program enable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
interface ft2232&lt;br /&gt;
ft2232_device_desc &amp;quot;Amontec JTAGkey&amp;quot;&lt;br /&gt;
ft2232_layout jtagkey&lt;br /&gt;
ft2232_vid_pid 0x0403 0xcff8&lt;br /&gt;
jtag_khz 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reset_config trst_only combined&lt;br /&gt;
jtag_ntrst_delay 200&lt;br /&gt;
&lt;br /&gt;
set  _CHIPNAME imx27&lt;br /&gt;
set  _ENDIAN little&lt;br /&gt;
&lt;br /&gt;
# The bs tap&lt;br /&gt;
set _BSTAPID 0x1b900f0f&lt;br /&gt;
jtag newtap $_CHIPNAME bs \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_BSTAPID&lt;br /&gt;
&lt;br /&gt;
# The CPU tap&lt;br /&gt;
set _CPUTAPID 0x07926121&lt;br /&gt;
jtag newtap $_CHIPNAME cpu \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID&lt;br /&gt;
&lt;br /&gt;
set _TARGETNAME [format &amp;quot;%s.cpu&amp;quot; $_CHIPNAME]&lt;br /&gt;
target create $_TARGETNAME arm926ejs \&lt;br /&gt;
    -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure \&lt;br /&gt;
  -work-area-virt 0xffff4c00 -work-area-phys 0xffff4c00 \&lt;br /&gt;
  -work-area-size  0x8000 -work-area-backup 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arm7_9 dcc_downloads enable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
jtag newtap xc3s200a.fpga fpga \&lt;br /&gt;
	-irlen 6 \&lt;br /&gt;
	-irmask 0x3f \&lt;br /&gt;
	-ircapture 0x9 \&lt;br /&gt;
	-expected-id 0x2218093&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Open issues ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;halt&amp;quot; does not stop the CPU:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; halt&lt;br /&gt;
timed out while waiting for target halted&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6240</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6240"/>
				<updated>2009-03-28T00:35:02Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nRST&lt;br /&gt;
| ---&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Adapter ==&lt;br /&gt;
&lt;br /&gt;
I'm using the [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configuring OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
yet to be done. Basic tests show that cable works as expected, but board-specific settings need some more time to figure out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
telnet_port 4444&lt;br /&gt;
gdb_port 3333&lt;br /&gt;
# GDB can also flash my flash!&lt;br /&gt;
gdb_memory_map enable&lt;br /&gt;
gdb_flash_program enable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
interface ft2232&lt;br /&gt;
ft2232_device_desc &amp;quot;Amontec JTAGkey&amp;quot;&lt;br /&gt;
ft2232_layout jtagkey&lt;br /&gt;
ft2232_vid_pid 0x0403 0xcff8&lt;br /&gt;
jtag_khz 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reset_config trst_only combined&lt;br /&gt;
jtag_ntrst_delay 200&lt;br /&gt;
&lt;br /&gt;
set  _CHIPNAME imx27&lt;br /&gt;
set  _ENDIAN little&lt;br /&gt;
&lt;br /&gt;
# The bs tap&lt;br /&gt;
set _BSTAPID 0x1b900f0f&lt;br /&gt;
jtag newtap $_CHIPNAME bs \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_BSTAPID&lt;br /&gt;
&lt;br /&gt;
# The CPU tap&lt;br /&gt;
set _CPUTAPID 0x07926121&lt;br /&gt;
jtag newtap $_CHIPNAME cpu \&lt;br /&gt;
  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID&lt;br /&gt;
&lt;br /&gt;
set _TARGETNAME [format &amp;quot;%s.cpu&amp;quot; $_CHIPNAME]&lt;br /&gt;
target create $_TARGETNAME arm926ejs \&lt;br /&gt;
    -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs&lt;br /&gt;
&lt;br /&gt;
$_TARGETNAME configure \&lt;br /&gt;
  -work-area-virt 0xffff4c00 -work-area-phys 0xffff4c00 \&lt;br /&gt;
  -work-area-size  0x8000 -work-area-backup 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arm7_9 dcc_downloads enable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#jtag newtap xc3s1600.fpga fpga \&lt;br /&gt;
#-irlen 6 \&lt;br /&gt;
#-irmask 0x3f \&lt;br /&gt;
#-ircapture 0x9 \&lt;br /&gt;
#-expected-id 0x3874126&lt;br /&gt;
&lt;br /&gt;
#target create xc3s1600.fpga xscale -endian little&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Open issues ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;halt&amp;quot; does not stop the CPU:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; halt&lt;br /&gt;
timed out while waiting for target halted&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6239</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6239"/>
				<updated>2009-03-27T23:13:12Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* Building a JTAG connector for apf27Dev board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-pin header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27dev J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nRST&lt;br /&gt;
| ---&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Adapter ==&lt;br /&gt;
&lt;br /&gt;
I'm using the [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configuring OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
yet to be done. Basic tests show that cable works as expected, but board-specific settings need some more time to figure out.&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6238</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6238"/>
				<updated>2009-03-27T23:11:14Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
First you need a decent JTAG connector. The description below produces a 20-pin male JTAG connectior with standard ARM pinout.&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-in header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27 J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nRST&lt;br /&gt;
| ---&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JTAG Adapter ==&lt;br /&gt;
&lt;br /&gt;
I'm using the [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] adapter. It has a male 20-pin plug and a 20-way female-to-female cable which fits directly into the cable as described above. A cheaper solution would be to use the Amontec JTAGkey-Tiny and install a 20-pin female plug on on the connector cable for apf27dev.&lt;br /&gt;
&lt;br /&gt;
== Configuring OpenOCD ==&lt;br /&gt;
&lt;br /&gt;
yet to be done. Basic tests show that cable works as expected, but board-specific settings need some more time to figure out.&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6237</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6237"/>
				<updated>2009-03-27T23:01:34Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-in header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27 J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nRST&lt;br /&gt;
| ---&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6236</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6236"/>
				<updated>2009-03-27T23:00:21Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* Building a JTAG connector for apf27Dev board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
Assembling it all together:&lt;br /&gt;
# Solder the 40-in header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Dissect the whole width of the 20-way cable and only pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ARM JTAG 20-pin cable&lt;br /&gt;
! apf27 J19 40-pin cable&lt;br /&gt;
|-&lt;br /&gt;
| 1 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 2 - Vddh (+3.3v)&lt;br /&gt;
| 39&lt;br /&gt;
|-&lt;br /&gt;
| 3 - nTRST&lt;br /&gt;
| 33&lt;br /&gt;
|-&lt;br /&gt;
| 4, 6, 8, 10, 12, 14, 16, 18, 20 - Vss (ground)&lt;br /&gt;
| 31, 34, 40&lt;br /&gt;
|-&lt;br /&gt;
| 5 - TDI&lt;br /&gt;
| 35&lt;br /&gt;
|-&lt;br /&gt;
| 7 - TMS&lt;br /&gt;
| 36&lt;br /&gt;
|-&lt;br /&gt;
| 9  - TCK&lt;br /&gt;
| 37&lt;br /&gt;
|-&lt;br /&gt;
| 13 –TDO&lt;br /&gt;
| 38&lt;br /&gt;
|-&lt;br /&gt;
| 15 – nRST&lt;br /&gt;
| ---&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6235</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=JTAG&amp;diff=6235"/>
				<updated>2009-03-27T22:52:34Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: New page: I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future. This page is not yet finished, and the work is in progress.  == Building a JTAG connector for ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I'm trying to get use of JTAG for U-Boot debugging and probably FPGA debugging in the future.&lt;br /&gt;
This page is not yet finished, and the work is in progress.&lt;br /&gt;
&lt;br /&gt;
== Building a JTAG connector for apf27Dev board ==&lt;br /&gt;
&lt;br /&gt;
List of material and part numbers at [http://www.conrad.ch Conrad]:&lt;br /&gt;
* 2x20-pin header, 2.54mm pitch (Conrad: 741973)&lt;br /&gt;
* ATA/IDE cable (Conrad: 971742)&lt;br /&gt;
* 2x10-pin IDC low profile header, 2.54mm pitch (Conrad: 743534)&lt;br /&gt;
* 20-way flat cable, 1.27mm pitch (Conrad: 609463)&lt;br /&gt;
&lt;br /&gt;
# Solder the 40-in header onto the J19 connector on the apf27dev board&lt;br /&gt;
# Cut off a ~10cm piece from the ATA cable with the 40pin plug at the end. &lt;br /&gt;
# Cut off ~10cm from 20-way flat cable&lt;br /&gt;
# Carefully attach the 20-pin header to the flat cable. The thing is easy to break and it requires some forcing. Better buy a spare piece in advance.&lt;br /&gt;
# Use a knife and a cutting pad and dissect the cable endings, ~3cm long. Disssect the whole 20-way cable and pins 40 to 31 on the 40-way ATA cable.&lt;br /&gt;
# Strip the cable endings&lt;br /&gt;
# Solder the two cables together, as specified below&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	<entry>
		<id>http://armadeus.org/wiki/index.php?title=LinuxInstall&amp;diff=6065</id>
		<title>LinuxInstall</title>
		<link rel="alternate" type="text/html" href="http://armadeus.org/wiki/index.php?title=LinuxInstall&amp;diff=6065"/>
				<updated>2009-03-07T21:59:04Z</updated>
		
		<summary type="html">&lt;p&gt;SSinyagin: /* Prerequisites for Linux installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;How-To install Armadeus Software Development Kit (SDK) on Linux systems.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The installation was successfully tested on the following distributions:&lt;br /&gt;
* Debian Sarge &amp;amp; Etch&lt;br /&gt;
* Fedora Core 3 &amp;amp; 4&lt;br /&gt;
* SuSE 10.1&lt;br /&gt;
* Ubuntu Dapper Drake (6.04)&lt;br /&gt;
* Kubuntu &amp;amp; Xubuntu Edgy Eft (6.10)&lt;br /&gt;
* KUbuntu Gusty Gibbon (7.10)&lt;br /&gt;
* KUbuntu Hardy Heron (8.04)&lt;br /&gt;
* Mandriva 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Prerequisites for Linux installation==&lt;br /&gt;
&lt;br /&gt;
Depending on your distribution, some additional packages are required. For Debian based system, you can use the following command to get them:&lt;br /&gt;
 $ sudo apt-get install autoconf automake bison flex g++ gettext \&lt;br /&gt;
           libncurses5-dev liblzo1 liblzo-dev liblzo2-2 liblzo2-dev \&lt;br /&gt;
           patch subversion texinfo wget zlib1g-dev libacl1 libacl1-dev libtool&lt;br /&gt;
&lt;br /&gt;
{{Warning|For Ubuntu based systems, the following is now required if your ''/bin/sh'' is '''not''' pointing to ''/bin/bash'':&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 $ ls -al /bin/sh&lt;br /&gt;
 lrwxrwxrwx 1 root root 4 2007-12-08 18:33 /bin/sh -&amp;gt; dash&lt;br /&gt;
 $ sudo dpkg-reconfigure dash&lt;br /&gt;
     and select no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For RPM-based systems like Fedora and CentOS, the following commands should install all the needed prerequisites (assuming root shell):&lt;br /&gt;
&lt;br /&gt;
 yum install gcc gcc-c++ autoconf automake libtool bison flex gettext&lt;br /&gt;
 yum install patch subversion texinfo&lt;br /&gt;
 yum install zlib-devel gettext-devel ncurses-devel lzo-devel&lt;br /&gt;
 yum install glib2-devel libacl-devel lzo2-devel&lt;br /&gt;
&lt;br /&gt;
==Get Armadeus software==&lt;br /&gt;
* If you are a &amp;quot;careful&amp;quot; user:&lt;br /&gt;
then download [http://sourceforge.net/project/showfiles.php?group_id=122057&amp;amp;package_id=133240 the latest stable installation tarball from SourceForge] and detar it wherever you want.&lt;br /&gt;
 $ tar xjvf armadeus-3.0.tar.bz2&lt;br /&gt;
* If your are upgrading from armadeus-2.x, then take a look at [[Armadeus_3|this page]]&lt;br /&gt;
* If you are a hacker or a registered developer, check out the required files from the SVN repository:&lt;br /&gt;
 $ svn co https://armadeus.svn.sourceforge.net/svnroot/armadeus/trunk armadeus&lt;br /&gt;
A directory named ''armadeus/'' or ''armadeus-3.0/'' will be created on your hard-disk and will contain all the files you need.&lt;br /&gt;
&lt;br /&gt;
'''Remarks''':&lt;br /&gt;
* '''Do not use spaces''' in the directory name !&lt;br /&gt;
* SVN write/commit accesses are limited to the integrators ([[User:JulienB|JulienB]], [[User:Salocin68|Salocin68]], [[User:Jorasse|Jorasse]], [[User:FabienM|FabienM]])&lt;br /&gt;
&lt;br /&gt;
==Configure SDK options==&lt;br /&gt;
The first time you compile an Armadeus distribution you have to specify the target to work with. &lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 $ cd armadeus/  (or armadeus-3.0/)&lt;br /&gt;
 $ make apf9328_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This command reloads the default configuration to support an [[APF9328|APF9328 board]] and automatically start a Buildroot's configuration menu. For the [[APF27]] it would be:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;host&amp;quot;&amp;gt;&lt;br /&gt;
 $ make apf27_defconfig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you made changes in the next step, at any time you can reload the default configuration with '''make apf9328_defconfig''' or '''make apf27_defconfig'''.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Menuconfig3.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
*If you are not familiar with Buildroot here are some tips:&lt;br /&gt;
*# you can move the highlighted item with the &amp;quot;up&amp;quot;/&amp;quot;down&amp;quot; arrow keys&lt;br /&gt;
*# with the &amp;quot;left&amp;quot;/&amp;quot;right&amp;quot; arrow keys you can choose between &amp;quot;Select&amp;quot;, &amp;quot;Exit&amp;quot; or &amp;quot;Help&amp;quot; buttons&lt;br /&gt;
*# &amp;quot;space&amp;quot;/&amp;quot;enter&amp;quot;:&lt;br /&gt;
*#* selects the currently highlighted item if you are on the &amp;quot;Select&amp;quot; button&lt;br /&gt;
*#* go back in previous menu if you are on &amp;quot;Exit&amp;quot; button&lt;br /&gt;
*#* show you some Help for current item if you are on &amp;quot;Help&amp;quot; button&lt;br /&gt;
*# for more Help about Buildroot commands, select &amp;quot;Help&amp;quot; in the main configuration screen&lt;br /&gt;
&lt;br /&gt;
*In menu:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;config&amp;quot;&amp;gt;&lt;br /&gt;
Target options  ---&amp;gt; &lt;br /&gt;
    [*] Armadeus Device Support  ---&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you can check and change the quantity of RAM available on your Armadeus board. (Default value 16MB is just fine with all [[APF9328]] boards, for [[APF27]] it could be either 64MB or 128MB).&lt;br /&gt;
&lt;br /&gt;
*In menu:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;config&amp;quot;&amp;gt;&lt;br /&gt;
Target filesystem options --&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
for each type of filesystems to build, you have the option (''also copy the image to...'') to copy the binary file to secondary location like your tftp server folder (for example ''/tftpboot'').&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In menu:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;config&amp;quot;&amp;gt;&lt;br /&gt;
Target filesystem options --&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you will find U-Boot options (at the end), including the one to copy it to a secondary location (like ''/tftpboot'')&lt;br /&gt;
&lt;br /&gt;
*In menu:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;config&amp;quot;&amp;gt;&lt;br /&gt;
Kernel --&amp;gt; &lt;br /&gt;
    Destination for linux kernel binaries --&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
you will find options to copy Linux to a secondary location (like ''/tftpboot'')&lt;br /&gt;
&lt;br /&gt;
* You may decrease the compilation time by increasing the number of parallel jobs running simultaneously on your system (the result is not guaranteed). This option is located in&lt;br /&gt;
&amp;lt;pre class=&amp;quot;config&amp;quot;&amp;gt;&lt;br /&gt;
Build Options ---&amp;gt;&lt;br /&gt;
    (1) Number of jobs to run simultaneously&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* During the toolchain/distribution automatic build, a lot of software archives are downloaded from Internet. The downloaded files are put by default in the ''armadeus/downloads/'' directory. '''If you have several views or plan to build the toolchain several times''', we advise you to put all the downloaded files in ''/local/downloads'' (for example). This is done by configuring Buildroot to use this directory for all your views:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;config&amp;quot;&amp;gt;&lt;br /&gt;
Build options  ---&amp;gt; &lt;br /&gt;
    (...) Download dir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Image:Build_config_menu_download.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Build_config_download.png]]&lt;br /&gt;
&lt;br /&gt;
* After the build, we advise you too to copy all the files in ''downloads/'' on a removable medium, in case you want to install the development tools on several systems.&lt;br /&gt;
&lt;br /&gt;
* Now, Exit the configuration tool and save your configuration&lt;br /&gt;
&lt;br /&gt;
==Launch build==&lt;br /&gt;
 $ make&lt;br /&gt;
The toolchain and the full distribution are automatically built. During this procedure, several files are downloaded from Internet. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Please wait for a while.... it takes at least one hour for the first run!'''&amp;lt;br&amp;gt;&lt;br /&gt;
The downloaded files are put (by default) in the ''armadeus/downloads/'' directory. Please see the previous chapter to know how to optimize that if you plan to build several views.&lt;br /&gt;
&lt;br /&gt;
==Enjoy the result==&lt;br /&gt;
The generated binary files can be found in the subdirectory ''buildroot/binaries/apfXX/'' (where XX is the name of your board):&lt;br /&gt;
&lt;br /&gt;
*''apfXX-u-boot.brec'': only on [[APF9328]]; BRecord image that can be used with the bootstrap, if U-Boot is not installed or not working (see [[BootLoader]] page)&lt;br /&gt;
*''apfXX-u-boot.bin'': U-Boot image file to be used with U-Boot itself, (see [[BootLoader#Update_U-Boot | updating U-Boot]])&lt;br /&gt;
*''apfXX-linux.bin'': Linux image to use with U-Boot, (see [[Target_Software_Installation#Linux_kernel_installation | updating Linux]])&lt;br /&gt;
*''apfXX-rootfs.arm.jffs2'': filesystem/rootfs image to use with U-Boot, (see [[Target_Software_Installation#Linux_rootfs_installation | updating rootfs]])&lt;br /&gt;
*''apfXX-rootfs.arm.tar'': for an NFS/MMC based rootfs, (see [[Network_Configuration#Boot_from_NFS | Booting from NFS]] &amp;amp; [[MultiMediaCard#Booting_from_MMC.2FSD | Booting from a MMC/SD]])&lt;br /&gt;
&lt;br /&gt;
'''Please note the new naming convention of binary files and directories'''&lt;br /&gt;
&lt;br /&gt;
The toolchain and project files share a new naming convention too (YY is 4t for APF9328 and 5te for APF27):&lt;br /&gt;
*''buildroot/build_armvYY'': contains all non configurable user-space tools&lt;br /&gt;
*''buildroot/project_build_armvYY/apfXX'': contains all configurable user-space tools: target filesystem, &amp;lt;b&amp;gt;linux&amp;lt;/b&amp;gt;, busybox and &amp;lt;b&amp;gt;u-boot&amp;lt;/b&amp;gt;...&lt;br /&gt;
*''buildroot/toolchain_build_armvYY'': cross compilation toolchain&lt;br /&gt;
&lt;br /&gt;
More information is available in the  [http://buildroot.uclibc.org/buildroot.html buildroot documentation]&lt;br /&gt;
&lt;br /&gt;
* Note: Previous versions of Armadeus SDK stored the generated binary files at different place ''buildroot/binaries/armadeus/'' and file names did not contained any prefix of board name:&lt;br /&gt;
&lt;br /&gt;
:u-boot.brec (BRecord image that can be used with the bootstrap, if U-Boot is not installed or not working)&lt;br /&gt;
:u-boot.bin (U-Boot image file for use with U-Boot itself)&lt;br /&gt;
:linux-kernel-2.6.xx-arm.bin (Linux image to use with U-Boot)&lt;br /&gt;
:rootfs.arm.jffs2 (FileSystem/RootFS image to use with U-Boot)&lt;br /&gt;
:rootfs.arm.tar (for an NFS/MMC RootFS)&lt;br /&gt;
&lt;br /&gt;
==To keep your copy up-to-date with the armadeus SVN repository==&lt;br /&gt;
 $ svn update&lt;br /&gt;
This will update your working directory to the latest release.&lt;br /&gt;
&lt;br /&gt;
Note: if &amp;quot;svn update&amp;quot; fails because a directory or a file already exists, then do:&lt;br /&gt;
 $ rm -rf &amp;lt;this-directory/file&amp;gt;&lt;br /&gt;
 $ svn update&lt;br /&gt;
&lt;br /&gt;
You can do a:&lt;br /&gt;
 $ make apf9328_defconfig&lt;br /&gt;
to have the latest features automatically activated and a &lt;br /&gt;
&lt;br /&gt;
You have to do a '''make''' to rebuild binary files and then upload the binary files to your target.&lt;br /&gt;
&lt;br /&gt;
Note: if definitively everything goes wrong while it worked before the last update.&lt;br /&gt;
You can apply the following procedure (all your modifications in buildroot will be lost):&lt;br /&gt;
 $ rm -rf buildroot/&lt;br /&gt;
 $ rm Makefile&lt;br /&gt;
 $ svn update&lt;br /&gt;
 $ make apf9328_defconfig&lt;br /&gt;
 $ make&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
{{LanguageBar|LinuxInstall|Compilateur croisé|LinuxInstall}}&lt;/div&gt;</summary>
		<author><name>SSinyagin</name></author>	</entry>

	</feed>