<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wikilegacy.armadeus.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JonathanI</id>
	<title>ArmadeusWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wikilegacy.armadeus.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JonathanI"/>
	<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=Special:Contributions/JonathanI"/>
	<updated>2026-04-28T14:58:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=8080</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=8080"/>
		<updated>2010-03-19T15:18:28Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Working with BDI2000 */&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 &#039;&#039;firmware_autoload&#039;&#039; feature. Under U-Boot, set the environment variable &#039;&#039;firmware_autoload&#039;&#039; 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 &#039;^]&#039;.&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;
In addition, you can follow these drawings :&lt;br /&gt;
[[Image:Schema brochage bdi2000 apf27dev 1.png|thumb|none|300px|BDI2000 to APF27-Dev, board side]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Schema brochage bdi2000 apf27dev 2.png|thumb|none|300px|BDI2000 to APF27-Dev, BDI side]]&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&#039;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&#039;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 &#039;&#039;u-boot.map&#039;&#039; 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 &#039;^]&#039;.&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 &#039;apf27-u-boot.bin&#039;.&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&#039;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&#039;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&#039;t come online. &lt;br /&gt;
&lt;br /&gt;
* FPGA chip is not visible when OpenOCD detects 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>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=8079</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=8079"/>
		<updated>2010-03-19T15:18:06Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Working with BDI2000 */&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 &#039;&#039;firmware_autoload&#039;&#039; feature. Under U-Boot, set the environment variable &#039;&#039;firmware_autoload&#039;&#039; 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 &#039;^]&#039;.&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;
In addition, you can follow these drawings :&lt;br /&gt;
[[Image:Schema brochage bdi2000 apf27dev 1.png|thumb|300px|BDI2000 to APF27-Dev, board side]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Schema brochage bdi2000 apf27dev 2.png|thumb|300px|BDI2000 to APF27-Dev, board side]]&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&#039;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&#039;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 &#039;&#039;u-boot.map&#039;&#039; 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 &#039;^]&#039;.&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 &#039;apf27-u-boot.bin&#039;.&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&#039;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&#039;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&#039;t come online. &lt;br /&gt;
&lt;br /&gt;
* FPGA chip is not visible when OpenOCD detects 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>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=File:Schema_brochage_bdi2000_apf27dev_2.png&amp;diff=8078</id>
		<title>File:Schema brochage bdi2000 apf27dev 2.png</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=File:Schema_brochage_bdi2000_apf27dev_2.png&amp;diff=8078"/>
		<updated>2010-03-19T15:17:50Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=File:Schema_brochage_bdi2000_apf27dev_1.png&amp;diff=8077</id>
		<title>File:Schema brochage bdi2000 apf27dev 1.png</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=File:Schema_brochage_bdi2000_apf27dev_1.png&amp;diff=8077"/>
		<updated>2010-03-19T15:16:04Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6278</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6278"/>
		<updated>2009-04-07T09:39:05Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Working with BDI2000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I&#039;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;
{{Under_Construction}}&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 - 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 – nRST&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&#039;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. WARNING: [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] and  JTAGkey-Tiny do not support 2.8V jtag.&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 ==&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, but board-specific settings need some more time to figure out.&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;
&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;
	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;
&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 &#039;^]&#039;.&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;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&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&#039;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&#039;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;
== 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;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6277</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6277"/>
		<updated>2009-04-07T09:25:49Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Working with BDI2000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I&#039;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;
{{Under_Construction}}&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 - 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 – nRST&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&#039;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. WARNING: [http://www.amontec.com/jtagkey.shtml Amontec JTAGkey] and  JTAGkey-Tiny do not support 2.8V jtag.&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 ==&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, but board-specific settings need some more time to figure out.&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;
&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;
	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;
&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 &#039;^]&#039;.&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;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&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&#039;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       3                   ; JTAG clock 3 = 4 MHz, 6 = 200KHz (setting used 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&#039;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;
== 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;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6252</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6252"/>
		<updated>2009-03-31T14:38:59Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Working with BDI2000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I&#039;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&#039;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;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Here is a configuration file I use. It does not work yet but some settings are already right. More informations will be added later, as soon as it works.&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;
