<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;feed=atom&amp;action=history</id>
		<title>OpenOCD Config File Paths - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;action=history"/>
		<updated>2013-05-23T20:08:48Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;diff=133694&amp;oldid=prev</id>
		<title>Wmat: fixed a broken wiki link</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;diff=133694&amp;oldid=prev"/>
				<updated>2012-05-28T18:25:13Z</updated>
		
		<summary type="html">&lt;p&gt;fixed a broken wiki link&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:25, 28 May 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; openocd -f interface/flyswatter2.cfg -f board/hammer.cfg&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; openocd -f interface/flyswatter2.cfg -f board/hammer.cfg&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you do not supply any config files with the -f switch, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/del&gt;[[OpenOCD]] attempts to load a config file called '''openocd.cfg'''. This file is not supplied by default; you must write or supply it yourself. If [[OpenOCD]] cannot find this file, it prints an error and exits.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you do not supply any config files with the -f switch, [[OpenOCD]] attempts to load a config file called '''openocd.cfg'''. This file is not supplied by default; you must write or supply it yourself. If [[OpenOCD]] cannot find this file, it prints an error and exits.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Default Locations for Config Files==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Default Locations for Config Files==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;diff=118922&amp;oldid=prev</id>
		<title>Wmat: Adding proper categories</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;diff=118922&amp;oldid=prev"/>
				<updated>2012-04-18T03:33:07Z</updated>
		
		<summary type="html">&lt;p&gt;Adding proper categories&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:33, 18 April 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;...then it looks looks for '''tcl/target/samsung_s3c2410.cfg''' and finds the file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;...then it looks looks for '''tcl/target/samsung_s3c2410.cfg''' and finds the file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:TinCanTools]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:OpenOCD]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;diff=111782&amp;oldid=prev</id>
		<title>Wmat: Porting the TCT content.</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=OpenOCD_Config_File_Paths&amp;diff=111782&amp;oldid=prev"/>
				<updated>2012-03-30T00:32:17Z</updated>
		
		<summary type="html">&lt;p&gt;Porting the TCT content.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Config File Basics==&lt;br /&gt;
&lt;br /&gt;
Each time you use [[OpenOCD]] you will need to configure it by passing it paths to configuration files. In the [[OpenOCD]] 0.4.0 release, these files are found in '''openocd-0.4.0/tcl''' and its subdirectories. From the '''tcl''' directory, the configuration file for the Flyswatter is at '''interface/flyswatter.cfg'''. The file for the TinCanTools Hammer is at '''board/hammer.cfg'''. If your copy of [[OpenOCD]] includes support for the Flyswatter2, its config file is at '''interface/flyswatter2.cfg'''.&lt;br /&gt;
&lt;br /&gt;
When you start [[OpenOCD]], you tell it to use the config files for your hardware with the '''-f''' switch, like this:&lt;br /&gt;
&lt;br /&gt;
 openocd -f path_to/cfg_file [-f path_to/other_cfg_file]&lt;br /&gt;
&lt;br /&gt;
For example, suppose you want to run [[OpenOCD]] for the TinCanTools Flyswatter2 and Hammer board. The current directory contains the [[OpenOCD]] executable and the '''board''', '''interface''', and '''target''' directories provided with the OpenOCD source. You would type:&lt;br /&gt;
&lt;br /&gt;
 openocd -f interface/flyswatter2.cfg -f board/hammer.cfg&lt;br /&gt;
