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

	<entry>
		<id>http://www.ethernut.de/nutwiki/index.php?title=Hardware/EIR/OpenOCD/CPU&amp;diff=397&amp;oldid=prev</id>
		<title>Harald: Created page with &quot;&lt;div id=&quot;content&quot;&gt;  = OpenOCD for AT91SAM7SE - Part 3 =  This is part 3 of our OpenOCD for AT91SAM7SE tutorial.  == Configuring the CPU ==  === Declaring a TA...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.ethernut.de/nutwiki/index.php?title=Hardware/EIR/OpenOCD/CPU&amp;diff=397&amp;oldid=prev"/>
				<updated>2017-07-13T09:04:50Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div id=&amp;quot;content&amp;quot;&amp;gt;  = OpenOCD for AT91SAM7SE - Part 3 =  This is part 3 of our &lt;a href=&quot;/nutwiki/index.php?title=Openocd.html&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Openocd.html (page does not exist)&quot;&gt;OpenOCD for AT91SAM7SE tutorial&lt;/a&gt;.  == Configuring the CPU ==  === Declaring a TA...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div id=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OpenOCD for AT91SAM7SE - Part 3 =&lt;br /&gt;
&lt;br /&gt;
This is part 3 of our [[openocd.html|OpenOCD for AT91SAM7SE tutorial]].&lt;br /&gt;
&lt;br /&gt;
== Configuring the CPU ==&lt;br /&gt;
&lt;br /&gt;
=== Declaring a TAP ===&lt;br /&gt;
&lt;br /&gt;
In the last part OpenOCD suggested to add a &amp;lt;code&amp;gt;jtag newtap&amp;lt;/code&amp;gt; command to the configuration. Its general form is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;jtag newtap &amp;amp;lt;chipname&amp;amp;gt; &amp;amp;lt;tapname&amp;amp;gt; &amp;amp;lt;options&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
We just need to fill out the parameters given in angle brackets. They have the following meanings.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Parameter&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| chipname&lt;br /&gt;
| A board may contain several chips with JTAG interfaces. You must specify unique chip names to identify each of them.&lt;br /&gt;
|-&lt;br /&gt;
| tapname&lt;br /&gt;
| A chip may contain several test access points (TAPs). You must specify a unique TAP names to identify each of them.&lt;br /&gt;
|-&lt;br /&gt;
| options&lt;br /&gt;
| At least, we must specify the length of the JTAG instruction register of the TAP, using the option &amp;lt;code&amp;gt;-irlen&amp;lt;/code&amp;gt;. It is also a good idea to let OpenOCD know the expected JTAG ID-Code using the option &amp;lt;code&amp;gt;-expected-id&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Remember the output we got at the end of the last part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!&lt;br /&gt;
Warn : AUTO auto0.tap - use &amp;amp;quot;jtag newtap auto0 tap -expected-id 0x3f0f0f0f ...&amp;amp;quot;&lt;br /&gt;
Warn : AUTO auto0.tap - use &amp;amp;quot;... -irlen 4&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
In most cases the autoprobe feature works quite well and OpenOCD suggests to use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;jtag newtap auto tap -irlen 4 -expected-id 0x3f0f0f0f&amp;lt;/pre&amp;gt;&lt;br /&gt;
For the AT91SAM7SE512 let's replace the chip name &amp;lt;code&amp;gt;auto&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;sam7se512&amp;lt;/code&amp;gt; and the TAP name &amp;lt;code&amp;gt;tap&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;cpu&amp;lt;/code&amp;gt;. This gives the following line, which you should add to your existing openocd.cfg. Btw. you can stop the running OpenOCD executable with Ctrl-C.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;jtag newtap sam7se512 cpu -irlen 4 -expected-id 0x3f0f0f0f&amp;lt;/pre&amp;gt;&lt;br /&gt;
We may later refer to this specific TAP by its dotted name &amp;lt;code&amp;gt;sam7se512.cpu&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Starting OpenOCD with this modified configuration should produce the following output&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;Open On-Chip Debugger 0.6.0-rc1 (2012-08-08-20:04)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
        http://openocd.sourceforge.net/doc/doxygen/bugs.html&lt;br /&gt;
