<?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/"
	>

<channel>
	<title>coding &#187; embarcado</title>
	<atom:link href="http://www.coding.com.br/category/embarcado/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coding.com.br</link>
	<description>have you coded today?</description>
	<lastBuildDate>Thu, 18 Aug 2011 17:29:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>avoid kernel messages at boottime</title>
		<link>http://www.coding.com.br/embarcado/avoid-kernel-messages-at-boottime/</link>
		<comments>http://www.coding.com.br/embarcado/avoid-kernel-messages-at-boottime/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:17:49 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[uboot]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1673</guid>
		<description><![CDATA[Linux embedded normally don&#8217;t behave as the same in desktop system, maybe instead login at your device you need only run a specific application &#8211; for example &#8211; by just modifying an start script. Although easily&#8230; one requisite that I faced these days was avoid boot messages from kernel, accomplished by changing kernel parameters:
setenv bootargs [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Linux embedded normally don&#8217;t behave as the same in desktop system, maybe instead <em>login</em> at your device you need only run a specific application &#8211; for example &#8211; by just modifying an start script. Although easily&#8230; one requisite that I faced these days was avoid boot messages from kernel, accomplished by changing <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/kernel-parameters.txt;h=cc85a927819070bef71e5802204b0f07cfb76973;hb=d77d9597ad8f2bd381a5168005a21e82df6f18eb" target="_blank">kernel parameters</a>:</p>
<p style="padding-left: 30px; text-align: justify;">setenv bootargs &#8216;<strong>console=<span style="color: #ff0000;">none</span> </strong>root=/dev/mmcblk0p<span style="color: #ff0000;">X</span> rootwait init=/sbin/init&#8217;</p>
<p>But this parameter broke the output of my start code (a shell script) located on /etc/rc.d/&#8230;</p>
<p style="text-align: justify;">Checking for solutions I go back to <em>getty</em> and added two parameters &#8220;<strong>-l</strong>&#8221; and &#8220;<strong>-n</strong>&#8221; to specify your program (or <em>script</em>) and prompt for <em>nologin</em>.</p>
<p>$ cat /etc/inittab</p>
<p style="padding-left: 30px;">::sysinit:/etc/rc.d/rcS<br />
::respawn:/sbin/getty -L <span style="color: #ff0000;">ttymxc0</span> 115200 vt100 <strong>-l </strong><span style="color: #ff0000;">/path/to/your/program</span><strong> -n </strong><br />
::ctrlaltdel:/sbin/reboot<br />
::shutdown:/etc/rc.d/rcS stop<br />
::restart:/sbin/init</p>
<p>Now I can see the serial output without kernel boot messages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/avoid-kernel-messages-at-boottime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>re-generating ubi</title>
		<link>http://www.coding.com.br/embarcado/re-generating-ubi/</link>
		<comments>http://www.coding.com.br/embarcado/re-generating-ubi/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 18:33:07 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[ubifs]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1605</guid>
		<description><![CDATA[If you need re-generate an UBIFS and don&#8217;t know the right parameters you can inspect dmesg output to filter UBI parameters.


If you need know the steps to creante an UBI/UBIFS check the official documentation or my ubifs tag on del.icio.us.
]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">If you need re-generate an UBIFS and <strong>don&#8217;t know</strong> the right parameters you can inspect<em> </em><a href="http://www.linfo.org/dmesg.html" target="_blank"><em>dmesg</em></a> output to filter UBI parameters.</p>
<p style="text-align: center;"><a href="http://www.coding.com.br/wp-content/uploads/2011/01/ubi.png"><img class="aligncenter size-full wp-image-1607" title="ubi" src="http://www.coding.com.br/wp-content/uploads/2011/01/ubi.png" alt="" width="537" height="559" /></a></p>
<p style="text-align: center;">
<p style="text-align: justify;">If you need know the steps to creante an UBI/UBIFS check the <a href="http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs" target="_blank">official documentation</a> or my <a href="http://www.delicious.com/maluta/ubifs" target="_blank">ubifs tag</a> on del.icio.us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/re-generating-ubi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using ubi on u-boot: compiling issues</title>
		<link>http://www.coding.com.br/embarcado/using-ubi-on-u-boot-compiling-issues/</link>
		<comments>http://www.coding.com.br/embarcado/using-ubi-on-u-boot-compiling-issues/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 18:24:18 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[ubifs]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1584</guid>
		<description><![CDATA[if you are adding support to ubifs on u-boot, you must add some ﻿include/configs/&#60;CONFIG&#62;.h
﻿#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
 #define CONFIG_RBTREE
#define CONFIG_LZO
to avoid errors like:
/uboot-imx/fs/ubifs/tnc.c:105: undefined reference to `rb_insert_color&#8217;
fs/ubifs/libubifs.a(orphan.o): In function `insert_dead_orphan&#8217;:
/uboot-imx/fs/ubifs/orphan.c:129: undefined reference to `rb_insert_color&#8217;
fs/ubifs/libubifs.a(recovery.o): In function `add_ino&#8217;:
/uboot-imx/fs/ubifs/recovery.c:1050: undefined reference to `rb_insert_color&#8217;
fs/ubifs/libubifs.a(recovery.o): In function `remove_ino&#8217;:
/uboot-imx/fs/ubifs/recovery.c:1088: undefined reference to `rb_erase&#8217;
fs/ubifs/libubifs.a(recovery.o): In function `ubifs_recover_size&#8217;:
/uboot-imx/fs/ubifs/recovery.c:1171: undefined reference to `rb_first&#8217;
/uboot-imx/fs/ubifs/recovery.c:1214: undefined [...]]]></description>
			<content:encoded><![CDATA[<p>if you are adding support to ubifs on u-boot, you must add some ﻿<em>include/configs/&lt;CONFIG&gt;.h</em></p>
<p style="padding-left: 30px;">﻿#define CONFIG_CMD_UBI<br />
#define CONFIG_CMD_UBIFS<br />
<strong> #define CONFIG_RBTREE</strong><br />
#define CONFIG_LZO</p>
<div id="_mcePaste">to avoid errors like:</div>
<p style="padding-left: 30px;">/uboot-imx/fs/ubifs/tnc.c:105: undefined reference to `rb_insert_color&#8217;<br />
fs/ubifs/libubifs.a(orphan.o): In function `insert_dead_orphan&#8217;:<br />
/uboot-imx/fs/ubifs/orphan.c:129: undefined reference to `rb_insert_color&#8217;<br />
fs/ubifs/libubifs.a(recovery.o): In function `add_ino&#8217;:<br />
/uboot-imx/fs/ubifs/recovery.c:1050: undefined reference to `rb_insert_color&#8217;<br />
fs/ubifs/libubifs.a(recovery.o): In function `remove_ino&#8217;:<br />
/uboot-imx/fs/ubifs/recovery.c:1088: undefined reference to `rb_erase&#8217;<br />
fs/ubifs/libubifs.a(recovery.o): In function `ubifs_recover_size&#8217;:<br />
/uboot-imx/fs/ubifs/recovery.c:1171: undefined reference to `rb_first&#8217;<br />
/uboot-imx/fs/ubifs/recovery.c:1214: undefined reference to `rb_next&#8217;<br />
/uboot-imx/fs/ubifs/recovery.c:1220: undefined reference to `rb_next&#8217;<br />
/uboot-imx/fs/ubifs/recovery.c:1221: undefined reference to `rb_erase&#8217;<br />
fs/ubifs/libubifs.a(replay.o): In function `insert_node&#8217;:<br />
/uboot-imx/fs/ubifs/replay.c:373: undefined reference to `rb_insert_color&#8217;<br />
fs/ubifs/libubifs.a(replay.o): In function `insert_dent&#8217;:<br />
/uboot-imx/fs/ubifs/replay.c:448: undefined reference to `rb_insert_color&#8217;<br />
fs/ubifs/libubifs.a(replay.o): In function `insert_ref_node&#8217;:<br />
/uboot-imx/fs/ubifs/replay.c:689: undefined reference to `rb_insert_color&#8217;<br />
fs/ubifs/libubifs.a(replay.o): In function `apply_replay_tree&#8217;:<br />
/uboot-imx/fs/ubifs/replay.c:306: undefined reference to `rb_next&#8217;<br />
/uboot-imx/fs/ubifs/replay.c:294: undefined reference to `rb_first&#8217;</p>
<p>obs.: probably you will need add MTD part support too <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/using-ubi-on-u-boot-compiling-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux booting on ubifs partitions</title>
		<link>http://www.coding.com.br/embarcado/linux-booting-on-ubifs-partitions/</link>
		<comments>http://www.coding.com.br/embarcado/linux-booting-on-ubifs-partitions/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 17:01:31 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[nand]]></category>
		<category><![CDATA[ubifs]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1561</guid>
		<description><![CDATA[UBIFS is relatively new on embedded systems but my guess is that they&#8217;ll become the standard on embedded market. To start, the first step is enable UBIFS support in kernel. I exaggerated on some debug options, fell free to avoid:
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
CONFIG_MTD_UBI_DEBUG=y
CONFIG_MTD_UBI_DEBUG_MSG=y
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
Next I used a simple rootfs &#8211; basically busybox + mtd-utils &#8211; to create/format the partitions, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">UBIFS is relatively new on embedded systems but my guess is that they&#8217;ll <a href="http://free-electrons.com/pub/conferences/2008/elce/flash-filesystems.pdf" target="_blank">become the standard</a> on embedded market. To start, the first step is enable UBIFS support in kernel. I exaggerated on some <em>debug</em> options, fell free to avoid:</p>
<p style="padding-left: 30px;">CONFIG_MTD_UBI=y<br />
CONFIG_MTD_UBI_WL_THRESHOLD=4096<br />
CONFIG_MTD_UBI_BEB_RESERVE=1<br />
CONFIG_MTD_UBI_DEBUG=y<br />
CONFIG_MTD_UBI_DEBUG_MSG=y<br />
CONFIG_UBIFS_FS=y<br />
CONFIG_UBIFS_FS_LZO=y<br />
CONFIG_UBIFS_FS_ZLIB=y</p>
<p style="text-align: justify;">Next I used a simple<em> rootfs</em> &#8211; basically <a href="http://www.busybox.net/" target="_blank">busybox</a> + <a href="http://git.infradead.org/mtd-utils.git" target="_blank">mtd-utils</a> &#8211; to create/format the partitions, suppose that you kernel <a href="http://www.coding.com.br/embarcado/mtd-partitions-tips/" target="_blank">divided</a> the memory in the following parts:</p>
<p style="padding-left: 30px;"># cat /proc/mtd<br />
mtd0: 00300000 00020000 &#8220;bootloader&#8221; *<br />
mtd1: 00500000 00020000 &#8220;nand.kernel&#8221; **<br />
mtd2: 00100000 00020000 &#8220;nand.ramdisk&#8221;<br />
<strong>mtd3: 06400000 00020000 &#8220;nand.system&#8221;</strong></p>
<p>*,** The<em> bootloade</em>r and <em>nand.kernel</em> I flashed via u-boot.</p>
<p>1. <strong>The first time<br />
</strong></p>
<p style="text-align: justify;">This is only needed when you create the partition for the first time. Steps are erasing the flash, detaching the UBI [if it was previously attached], format on UBI model, attach again, creating the volume (specifying a name) and finally mounting.<strong><br />
</strong></p>
<pre style="padding-left: 30px;">flash_eraseall /dev/mtd3

ubidetach /dev/ubi_ctrl -m 3
ubiformat /dev/mtd3 -y
ubiattach /dev/ubi_ctrl -m 3
ubimkvol /dev/ubi0 -N system -m
mount -t ubifs ubi0:<strong>system</strong> /mnt/ubi

[ copy your rootfs ]

umount /mnt/ubi</pre>
<p><strong>system</strong> is the name that I choose for partition, could be any.</p>
<p>2. <strong> Editing</strong></p>
<p>Suppose that you need edit some files on your UBIFS , then you only need:</p>
<pre style="padding-left: 30px;">ubiattach /dev/ubi_ctrl -m 3
mount -t ubifs ubi0:system /mnt/ubi</pre>
<p>3. <strong>Boot</strong></p>
<p>In order to boot, you need add some parameters to u-boot.</p>
<pre style="padding-left: 30px;">setenv bootargs 'console=ttymxc0,115200 <strong>rootfstype=ubifs ubi.mtd=3 root=ubi0:system</strong> init=...'</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/linux-booting-on-ubifs-partitions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mtd partitions: tips</title>
		<link>http://www.coding.com.br/embarcado/mtd-partitions-tips/</link>
		<comments>http://www.coding.com.br/embarcado/mtd-partitions-tips/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 12:15:29 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[mtd]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1555</guid>
		<description><![CDATA[there are two tips when initializing MTD partition struct:

use MTDPART_OFS_APPEND  to define .offset
1024 multiple to .size (4MB = 4194304 bytes or 4 * 1024 * 1024)

static struct mtd_partition nand_flash_partitions[] = {
{
.name = &#8220;bootloader&#8221;,
.offset = 0,
.size = 3 * 1024 * 1024},
{
.name = &#8220;nand.kernel&#8221;,
.offset = MTDPART_OFS_APPEND,
.size = 5 * 1024 * 1024},
{
.name = &#8220;nand.rootfs&#8221;,
.offset = [...]]]></description>
			<content:encoded><![CDATA[<p>there are two<em> tips </em>when initializing MTD partition struct:</p>
<ul>
<li>use <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=include/linux/mtd/partitions.h;h=2b54316591d2b4231070a08dec7b6ad33a061ad3;hb=ff8b16d7e15a8ba2a6086645614a483e048e3fbf" target="_blank">MTDPART_OFS_APPEND </a> to define <em>.offset</em></li>
<li>1024 multiple to <em>.size</em> (4MB = 4194304 bytes or 4 * 1024 * 1024)</li>
</ul>
<p><strong>static</strong> <strong>struct</strong> <span style="color: #2040a0;">mtd_partition</span> <span style="color: #2040a0;">nand_flash_partitions</span><span style="color: #4444ff;">[</span><span style="color: #4444ff;">]</span> <span style="color: #4444ff;">=</span> <span style="color: #4444ff;"><strong>{</strong></span><br />
<span style="color: #4444ff;"><strong>{</strong></span><br />
.<span style="color: #2040a0;">name</span> <span style="color: #4444ff;">=</span> <span style="color: #008000;">&#8220;bootloader&#8221;</span>,<br />
.<span style="color: #2040a0;">offset</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0</span>,<br />
.<span style="color: #2040a0;">size</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">3</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span><span style="color: #4444ff;"><strong>}</strong></span>,<br />
<span style="color: #4444ff;"><strong>{</strong></span><br />
.<span style="color: #2040a0;">name</span> <span style="color: #4444ff;">=</span> <span style="color: #008000;">&#8220;nand.kernel&#8221;</span>,<br />
.<span style="color: #2040a0;">offset</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">MTDPART_OFS_APPEND</span>,<br />
.<span style="color: #2040a0;">size</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">5</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span><span style="color: #4444ff;"><strong>}</strong></span>,<br />
<span style="color: #4444ff;"><strong>{</strong></span><br />
.<span style="color: #2040a0;">name</span> <span style="color: #4444ff;">=</span> <span style="color: #008000;">&#8220;nand.rootfs&#8221;</span>,<br />
.<span style="color: #2040a0;">offset</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">MTDPART_OFS_APPEND</span>,<br />
.<span style="color: #2040a0;">size</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">256</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span><span style="color: #4444ff;"><strong>}</strong></span>,<br />
<span style="color: #4444ff;"><strong>{</strong></span><br />
.<span style="color: #2040a0;">name</span> <span style="color: #4444ff;">=</span> <span style="color: #008000;">&#8220;nand.userfs1&#8243;</span>,<br />
.<span style="color: #2040a0;">offset</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">MTDPART_OFS_APPEND</span>,<br />
.<span style="color: #2040a0;">size</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">256</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span> <span style="color: #4444ff;">*</span> <span style="color: #ff0000;">1024</span><span style="color: #4444ff;"><strong>}</strong></span>,<br />
<span style="color: #4444ff;"><strong>{</strong></span><br />
.<span style="color: #2040a0;">name</span> <span style="color: #4444ff;">=</span> <span style="color: #008000;">&#8220;nand.userfs2&#8243;</span>,<br />
.<span style="color: #2040a0;">offset</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">MTDPART_OFS_APPEND</span>,<br />
.<span style="color: #2040a0;">size</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">MTDPART_SIZ_FULL</span><span style="color: #4444ff;"><strong>}</strong></span>,<br />
<span style="color: #4444ff;"><strong>}</strong></span><span style="color: #4444ff;">;</span></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 122px; width: 1px; height: 1px; overflow: hidden;">&lt;strong&gt;static&lt;/strong&gt; &lt;strong&gt;struct&lt;/strong&gt; &lt;span style=&#8221;color: #2040a0;&#8221;&gt;mtd_partition&lt;/span&gt; &lt;span style=&#8221;color: #2040a0;&#8221;&gt;nand_flash_partitions&lt;/span&gt;&lt;span style=&#8221;color: #4444ff;&#8221;&gt;[&lt;/span&gt;&lt;span style="color: #4444ff;"&gt;]&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;<br />
&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;&amp;amp;nbname&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #008000;&#8221;&gt;&#8221;bootloader&#8221;&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;offset&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;0&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;size&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;3&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt;&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;,<br />
&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;name&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #008000;&#8221;&gt;&#8221;nand.kernel&#8221;&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;offset&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #2040a0;&#8221;&gt;MTDPART_OFS_APPEND&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;size&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;5&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt;&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;,<br />
&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;name&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #008000;&#8221;&gt;&#8221;nand.rootfs&#8221;&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;offset&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #2040a0;&#8221;&gt;MTDPART_OFS_APPEND&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;size&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;256&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt;&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;,<br />
&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;name&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #008000;&#8221;&gt;&#8221;nand.userfs1&#8243;&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;offset&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #2040a0;&#8221;&gt;MTDPART_OFS_APPEND&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;size&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;256&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;*&lt;/span&gt; &lt;span style=&#8221;color: #ff0000;&#8221;&gt;1024&lt;/span&gt;&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;,<br />
&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;name&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #008000;&#8221;&gt;&#8221;nand.userfs2&#8243;&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;offset&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #2040a0;&#8221;&gt;MTDPART_OFS_APPEND&lt;/span&gt;,<br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;span style=&#8221;color: #2040a0;&#8221;&gt;size&lt;/span&gt; &lt;span style=&#8221;color: #4444ff;&#8221;&gt;=&lt;/span&gt; &lt;span style=&#8221;color: #2040a0;&#8221;&gt;MTDPART_SIZ_FULL&lt;/span&gt;&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;,<br />
&lt;span style=&#8221;color: #4444ff;&#8221;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;span style=&#8221;color: #4444ff;&#8221;&gt;;&lt;/span&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/mtd-partitions-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>using ubi on u-boot: part one</title>
		<link>http://www.coding.com.br/embarcado/using-ubi-on-u-boot-part-one/</link>
		<comments>http://www.coding.com.br/embarcado/using-ubi-on-u-boot-part-one/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 13:42:45 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[ubi]]></category>
		<category><![CDATA[uboot]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1502</guid>
		<description><![CDATA[UBI stands for Unsorted Block Images. The shortest description for UBI is &#8220;LVM for NAND flash memory devices&#8221; and if you don&#8217;t know yet how it&#8217;s works I recommend check this presentation. I intend here describe my use with u-boot, starting with the steps to flash an kernel image. First of all, if you not [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">UBI stands for <em>Unsorted Block Images</em>. The <a href="http://kernelnewbies.org/Linux_2_6_22#head-1c99f2ac9780815fe6dad0420fbe2869a7a687a5" target="_blank">shortest</a> description for UBI is &#8220;LVM for NAND flash memory devices&#8221; and if you don&#8217;t know yet how it&#8217;s works I recommend check this <a href="http://www.linux-mtd.infradead.org/doc/ubi.ppt " target="_blank">presentation</a>. I intend here describe my use with u-boot, starting with the steps to flash an kernel image. First of all, if you not defined MTDPARTS_DEFAULT on you u-boot config file, you must define (or redefine) on u-boot terminal.</p>
<pre style="text-align: left;">&gt; setenv mtdparts mtdparts=nand0:0x80000@0x0(uboot),0x400000@0x80000(kernel),-@0x480000(root)</pre>
<p>If you type <strong>mtd</strong><strong> </strong> you I&#8217;ll see:</p>
<pre>device nand0 &lt;nand0&gt;, # parts = 3
 #: name        size        offset        mask_flags
 0: uboot     0x00080000    0x00000000    0
 1: kernel    0x00400000    0x00080000    0
 2: root      0x1fb80000    0x00480000    0</pre>
<p style="text-align: left;">UBI deal with volume and not partitions. Let&#8217;s create one.</p>
<pre style="text-align: left;">&gt; ubi part kernel</pre>
<p>If you got some <a href="https://acassis.wordpress.com/2009/10/29/creating-an-error-number-table/" target="_blank">-22</a> error, like:</p>
<p style="padding-left: 30px;"><em>UBI error: ubi_read_volume_table: the layout volume was not found<br />
UBI error: ubi_init: cannot attach mtd1<br />
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22<br />
UBI init error -22</em></p>
<p>you need <a href="http://lkml.org/lkml/2007/3/23/199" target="_blank">erase</a> the NAND region [ <strong>nand erase 0x00080000 0x400000 </strong>] and <em>ubi part</em> command again<strong>. </strong></p>
<p>Next step is create the volume:</p>
<pre>&gt; ubi create kernel_vol
Creating dynamic volume kernel_vol of size <strong>3354624</strong></pre>
<p style="text-align: justify;">The value in bold is the max size of that volume in bytes (~3MB). Note that is less than the 4MB (0&#215;400000) defined in mtdparts. This happens because UBI works with logical blocks instead (LEB) of physical ones (PEB).</p>
<p style="text-align: justify;">In order to write the kernel you need transfer the image to u-boot. Since Ethernet  isn&#8217;t working in my board I choose between <a href="http://www.coding.com.br/embarcado/accessing-u-boot-with-picocom-to-transfer-files-via-serial-interface/" target="_blank">serial</a> or mmc.  As serial is too slow to large files I opted to write the image on FAT partition on SD card and load through:</p>
<pre>&gt; mmcinfo
&gt; fatload mmc 0 ${loadaddr} uImage</pre>
<p>The output will be something like</p>
<p style="padding-left: 30px;"><em>reading uImage<br />
2845120 bytes read</em></p>
<p>Finally write it:</p>
<pre>&gt; ubi write ${loadaddr} kernel_vol 0x2b69c0</pre>
<p>You can check if everything went fine comparing</p>
<pre>&gt; ubi read 0x90AC0000 kernel_vol
&gt; cmp.b ${loadaddr} 0x90ac0000  0x2b69c0
Total of 2845120 bytes were the same</pre>
<p>0&#215;90AC0000 is some place on RAM different from ${loadaddr} (check using echo ${loadaddr}).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/using-ubi-on-u-boot-part-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>accessing u-boot with picocom to transfer files via serial interface</title>
		<link>http://www.coding.com.br/embarcado/accessing-u-boot-with-picocom-to-transfer-files-via-serial-interface/</link>
		<comments>http://www.coding.com.br/embarcado/accessing-u-boot-with-picocom-to-transfer-files-via-serial-interface/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 00:52:00 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[u-boot]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1460</guid>
		<description><![CDATA[There is a how-to with minicom too, this is using picocom to transfer files via serial interface (ymodem). First start with some parameters, in this case I&#8217;m using ttyUSB0.
$ picocom --baud 115200 --send-cmd="sb -vv" --receive-cmd="rb -vvv" /dev/ttyUSB0
Then:
U-Boot &#62; loady
## Ready for binary (ymodem) download to 0x90800000 at 115200 bps...
Type C-a C-s and choose the file.
*** [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">There is a how-to with <a href="https://acassis.wordpress.com/2009/10/23/transfering-file-to-u-boot-over-serial/">minicom</a> too, this is using picocom to transfer files via serial interface (ymodem). First start with some parameters, in this case I&#8217;m using ttyUSB0.</p>
<pre style="padding-left: 30px;">$ picocom --baud 115200 --send-cmd="sb -vv" --receive-cmd="rb -vvv" /dev/ttyUSB0</pre>
<p>Then:</p>
<pre style="padding-left: 30px;">U-Boot &gt; <strong>loady</strong>
## Ready for binary (ymodem) download to 0x90800000 at 115200 bps...</pre>
<p>Type <strong>C-a C-s</strong> and choose the file.</p>
<pre style="padding-left: 30px;">*** file: /tftpboot/uImage
sb -vv /tftpboot/uImage
Sending: uImage
Ymodem sectors/kbytes sent:   0/ 0kRetry 0: NAK on sector
Retry 0: NAK on sector
Bytes Sent:2203904   BPS:7800
Sending:Transfer complete*** exit status: 0
0(STX)/0(CAN) packets, 6 retries
## Total Size      = 0x0021a0e4 = 2203876 Bytes
U-Boot &gt;</pre>
<p>* The sb and rb utility are on lrzsz package [ $sudo apt-get install lrzsz ]</p>
<p>** Other <a href="http://casper.berkeley.edu/wiki/Setting_Up_BORPH_on_ROACH" target="_blank">reference </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/accessing-u-boot-with-picocom-to-transfer-files-via-serial-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Buildroot toolchain for Nuttx</title>
		<link>http://www.coding.com.br/embarcado/installing-buildroot-toolchain-for-nuttx/</link>
		<comments>http://www.coding.com.br/embarcado/installing-buildroot-toolchain-for-nuttx/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 06:44:42 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[cortex-m3]]></category>
		<category><![CDATA[lpc1768]]></category>
		<category><![CDATA[nuttx]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1436</guid>
		<description><![CDATA[On my previous post I discussed some stats using Buildroot toolchain to build Nuttx. Today I&#8217;ll add the necessary steps to build on Ubuntu. Ubuntu is de-facto GNU/Linux distribution (although I&#8217;m Gentoo user) and many users, from different areas, uses it [they are not necessary command line experts] so I decided to publish my raw [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">On my <a href="http://www.coding.com.br/embarcado/compiler-for-nuttx/" target="_blank">previous</a> post I discussed some stats using Buildroot toolchain to build Nuttx. Today I&#8217;ll add the necessary steps to build on Ubuntu. Ubuntu is<em> de-facto</em> GNU/Linux distribution (although I&#8217;m Gentoo user) and many users, from different areas, uses it [they are not necessary command line experts] so I decided to publish my <em>raw</em> tutorial. If you are familiarized installing files from source-code you probably won&#8217;t need this&#8230;</p>
<h2>1. Dependencies</h2>
<p style="padding-left: 30px;">$ sudo apt-get install libncurses5-dev<br />
$ sudo apt-get install bison<br />
$ sudo apt-get install flex<br />
$ sudo apg-get install libgmp3-dev<br />
$ sudo apg-get install libmpc-dev<br />
$ sudo apg-get install libmpfr-dev<br />
$ sudo apg-get install binutils-dev</p>
<h2>2. Download</h2>
<p style="padding-left: 30px;">$ mkdir Nuttx<br />
$ cd Nuttx</p>
<p style="padding-left: 30px;">$ wget http://sourceforge.net/projects/nuttx/files/nuttx/nuttx-5.10/nuttx-5.10.tar.gz/download<br />
$ wget http://sourceforge.net/projects/nuttx/files/buildroot/buildroot-1.8/buildroot-1.8.tar.gz/download</p>
<p style="padding-left: 30px;">$ ls<br />
buildroot-1.8.tar.gz  nuttx-5.10.tar.gz</p>
<h2>3. Install</h2>
<p style="padding-left: 30px;">$ tar zxf buildroot-1.8.tar.gz<br />
$ tar zxf nuttx-5.10.tar.gz</p>
<p style="padding-left: 30px;">$ cd misc/<br />
$ ln -s ../nuttx-5.10 nuttx</p>
<p>You need define some Nuttx files before:</p>
<p style="padding-left: 30px;">$ cd nuttx/<br />
$ cd tools/<br />
$ ./configure.sh nucleus2g/nsh # or ./configure &lt;board-name&gt;<br />
$ cd -</p>
<p style="padding-left: 30px;">$ cd ../misc</p>
<p>I&#8217;m building a <em>toolchain</em> for arm cortex-m3 but check configs/ to other configuration files.</p>
<p style="padding-left: 30px;">$ cd buildroot-1.8/<br />
$ cp configs/cortexm3-defconfig-4.3.3 .<br />
$ mv cortexm3-defconfig-4.3.3 .config</p>
<p style="padding-left: 30px;">$ make menuconfig<br />
[If you don't have any changes, just click on 'exit' and save the configuration]</p>
<p style="padding-left: 30px;">$ make<br />
[will download and build all necessary files]</p>
<p style="padding-left: 30px;">$ cd build_arm_nofpu/staging_dir/bin<br />
$ export PATH=`pwd`:$PATH<br />
$ cd -</p>
<p style="padding-left: 30px;">$ cd ../nuttx<br />
[use normally]</p>
<p>I usually create an script to (re)define the $PATH for necessary building tools, something like:</p>
<p style="padding-left: 30px;">$ echo &#8220;export PATH=\&#8221;"$PATH&#8221;\&#8221;" &gt; compiler.sh</p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;">
<p style="padding-left: 30px;">
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/installing-buildroot-toolchain-for-nuttx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiler for Nuttx</title>
		<link>http://www.coding.com.br/embarcado/compiler-for-nuttx/</link>
		<comments>http://www.coding.com.br/embarcado/compiler-for-nuttx/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 21:09:41 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[cortex-m3]]></category>
		<category><![CDATA[lpc1768]]></category>
		<category><![CDATA[nuttx]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1414</guid>
		<description><![CDATA[I was following this thread on Nuttx maillist on recommended compiler to build Nuttx RTOS. As a matter of practicality I guess that many users use CodeSourcery arm-none-linux-gnueabi but today I decided test the code generated for Cortex-M3 (LPC1768) using the toolchain from Buildroot. As Greg Nutt said (text adapted):
They were configured using OABI [old arm ABI], but [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I was following this <a href="http://article.gmane.org/gmane.comp.embedded.nuttx/102" target="_blank">thread</a> on Nuttx maillist on recommended compiler to build <a href="http://nuttx.sf.net">Nuttx RTOS</a>. As a matter of practicality I guess that many users use CodeSourcery <em><a href="http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2010q1-202-arm-none-linux-gnueabi.bin" target="_blank">arm-none-linux-gnueabi</a> </em>but today I decided test the code generated for Cortex-M3 (LPC1768) using the <em>toolchain</em> from <a href="http://sourceforge.net/projects/nuttx/files/buildroot/buildroot-1.8/" target="_blank">Buildroot</a>. As Greg Nutt said (text adapted):</p>
<blockquote><p><em>They were configured using OABI [old arm ABI], but I prefer them because (1) they are not EABI and reliably link code with -O3 or -Os, making it up to half the size, and (2) include nuttx &#8220;built in&#8221; &#8212; they really should be called arm-nuttx-gcc tools.</em></p></blockquote>
<p>Here my stats (<a href="http://www.coding.com.br/wp-content/uploads/2010/09/defconfig.txt" target="_blank">defconfig</a>):</p>
<p style="padding-left: 30px;">$ arm-none-eabi-size nutt<br />
text         data   bss       dec        hex      filename<br />
71000     324    2248   73572   11f64   nuttx</p>
<p style="padding-left: 30px;">$ arm-elf-size nuttx<br />
text         data    bss      dec         hex     filename<br />
56172     330    2248   58750    e57e   nuttx</p>
<p style="text-align: justify;">The final .bin has an <em>delta</em> of 16K. As I&#8217;m using one <a href="http://en.wikipedia.org/wiki/Wiggler_(JTAG)" target="_blank">parallel</a> JTAG (flash rates @ 0.2 KiB/S) this means almost <strong>1 minute</strong> reduction in each flash <a href="http://openocd.berlios.de/doc/html/Flash-Commands.html#Flash-Commands" target="_blank"><em>write_image</em></a>. If you check <a href="http://nuttx.cvs.sourceforge.net/viewvc/nuttx/nuttx/configs/nucleus2g/nsh/Make.defs?revision=1.2&amp;view=markup" target="_blank">Make.defs</a> note that MAXOPTIMIZATION for CodeSourcery isn&#8217;t using <em>optimize for size</em> option (-Os). As explained on config/&lt;board&gt;/<a href="http://nuttx.cvs.sourceforge.net/viewvc/nuttx/nuttx/configs/nucleus2g/README.txt?revision=1.6&amp;view=markuphttp://nuttx.cvs.sourceforge.net/viewvc/nuttx/nuttx/configs/nucleus2g/README.txt?revision=1.6&amp;view=markup" target="_blank">README.txt</a> it doesn&#8217;t work with this kind of optimization level [tested with 2009q1].</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/compiler-for-nuttx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Opcode stats</title>
		<link>http://www.coding.com.br/embarcado/opcode-stats/</link>
		<comments>http://www.coding.com.br/embarcado/opcode-stats/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 00:09:50 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1128</guid>
		<description><![CDATA[I was trying some GCC options and decided see how they affect assembly code generated. I&#8217;ve created a simple Python script that parses .s output and put in a human readable way. Suppose the classical Hello World program. The output will be something like:
$ python stats_opcodes.py file
For Cortex-m3 (check previous post):

At my laptop (x86):

 

Download the script here.
]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I was trying some GCC options and decided see how they affect assembly code generated. I&#8217;ve created a simple Python script that parses <em>.s</em> output and put in a human readable way. Suppose the classical <em>Hello World </em>program. The output will be something like:</p>
<p style="padding-left: 30px;">$ python stats_opcodes.py file</p>
<p>For Cortex-m3 (check <a href="http://www.coding.com.br/embarcado/cortex-m3-and-qemu/" target="_blank">previous</a> post):</p>
<p style="padding-left: 30px;"><img class="aligncenter size-full wp-image-1136" title="opcode-arm" src="http://www.coding.com.br/wp-content/uploads/2010/06/opcode-arm.png" alt="" width="304" height="194" /></p>
<p>At my laptop (x86):</p>
<p style="padding-left: 30px;"><img class="aligncenter size-full wp-image-1133" title="output" src="http://www.coding.com.br/wp-content/uploads/2010/06/opcodes1.png" alt="" width="306" height="194" /></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"><span style="line-height: 19px; white-space: normal;"> </span></span></span></span></p>
<p style="text-align: center;">
<p>Download the script <a href="http://gist.github.com/raw/452170/db097f735c52ffd733d2060603c203982d53b79f/stats_opcode.py" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/opcode-stats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
