<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Michal&#039;s Blog</title>
	<atom:link href="http://michaldemin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaldemin.wordpress.com</link>
	<description>Electronics, software, things that matter.</description>
	<lastBuildDate>Fri, 23 Sep 2011 08:50:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='michaldemin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Michal&#039;s Blog</title>
		<link>http://michaldemin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://michaldemin.wordpress.com/osd.xml" title="Michal&#039;s Blog" />
	<atom:link rel='hub' href='http://michaldemin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Turnigy SuperBrain on Linux</title>
		<link>http://michaldemin.wordpress.com/2011/01/15/turnigy-superbrain-on-linux/</link>
		<comments>http://michaldemin.wordpress.com/2011/01/15/turnigy-superbrain-on-linux/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 13:33:41 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://michaldemin.wordpress.com/?p=69</guid>
		<description><![CDATA[Hobby king has been selling Turnigy SuperBrain Brushless motor controllers for quite some time. These BLDC motor controllers are unique for their functionality and price. Each of these units serves not only as controller but also logs various telemetry data of your system. The only problem with these motor controllers is, that the shipped software [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=69&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://hobbyking.com">Hobby king</a> has been selling Turnigy SuperBrain Brushless motor controllers for quite some time. These BLDC motor controllers are unique for their functionality and price. Each of these units serves not only as controller but also logs various telemetry data of your system.</p>
<p><span id="more-69"></span></p>
<p>The only problem with these motor controllers is, that the shipped software is Win32 only. The Link dongle as such, is simple USBRs232 converter with some microcontroller. The maximum transfer speed is 9600Bauds.</p>
<p>I have been playing with the Superbrain controller for some time, and decided to sniff every transaction there is. All my knowledge has been put into single project that aims to be replacement for stock software &#8211; Tgypytool &#8211; as I call it.</p>
<p>This tool can be downloaded from github <a href="http://github.com/robots/Tgypytool">http://github.com/robots/Tgypytool</a>. </p>
<p>What is supported:<br />
- configuration read/write<br />
- log read/clear<br />
- log settings (no access to this feature so far)<br />
- fw write (not tested yet)</p>
<p>The configuration is stored in text file, all available options are in the .py file. I suggest you first read out your config, and modify it. All values are stored as: parameter=value, each on its own line.</p>
<p>Log reading has been implemented. These devices store up to 8 run logs. Everytime log is downloaded, tgypytool splits the downloaded data into corresponding runs.</p>
<p>Another tool included is graphing tool. This tool should read downloaded log data and plot graphs of voltage, current, rpm, etc. I have yet to figure out how these values are calculated.</p>
<p>I have also included small README that includes small howto.</p>
<p>The playing with SuperBrains is not over, I have done little reverse engineering on the firmware &#8211; stay tuned for future post :-)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/michaldemin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/michaldemin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/michaldemin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/michaldemin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/michaldemin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/michaldemin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/michaldemin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/michaldemin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/michaldemin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/michaldemin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/michaldemin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/michaldemin.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/michaldemin.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/michaldemin.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=69&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://michaldemin.wordpress.com/2011/01/15/turnigy-superbrain-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9864c2316a0f689d6d43483c5025407c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">robots01</media:title>
		</media:content>
	</item>
		<item>
		<title>Zx Spectrum on FPGA with 17-inch LCD screen</title>
		<link>http://michaldemin.wordpress.com/2010/12/21/zx-spectrum-on-fpga-with-17-inch-lcd-screen/</link>
		<comments>http://michaldemin.wordpress.com/2010/12/21/zx-spectrum-on-fpga-with-17-inch-lcd-screen/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 16:36:55 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[FPGA]]></category>
		<category><![CDATA[LCD]]></category>

		<guid isPermaLink="false">http://michaldemin.wordpress.com/?p=49</guid>
		<description><![CDATA[Last time I went through junk in the basement I found old ZX spectrum.This was the time I got the great idea. Have the ZX spectrum implemented in FPGA. So after a bit of searching I found ZXgate project. This is exactly the project I have been looking for. It implements the peripherals of ZX [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=49&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last time I went through junk in the basement I found old ZX spectrum.This was the time I got the great idea. Have the ZX spectrum implemented in FPGA. So after a bit of searching I found <a href="http://zxgate.sourceforge.net/">ZXgate</a> project. This is exactly the project I have been looking for. It implements the peripherals of ZX Spectrum, just have to add CPU and some external parts.<br />
<a href="http://michaldemin.files.wordpress.com/2010/12/img2500.jpg"><img src="http://michaldemin.files.wordpress.com/2010/12/img2500.jpg?w=300&#038;h=200" alt="" title="Space raiders" width="300" height="200" class="aligncenter size-medium wp-image-62" /></a><br />
<span id="more-49"></span></p>
<p>In meantime, while I was gathering information. I received a LCD screen from a broken notebook. 17inch TFT LCD screen  with resolution of 1024&#215;768 and 18bit colors. Calculated refresh rate 60 Hz. This looked like great opportunity to learn something new, and to create something cool. I decided to use the LCD as ZX spectrum display.</p>
<p>As for the hardware part I had this SparkFun&#8217;s <a href="http://www.sparkfun.com/products/8458">Spartan 3 breakout board</a>. 500k gate FPGA that should be big enough most home made projects. This board as such is without any external RAM and Flash ROM, except for the SPI Flash.</p>
<p>I needed to design RAM board that goes with the FPGA breakout board. One of the cheapest SRAM available from Farnell is AS7C3256 &#8211; 32kx8 10ns SRAM. I decided to go with 2 chips. 64k doesn&#8217;t seem much these days, but is plenty for ZX Spectrum. 64k is the size of Z80 address space.</p>
<p>The IO board was inspired by ZXgate&#8217;s zxio board. The original design was using through-hole parts and contained one Reset button, Composite out (B/W only), PS/2 keyboard and Tape connection. I have redesigned it to SMD parts and also added speaker, 2 LEDs and NMI button.</p>
<p>The last board contains LVDS transmitter from TI &#8211; SN65LVDS84. This is the key component that sends data to my TFT LCD panel. I am not sure (and not experienced enough) whether the FPGA would be able to drive the LVDS on its own.</p>
<p>If someone is interested in the board designs I have them in eagle format,</p>
<p>The ZXgate project ran by it&#8217;s own without any major modifications. I just didn&#8217;t like the idea of having external ROM for the Spectrum. I have placed the ROM code in the BRAM of the FPGA, and preloaded the BRAM with the correct data.</p>
<p>After deploying of the VHDL I saw Sinclair copyright. Really great feeling If you ask :-). But the computer behaved strangely &#8211; it died after ~5 seconds. After reprogramming of the FPGA same behavior repeated. It turned out to be result of my fight with the FpgaPlanner tool and I forgot to enable pull-ups on the buttons &#8211; duh.</p>
<p>Next step was to add the LCD panel controller. The LCD controller is pretty straight-forward once you understand what &#8220;DE-mode&#8221; is. It turns out that current LCDs don&#8217;t need two H/V sync signals and have just one signal &#8211; Data Enable. You still need to over-scan the screen by ~300pixels horizontally and ~100lines vertically, but over-scanning means to just keep clock running. DE signal it high only when pixel data is sent to the screen (low when off-screen).</p>
<p>Nice thing about 1024&#215;768 screen is that ZX spectrum&#8217;s screen (256&#215;192) fits there 4 times. So each pixel is displayed as 4&#215;4 dot. The border is not displayed on the LCD, as it does not display anything valuable, except for the loading curtain.</p>
<p>The whole screen generator consists of 2 counters &#8211; horizontal and vertical and some logic that copies data from the Vram to screen. Both counters are used in address generation. Actual data is transfered even when off-screen, but the LCD panel ignores them.</p>
<p>I have replaced the VRAM and ARAM (video and attribute ram) with Dual port RAM. This way the ZX spectrum works uninterrupted and my display routine works on it&#8217;s own.<br />
The result looks something like this:<br />
<a href="http://michaldemin.files.wordpress.com/2010/12/img2496.jpg"><img src="http://michaldemin.files.wordpress.com/2010/12/img2496.jpg?w=300&#038;h=200" alt="FPGA setup" title="FPGA setup" width="300" height="200" class="aligncenter size-medium wp-image-54" /></a><br />
The FPGA board with the extension boards attached:<br />
<a href="http://michaldemin.files.wordpress.com/2010/12/img2506.jpg"><img src="http://michaldemin.files.wordpress.com/2010/12/img2506.jpg?w=300&#038;h=200" alt="" title="FPGA board" width="300" height="200" class="aligncenter size-medium wp-image-56" /></a></p>
<p>There are still many improvements to be done. I plan to store some applications to the SPI Flash that holds FPGA configuration. The FPGA needs about 250k bytes for it&#8217;s configuration and the SPI Flash size is ~2MB. Lot of space wasted.<br />
I might reuse the loading menu from <a href="http://speccyboot.sourceforge.net">SpecyBoot</a>. This project aims to add Ethernet connection to spectrum and uses nice menu to browse the network repository. Of course I will not add network logic to the FPGA as I want the system to be portable.<br />
If you are interested watch for updates, I will post updated when some time is left.</p>
<p>ISE project can be downloaded <a href="http://robot.mysteria.cz/zxspectrum.tar.bz2">HERE</a><br />
Missing ROMs <a href="http://robot.mysteria.cz/roms.zip">HERE</a><br />
I am really not sure by the licenses. If there is something wrong with sharing source I should not have, please contact me, and I will remove the offending material asap. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/michaldemin.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/michaldemin.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/michaldemin.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/michaldemin.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/michaldemin.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/michaldemin.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/michaldemin.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/michaldemin.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/michaldemin.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/michaldemin.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/michaldemin.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/michaldemin.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/michaldemin.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/michaldemin.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=49&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://michaldemin.wordpress.com/2010/12/21/zx-spectrum-on-fpga-with-17-inch-lcd-screen/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9864c2316a0f689d6d43483c5025407c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">robots01</media:title>
		</media:content>

		<media:content url="http://michaldemin.files.wordpress.com/2010/12/img2500.jpg?w=300" medium="image">
			<media:title type="html">Space raiders</media:title>
		</media:content>

		<media:content url="http://michaldemin.files.wordpress.com/2010/12/img2496.jpg?w=300" medium="image">
			<media:title type="html">FPGA setup</media:title>
		</media:content>

		<media:content url="http://michaldemin.files.wordpress.com/2010/12/img2506.jpg?w=300" medium="image">
			<media:title type="html">FPGA board</media:title>
		</media:content>
	</item>
		<item>
		<title>FreeRTOS + newlib on Cortex-M3</title>
		<link>http://michaldemin.wordpress.com/2010/03/09/freertos-newlib-on-cortex-m3/</link>
		<comments>http://michaldemin.wordpress.com/2010/03/09/freertos-newlib-on-cortex-m3/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 20:59:27 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[STM32]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[FreeRTOS]]></category>

		<guid isPermaLink="false">http://michaldemin.wordpress.com/?p=34</guid>
		<description><![CDATA[You have probably noticed there is more power in the STM32 processors than simple tasks can use. In this case you probably want to run some more &#8220;tasks&#8221;. FreeRTOS has just the stuff you need &#8211; tasks, mutexes/semaphores, queues. Unfortunately I ran into trouble with newlib and FreeRTOS not playing nicely as they should. Memory [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=34&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You have probably noticed there is more power in the STM32 processors than simple tasks can use. In this case you probably want to run some more &#8220;tasks&#8221;.<br />
<a href="http://www.freertos.org/">FreeRTOS</a> has just the stuff you need &#8211; tasks, mutexes/semaphores, queues.<br />
Unfortunately I ran into trouble with newlib and FreeRTOS not playing nicely as they should. Memory allocation (malloc) didn&#8217;t work as expected and caused the CPU to Bus-Fault. Then I realized there is another allocator in the FreeRTOS, and why does one need 2 allocators on embeded system ?</p>
<p><span id="more-34"></span></p>
<p>First of all, you need to be sure that you compiled newlib with something like (MALLOC_PROVIDED being the important here)<br />
<code><br />
make CFLAGS_FOR_TARGET="-msoft-float -DMALLOC_PROVIDED" CCASFLAGS="-msoft-float -DMALLOC_PROVIDED"<br />
</code><br />
By doing this you tell newlib that you are going to provide malloc and friends (that includes: free, realloc, calloc)</p>
<p>Go ahead and fetch the sources of <a href="http://www.freertos.org/">FreeRTOS</a> from  <a href="http://sourceforge.net/project/showfiles.php?group_id=111543&amp;package_id=120544"> HERE</a>. Unpack them. Examples are taking the most of space in the package. Most of them are ready to compile (if you have the correct compiler/IDE)</p>
<p>Next thing you need is a &#8220;glue&#8221; that tells newlib to use the allocator of FreeRTOS. I suggest that you use heap2.c allocator. (allocator heap1.c is too simple for this use. Heap3.c uses external library, which could have been malloc from newlib, if it were working right :) )</p>
<p>The glue can be downloaded here: <a href="http://robot.mysteria.cz/alloc.c">alloc.c</a>.<br />
It implements functions like _malloc_r, _free_r, etc. (R standing for reentrant?) All of these functions are straight-forward, except realloc, that needs to copy some memory. I have not done very extensive testing on this. The state is now &#8220;Works-For-ME&#8221;, so far I have tested sprintf function while testing gcc to support soft-float. The sprintf probably uses only malloc and free.<br />
If you have any suggestions, patches, please comment.</p>
<p>I have created project that runs on Olimex&#8217;s <a href="http://olimex.com/dev/stm32-103stk.html">stm32-103stk</a> using FreeRTOS. The project includes:</p>
<ul>
<li>Makefile (to help putting everything together &#8211; not my work)</li>
<li>SPI Master driver (using DMA transfers, and locking support)</li>
<li>Simple menu for the LCD.</li>
<li>Nokia 3310 LCD driver (again not my work, but heavily modified to support my SPI driver)</li>
</ul>
<p><del datetime="2010-03-10T09:37:49+00:00">If anyone is interested just leave a comment, I will put together some releasable version :) </del><br />
<strong>Update:</strong> I have created git repository with my projects <a href="http://github.com/robots/STM32">HERE</a>.</p>
<p>Some notes about newlib:<br />
Don&#8217;t use [s|vs|...]printf if you are dealing with integers only. Use *iprintf versions instead, these don&#8217;t include printing of floating point, reduce size of final code, and should be faster &#8211; they use static buffer instead of allocating one.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/michaldemin.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/michaldemin.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/michaldemin.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/michaldemin.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/michaldemin.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/michaldemin.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/michaldemin.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/michaldemin.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/michaldemin.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/michaldemin.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/michaldemin.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/michaldemin.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/michaldemin.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/michaldemin.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=34&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://michaldemin.wordpress.com/2010/03/09/freertos-newlib-on-cortex-m3/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9864c2316a0f689d6d43483c5025407c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">robots01</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: Buspirate and OpenOCD</title>
		<link>http://michaldemin.wordpress.com/2010/02/27/how-to-buspirate-and-openocd/</link>
		<comments>http://michaldemin.wordpress.com/2010/02/27/how-to-buspirate-and-openocd/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 10:26:04 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[buspirate]]></category>
		<category><![CDATA[openocd]]></category>

		<guid isPermaLink="false">http://michaldemin.wordpress.com/?p=28</guid>
		<description><![CDATA[Some time ago, I have added support to OpenOCD to be able to use Buspirate as JTAG interface. This how-to will show you, how to setup all the things necessary. Things you will need: - Buspirate - Computer with OpenOCD installed - target with JTAG - luck :) The Buspirate can be bought various sources, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=28&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I have added support to OpenOCD to be able to use Buspirate as JTAG interface.<br />
This how-to will show you, how to setup all the things necessary.</p>
<p><span id="more-28"></span></p>
<p>Things you will need:<br />
- Buspirate<br />
- Computer with OpenOCD installed<br />
- target with JTAG<br />
- luck :)</p>
<p>The Buspirate can be bought various sources, like Seeed studio or SparkFun. You will need version v2go or v3. (There is a slight change in the pinout). You will also need to update your BP to v4 bootloader and upload fairly new firmware (v4.2 nightly build).<br />
I will not go through the bootloader updating process, you can find tutorial <a href="http://dangerousprototypes.com/2010/01/18/how-to-bus-pirate-bootloader-v4-upgrade/">HERE</a>.<br />
The firmware you want to download is <a href="http://the-bus-pirate.googlecode.com/svn/trunk/firmware/v4-nightly/BPv3&amp;v2go/BPv3-Firmware-v4.2.OpenOCD.hex">HERE</a>.</p>
<p>You will also need some cable to connect BP to the target. Again that depends on the version of BP you have. For v2go (the one I own) is the pinout <a href="http://whereisian.com/forum/index.php?topic=223.msg2012#msg2012">HERE</a>. You don&#8217;t need to connect the &#8220;WHITE&#8221; cable at all.</p>
<p>The second part is OpenOCD software. There is a patch for version 0.3.0-rc0, and there is a patch for the development branch in git. The first patch works, but has some bugs that were fixed in the later one. I suggest that you checkout the development branch <del datetime="2010-03-11T20:17:56+00:00">and apply my patch. </del><br />
<del datetime="2010-03-11T20:17:56+00:00">Download the patch attached to <a href="http://whereisian.com/forum/index.php?topic=217.msg3020#msg3020">THIS post</a>.</del><br />
Go ahead and clone the git repository <del datetime="2010-03-11T20:17:56+00:00">and apply the patch you&#8217;ve downloaded:</del><br />
<strong>Update:</strong> There is no need to patch. The patch is included in the git reprository.<br />
<code><br />
git clone  git://openocd.git.sourceforge.net/gitroot/openocd/openocd<br />
</code><br />
I assume that you have &#8220;standard&#8221; development kit: gcc, make, autotools, etc. Running the next few commands should produce usable version of OpenOCD<br />
<code><br />
./bootstrap<br />
./configure --enable-buspirate --enable-maintainer-mode<br />
make<br />
sudo make install<br />
</code><br />
You need to enable maintainer mode, or else it will fail while making documentation. You can also add more interfaces, if you own more.</p>
<p>Next step is creating the correct configuration file. The confiuration file contains interface specification and target specification.<br />
The interface is buspirate, of course. If defaults are Ok, you can just use<br />
<code><br />
source [find interface/buspirate.cfg]<br />
</code><br />
More advance way is to copy the content of the buspirate.cfg file and change it to needs.<br />
<code><br />
interface buspirate<br />
buspirate_port /dev/ttyUSB0<br />
buspirate_speed normal # or fast<br />
#buspirate_vreg 0 # or 1<br />
#buspirate_mode normal # or open-drain<br />
#buspirate_pullup 0 # or 1<br />
</code><br />
These commands should be self explanatory. Fast speed mode switches the UART speed to 1Mbit upon connecting to BP, some BP revisions might not work, if this happens please report!<br />
Next you need to add your target configuration. I use STM32 cpu.<br />
<code><br />
source [find target/stm32.cfg]<br />
</code><br />
This tells OpenOCD what TAPs are on the JTAG chain, and OpenOCD scans if the IDs match.<br />
After you are done with the configuration file, save it, and run openocd in the same directory. If there is no fatal error, OpenOCD listens on 4444 port. Use telnet to connect to it, you will get simple console to send commands to OpenOCD.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/michaldemin.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/michaldemin.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/michaldemin.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/michaldemin.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/michaldemin.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/michaldemin.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/michaldemin.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/michaldemin.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/michaldemin.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/michaldemin.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/michaldemin.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/michaldemin.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/michaldemin.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/michaldemin.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=28&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://michaldemin.wordpress.com/2010/02/27/how-to-buspirate-and-openocd/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9864c2316a0f689d6d43483c5025407c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">robots01</media:title>
		</media:content>
	</item>
		<item>
		<title>Part 2: Debugging with GDB and OpenOCD</title>
		<link>http://michaldemin.wordpress.com/2010/02/22/part-2-debugging-with-gdb-and-openocd/</link>
		<comments>http://michaldemin.wordpress.com/2010/02/22/part-2-debugging-with-gdb-and-openocd/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 14:21:21 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[Toolchains]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[openocd]]></category>
		<category><![CDATA[toolchain]]></category>

		<guid isPermaLink="false">http://michaldemin.wordpress.com/?p=20</guid>
		<description><![CDATA[Now that we can compile stuff for ARM, we need a way to see what our code is doing. Most (all?) of ARM processors have JTAG. JTAG is used to access the debug port on the CPU, allowing to change state, registers, memory, peripheral registers, etc. OpenOCD knows how to talk to CPU through JTAG. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=20&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now that we can compile stuff for ARM, we need a way to see what our code is doing.<br />
Most (all?) of ARM processors have JTAG. JTAG is used to access the debug port on the CPU, allowing to change state, registers, memory, peripheral registers, etc. OpenOCD knows how to talk to CPU through JTAG.<br />
We are going to show you how to setup OpenOCD with GDB and make them behave together.<br />
<span id="more-20"></span><br />
In Part 2 we assume that you are coming with all the environment variables set as in Part 1.</p>
<p>Go get the sources of GDB and OpenOCD from:<br />
<code><br />
ftp://sourceware.org/pub/gdb/releases/</p>
<p>http://sourceforge.net/projects/openocd/files/</p>
<p></code></p>
<p>We used OpenOCD version 0.3.0-rc0, and GDB version 7.0.1. Go build the GDB, and install it with the rest of the toolchain.<br />
<code><br />
cd gdb-7.0.1/<br />
mkdir  build<br />
cd build<br />
../configure --target=$ARMTARGET --prefix=$TOOLPATH<br />
make<br />
sudo make install<br />
</code></p>
<p>OpenOCD is pretty straight forward as well. Except you need to specify which JTAG adapters you want to use. You should check the &#8220;configure help&#8221; to see all available. We own Wiggler and Usbprog, so we are enabling those.<br />
<code><br />
openocd-0.3.0-rc0<br />
cd openocd<br />
mkdir build<br />
cd build<br />
../configure --enable-parport --enable-usbprog --prefix=$TOOLPATH<br />
make<br />
sudo make install<br />
</code></p>
<p>Now that we have complete toolchain, we need to create OpenOCD configuration file. The idea with OpenOCD is, that you have separate configuration file for every project/every board configuration.</p>
<p>The setup we are going show uses Olimex STM32-103STK board with Wiggler clone adapter.</p>
<p>Everytime you start OpenOCD it looks for openocd.cfg file. This file should contain information on what interface you are using, speed, port, etc, and target(s) specification.<br />
Default settings for many interfaces come with OpenOCD. If you are using some standard setup, you should be able to find your config here:<br />
<code><br />
$TOOLPATH/share/openocd/scripts/interface<br />
</code><br />
You also need to be sure to include target file. Target files specify TAP(s) that are provided, some constrains like RAM size, Flash size. Also if you have some good known evaluation board.<br />
If you cannot find the right target file, look in similarly named files, Most of these targets are same (in JTAG sense).</p>
<p>Our configuration looks like this:<br />
<code><br />
interface parport<br />
parport_port 0<br />
parport_cable wiggler<br />
jtag_speed 0<br />
source [find board/olimex_stm32_h103.cfg]<br />
</code></p>
<p>This configures the wiggler to use /dev/parport0 in maximal speed mode. And adds the olimex board configuration.<br />
In this file you can also define procedures that could save you a lot of time. For example to flash and restart STM32 cpu you need to issue 3-4 commands. These procedures are written in lightweight TCL language. <a href="http://openocd.berlios.de/doc/html/Tcl-Crash-Course.html">TCL Crash course</a> will give you overview of this language.</p>
<p><code><br />
proc flash_load {file} {<br />
        halt<br />
        poll off<br />
        stm32x mass_erase 0<br />
        sleep 500<br />
        flash write_image $file elf<br />
        poll on<br />
}<br />
</code><br />
Disabling the poll mode will save you some bandwidth while flashing, thus saving some time. The difference is not noticeable on high-speed interfaces, so you can omit these commands.</p>
<p>Now that we have everything setup, we can fire up the OpenOCD. If you have entered everything correctly you should see that OpenOCD has identified the TAPs correctly. If not check your JTAG connection and retry.</p>
<p><strong>Update:</strong> I have found out that for some ARM processors (namely Cortex-M3) I had to issue &#8220;reset halt&#8221; command, otherwise I got many errors.<br />
Using this command line helps:<br />
<code>openocd -f openocd.cfg  -c "init" -c "halt" -c "reset halt"</code></p>
<p>Once it&#8217;s up and running OpenOCD listens on 2 ports by default:<br />
- 3333 for GDB connection.<br />
- 4444 for telnet connection.</p>
<p>Connecting with telnet to localhost:4444 will give you command line where you can control OpenOCD directly. Help command will print all the known commands.</p>
<p>For the GDB to be able to use the OpenOCD, you need to tell it, where to find the remote target. Easiest way to do so, is to create file named &#8220;.gdbinit&#8221; in the directory of your project.<br />
In this file you want to specify following:<br />
<code><br />
file stm32.elf<br />
target remote localhost:3333<br />
monitor soft_reset_halt<br />
</code><br />
First line tells GDB where to find the elf for symbols. Second line specifies that the target is remote and sitting on port 3333. The third line executes &#8220;soft_reset_halt&#8221; command on the monitor.<br />
The monitor in this case is OpenOCD. Using the monitor command you can execute any command of the OpenOCD and the output will appear in the GDB. For complete list of commands see the help command.</p>
<p>I won&#8217;t go much deeper into using GDB, as there are many other nice tutorials out there :).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/michaldemin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/michaldemin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/michaldemin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/michaldemin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/michaldemin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/michaldemin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/michaldemin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/michaldemin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/michaldemin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/michaldemin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/michaldemin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/michaldemin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/michaldemin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/michaldemin.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=20&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://michaldemin.wordpress.com/2010/02/22/part-2-debugging-with-gdb-and-openocd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9864c2316a0f689d6d43483c5025407c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">robots01</media:title>
		</media:content>
	</item>
		<item>
		<title>Part 1: Arm-softfloat-elf + newlib</title>
		<link>http://michaldemin.wordpress.com/2010/02/09/arm-toolchain-newlib-part1/</link>
		<comments>http://michaldemin.wordpress.com/2010/02/09/arm-toolchain-newlib-part1/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 16:49:50 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[Toolchains]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[toolchain]]></category>

		<guid isPermaLink="false">http://michaldemin.wordpress.com/?p=7</guid>
		<description><![CDATA[Few months ago I came across STM32 microprocessors. These processors are use ARM Cortex-M3 core, with clock up to 70Mhz, Internal flash, and RAM, Peripherals include DMA, SPI, CAN, RTC and lot of other. Of course you need some compiler to develop application for this processor. Standard way of compilation for gcc will lead to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=7&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Few months ago I came across STM32 microprocessors. These processors are use ARM Cortex-M3 core, with clock up to 70Mhz, Internal flash, and RAM, Peripherals include DMA, SPI, CAN, RTC and lot of other.</p>
<p>Of course you need some compiler to develop application for this processor. Standard way of compilation for gcc will lead to very much usable toolchain, until you want to do something with floating point.</p>
<p><span id="more-7"></span></p>
<p>Cortex-M3 does not come with FPU, nor any kind of floating point support (VFP, NEON, &#8230;). Only support is through Soft-float. Which means that floating instructions are emulated in software, this adds some more code, but maintains compatibility.<br />
There is a small drawback for the vanilla GCC &#8211; the code containing any kind of floating operation will cause &#8220;Bus Failure&#8221; exception.<br />
I have spent many hours googling for the right options for GCC and friends. And came up with conclusion that arm-elf GCC target does not support thumb2 instructions, and the soft-float support is kinda broken due to backward compatibility.</p>
<p>Here are the steps to create GCC with Thumb2 and soft-float support. Please understand what each step does, as there might be a typo in the paths, etc.</p>
<p>First of all you need to download the sources of binutils, gcc, and newlib.<br />
<code><br />
wget http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.bz2<br />
wget ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-4.4.3/gcc-4.4.3.tar.bz2<br />
wget ftp://sources.redhat.com/pub/newlib/newlib-1.18.0.tar.gz<br />
</code></p>
<p>Export some variables used throughout the howto:<br />
<code><br />
export TOOLPATH=/usr/local/cross-arm<br />
export ARMTARGET=arm-softfloat-elf<br />
</code></p>
<p>TOOLPATH will be the destination directory. ARMTARGET is the prefix for the gcc, this also selects the internal target for gcc. Do not change the target unless you know what you are doing.</p>
<p>Next step is to create the binutils (as, ld, &#8230;). The release 2.20 does contain bug! Some curly braces are missing in tc-arm file. This is a known bug, and patch is available.<br />
<code><br />
tar xvf binutils-2.20<br />
# patch tc_arm.c with  http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.407&amp;r2=1.408&amp;cvsroot=src&amp;f=h<br />
cd binutils-2.20/<br />
mkdir build<br />
cd build<br />
../configure --target=$ARMTARGET --prefix=$TOOLPATH --enable-interwork --enable-multilib --with-gnu-as --with-gnu-ld --disable-nls<br />
make all<br />
sudo make install<br />
export PATH=${TOOLPATH}/bin:$PATH<br />
cd ../../<br />
</code></p>
<p>Option &#8220;interwork&#8221; is needed when compiling mixed arm/thumb code. &#8220;Multilib&#8221; is needed to support arm, thumb, thumb2 at the same time.</p>
<p>Now we need the basic gcc (no libs yet). Unpack the source.<br />
<code><br />
tar xvf gcc-4.4.3.tar.bz2<br />
cd gcc-4.4.3/<br />
</code></p>
<p>This is the most hackish part. You need to edit few files in the gcc sources. First one is &#8220;gcc/config/arm/elf.h&#8221;.<br />
Edit in your favourite editor, and find &#8220;#define SUBTARGET_ASM_FLOAT_SPEC&#8221;. Change the few line macro to something like this:<br />
<code><br />
#define SUBTARGET_ASM_FLOAT_SPEC "%{mapcs-float:-mfloat} \<br />
%{mhard-float:-mfpu=fpa} \<br />
%{!mhard-float:-mfpu=softfpa}"<br />
#endif<br />
</code></p>
<p>Patching the &#8220;elf&#8221; target is next. This patch was found on some mailing list. I have not used the patch program to apply it, instead I&#8217;ve edited the file manually, and removed those comments. This will enable the thumb2 multilib.</p>
<p><code><br />
--- proddev/vendor/gcc/current/gcc/config/arm/t-arm-elf    2009/02/03 23:22:05    2923<br />
+++ proddev/vendor/gcc/current/gcc/config/arm/t-arm-elf    2009/02/04 18:33:29    2924<br />
@@ -11,15 +11,15 @@<br />
MULTILIB_EXCEPTIONS  =<br />
MULTILIB_MATCHES     =</p>
<p>-#MULTILIB_OPTIONS      += march=armv7<br />
-#MULTILIB_DIRNAMES     += thumb2<br />
-#MULTILIB_EXCEPTIONS   += march=armv7* marm/*march=armv7*<br />
-#MULTILIB_MATCHES      += march?armv7=march?armv7-a<br />
-#MULTILIB_MATCHES      += march?armv7=march?armv7-r<br />
-#MULTILIB_MATCHES      += march?armv7=march?armv7-m<br />
-#MULTILIB_MATCHES      += march?armv7=mcpu?cortex-a8<br />
-#MULTILIB_MATCHES      += march?armv7=mcpu?cortex-r4<br />
-#MULTILIB_MATCHES      += march?armv7=mcpu?cortex-m3<br />
+MULTILIB_OPTIONS      += march=armv7<br />
+MULTILIB_DIRNAMES     += thumb2<br />
+MULTILIB_EXCEPTIONS   += march=armv7* marm/*march=armv7*<br />
+MULTILIB_MATCHES      += march?armv7=march?armv7-a<br />
+MULTILIB_MATCHES      += march?armv7=march?armv7-r<br />
+MULTILIB_MATCHES      += march?armv7=march?armv7-m<br />
+MULTILIB_MATCHES      += march?armv7=mcpu?cortex-a8<br />
+MULTILIB_MATCHES      += march?armv7=mcpu?cortex-r4<br />
+MULTILIB_MATCHES      += march?armv7=mcpu?cortex-m3</p>
<p># MULTILIB_OPTIONS    += mcpu=ep9312<br />
# MULTILIB_DIRNAMES   += ep9312<br />
</code></p>
<p>Finally we can build the basic gcc.<br />
<code><br />
mkdir build<br />
cd build<br />
../configure --target=$ARMTARGET --prefix=$TOOLPATH --enable-interwork --enable-multilib --enable-languages="c,c++" --with-newlib --without-headers --disable-shared --with-gnu-as --with-gnu-ld --with-float=soft<br />
make all-gcc<br />
sudo make install-gcc<br />
</code><br />
This will take some time. You can add &#8220;-j2&#8243; parameter to make, if you have more processor machine.</p>
<p>Unpack the newlib:<br />
<code><br />
tar xvf newlib-1.18.0.tar.gz<br />
cd newlib-1.18.0<br />
</code><br />
Tell the configure to exclude few libraries, from build process. Edit configure.ac, and look for:<br />
<code><br />
arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )<br />
</code></p>
<p>And add &#8220;target-libgloss&#8221; to the &#8220;noconfigdirs&#8221; variable. In the end it should look like this:<br />
<code><br />
arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )<br />
noconfigdirs="$noconfigdirs target-libffi target-qthreads target-libgloss"<br />
libgloss_dir=arm<br />
;;<br />
</code></p>
<p>Save the modified file and execute autoconf. This will rebuild the configure script. Continue the build process.</p>
<p><code><br />
mkdir build<br />
cd build<br />
../configure --target=$ARMTARGET --prefix=$TOOLPATH --enable-interwork --disable-newlib-supplied-syscalls --with-gnu-ld --with-gnu-as --disable-shared --with-float=soft<br />
make CFLAGS_FOR_TARGET="-msoft-float" CCASFLAGS="-msoft-float"<br />
</code></p>
<p>The make line is kinda tricky. I had some trouble using the internal malloc along with FreeRTOS. Realizing that FreeRTOS has own manager I used following:<br />
<code><br />
make CFLAGS_FOR_TARGET="-msoft-float -DMALLOC_PROVIDED" CCASFLAGS="-msoft-float -DMALLOC_PROVIDED"<br />
</code><br />
The MALLOC_PROVIDED option tells newlib that we have malloc and free. This needs some glue that I will discuss later.</p>
<p>To install the newlib, you cannot use sudo. This will fail on ranlib not being available. You will need root terminal to do this. E.g:<br />
<code><br />
sudo bash<br />
export PATH=/usr/local/cross-arm/bin:$PATH<br />
make install<br />
exit<br />
cd ../../<br />
</code></p>
<p>Now finish the gcc compiling (libgcc, libstdc++, &#8230;)<br />
<code><br />
cd gcc-4.4.2/build<br />
make CFLAGS="-msoft-float" CXXFLAGS="-msoft-float" LIBCXXFLAGS="-msoft-float" all<br />
sudo make install<br />
</code><br />
I&#8217;m not sure whether the &#8220;-msoft-float&#8221; option is really necessary. But it works with them in place.</p>
<p>Now you should end up with gcc toolchain, that supports C and C++ languages, ARM, Thumb, Thumb2 instructions, and uses soft-float emulation.</p>
<p>Just don&#8217;t forget to add it to your path everytime you want to compile something<br />
<code><br />
export PATH=/usr/local/cross-arm/bin:$PATH<br />
</code></p>
<p>In next part, I am going to show how to setup OpenOCD and GDB for arm processors.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/michaldemin.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/michaldemin.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/michaldemin.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/michaldemin.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/michaldemin.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/michaldemin.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/michaldemin.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/michaldemin.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/michaldemin.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/michaldemin.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/michaldemin.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/michaldemin.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/michaldemin.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/michaldemin.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=7&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://michaldemin.wordpress.com/2010/02/09/arm-toolchain-newlib-part1/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9864c2316a0f689d6d43483c5025407c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">robots01</media:title>
		</media:content>
	</item>
		<item>
		<title>Finally ! A Blog !</title>
		<link>http://michaldemin.wordpress.com/2010/02/09/finally-a-blog/</link>
		<comments>http://michaldemin.wordpress.com/2010/02/09/finally-a-blog/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 15:12:17 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://michaldemin.wordpress.com/?p=4</guid>
		<description><![CDATA[I have finally decided to create a blog for all the things I do, and I&#8217;m interested in. This will mostly be related to embedded computing, programming and electronics I hope that some (all?) posts will be useful in some way. Stay tuned :)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=4&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have finally decided to create a blog for all the things I do, and I&#8217;m interested in. This will mostly be related to embedded computing, programming and electronics</p>
<p>I hope that some (all?) posts will be useful in some way. Stay tuned :)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/michaldemin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/michaldemin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/michaldemin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/michaldemin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/michaldemin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/michaldemin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/michaldemin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/michaldemin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/michaldemin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/michaldemin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/michaldemin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/michaldemin.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/michaldemin.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/michaldemin.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=michaldemin.wordpress.com&amp;blog=11938942&amp;post=4&amp;subd=michaldemin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://michaldemin.wordpress.com/2010/02/09/finally-a-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9864c2316a0f689d6d43483c5025407c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">robots01</media:title>
		</media:content>
	</item>
	</channel>
</rss>
