<?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>HENJAB</title>
	<atom:link href="http://www.henjab.se/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.henjab.se</link>
	<description></description>
	<lastBuildDate>Thu, 13 Sep 2012 07:34:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Växjö</title>
		<link>http://www.henjab.se/?p=179</link>
		<comments>http://www.henjab.se/?p=179#comments</comments>
		<pubDate>Thu, 13 Sep 2012 07:34:24 +0000</pubDate>
		<dc:creator>anders</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.henjab.se/?p=179</guid>
		<description><![CDATA[My family and I have moved to Växjö. This means that an experienced software consultant (see linked in profile) is looking for new and existing projects in the region.]]></description>
			<content:encoded><![CDATA[<p>My family and I have moved to Växjö. This means that an experienced software consultant (see <a href="http://se.linkedin.com/pub/anders-henja/5/1b0/3a">linked in profile</a>) is looking for new and existing projects in the region.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henjab.se/?feed=rss2&amp;p=179</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>baltrad</title>
		<link>http://www.henjab.se/?p=130</link>
		<comments>http://www.henjab.se/?p=130#comments</comments>
		<pubDate>Sat, 25 Feb 2012 08:06:00 +0000</pubDate>
		<dc:creator>anders</dc:creator>
				<category><![CDATA[baltrad]]></category>
		<category><![CDATA[weather radar]]></category>

		<guid isPermaLink="false">http://www.henjab.se/?p=130</guid>
		<description><![CDATA[The last 3 years I have been chief architect and developer of an advanced weather radar network for the baltic sea region called baltrad (http://www.baltrad.eu). Finally we have released 1.0 of the baltrad software and it seems like we managed &#8230; <a href="http://www.henjab.se/?p=130">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div><a href="http://www.henjab.se/wp-content/uploads/2012/02/BALTRAD.png"><img class="alignnone size-full wp-image-133" title="BALTRAD" src="http://www.henjab.se/wp-content/uploads/2012/02/BALTRAD.png" alt="" width="200" height="75" /></a></div>
<div><a href="http://www.henjab.se/wp-content/uploads/2012/02/BALTRAD.png"></a>The last 3 years I have been chief architect and developer of an advanced weather radar network for the baltic sea region called baltrad (<a href="http://www.baltrad.eu">http://www.baltrad.eu</a>).</div>
<div>Finally we have released 1.0 of the baltrad software and it seems like we managed to produce a decently stable release even though we did quite a few huge changes in the end. It still has a number of issues but we have had it running for a couple of months now without any big surprises. You can find the software here <a href="http://git.baltrad.eu">http://git.baltrad.eu</a> or <a href="http://git.baltrad.eu/git/">http://git.baltrad.eu/git/</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.henjab.se/?feed=rss2&amp;p=130</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPC2478 Hello World</title>
		<link>http://www.henjab.se/?p=79</link>
		<comments>http://www.henjab.se/?p=79#comments</comments>
		<pubDate>Sun, 13 Feb 2011 21:18:49 +0000</pubDate>
		<dc:creator>anders</dc:creator>
				<category><![CDATA[LPC2478]]></category>

		<guid isPermaLink="false">http://www.henjab.se/?p=79</guid>
		<description><![CDATA[It is time to setup the basic development environment so that it is possible to compile a simple hello world program. The Olimex LPC2478 stk comes with a cdrom containing most of the necessary software but if you feel like experimenting you can always &#8230; <a href="http://www.henjab.se/?p=79">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It is time to setup the basic development environment so that it is possible to compile a simple hello world program. The Olimex LPC2478 stk comes with a cdrom containing most of the necessary software but if you feel like experimenting you can always find other versions at <a href="http://ftp.snapgear.org/pub/snapgear/tools/arm-linux">Snapgear</a> or <a href="http://www.uclinux.org/">uClinux</a>.</p>
<p>You will need to extract two different tar balls, either the ones provided on the cdrom or else by downloading them. When writing this post, I tried to use arm-linux-tools-20080623.tar.gz to build uClinux but ran into some unexpected behaviours. The objcopy generated extremly large vmlinux.bin files so if this happens, try the provided arm tools instead (arm-linux-tools-20061213.tar.gz).<br />
<strong>NOTE:</strong> The uClinix dist delivered with the olimex board comes patched so it might be a good idea using it initially.</p>
<p>I assume that the development environment should be placed under /opt/arm so let&#8217;s start by creating that directory.<br />
<code>%&gt; mkdir /opt/arm<br />
%&gt; cd /opt/arm</code></p>
<p>Extract the necessary tarballs.<br />
<code>%&gt; tar -xvzf .../Utils/arm-linux-tools-20061213.tar.gz<br />
%&gt; tar -xvzf .../uClinux/uClinux-dist-lpc_2478_stk-20081007.tgz</code></p>
<p>For some reason, genromfs was not included with the tools chain delivered with the Olimex development board so if you can&#8217;t locate it, fetch it and build it like this.</p>
<p><code>%&gt; wget http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/gcc-3/uclinux-tools-20040603/genromfs-0.5.1.tar.gz<br />
%&gt; tar -xvzf genromfs-0.5.1.tar.gz<br />
%&gt; cd genromfs-0.5.1<br />
%&gt; make<br />
%&gt; cd ..</code></p>
<p>Before building uClinux we need to setup the PATH,<br />
<code>%&gt; export PATH=/opt/arm/usr/local/bin:/opt/arm/genromfs-0.5.1:$PATH</code><br />
<code>%&gt; cd uClinux-dist-lpc_2478_stk</code></p>
<p>and clean it before building.</p>
<p><code>%&gt; make distclean<br />
%&gt; \rm -f tools/ucfront-g++<br />
%&gt; \rm -f tools/ucfront-gcc<br />
%&gt; \rm -f tools/ucfront-ld<br />
%&gt; \rm -f tools/cksum</code></p>
<p>Finally, it is time to build uClinux.<br />
<code>%&gt; make menuconfig</code></p>
<div id="attachment_101" class="wp-caption alignnone" style="width: 488px"><a href="http://www.henjab.se/wp-content/uploads/2011/02/menuconfig_main.jpg"><img class="size-full wp-image-101" title="menuconfig_main" src="http://www.henjab.se/wp-content/uploads/2011/02/menuconfig_main.jpg" alt="Menuconfig" width="478" height="332" /></a><p class="wp-caption-text">Menu config</p></div>
<p>Now, just set Vendor/Product to NXP/LPC2468 by choosing Vendor/Product Selection &#8212;&gt; Vendor -&gt; NXP. LPC2468 will automatically be choosen since it is the only alternative.</p>
<div id="attachment_104" class="wp-caption alignnone" style="width: 488px"><a href="http://www.henjab.se/wp-content/uploads/2011/02/NXP_LPC2468.jpg"><img class="size-full wp-image-104" title="NXP_LPC2468" src="http://www.henjab.se/wp-content/uploads/2011/02/NXP_LPC2468.jpg" alt="NXP and LPC2468" width="478" height="330" /></a><p class="wp-caption-text">NXP and LPC2468</p></div>
<p>Select Exit-&gt;Exit-&gt;Yes.</p>
<p><code>%&gt; make dep<br />
%&gt; make</code></p>
<p>Hopefully everything went well and you probably have got a couple of images directly under the subdirectory <code>images</code>. Most likely romfs_5.img and vmlinux.bin. We need to add the uClinux tools directory to our path as well.<br />
<code>%&gt; export PATH=/opt/arm/uClinux-dist-lpc_2478_stk/tools:$PATH</code></p>
<p>The new image files that we have created might be a good idea to use so you probably should copy them to tftps home catalogue so that you can boot from them instead.<br />
<code>%&gt; cp images/romfs_5.img /home/tftp/romfs_new.img<br />
%&gt; cp images/vmlinux.bin /home/tftp/vmlinux_new.bin</code></p>
<p>Finally it is time to create our hello world program and the associated makefile for building it. Create some work directory, like /projects/Olimex/HelloWorld.</p>
<p>Create helloworld.c and the Makefile (or download them from <a href="http://www.henjab.se/wp-content/uploads/2011/02/HelloWorld.zip">here</a>).</p>
<p><code>#include &lt;stdio.h&gt;<br />
int main(int argc, char** argv) {<br />
printf("\r\nHello world!\r\n");<br />
return 0;<br />
}</code></p>
<p>and create the Makefile<br />
<code><br />
CC=ucfront-gcc arm-linux-gcc<br />
LD=ucfront-gcc arm-linux-gcc</p>
<p>CFLAGS=-msoft-float -D__PIC__ -fpic -msingle-pic-base -Dlinux -D__linux__ -Dunix -D__uClinux__<br />
LDFLAGS=-Wl,--fatal-warnings -Wl,-elf2flt -msoft-float -L/opt/arm/uClinux-dist-lpc_2478_stk/uClibc/lib<br />
SOURCES=helloworld.c<br />
OBJECTS=$(SOURCES:.c=.o)</p>
<p>TARGET=helloworld<br />
.PHONY=all<br />
all: $(TARGET)</p>
<p>%.o : %.c<br />
&nbsp;$(CC) $(CFLAGS) -c $&lt;</p>
<p>$(TARGET): $(OBJECTS)<br />
&nbsp;$(LD) $(LDFLAGS) -o $@ $(OBJECTS) -lc</p>
<p>.PHONY=clean<br />
clean:<br />
&nbsp;\rm -f *.o<br />
&nbsp;\rm -f *~<br />
</code></p>
<p>Remember that Makefiles are very obnoxious when it comes to whitespacing, all commands must start with a tab character and not spaces so if you get an error about missing separator, check that line if it contains leading spaces instead of a tab.</p>
<p>Try compiling the hello world application.<br />
<code>%&gt; make</code></p>
<p>Hopefully the output will look something like this:</p>
<p><code>ucfront-gcc arm-linux-gcc -msoft-float -D__PIC__ -fpic -msingle-pic-base -Dlinux -D__linux__ -Dunix -D__uClinux__ -c helloworld.c<br />
ucfront-gcc arm-linux-gcc -Wl,--fatal-warnings -Wl,-elf2flt -msoft-float -L/opt/arm/uClinux-dist-lpc_2478_stk/uClibc/lib -o helloworld helloworld.o -lc<br />
</code><br />
Since we are going to use tftp to get the helloworld application to the dev-board, copy the program to tftps home directory.<br />
<code>%&gt; cp helloworld /home/tftp/</code></p>
<p>Let&#8217;s try to get it over to our development board, so first we need to do a short recap on what was done in &#8220;Getting started with Olimex LPC2478&#8243; but the short version is:</p>
<ul>
<li>Connect ethernet and rs232 cable to development board</li>
<li>Write &#8216;picocom -b 115200 /dev/ttyUSB0&#8242; in a terminal</li>
<li>Add power to the development board and hit any key while beeing in the picocom terminal within 3 seconds.</li>
<li>tftpboot 0xa0800000 192.168.1.100:romfs_new.img</li>
<li>tftpboot 0xa0008000 192.168.1.100:vmlinux_new.bin</li>
<li>go a0008000</li>
</ul>
<p>Since we are going to use tftp to get helloworld to the development board we need to start the eth0.<br />
<code># /sbin/ifconfig eth0 192.168.1.20 up</code></p>
<p>You can test if ethernet is working by typing<br />
<code># ping -c 1 192.168.1.100</code></p>
<p>Almost everything is read only so change directory to /var and fetch the helloworld application from the tftp server<br />
<code># cd /var<br />
# tftp -g -r helloworld 192.168.1.100<br />
# chmod +x helloworld<br />
# ./helloworld</p>
<p>Hello world!<br />
#<br />
</code></p>
<p>That&#8217;s about it.</p>
<p>As I wrote previously, I had some problems with the tools chain and extremely large images. I still haven&#8217;t figured out why it occured and I can not find any bug reported on objcopy but this is how it looked when listing the size.<br />
<code>%&gt; ls -la images/<br />
....<br />
-rw-r--r--  1 anders anders 2686629728 2011-02-13 19:53 vmlinux.bin<br />
</code></p>
<p>As you can see, vmlinux.bin is quite huge.</p>
<p>Another odd problem I had when writing this post was that printf only sent garbage characters to the console. After a lot of searching I found out that the CFLAGS in the Makefile needed <code>-D__PIC__ -fpic -msingle-pic-base</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henjab.se/?feed=rss2&amp;p=79</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Olimex LPC2478</title>
		<link>http://www.henjab.se/?p=41</link>
		<comments>http://www.henjab.se/?p=41#comments</comments>
		<pubDate>Tue, 21 Sep 2010 21:22:19 +0000</pubDate>
		<dc:creator>anders</dc:creator>
				<category><![CDATA[LPC2478]]></category>

		<guid isPermaLink="false">http://www.henjab.se/?p=41</guid>
		<description><![CDATA[Have you ever wanted to develop your first embedded application but always felt that the initial work assembling a complete development board would take too long time or just felt that it isn&#8217;t your cup of tea. Then you maybe &#8230; <a href="http://www.henjab.se/?p=41">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to develop your first embedded application but always felt that the initial work assembling a complete development board would take too long time or just felt that it isn&#8217;t your cup of tea. Then you maybe should take a look at the Olimex LPC2478 development board.</p>
<p>The Olimex LPC2478 development board is fully packed with nice features and it even has a nice steel cover and it is quite easy to get it up and running.</p>
<p>You will need the following items.</p>
<div>
<ul>
<li>Olimex LPC2478 development board (obviously)</li>
<li>A transformator (I use a 12V DC)</li>
<li>Null modem cable (and probably an USB to RS232 adaptor)</li>
</ul>
</div>
<div><span style="font-size: small;"><span style="line-height: 19px;"><img class="alignnone size-full wp-image-46" title="Olimex_2478" src="http://www.henjab.se/wp-content/uploads/2010/09/Olimex_2478.jpg" alt="Olimex 2478" width="478" height="320" /></span></span></div>
<p>Since the development board does not have sufficient non-volatile memory it is necessary to transfer the uClinix kernel and file system from an external resource every time the system is started. There are quite a few ways to do that but for now we will just do it over the network to get an easy start.</p>
<p>We will need to setup the development environment somewhat before we do anything else, my examples will be for ubuntu but it shouldn&#8217;t be much different to do it in other linuxes.</p>
<h3>TFTP server</h3>
<p>We are going to use the tftpboot method on the development board so we will have to install a tftp server.</p>
<p><span style="font-family: 'courier new', courier;"># Install necessary packages<br />
</span><span style="font-family: 'courier new', courier;">%&gt; sudo apt-get install xinetd tftpd tftp<br />
# Create some directory to store the boot images in<br />
%&gt; sudo mkdir /home/tftp<br />
</span><span style="font-family: 'courier new', courier;"># Copy the images from the olimex CD to the tftp directory<br />
%&gt; sudo cp /media/cdrom0/Images/romfs_5.img /home/tftp/<br />
%&gt; sudo cp /media/cdrom0/Images/vmlinux.bin /home/tftp/<br />
%&gt; sudo chmod -R a+rwx /home/tftp<br />
%&gt; sudo chown -R nobody /home/tftp<br />
# Create the tftp xinetd file<br />
%&gt; cat &lt;&lt;EOF &gt; /tmp/dummytftp<br />
service tftp {<br />
socket_type = dgram<br />
protocol = udp<br />
wait = yes<br />
user = nobody<br />
server = /usr/sbin/in.tftpd<br />
server_args = /home/tftp<br />
disable = no<br />
}<br />
</span><span style="font-family: 'courier new', courier;">EOF<br />
%&gt; sudo cp /tmp/dummytftp /etc/xinetd.d/tftp<br />
%&gt; sudo /etc/init.d/xinetd restart</span></p>
<h3>Terminal</h3>
<p>We will have to communicate with the development board through a serial terminal so let&#8217;s install picocom.</p>
<p><span style="font-family: 'courier new', courier;"> %&gt; sudo apt-get install picocom</span></p>
<div>
<ol>
<li>Connect null modem cable between PC and LPC2478</li>
<li>Connect a ethernet cable to the LPC2478</li>
<li>Run &#8216;picocom -b 115200 /dev/ttyUSB0&#8242; in a terminal</li>
<li>Add power to LPC2478</li>
<li>Within 3 seconds hit any key in the active picocom terminal.</li>
</ol>
</div>
<p>If everything looks like</p>
<div><a href="http://www.henjab.se/wp-content/uploads/2010/09/uBooted.jpg"><img class="alignnone size-full wp-image-49" title="uBooted" src="http://www.henjab.se/wp-content/uploads/2010/09/uBooted.jpg" alt="u booted" width="533" height="320" /></a></div>
<p>you are still on track and it is time to load the images.  You will have to figure out if the preset network parameters that are in the olimex development board will work with your network or not. The preset network information is 192.168.0.158 / 255.255.255.0. I am using 192.168.1.X network and have quite a lot of reserved addresses so I will use the following configuration.</p>
<div>
<ul>
<li>Olimex development board ip address: 192.168.1.20</li>
<li>Gateway: 192.168.1.1</li>
<li>Tftp server ip address: 192.168.1.102</li>
</ul>
</div>
<p>Now we should just store a couple of environment variables in the flash memory on the LPC2478.</p>
<p><span style="font-family: 'courier new', courier;">lpc-2478-stk # setenv serverip 192.168.1.102<br />
lpc-2478-stk # setenv ipaddr 192.168.1.20<br />
lpc-2478-stk # setenv gatewayip 192.168.1.1<br />
lpc-2478-stk # saveenv</span></p>
<p>First we load the file system and then the kernel.</p>
<p><span style="font-family: 'courier new', courier;"> lpc-2478-stk # tftpboot 0xa0800000 192.168.1.102:romfs_5.img<br />
lpc-2478-stk # tftpboot 0xa0008000 192.168.1.102:vmlinux.bin</span></p>
<p>The result will hopefully look like this</p>
<div><a href="http://www.henjab.se/wp-content/uploads/2010/09/Images_loaded.jpg"><img class="alignnone size-full wp-image-50" title="Images_loaded" src="http://www.henjab.se/wp-content/uploads/2010/09/Images_loaded.jpg" alt="images loaded" width="590" height="320" /></a></div>
<p>Finally we hope that everything will boot.</p>
<p><span style="font-family: 'courier new', courier;">lpc-2478-stk # go a0008000</span></p>
<div id="_mcePaste"><a href="http://www.henjab.se/wp-content/uploads/2010/09/uClinux_booted1.jpg"><img class="alignnone size-full wp-image-52" title="uClinux_booted" src="http://www.henjab.se/wp-content/uploads/2010/09/uClinux_booted1.jpg" alt="uClinux loaded" width="517" height="320" /></a></div>
<p>The display will look something like</p>
<div><a href="http://www.henjab.se/wp-content/uploads/2010/09/System_booted.jpg"><img class="alignnone size-full wp-image-61" title="System_booted" src="http://www.henjab.se/wp-content/uploads/2010/09/System_booted.jpg" alt="System booted" width="478" height="320" /></a></div>
<p>That&#8217;s it, you have got a running uClinux and you got the world at your feets&#8230;</p>
<p>I will post more posts about the olimex development board in the future so drop in now and then.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henjab.se/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://www.henjab.se/?p=1</link>
		<comments>http://www.henjab.se/?p=1#comments</comments>
		<pubDate>Tue, 14 Sep 2010 20:37:39 +0000</pubDate>
		<dc:creator>anders</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=1</guid>
		<description><![CDATA[Finally I have had the time to setup the site for my company. In the future various technical related posts will be posted here but now the standard sell pitch. With a solid track record in software development I can &#8230; <a href="http://www.henjab.se/?p=1">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Finally I have had the time to setup the site for my company. In the future various technical related posts will be posted here but now the standard sell pitch.</p>
<p>With a solid track record in software development I can  offer you assistance in several areas. I have more than 15 years of experience in software development, mostly C, Python and Java in various unices. Seven years has been in the mobile industry where half of the time was the service provisioning side and the other half was handset development. Six years has been various research and development projects in nowcasting systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henjab.se/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