Info : only one transport option; autoselect 'jtag'&lt;br /&gt;
8 kHz&lt;br /&gt;
Info : device: 4 &amp;amp;quot;2232C&amp;amp;quot;&lt;br /&gt;
Info : deviceID: 67354056&lt;br /&gt;
Info : SerialNumber: TLVE8EUJA&lt;br /&gt;
Info : Description: Turtelizer JTAG/RS232 Adapter A&lt;br /&gt;
Info : clock speed 8 kHz&lt;br /&gt;
Info : JTAG tap: sam7se512.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)&lt;br /&gt;
Warn : gdb services need one or more targets defined&amp;lt;/pre&amp;gt;&lt;br /&gt;
We still have one warning, which will be handled next.&lt;br /&gt;
&lt;br /&gt;
=== Declaring a Debug Target ===&lt;br /&gt;
&lt;br /&gt;
Some of you may simply want to use OpenOCD to flash a target board, but in the first place it has been created for debugging. So far we have configured the JTAG interface only, nothing is known about CPU internals.&lt;br /&gt;
&lt;br /&gt;
While OpenOCD is mainly used with ARM CPUs, it supports a few other targets, more or less well. Controlling different targets via JTAG is complicated. For example, targets may be switched to different modes or states, may or may not have an MMU and even a simple reset may result in a number of side effects, which are not always trivial to handle. Even if it would have been limited to ARM cores, there are quite many variants with totally different features.&lt;br /&gt;
&lt;br /&gt;
As a result, most of OpenOCD's knowledge about target CPUs has been hard coded and you select the right routines by simply telling OpenOCD, which kind of chip it is connected to at a given TAP, using the configuration command &amp;lt;code&amp;gt;target create&amp;lt;/code&amp;gt;. Its general form is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;target create &amp;amp;lt;targetname&amp;amp;gt; &amp;amp;lt;type&amp;amp;gt; &amp;amp;lt;options&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The meaning of the parameters is given in the following table.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Parameter&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| targetname&lt;br /&gt;
| The name that will be used to access this target. By convention the same dotted name as for the TAP is used here.&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| This is the important option, which let's OpenOCD know the type of chip to control. For the AT91SAM7SE we specify &amp;lt;code&amp;gt;arm7tdmi&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| options&lt;br /&gt;
| Several options are available to further specify the chip variant and to provide additional information about the target. At least one option is mandantory, the &amp;lt;code&amp;gt;-chain-position&amp;lt;/code&amp;gt;, which tells OpenOCD the name of the TAP this target is attached at.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For the AT91SAM7SE512 we should use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;target create sam7se512.cpu arm7tdmi -chain-position sam7se512.cpu&amp;lt;/pre&amp;gt;&lt;br /&gt;
After adding this line to the openocd.cfg (don't forget to save it), OpenOCD should start running without any more errors or warnings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;Open On-Chip Debugger 0.6.0-rc1 (2012-08-08-20:04)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
        http://openocd.sourceforge.net/doc/doxygen/bugs.html&lt;br /&gt;
Info : only one transport option; autoselect 'jtag'&lt;br /&gt;
8 kHz&lt;br /&gt;
sam7se512.cpu&lt;br /&gt;
Info : device: 4 &amp;amp;quot;2232C&amp;amp;quot;&lt;br /&gt;
Info : deviceID: 67354056&lt;br /&gt;
Info : SerialNumber: TLVE8EUJA&lt;br /&gt;
Info : Description: Turtelizer JTAG/RS232 Adapter A&lt;br /&gt;
Info : clock speed 8 kHz&lt;br /&gt;
Info : JTAG tap: sam7se512.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)&lt;br /&gt;
Info : Embedded ICE version 1&lt;br /&gt;
Info : sam7se512.cpu: hardware has 2 breakpoint/watchpoint units&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, the complete contents of your openocd.cfg should be&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;coding&amp;quot;&amp;gt;interface ft2232&lt;br /&gt;
ft2232_layout turtelizer2&lt;br /&gt;
ft2232_device_desc &amp;amp;quot;Turtelizer JTAG/RS232 Adapter&amp;amp;quot;&lt;br /&gt;
adapter_khz 8&lt;br /&gt;
jtag newtap sam7se512 cpu -irlen 4 -expected-id 0x3f0f0f0f&lt;br /&gt;
target create sam7se512.cpu arm7tdmi -chain-position sam7se512.cpu&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, replacing the first line with &amp;lt;code&amp;gt;interface turtle&amp;lt;/code&amp;gt; when using the Turtelizer support package.&lt;br /&gt;
&lt;br /&gt;
Are you bored? Don't worry, hard times are ahead. In the next part you will learn how to configure the PLL of the EIR board. Dig out the AT91SAM7SE data sheet now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Harald</name></author>	</entry>

	</feed>