<?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>ComSubVies Creative Content &#187; Linux</title>
	<atom:link href="http://blog.ocrs.at/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ocrs.at</link>
	<description></description>
	<lastBuildDate>Wed, 17 Mar 2010 12:23:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Silex SX-560 Embedded WLAN</title>
		<link>http://blog.ocrs.at/2009/12/21/silex-sx-560-embedded-wlan/</link>
		<comments>http://blog.ocrs.at/2009/12/21/silex-sx-560-embedded-wlan/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 18:37:46 +0000</pubDate>
		<dc:creator>Markus Schabel</dc:creator>
				<category><![CDATA[Informatik]]></category>
		<category><![CDATA[Modellbau]]></category>
		<category><![CDATA[Embedded Systems]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SX-560]]></category>
		<category><![CDATA[WLAN]]></category>

		<guid isPermaLink="false">http://blog.ocrs.at/?p=847</guid>
		<description><![CDATA[Das SX-560 ist ein kleines embedded WLAN Modul, auf dem bereits ein Linux läuft. Meines ist gerade angekommen und ich habe damit zumindest mal die ersten Versuche unternommen - Inbetriebnahme und erste Schritte.]]></description>
			<content:encoded><![CDATA[<p>Nachdem inzwischen mein <a href="http://www.silexamerica.com/products/wireless_modules/sx-560.html">SX-560</a> inklusive Development-Board angekommen ist, habe ich mich heute gleich mal damit spielen müssen.</p>
<p>Der Lieferumfang des Development-Boards ist jedenfalls sehr ausführlich: 3 serielle Kabel, 2 externe Stabantennen, eine externe Stehantenne, eine Netzgerät mit echtem und mit amerikanischem Anschlusskabel sowie einer Software-CD.</p>
<p>Nach erfolgreichem Zusammenbau und erstem Schock, weil die orange Power-On-LED nur kurz nach dem Anstecken aufblinkt und dann ausgeht habe ich mein serielles Kabel am Mac angesteckt und eine Screen-Session darüber gestartet:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ screen -T vt100 /dev/tty.usbserial 115200</div></div>
<p>Und schon sieht man den Boot-Prozess des Gerätes.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CPU: &nbsp; S3C2412@200MHz<br />
&nbsp; &nbsp; &nbsp; &nbsp;Fclk = 200MHz, Hclk = 100MHz, Pclk = 50MHz<br />
Board: SMDK2412 &nbsp;SDRAM 16bits <br />
DRAM: &nbsp;16 MB<br />
Flash: &nbsp;8 MB<br />
In: &nbsp; &nbsp;serial<br />
Out: &nbsp; serial<br />
Err: &nbsp; serial<br />
Hit any key to stop autoboot: &nbsp;0 <br />
## Booting image at 00040000 ...<br />
&nbsp; &nbsp;Image Name: &nbsp; Linux Kernel<br />
&nbsp; &nbsp;Created: &nbsp; &nbsp; &nbsp;2008-05-24 &nbsp;15:47:46 UTC<br />
&nbsp; &nbsp;Image Type: &nbsp; ARM Linux Kernel Image (gzip compressed)<br />
&nbsp; &nbsp;Data Size: &nbsp; &nbsp;988488 Bytes = 965.3 kB<br />
&nbsp; &nbsp;Load Address: 30008000<br />
&nbsp; &nbsp;Entry Point: &nbsp;30008000<br />
&nbsp; &nbsp;Verifying Checksum ... OK</div></div>
<p>Nach kurzen nachschauen im Manual habe ich dann auch gleich das Passwort (admin / access) gefunden &#8211; und den hinweis überlesen, das bei älteren Firmware-Versionen root als Benutzer zu verwenden ist. Naja, 3 Versuche später hab ich es dann erfolgreich erraten.</p>
<p>Erster Schritt am eingeloggten System: welche Version hamma denn?</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># cat /proc/version <br />
Linux version 2.6.16.11 (bill@localhost.localdomain) (gcc version 3.4.6) #160 Sat May 24 08:47:34 PDT 2008</div></div>
<p>Dann mal die Überprüfung, wie viel Speicherplatz wir denn eigentlich verwenden (dabei habe ich auch gleich festgestellt, das jffs2 als root-Filesystem verwendet wird):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># df -h<br />
Filesystem &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp; &nbsp; &nbsp;Used Available Use% Mounted on<br />
rootfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6.8M &nbsp; &nbsp; &nbsp;3.5M &nbsp; &nbsp; &nbsp;3.2M &nbsp;52% /<br />
/dev/root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6.8M &nbsp; &nbsp; &nbsp;3.5M &nbsp; &nbsp; &nbsp;3.2M &nbsp;52% /<br />
tmpfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8.0M &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp;8.0M &nbsp; 0% /tmp<br />
tmpfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 248.0k &nbsp; &nbsp; 20.0k &nbsp; &nbsp;228.0k &nbsp; 8% /var</div></div>
<p>Hm, nicht viel, sollte aber für&#8217;s erste Mal ausreichen. Sodann überprüfe ich einmal, welche Module denn verwendet werden &#8211; in der Vermutung, das das sicher teilweise recht spezifische sein werden:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># lsmod<br />
Module &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp;Used by &nbsp; &nbsp;Tainted: P &nbsp;<br />
sx560_gpio &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3432 &nbsp;2 <br />
ar6000 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;173628 &nbsp;0 <br />
sdio_s3c2412 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16132 &nbsp;0 <br />
sdio_busdriver &nbsp; &nbsp; &nbsp; &nbsp; 78984 &nbsp;2 ar6000,sdio_s3c2412<br />
sdio_lib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6656 &nbsp;2 ar6000,sdio_busdriver</div></div>
<p>Eigentlich sollte ich ja eine aktuelle Version der Firmware installieren, aber das funktioniert irgendwie nicht so wie geplant &#8211; es ist zwar möglich, diese via TFTP oder auch über das eigene UpdateIP Programm auf das SX-560 zu transferieren, dort passiert aber genau nichts damit. Ich vermute das ist ein Problem der frühen Version (1.00A scheint das bei mir zu sein, offenbar sind da irgendwelche alten Lagerhallten bei der Bestellung geräumt worden).</p>
<p>Der nächste Schritt ist es, die Tool Chain für das Ding zu laden und zu installieren. Dabei gibt es im wesentlichen 2 verschiedene Dinge und Ergebnisse:</p>
<h3>Erzeugen eines neuen Root-Filesystems</h3>
<p>Damit habe ich mich noch nicht wirklich sonderlich auseinander gesetzt, weil ich annehme, dass die ohnehin vorhandenen Firmware-Images ganz brauchbar sind. Und auf 8MB Flash lässt sich ja auch nicht sonderlich viel unterbringen. Die dazu benötigten Files findet man jedenfalls <a href="http://www.silexamerica.com/engineering/SX-560/">hier</a> auf der Silex Homepage, wobei zu beachten ist, das man bei einer aktuellen Version von Buildroot ein paar Anpassungen durchführen muss, die im folgenden Abschnitt erklärt werden. Wenn man sich jedenfalls an die Anleitung in der dortigen Readme hält, bekommt man als Endresultat ein ext2-Image (eventuell sollte man hier also noch etwas umkonfigurieren, um ein JFFS2 Image zu erhalten).</p>
<h3>Erzeugen einer Tool-Chain um eigene Programme zu erstellen</h3>
<p>Für diese Aufgabe ist auf der Silex Homepage ebenfalls eine <a href="http://www.silexamerica.com/support/downloads/documentation/wireless_modules/sx-560/sx560_tools_a.pdf">Anleitung</a> zu finden, an die man sich weitgehend halten kann. Es waren lediglich zwei Dinge umzukonfigurieren: die Version des empfohlenen Kernels ist nicht mehr in der Auswahlliste vorhanden, da der schon zu verstaubt ist. Ich habe es noch nicht probiert, ob das ganze auch mit einem aktuellen Kernel noch funktioniert (bzw. sich mit dem installierten 2.6.16er verträgt) &#8211; insbesondere da ja auch in der Anleitung nicht die aktuelle sondern die vorige Version verwendet wird. Dazu muss man nach dem <code class="codecolorer text default"><span class="text">make menuconfig</span></code> in der <code class="codecolorer text default"><span class="text">.config</span></code> die Optione <code class="codecolorer text default"><span class="text">BR2_KERNEL_HEADERS_2_6_22=y</span></code> einfügen, und den Default-Kernel ändern:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">BR2_KERNEL_HEADERS_2_6_22=y<br />
BR2_DEFAULT_KERNEL_HEADERS=&quot;2.6.22&quot;</div></div>
<p>Im Anschluss kann man das ganze Ding kompilieren, wobei er sich da zumindest zweimal dastoßen wird: beim Kernel und bei der Libc. In beiden Fällen betrifft es eine Inkompatibilität der <code class="codecolorer text default"><span class="text">unifdef.c</span></code> mit der <code class="codecolorer text default"><span class="text">stdio.h</span></code>, sodass die Datei <code class="codecolorer text default"><span class="text">unifdef.c</span></code> bei der er da jeweils meckert entsprechend adaptiert werden muss (siehe auch <a href="http://patchwork.kernel.org/patch/11166/">dieser</a> Kernel-Patch):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">diff --git a/scripts/unifdef.c b/scripts/unifdef.c<br />
index 552025e..977e682 100644<br />
--- a/scripts/unifdef.c<br />
+++ b/scripts/unifdef.c<br />
@@ -206,7 +206,7 @@ &nbsp;static void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; done(void);<br />
&nbsp;static void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error(const char *);<br />
&nbsp;static int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;findsym(const char *);<br />
&nbsp;static void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; flushline(bool);<br />
-static Linetype &nbsp; &nbsp; &nbsp; &nbsp; getline(void);<br />
+static Linetype &nbsp; &nbsp; &nbsp; &nbsp; parseline(void);<br />
&nbsp;static Linetype &nbsp; &nbsp; &nbsp; &nbsp; ifeval(const char **);<br />
&nbsp;static void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ignoreoff(void);<br />
&nbsp;static void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ignoreon(void);<br />
@@ -512,7 +512,7 @@ &nbsp;process(void)<br />
&nbsp;<br />
&nbsp; for (;;) {<br />
&nbsp; &nbsp; linenum++;<br />
- &nbsp; lineval = getline();<br />
+ &nbsp; lineval = parseline();<br />
&nbsp; &nbsp; trans_table[ifstate[depth]][lineval]();<br />
&nbsp; &nbsp; debug(&quot;process %s -&gt; %s depth %d&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; linetype_name[lineval],<br />
@@ -526,7 +526,7 @@ &nbsp;process(void)<br />
&nbsp; * help from skipcomment().<br />
&nbsp; */<br />
&nbsp;static Linetype<br />
-getline(void)<br />
+parseline(void)<br />
&nbsp;{<br />
&nbsp; const char *cp;<br />
&nbsp; int cursym;</div></div>
<p>Wenn das alles erfolgreich funktioniert hat, findet man im Verzeichnis <code class="codecolorer text default"><span class="text">build_arm/staging_dir/usr/bin/</span></code> den Cross-Compiler <code class="codecolorer text default"><span class="text">arm-linux-gcc</span></code> sowie weitere Tools. Damit kann dann das erste Programm erstellt, kompiliert und mittels TFTP auf den SX-560 kopiert werden.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.ocrs.at/2009/12/21/silex-sx-560-embedded-wlan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

