<?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=Compiling_OpenOCD_v04_Linux_D2XX&amp;feed=atom&amp;action=history</id>
		<title>Compiling OpenOCD v04 Linux D2XX - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=Compiling_OpenOCD_v04_Linux_D2XX&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Compiling_OpenOCD_v04_Linux_D2XX&amp;action=history"/>
		<updated>2013-05-22T15:21:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=Compiling_OpenOCD_v04_Linux_D2XX&amp;diff=118838&amp;oldid=prev</id>
		<title>Wmat: Adding proper categories</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Compiling_OpenOCD_v04_Linux_D2XX&amp;diff=118838&amp;oldid=prev"/>
				<updated>2012-04-18T03:22:33Z</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:22, 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 108:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 108:&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;You can now run [[OpenOCD]] from '''/home/USERNAME/openocd-bin'''. To get started running OpenOCD, see [[Running OpenOCD on Linux]].&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;You can now run [[OpenOCD]] from '''/home/USERNAME/openocd-bin'''. To get started running OpenOCD, see [[Running OpenOCD on Linux]].&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;!-- diff cache key elinux:diff:version:1.11a:oldid:111896:newid:118838 --&gt;
&lt;/table&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=Compiling_OpenOCD_v04_Linux_D2XX&amp;diff=111896&amp;oldid=prev</id>
		<title>Wmat: Porting the TCT content.</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Compiling_OpenOCD_v04_Linux_D2XX&amp;diff=111896&amp;oldid=prev"/>
				<updated>2012-03-30T01:27: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;This guide will compile [[OpenOCD]] 0.4.0 for Ubuntu 10.04 with the FTD2XX driver library, for use with the TinCanTools Flyswatter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Packages==&lt;br /&gt;
&lt;br /&gt;
You will need to install several packages to compile and run [[OpenOCD]]. Open a terminal window ('''Applications menu &amp;gt; Accessories &amp;gt; Terminal''') and type:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libtool&lt;br /&gt;
 sudo apt-get install autoconf&lt;br /&gt;
 sudo apt-get install texinfo&lt;br /&gt;
 sudo apt-get install libusb-dev&lt;br /&gt;
&lt;br /&gt;
If you prefer to compile libusb yourself, you can find the source at http://sourceforge.net/projects/libusb/files/libusb-1.0/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing libFTD2XX==&lt;br /&gt;
&lt;br /&gt;
Download version 0.4.16 of the D2XX Linux drivers from http://www.ftdichip.com. Direct link is here: http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.16.tar.gz. This is not the most recent version of the ftd2xx library, but you will need the older version. Extract the contents to your home directory ('''/home/USERNAME''', replacing USERNAME with your username.)&lt;br /&gt;
&lt;br /&gt;
In the terminal window, navigate to '''~/libftd2xx0.4.16/sample''' and copy the files '''ftd2xx.h''' and '''WinTypes.h''' to '''/usr/include'''. Then navigate to '''/usr/local/include''' and create symbolic links to the header files.&lt;br /&gt;
&lt;br /&gt;
 cd ~/libftd2xx0.4.16/sample&lt;br /&gt;
 sudo cp ftd2xx.h /usr/include&lt;br /&gt;
 sudo cp WinTypes.h /usr/include&lt;br /&gt;
 cd /usr/local/include&lt;br /&gt;
 sudo ln -s /usr/include/ftd2xx.h ftd2xx.h&lt;br /&gt;
 sudo ln -s /usr/include/WinTypes.h WinTypes.h&lt;br /&gt;
&lt;br /&gt;
Now return to the '''~/libftd2xx0.4.16''' directory and copy the library file to '''/usr/local/lib'''. Then create symbolic links to the file in '''/usr/lib''' and '''/usr/local/lib''':&lt;br /&gt;
&lt;br /&gt;
 cd ~/libftd2xx0.4.16&lt;br /&gt;
 sudo cp libftd2xx.so.0.4.16 /usr/local/lib&lt;br /&gt;
 cd /usr/local/lib&lt;br /&gt;
 sudo ln -s libftd2xx.so.0.4.16 libftd2xx.so.0&lt;br /&gt;
 sudo ln -s libftd2xx.so.0.4.16 libftd2xx.so&lt;br /&gt;
 cd /usr/lib&lt;br /&gt;
 sudo ln -s /usr/local/lib/libftd2xx.so.0.4.16 libftd2xx.so.0&lt;br /&gt;
 sudo ln -s /usr/local/lib/libftd2xx.so.0.4.16 libftd2xx.so&lt;br /&gt;