; These settings do not work yet&lt;br /&gt;
[INIT]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       6                   ; JTAG clock 3 = 4 MHz, 6 = 200KHz (setting used for testing)&lt;br /&gt;
WAKEUP	    500	                ; 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 3                 ; i.MX27 JTAG Controller, not used but present in the JTAG chain (I&#039;m not sure if it is needed)&lt;br /&gt;
TRST        OPENDRAIN           ; pullup provided by iMX27 (§7.4 JTAG Controller Pin List)&lt;br /&gt;
RESET	    HARD 200            ;&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   ; disabled while testing&lt;br /&gt;
&amp;lt;/pre&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>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6251</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6251"/>
		<updated>2009-03-31T12:05:19Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Working with BDI2000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I&#039;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&#039;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;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Here is a configuration file I use. It does not work yet but some settings are already right. More informations will be added later, as soon as it works.&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;
; These settings do not work yet&lt;br /&gt;
[INIT]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       6                   ; JTAG clock 3 = 4 MHz, 6 = 200KHz (setting used for testing)&lt;br /&gt;
WAKEUP	    500	                ; 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 3                 ; 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	    HARD 200            ;&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   ; disabled while testing&lt;br /&gt;
&amp;lt;/pre&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>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6246</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6246"/>
		<updated>2009-03-30T14:46:49Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Working with BDI2000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I&#039;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&#039;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;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Here is a configuration file I use. It does not work yet but some settings are already right. More informations will be added later, when it works.&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;
; These settings do not work yet&lt;br /&gt;
[INIT]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       6                   ; JTAG clock 3 = 4 MHz, 6 = 200KHz (setting used for testing)&lt;br /&gt;
WAKEUP	    500	                ; 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;
TRST        OPENDRAIN           ; pullup provided by iMX27 (§7.4 JTAG Controller Pin List)&lt;br /&gt;
RESET	    HARD 200            ;&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   ; disabled while testing&lt;br /&gt;
&amp;lt;/pre&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>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6245</id>
		<title>JTAG</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=JTAG&amp;diff=6245"/>
		<updated>2009-03-30T14:09:37Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[SSinyagin] I&#039;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&#039;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;
== Working with BDI2000 ==&lt;br /&gt;
&lt;br /&gt;
Here is a configuration file I use. It does not work yet but some settings are already right.&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;
; These settings do not work yet&lt;br /&gt;
[INIT]&lt;br /&gt;
; to be done&lt;br /&gt;
&lt;br /&gt;
[TARGET]&lt;br /&gt;
CPUTYPE     ARM926E             ; processor core&lt;br /&gt;
CLOCK       6                   ; JTAG clock 3 = 4 MHz, 6 = 200KHz (setting used for testing)&lt;br /&gt;
WAKEUP	    500	                ; 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;
TRST        OPENDRAIN           ; pullup provided by iMX27 (§7.4 JTAG Controller Pin List)&lt;br /&gt;
RESET	    HARD 200            ;&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   ; disabled while testing&lt;br /&gt;
&amp;lt;/pre&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>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6244</id>
		<title>User:JonathanI</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6244"/>
		<updated>2009-03-30T09:53:45Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fiche d&#039;identité / Identity ==&lt;br /&gt;
&lt;br /&gt;
* Nom : Jonathan ILIAS-PILLET&lt;br /&gt;
* Emploi : Enseignant-chercheur à l&#039;[http://www.eseo.fr/ ESEO] (Angers) / associate professor at ESEO (Angers, France)&lt;br /&gt;
* email : jonathan.ilias@eseo.fr&lt;br /&gt;
* jid : ismael@im.chouppy.net&lt;br /&gt;
&lt;br /&gt;
== Ce que nous faisons avec la carte APF27 ==&lt;br /&gt;
&lt;br /&gt;
Nous étudions la possibilité d&#039;utiliser la carte APF27 pour le portage d&#039;un noyau temps réel OSEK/AUTOSAR (Trampoline [http://trampoline.rts-software.org/]). Elle servirait ainsi de base pour le développement de la protection mémoire de ce système d&#039;exploitation.&lt;br /&gt;
&lt;br /&gt;
Nous utilisons la sonde BDI2000 (JTAG) pour le débuggage in situ de nos cartes ARM7, actuellement utilisées dans les enseignements. Nous sommes en train d&#039;étudier la possibilité de la faire fonctionner avec la carte APF27.&lt;br /&gt;
&lt;br /&gt;
Nous ne manquerons pas de partager nos résultats, s&#039;il sont fructueux. Si, d&#039;ici là, quelqu&#039;un a une quelconque expérience pour brancher un JTAG sur la bête, je suis preneur !&lt;br /&gt;
&lt;br /&gt;
== What we do with APF27 ==&lt;br /&gt;
&lt;br /&gt;
We want to use APF27 board to port an OSEK/AUTOSAR real time kernel (called Trampoline [http://trampoline.rts-software.org/]). It will then be used to develop memory protection support (based on MMU) for this operating system.&lt;br /&gt;
&lt;br /&gt;
We use BDI2000 JTAG interface to debug our ARM7 boards, which are used in student&#039;s practices. We are looking for a way to use these interfaces with APF27.&lt;br /&gt;
&lt;br /&gt;
We will share our results as soon as we have any. Until then, if anyone has experienced JTAG connection with APF27 board, I&#039;m interested !&lt;br /&gt;
&lt;br /&gt;
== Bookmarks web ==&lt;br /&gt;
&lt;br /&gt;
; iMXdev.org (Wiki) : http://www.imxdev.org/wiki/index.php?title=Main_Page&lt;br /&gt;
&lt;br /&gt;
; documentation iMX27 sur Freescale : http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX27&amp;amp;fpsp=1&amp;amp;tab=Documentation_Tab&lt;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6215</id>
		<title>User:JonathanI</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6215"/>
		<updated>2009-03-23T15:37:18Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: /* Fiche d&amp;#039;identité / Identity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fiche d&#039;identité / Identity ==&lt;br /&gt;
&lt;br /&gt;
* Nom : Jonathan ILIAS-PILLET&lt;br /&gt;
* Emploi : Enseignant-chercheur à l&#039;[http://www.eseo.fr/ ESEO] (Angers) / associate professor at ESEO (Angers, France)&lt;br /&gt;
* email : jonathan.ilias@eseo.fr&lt;br /&gt;
* jid : ismael@im.chouppy.net&lt;br /&gt;
&lt;br /&gt;
== Ce que nous faisons avec la carte APF27 ==&lt;br /&gt;
&lt;br /&gt;
Nous étudions la possibilité d&#039;utiliser la carte APF27 pour le portage d&#039;un noyau temps réel OSEK/AUTOSAR (Trampoline [http://trampoline.rts-software.org/]). Elle servirait ainsi de base pour le développement de la protection mémoire de ce système d&#039;exploitation.&lt;br /&gt;
&lt;br /&gt;
Nous utilisons la sonde BDI2000 (JTAG) pour le débuggage in situ de nos cartes ARM7, actuellement utilisées dans les enseignements. Nous sommes en train d&#039;étudier la possibilité de la faire fonctionner avec la carte APF27.&lt;br /&gt;
&lt;br /&gt;
Nous ne manquerons pas de partager nos résultats, s&#039;il sont fructueux. Si, d&#039;ici là, quelqu&#039;un a une quelconque expérience pour brancher un JTAG sur la bête, je suis preneur !&lt;br /&gt;
&lt;br /&gt;
== What we do with APF27 ==&lt;br /&gt;
&lt;br /&gt;
We want to use APF27 board to port an OSEK/AUTOSAR real time kernel (called Trampoline [http://trampoline.rts-software.org/]). It will then be used to develop memory protection support (based on MMU) for this operating system.&lt;br /&gt;
&lt;br /&gt;
We use BDI2000 JTAG interface to debug our ARM7 boards, which are used in student&#039;s practices. We are looking for a way to use these interfaces with APF27.&lt;br /&gt;
&lt;br /&gt;
We will share our results as soon as we have any. Until then, if anyone has experienced JTAG connection with APF27 board, I&#039;m interested !&lt;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6214</id>
		<title>User:JonathanI</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6214"/>
		<updated>2009-03-23T15:36:50Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fiche d&#039;identité / Identity ==&lt;br /&gt;
&lt;br /&gt;
* Nom : Jonathan ILIAS-PILLET&lt;br /&gt;
* Emploi : Enseignant-chercheur à l&#039;ESEO (Angers) / associate professor at ESEO (Angers, France)&lt;br /&gt;
* email : jonathan.ilias@eseo.fr&lt;br /&gt;
* jid : ismael@im.chouppy.net&lt;br /&gt;
&lt;br /&gt;
== Ce que nous faisons avec la carte APF27 ==&lt;br /&gt;
&lt;br /&gt;
Nous étudions la possibilité d&#039;utiliser la carte APF27 pour le portage d&#039;un noyau temps réel OSEK/AUTOSAR (Trampoline [http://trampoline.rts-software.org/]). Elle servirait ainsi de base pour le développement de la protection mémoire de ce système d&#039;exploitation.&lt;br /&gt;
&lt;br /&gt;
Nous utilisons la sonde BDI2000 (JTAG) pour le débuggage in situ de nos cartes ARM7, actuellement utilisées dans les enseignements. Nous sommes en train d&#039;étudier la possibilité de la faire fonctionner avec la carte APF27.&lt;br /&gt;
&lt;br /&gt;
Nous ne manquerons pas de partager nos résultats, s&#039;il sont fructueux. Si, d&#039;ici là, quelqu&#039;un a une quelconque expérience pour brancher un JTAG sur la bête, je suis preneur !&lt;br /&gt;
&lt;br /&gt;
== What we do with APF27 ==&lt;br /&gt;
&lt;br /&gt;
We want to use APF27 board to port an OSEK/AUTOSAR real time kernel (called Trampoline [http://trampoline.rts-software.org/]). It will then be used to develop memory protection support (based on MMU) for this operating system.&lt;br /&gt;
&lt;br /&gt;
We use BDI2000 JTAG interface to debug our ARM7 boards, which are used in student&#039;s practices. We are looking for a way to use these interfaces with APF27.&lt;br /&gt;
&lt;br /&gt;
We will share our results as soon as we have any. Until then, if anyone has experienced JTAG connection with APF27 board, I&#039;m interested !&lt;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6213</id>
		<title>User:JonathanI</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6213"/>
		<updated>2009-03-23T15:36:32Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fiche d&#039;identité ==&lt;br /&gt;
&lt;br /&gt;
* Nom : Jonathan ILIAS-PILLET&lt;br /&gt;
* Emploi : Enseignant-chercheur à l&#039;ESEO (Angers) / associate professor at ESEO (Angers, France)&lt;br /&gt;
* email : jonathan.ilias@eseo.fr&lt;br /&gt;
* jid : ismael@im.chouppy.net&lt;br /&gt;
&lt;br /&gt;
== Ce que nous faisons avec la carte APF27 ==&lt;br /&gt;
&lt;br /&gt;
Nous étudions la possibilité d&#039;utiliser la carte APF27 pour le portage d&#039;un noyau temps réel OSEK/AUTOSAR (Trampoline [http://trampoline.rts-software.org/]). Elle servirait ainsi de base pour le développement de la protection mémoire de ce système d&#039;exploitation.&lt;br /&gt;
&lt;br /&gt;
Nous utilisons la sonde BDI2000 (JTAG) pour le débuggage in situ de nos cartes ARM7, actuellement utilisées dans les enseignements. Nous sommes en train d&#039;étudier la possibilité de la faire fonctionner avec la carte APF27.&lt;br /&gt;
&lt;br /&gt;
Nous ne manquerons pas de partager nos résultats, s&#039;il sont fructueux. Si, d&#039;ici là, quelqu&#039;un a une quelconque expérience pour brancher un JTAG sur la bête, je suis preneur !&lt;br /&gt;
&lt;br /&gt;
== What we do with APF27 ==&lt;br /&gt;
&lt;br /&gt;
We want to use APF27 board to port an OSEK/AUTOSAR real time kernel (called Trampoline [http://trampoline.rts-software.org/]). It will then be used to develop memory protection support (based on MMU) for this operating system.&lt;br /&gt;
&lt;br /&gt;
We use BDI2000 JTAG interface to debug our ARM7 boards, which are used in student&#039;s practices. We are looking for a way to use these interfaces with APF27.&lt;br /&gt;
&lt;br /&gt;
We will share our results as soon as we have any. Until then, if anyone has experienced JTAG connection with APF27 board, I&#039;m interested !&lt;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6212</id>
		<title>User:JonathanI</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=User:JonathanI&amp;diff=6212"/>
		<updated>2009-03-23T15:28:47Z</updated>

		<summary type="html">&lt;p&gt;JonathanI: New page: * Nom : Jonathan ILIAS-PILLET * Emploi : Enseignant-chercheur à l&amp;#039;ESEO (Angers). * email : jonathan.ilias@eseo.fr * jid : ismael@im.chouppy.net  Nous étudions la possibilité d&amp;#039;utiliser ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Nom : Jonathan ILIAS-PILLET&lt;br /&gt;
* Emploi : Enseignant-chercheur à l&#039;ESEO (Angers).&lt;br /&gt;
* email : jonathan.ilias@eseo.fr&lt;br /&gt;
* jid : ismael@im.chouppy.net&lt;br /&gt;
&lt;br /&gt;
Nous étudions la possibilité d&#039;utiliser la carte APF27 pour le portage d&#039;un noyau temps réel OSEK/AUTOSAR (Trampoline [http://trampoline.rts-software.org/]). Elle servirait ainsi de base pour le développement de la protection mémoire de ce système d&#039;exploitation.&lt;br /&gt;
&lt;br /&gt;
Nous utilisons la sonde BDI2000 (JTAG) pour le débuggage in situ de nos cartes ARM7, actuellement utilisées dans les enseignements. Nous sommes en train d&#039;étudier la possibilité de la faire fonctionner avec la carte APF27.&lt;br /&gt;
&lt;br /&gt;
Nous ne manquerons pas de partager nos résultats, s&#039;il sont fructueux. Si, d&#039;ici là, quelqu&#039;un a une quelconque expérience pour brancher un JTAG sur la bête, je suis preneur !&lt;/div&gt;</summary>
		<author><name>JonathanI</name></author>
	</entry>
</feed>