&lt;br /&gt;
If you do not supply any config files with the -f switch, [[[OpenOCD]] attempts to load a config file called '''openocd.cfg'''. This file is not supplied by default; you must write or supply it yourself. If [[OpenOCD]] cannot find this file, it prints an error and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Default Locations for Config Files==&lt;br /&gt;
&lt;br /&gt;
The [[OpenOCD]] source comes with config files in three different locations.  &lt;br /&gt;
&lt;br /&gt;
* openocd/tcl/target&lt;br /&gt;
* openocd/tcl/interface&lt;br /&gt;
* openocd/tcl/board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you compile [[OpenOCD]], the '''make install''' command copies the config files in three additional locations.&lt;br /&gt;
&lt;br /&gt;
* /usr/local/share/openocd/scripts/target&lt;br /&gt;
* /usr/local/share/openocd/scripts/interface&lt;br /&gt;
* /usr/local/share/openocd/scripts/board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you compile [[OpenOCD]] for Windows using Cygwin, these paths are within Cygwin. The full Windows paths would be '''C:\cygwin\usr\local\share\openocd\scripts\target''' and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Searching Additional Directories: The -s Switch==&lt;br /&gt;
&lt;br /&gt;
You can tell [[OpenOCD]] to look for config files in a directory using the '''-s''' command line switch, like this:&lt;br /&gt;
&lt;br /&gt;
 openocd -s path/to/dir_with_cfg_files -f cfg_file.cfg&lt;br /&gt;
&lt;br /&gt;
The search path can be absolute, or relative to the current directory. For example, suppose you have just finished compiling [[OpenOCD]]. The '''openocd''' executable is located in '''openocd/src''' and the config files are in '''openocd/tcl'''. You want to run [[OpenOCD]] with the Flyswatter and Hammer board. From '''openocd/src''', you run [[OpenOCD]] as follows:&lt;br /&gt;
&lt;br /&gt;
 openocd -s ../tcl -f interface/flyswatter.cfg -f board/hammer.cfg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==File Locations==&lt;br /&gt;
&lt;br /&gt;
When [[OpenOCD]] searches for a config file, it looks in the following locations, in order:&lt;br /&gt;
&lt;br /&gt;
# The current directory&lt;br /&gt;
# Any additional directories you supply with the '''-s''' switch&lt;br /&gt;
# Any additional directories added with OpenOCD's '''add_script_search_dir''' command&lt;br /&gt;
# ''Linux/Cygwin Only:'' The hidden directory '''.openocd''' in your home directory&lt;br /&gt;
# ''Linux/Cygwin Only:'' The directory '''/usr/local/share/openocd/scripts''' (created in '''/usr/local/share''' when you compile OpenOCD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the config file exists in more than one location, [[OpenOCD]] uses the first one found. This is especially important if you have more than one copy of the same config file on your computer. If you need to change a config file, make sure your place it where OpenOCD will use it in preference to other versions of the file.&lt;br /&gt;
&lt;br /&gt;
On Windows the last two locations will only be available if you run OpenOCD from within Cygwin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Loading Config Files from Other Config Files==&lt;br /&gt;
&lt;br /&gt;
Some config files load other config files. For example, the config file for the Hammer, '''hammer.cfg''', contains this line:&lt;br /&gt;
&lt;br /&gt;
 source [find target/samsung_s3c2410.cfg]&lt;br /&gt;
&lt;br /&gt;
When [[OpenOCD]] loads '''hammer.cfg''', it also tries to load '''target/samsung_s3c2410.cfg''' and gives an error if it cannot find this file. You need to ensure that [[OpenOCD]] can find this file from one of its search directories. If you have your config files in the default '''openocd/tcl''' directory, the executable in '''openocd/src''', and you run [[OpenOCD]] like this:&lt;br /&gt;
&lt;br /&gt;
 openocd -s ../tcl/board -s ../tcl/interface -f flyswatter.cfg -f hammer.cfg&lt;br /&gt;
&lt;br /&gt;
...then OpenOCD won't find '''target/samsung_s3c2410.cfg'''. It searches for '''/tcl/board/target''' and '''/tcl/interface/target''' but doesn't find either. However, if you run [[OpenOCD]] like this:&lt;br /&gt;
&lt;br /&gt;
  openocd -s ../tcl -f interface/flyswatter.cfg -f board/hammer.cfg&lt;br /&gt;
&lt;br /&gt;
...then it looks looks for '''tcl/target/samsung_s3c2410.cfg''' and finds the file.&lt;/div&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	</feed>