&lt;br /&gt;
==Downloading OpenOCD==&lt;br /&gt;
&lt;br /&gt;
Download the [[OpenOCD]] 0.4.0 source from http://prdownload.berlios.de/openocd/openocd-0.4.0.tar.gz and extract '''openocd-0.4.0''' to your home directory ('''/home/USERNAME/openocd-0.4.0). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FS3PATCH|UBUNTU1004}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Compiling OpenOCD==&lt;br /&gt;
&lt;br /&gt;
In the terminal window, navigate to the new folder containing the [[OpenOCD]] source and run the configure script.&lt;br /&gt;
&lt;br /&gt;
 cd ~/openocd-0.4.0&lt;br /&gt;
 sudo ./configure --disable-werror --enable-ft2232_ftd2xx --with-ftd2xx-linux-tardir=&amp;quot;../libftd2xx0.4.16&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This assumes that you followed this guide exactly and extracted libftd2xx0.4.16 to your '''/home/USERNAME''' directory, one level above the [[OpenOCD]] source. If this is not the case, change the value of '''--with-ftd2xx-linux-tardir''' to the path to your '''libftd2xx0.4.16''' directory.&lt;br /&gt;
&lt;br /&gt;
The configure script creates a makefile and a file called '''libtool''', which is used to compile [[OpenOCD]]. However, a bug in libtool causes the libopenocd and ftd2xx libraries to be compiled out of order, which will cause compile errors. To fix this, open libtool in a text editor...&lt;br /&gt;
&lt;br /&gt;
 sudo gedit libtool&lt;br /&gt;
&lt;br /&gt;
...and use the text editor's Find command to search for...&lt;br /&gt;
&lt;br /&gt;
 finalize_command=&amp;quot;$finalize_command $finalize_deplibs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This text should appear near the end of the file, at about line 7500. Directly under this line, add the following:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;compile_command='gcc -std=gnu99 -g -O2 -I~/libftd2xx0.4.16 -Wall -Wstrict-prototypes &lt;br /&gt;
 -Wformat-security -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -o openocd &lt;br /&gt;
 main.o ./.libs/libopenocd.a ~/libftd2xx0.4.16/static_lib/libftd2xx.a.0.4.16 -ldl -lpthread'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This puts the libopenocd and libftd2xx libraries in the correct order. ''Important:'' If you copy the above text directly from this page, be sure to delete the newlines from the text, so that it all appears as one line in libtool. The file paths in the code above assume that you have followed this guide exactly, and extracted libftd2xx to your '''/home''' directory. If this is not the case, change the file paths above to match the location of your '''libftd2xx0.4.16''' directory.&lt;br /&gt;
&lt;br /&gt;
Compile [[OpenOCD]] as follows:&lt;br /&gt;
&lt;br /&gt;
 sudo make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Preparing to Run OpenOCD==&lt;br /&gt;
&lt;br /&gt;
Navigate to '''~/openocd/src''' to find the '''openocd''' binary. You will need superuser priveleges to run [[OpenOCD]].&lt;br /&gt;
&lt;br /&gt;
You can run openocd from '''~/openocd-0.4.0/src''', but you may encounter problems with configuration files. For a more in-depth discussion of these issues, see [[OpenOCD Config File Paths]]. This guide recommends that you create a new directory containing OpenOCD and its config files.&lt;br /&gt;
&lt;br /&gt;
Create a new directory in '''/home/USERNAME''' called '''openocd-bin''', and copy the '''openocd''' binary and the contents of '''/home/USERNAME/openocd/tcl''' to the new directory. You can do this from the terminal window with the collowing commands:&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
 mkdir openocd-bin&lt;br /&gt;
 cd ~/openocd/tcl&lt;br /&gt;
 cp -r * ~/openocd-bin&lt;br /&gt;
 cd ~/openocd/src&lt;br /&gt;
 cp openocd ~/openocd-bin&lt;br /&gt;
&lt;br /&gt;
'''openocd-bin''' should now contain the following files and subdirectories:&lt;br /&gt;
&lt;br /&gt;
 board&lt;br /&gt;
 chip&lt;br /&gt;
 cpld&lt;br /&gt;
 cpu&lt;br /&gt;
 openocd&lt;br /&gt;
 interface&lt;br /&gt;
 target&lt;br /&gt;
 test&lt;br /&gt;
 bitsbytes.tcl&lt;br /&gt;
 mem_helper.tcl&lt;br /&gt;
 memory.tcl&lt;br /&gt;
 mmr_helpers.tcl&lt;br /&gt;
&lt;br /&gt;
You can now run [[OpenOCD]] from '''/home/USERNAME/openocd-bin'''. To get started running OpenOCD, see [[Running OpenOCD on Linux]].&lt;/div&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	</feed>