<?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>Headnut.org &#187; Chris</title>
	<atom:link href="http://www.headnut.org/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.headnut.org</link>
	<description>Musings of a Nut</description>
	<lastBuildDate>Thu, 09 Jun 2011 23:25:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>OpenEmbedded bblayers and bbappend</title>
		<link>http://www.headnut.org/2011/06/09/openembedded-bblayers-and-bbappend/</link>
		<comments>http://www.headnut.org/2011/06/09/openembedded-bblayers-and-bbappend/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 23:23:58 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bitbake]]></category>
		<category><![CDATA[openembedded]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=129</guid>
		<description><![CDATA[I recently found a blog posting at http://sakrah.homelinux.org/blog/2010/11/bblayers-bbappend/ that discusses two new features in OE: bblayers and bbappend. This is a huge step forward in improving the maintainability of large scale OE developments. I&#8217;ll post more once I&#8217;ve had a chance to look through the features a bit more. (This posting was really just an [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found a blog posting at <a href="http://sakrah.homelinux.org/blog/2010/11/bblayers-bbappend/">http://sakrah.homelinux.org/blog/2010/11/bblayers-bbappend/</a> that discusses two new features in OE: <strong>bblayers</strong> and <strong>bbappend</strong>.  This is a huge step forward in improving the maintainability of large scale OE developments.  I&#8217;ll post more once I&#8217;ve had a chance to look through the features a bit more.</p>
<p>(This posting was really just an archive of the link to the blog for me!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2011/06/09/openembedded-bblayers-and-bbappend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s needed to run an engineering department?</title>
		<link>http://www.headnut.org/2011/03/15/running-engineering/</link>
		<comments>http://www.headnut.org/2011/03/15/running-engineering/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 04:53:11 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[management]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=122</guid>
		<description><![CDATA[The past few years have been a huge learning opportunity for me. I&#8217;ve had the pleasure working with a great team and the flexibility to design an engineering department from the ground up. With that in mind, here are some of the key lessons learned during that time. People People are the main ingredient in [...]]]></description>
			<content:encoded><![CDATA[<p>The past few years have been a huge learning opportunity for me.  I&#8217;ve had the pleasure working with a great team and the flexibility to design an engineering department from the ground up.  With that in mind, here are some of the key lessons learned during that time.</p>
<p><span id="more-122"></span></p>
<p><b>People</b></p>
<p>People are the main ingredient in an engineering organization.  When interviewing candidates, I look for three qualities: professionalism, interest, and interpersonal skills.</p>
<p>Professionalism is an aggregation of three attributes.  First, self-control and a system of ethics.  Second, competency and expertise in a technical area and an awareness of how that technical area links to the larger picture.  Third, selflessness (or doing what&#8217;s best for the organization before any personal gain.)</p>
<p>Interest is sharing values between the candidate and organization.  This includes a personalized understanding of the organization&#8217;s mission, vision, and core values.</p>
<p>Interpersonal skills are the final component to the recipe.  How does the candidate work in a team environment?  What is his/her behavior during a conflict?  During stressful times?  Does the candidate look for realistic, productive solutions?</p>
<p><b>Software</b></p>
<ul>
<li><a href="http://www.igniterealtime.org/projects/openfire">OpenFire</a></li>
<li><a href="http://www.dokuwiki.org">DokuWiki</a></li>
<li><a href="http://subversion.tigris.org">Subversion</a></li>
<li><a href="http://openembedded.org">OpenEmbedded</a></li>
<li><a href="http://www.mantisbt.org">Mantis Bug Tracker</a></li>
<li><a href="http://www.gurock.com/testrail">Gurock TestRail</a></li>
</ul>
<p>The cornerstone of any successful team is communication.  To aid with that, we selected two packages: OpenFire and DokuWiki.  OpenFire is a Jabber-based instant messaging server that is compatible with any Jabber/XMPP client such as Adium, Pidgin, Spark, etc.  DokuWiki is an extremely powerful wiki that can be used as a scratch board, requirements/specifications repository, etc.</p>
<p>Next in the process is coding.  Our repository of choice is Subversion, with each project split into the standard <i>trunk/branches/tags</i> hierarchy.  (We did evaluate git, but decided Subversion worked better for our needs.  Either would probably have worked well.)</p>
<p>The build system is a close third, and OpenEmbedded is a winner here.  For embedded systems development, it greatly simplifies the entire build process.  <a href="http://www.headnut.org/tag/openembedded">In previous postings</a>, I&#8217;ve discussed OE in great detail.</p>
<p>Of course, coding is nothing without quality.  Tracking issues (and features and roadmaps) is the responsibility of Mantis.  TestRail, the only package with licensing, linked in with Mantis and provided our QA team the ability to create test suites and test cases, assign test runs to specific people, and track progress towards release.</p>
<p><b>Planning</b></p>
<p>“In preparing for battle I have always found that plans are useless, but planning is indispensable&#8221; (Dwight D. Eisenhower).  Know your mission, know what success means in a measurable way, and communicate that information to everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2011/03/15/running-engineering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bitbake via GIT</title>
		<link>http://www.headnut.org/2009/11/29/bitbake-via-git/</link>
		<comments>http://www.headnut.org/2009/11/29/bitbake-via-git/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 14:03:48 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bitbake]]></category>
		<category><![CDATA[openembedded]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=115</guid>
		<description><![CDATA[Bitbake recently converted from SVN to GIT.  As such, many users may be wondering where to get the latest and greatest updates.  The new repository has moved to git://git.openembedded.org/bitbake.git. To checkout Bitbake 1.8.18 (the latest as of this writing), use the following instructions: $ git clone git://openembedded.org/bitbake.git $ cd bitbake $ git checkout 1.8.18 You [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bitbake.berlios.de">Bitbake</a> recently converted from SVN to GIT.  As such, many users may be wondering where to get the latest and greatest updates.  The new repository has moved to <a href="http://cgit.openembedded.org/cgit.cgi/bitbake/">git://git.openembedded.org/bitbake.git</a>.</p>
<p>To checkout Bitbake 1.8.18 (the latest as of this writing), use the following instructions:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">$</span> git clone git://openembedded.org/bitbake.git
<span style="color: #0000ff;">$</span> cd bitbake
<span style="color: #0000ff;">$</span> git checkout 1.8.18</pre>
<p>You can see a list of current tags and upgrade to a specific one, if desired:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">$</span> git tag -l</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2009/11/29/bitbake-via-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing OpenEmbedded</title>
		<link>http://www.headnut.org/2009/08/12/customizing-openembedded/</link>
		<comments>http://www.headnut.org/2009/08/12/customizing-openembedded/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 21:48:45 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[at91sam9263]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[openembedded]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=92</guid>
		<description><![CDATA[This third post in a series focuses on creating your own &#8220;distribution&#8221; using OpenEmbedded. The instructions below assume that you have a working build system that can produce binaries that run on the Atmel AT91SAM9263-EK board using NAND flash memory. Our goal at the end of this post is to have an OE environment that: [...]]]></description>
			<content:encoded><![CDATA[<p>This third post in a series focuses on creating your own &#8220;distribution&#8221; using OpenEmbedded.  The instructions below assume that you have a <a href="http://www.headnut.org/2009/08/08/building-oe-workspace/">working build system</a> that can <a href="http://www.headnut.org/2009/08/09/flashing-the-at91sam9263-ek-board/">produce binaries that run</a> on the <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057">Atmel AT91SAM9263-EK</a> board using NAND flash memory.</p>
<p>Our goal at the end of this post is to have an OE environment that:</p>
<ol>
<li>builds images for a custom board based on the AT91SAM9263-EK;</li>
<li>adds the patches needed for the custom board to AT91Bootstrap, U-boot, and the Linux kernel; and</li>
<li>creates a custom root filesystem, bundled with programs that you want installed in the default image.</li>
</ol>
<p>Lots to do, so let&#8217;s get started!<span id="more-92"></span></p>
<h2>Creating the Agama9263 Machine</h2>
<p>The <a href="http://www.headnut.org/wp-content/uploads/2009/08/Agama9263-Board.pdf">Agama9263</a> machine will be a spin-off of the Atmel AT91SAM9263-EK.  The quick overview of technical specifications for this new machine is below:</p>
<ul>
<li><a href="http://www.atmel.com">Atmel AT91SAM9263 Rev. B</a> processor</li>
<li>18.432 MHz main crystal</li>
<li>~200 Hz master clock</li>
<li><a href="http://www.numonyx.com">Numonyx NAND02GW3B2D</a> NAND flash (256 MB, 8-bit wide)</li>
<li>(2) <a href="http://www.micron.com">Micron MT48LC8M16A2B4</a> SDRAM (Each 32 MB, 16-bit wide &#8212; connected in 32-bit wide mode for 64 MB total RAM)</li>
<li>(2) USB host ports</li>
<li>(1) USB gadget port (for programming)</li>
<li>(1) RS-232 Debug UART port (/dev/ttyS0, for programming)</li>
<li>(1) RS-232 UART port (/dev/ttyS1, for user output)</li>
</ul>
<p>A <a href="http://www.headnut.org/wp-content/uploads/2009/08/Agama9263-Board.pdf">high-level block diagram</a> of the Agama9263 is available.</p>
<p>Since this machine is based on an existing one, we first start by copying the OE machine configuration file:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> cd ~/workspace/local/conf/machine
<span style="color: #0000ff;">#</span> cp at91sam9263ek.conf agama9263.conf</pre>
<p>Load up the new file in your favorite editor and let&#8217;s tweak it:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #ff0000;">#@TYPE: Machine
#@Name: Agama9263 from Headnut.org
#@DESCRIPTION: Machine configuration for the Agama9263 board with a at91sam9263 processor
</span>
TARGET_ARCH = "arm"
<span style="color: #0000ff;">#PACKAGE_EXTRA_ARCHS = "armv4t armv5te"
</span>
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_VERSION_linux = "2.6.28"
PREFERRED_PROVIDER_xserver = "xserver-kdrive"

KERNEL_IMAGETYPE = "uImage"
<span style="color: #ff0000;">UBOOT_MACHINE = "agama9263_nandflash_config"
</span>AT91BOOTSTRAP_MEDIA = "nandflash"

PREFERRED_VERSION_at91bootstrap = "1.14"

#don't try to access tty1
USE_VT = "0"

MACHINE_FEATURES = "kernel26 ext2 usbhost usbgadget screen touchscreen"
EXTRA_IMAGEDEPENDS += "u-boot"
EXTRA_IMAGEDEPENDS += "at91bootstrap"

# used by sysvinit_2
<span style="color: #ff0000;">SERIAL_CONSOLE = "115200 ttyS1"
</span>IMAGE_FSTYPES ?= "jffs2"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"

require conf/machine/include/tune-arm926ejs.inc</pre>
<p>We also need to update <code>~/workspace/local/conf/local.conf</code> to point to this new machine:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">DL_DIR = "<strong>/home/chris</strong>/sources"

<span style="color: #0000ff;"># BitBake configuration
</span>BBFILES = "<strong>/home/chris</strong>/workspace/openembedded/recipes/*/*.bb"
BBFILES += "<strong>/home/chris</strong>/workspace/local/recipes/*/*.bb"
BBFILE_COLLECTIONS="upstream local"
BBFILE_PATTERN_upstream = "^/workspace/openembedded/"
BBFILE_PATTERN_local = "^/workspace/local/"
BBFILE_PRIORITY_upstream = "5"
BBFILE_PRIORITY_local = "10"
BBMASK = ""

<span style="color: #0000ff;"># Uncomment the next line to have BitBake output debug messages
# BBDEBUG = "yes"

# Uncomment the next line to have BitBake emit a log upon an error
</span>BBINCLUDELOGS = "yes"

<span style="color: #0000ff;"># OpenEmbedded configuration
</span><span style="color: #ff0000;">MACHINE = "agama9263"
</span>DISTRO = "angstrom-2008.1"
IMAGE_FSTYPES = "jffs2"
ENABLE_BINARY_LOCALE_GENERATION = "0"
<span style="color: #0000ff;"># GLIBC_GENERATE_LOCALES = "en_US.UTF-8"
</span>
<span style="color: #0000ff;"># Select between multiple alternative providers, if more than one is eligible.
</span>PREFERRED_PROVIDERS = "virtual/qte:qte virtual/libqpe:libqpe-opie"
PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-x11"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-intermediate:gcc-cross-intermediate"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"</pre>
<p>Now the remainder of the work involves porting the various applications that have board-specific support.</p>
<h2>Modifying AT91Bootstrap</h2>
<p>In our second post, we created a new recipe for AT91Bootstrap that added version 1.14 to OE.  Now we need to take that one step further, adding our custom board to the AT91Bootstrap sources.  To get started, create a repository for our patches:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"># mkdir -p ~/workspace/local/recipes/at91bootstrap/at91bootstrap-1.14/agama9263</pre>
<p><a href="http://www.headnut.org/wp-content/uploads/2009/08/at91bootstrap-1.14-agama9263.patch">Download <code>at91bootstrap-1.14-agama9263.patch</code></a> and save it to <code>~/workspace/local/recipes/at91bootstrap/at91bootstrap-1.14/agama9263/</code>.  Next, modify <code>at91bootstrap_1.14.bb</code> to include the following:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">DESCRIPTION = "at91bootstrap: loaded into internal SRAM by AT91 BootROM"
SECTION = "bootloaders"
PR = "r0"

SRC_URI = " \
     ftp://www.linux4sam.org/pub/at91bootstrap/AT91Bootstrap${PV}.zip \
"

<span style="color: #ff0000;">SRC_URI_append_agama9263 = " \
     file://at91bootstrap-1.14-agama9263.patch;patch=1;pnum=0 \
"
</span>
S = "${WORKDIR}/Bootstrap-v${PV}"
PACKAGE_ARCH = "${MACHINE_ARCH}"
EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} DESTDIR=${DEPLOY_DIR_IMAGE} REVISION=${PR}"

AT91BOOTSTRAP_MEDIA ?= "nandflash"

do_compile () {
     unset LDFLAGS
     unset CFLAGS
     unset CPPFLAGS

     rm -Rf ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.bin
     rm -Rf ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.elf
     rm -Rf ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.map
     oe_runmake -C ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA} AT91_CUSTOM_FLAGS="${AT91BOOTSTRAP_FLAGS}" rebuild
}

do_install () {
     install -d ${DEPLOY_DIR_IMAGE}
     install -m 0755 \
          ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.bin \
          ${DEPLOY_DIR_IMAGE}/${MACHINE}-${AT91BOOTSTRAP_MEDIA}boot-${PV}-${PR}.bin
     rm -Rf ${DEPLOY_DIR_IMAGE}/at91bootstrap.bin
     cd ${DEPLOY_DIR_IMAGE} \
          &amp;&amp; ln -sf ${MACHINE}-${AT91BOOTSTRAP_MEDIA}boot-${PV}-${PR}.bin at91bootstrap.bin
}</pre>
<p>And that&#8217;s all, folks.  The beauty of OE is that such complex tasks like adding board support are made so ridiculously simple at the build level.</p>
<p>You can incrementally rebuild AT91Bootstrap through the <code>make bb PACKAGE="at91bootstrap"</code> command.  (Remember to do it once with <code>CMD="-c clean"</code> and again with no <code>CMD</code> argument.)</p>
<h2>Modifying U-boot</h2>
<p>Similar to the process we followed with AT91Bootstrap, a patch must be added to the U-boot recipe.  For the Agama9263 machine, we&#8217;ve provided one for you.</p>
<p>Before we apply the patch, however, we must first create a copy of the U-boot recipe into our local overlay.  While we&#8217;re doing this, let&#8217;s go ahead and make the machine-specific subfolder for the patch require:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> cp -R ~/workspace/openembedded/recipes/u-boot/ \
     ~/workspace/local/recipes/u-boot/
<span style="color: #0000ff;">#</span> mkdir -p ~/workspace/local/recipes/u-boot/u-boot-2009.01/agama9263/</pre>
<p><a href="http://www.headnut.org/wp-content/uploads/2009/08/u-boot-2009.01-agama9263.patch">Download <code>u-boot-2009.01-agama9263.patch</code></a> and save it to <code>~/workspace/local/recipes/u-boot/u-boot-2009.01/agama9263/</code>.  Next, let&#8217;s modify the <code>u-boot_2009.01.bb</code> recipe to include the patch:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">require u-boot.inc

PV = "2009.01"

DEFAULT_PREFERENCE = "-1"

DEFAULT_PREFERENCE_at91rm9200dk  = "1"
DEFAULT_PREFERENCE_at91sam9rlek  = "1"
DEFAULT_PREFERENCE_at91sam9260ek = "1"
DEFAULT_PREFERENCE_at91sam9261ek = "1"
DEFAULT_PREFERENCE_at91sam9g20ek = "-1"
DEFAULT_PREFERENCE_at91sam9263ek = "1"
DEFAULT_PREFERENCE_at91cap9adk   = "1"
DEFAULT_PREFERENCE_atngw100      = "1"
DEFAULT_PREFERENCE_atstk1000     = "1"
<span style="color: #ff0000;">DEFAULT_PREFERENCE_agama9263     = "1"</span>

PR = "r1"

SRC_URI = "ftp://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2"

SRC_URI_append_at91sam9263ek = " \
     file://u-boot-2009.01-exp-002-at91sam9g20ek.patch;patch=1 \
     file://u-boot-2009.01-exp-003-drivers-net-macb.c.patch;patch=1 \
"

SRC_URI_append_at91sam9g20ek = " \
     file://u-boot-2009.01-exp-002-at91sam9g20ek.patch;patch=1 \
     file://u-boot-2009.01-exp-003-drivers-net-macb.c.patch;patch=1 \
     file://at91sam9g20-fix-config.patch;patch=1 \
"

<span style="color: #ff0000;">SRC_URI_append_agama9263 = " \
     file://u-boot-2009.01-exp-002-at91sam9g20ek.patch;patch=1 \
     file://u-boot-2009.01-exp-003-drivers-net-macb.c.patch;patch=1 \
     file://u-boot-2009.01-agama9263.patch;patch=1;pnum=0 \
"</span></pre>
<p>Thus has support for the Agama9263 platform been added to U-boot.</p>
<p>Like with AT91Bootstrap, you can incrementally rebuild U-boot through the <code>make bb PACKAGE="u-boot"</code> command.  (Remember to do it once with <code>CMD="-c clean"</code> and again with no <code>CMD</code> argument.)</p>
<h2>Modifying the Linux Kernel</h2>
<p>Finally, we perform the same process in modifying the Linux kernel.  At this point, try to make the modifications needed, using the <a href="http://www.headnut.org/wp-content/uploads/2009/08/linux-2.6.28-agama9263.patch"><code>linux-2.6.28-agam9263.patch</code></a> and <a href="http://www.headnut.org/wp-content/uploads/2009/08/defconfig"><code>defconfig</code></a> provided.</p>
<p>Once you are finished or get stuck, take a look below for the recommended approach:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> mkdir -p ~/workspace/local/recipes/linux
<span style="color: #0000ff;">#</span> cp ~/workspace/openembedded/recipes/linux/linux.inc \
     ~/workspace/local/recipes/linux/
<span style="color: #0000ff;">#</span> cp ~/workspace/openembedded/recipes/linux/linux_2.6.28.bb \
     ~/workspace/local/recipes/linux/
<span style="color: #0000ff;">#</span> cp -R ~/workspace/openembedded/recipes/linux/linux-2.6.28/ \
     ~/workspace/local/recipes/linux/linux-2.6.28/
<span style="color: #0000ff;">#</span> mkdir -p ~/workspace/local/recipes/linux/linux-2.6.28/agama9263/</pre>
<p>Because there are a huge number of files in <code>~/workspace/openembedded/recipes/linux/</code>, we cherry pick only the ones needed.  Next, modify the <code>linux_2.6.28.bb</code> file:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">require linux.inc

PR = "r11"

DEFAULT_PREFERENCE = "-1"
<span style="color: #ff0000;">DEFAULT_PREFERENCE_agama9263 = "28"
</span>DEFAULT_PREFERENCE_at91sam9263ek = "28"

SRC_URI = " \
     ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2 \
     file://linux-2.6.28-at91.patch.bz2;patch=1 \
     file://linux-2.6.28-exp.patch.bz2;patch=1 \
     file://defconfig \
"

<span style="color: #ff0000;">SRC_URI_append_agama9263= " \
     file://linux-2.6.28-agama9263.patch;patch=1;pnum=0 \
"
</span>
S = "${WORKDIR}/linux-2.6.28/"</pre>
<p>Rebuild through the <code>make bb PACKAGE="linux"</code> command.</p>
<h2>Building the Root Filesystem</h2>
<p>The final step is to build a root filesystem for our new machine.  We want to create our own custom root filesystem (a.k.a. &#8220;image&#8221; in the OE terminology), and so need to create a corresponding recipe for it.</p>
<p>Create ~/workspace/local/recipes/images/headnut-image.bb with the following content:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #ff0000;">export IMAGE_BASENAME = "headnut-image"</span>

PREFERRED_PROVIDER_virtual/psplash      = "psplash/angstrom"
PREFERRED_PROVIDER_virtual/xserver      = "xserver-xorg"
PREFERRED_PROVIDER_xserver              = "xserver-xorg"

SPLASH                                  = "psplash-angstrom"
DISTRO_SSH_DAEMON                       = "openssh"
XSERVER                                 = "xserver-xorg xf86-input-evdev xf86-input-keyboard xf86-input-mouse xf86-video-fbdev"

IMAGE_LINGUAS = ""

DEPENDS = "task-base"

ANGSTROM_EXTRA_INSTALL ?= ""
<span style="color: #ff0000;">IMAGE_INSTALL = " \
     task-base-extended \
     apache2 \
     dhclient \
     inetutils \
     libpam \
     msmtp \
     ntp \
     openldap \
     python \
     python-pygtk \
     rng-tools \
     socketcan-modules \
     socketcan-utils-test \
     sqlite3 \
     syslog-ng \
     ${DISTRO_SSH_DAEMON} \
     ${SPLASH} \
     ${XSERVER} \
     ${ANGSTROM_EXTRA_INSTALL} \
"</span>

<span style="color: #0000ff;"># create /etc/timestamp from build date
</span>IMAGE_PREPROCESS_COMMAND = "create_etc_timestamp"

inherit image</pre>
<p>Two key aspects of the image recipe are marked in red.  The first is the name of the image.  The output image will have a name that corresponds to this field.  The second is the <code>IMAGE_INSTALL</code> variable.  The programs listed in this variable (whitespace separated) are installed in the actual root filesystem.  From our list of programs above, you&#8217;ll notice that we&#8217;re producing a fairly heavy-set image: Apache, OpenLDAP, etc.  Tweak this list to match your particular desires/needs.</p>
<p>Use the images that come with OE to help guide you in modifying this file.  The images are located in <code>~/workspace/openembedded/recipes/images/</code> and range from very basic (<code>minimal-image.bb</code>) to very complex.</p>
<p>The command from <code>~/workspace/</code> to accomplish this is simply:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> make image IMG="headnut-image"</pre>
<p>Alternatively, you can modify the <code>Makefile</code> to replace the default <code>IMG</code> value and omit it from the command line above.</p>
<p>This one line kicks off a long bundling process.  Take a break while the computer works.</p>
<h2>From the Agama9263 to the &#8230;?</h2>
<p>Unfortunately, the Agama9263 doesn&#8217;t actually exist, so loading firmware onto that board will be difficult.  <img src='http://www.headnut.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   Suffice to say that if you follow the instructions above and apply your own patches to AT91Bootstrap, U-boot, and Linux, you should be successful at getting your board up and running.</p>
<p>Feel free to use the patches for the Agama9263 as a starting point for your own modifications to those programs.  (The patches were directly derived from those needed for an actual board, so have been tested on live hardware.  Names were changed to protect the innocent.)</p>
<h2>Disclaimer</h2>
<p>Sadly to say in our &#8220;sue-first&#8221; world, I need to write the following disclaimer:</p>
<p style="padding-left: 30px;">This information is provided for educational purposes only.  Headnut.org nor its owner (&#8220;AUTHOR&#8221;) does not warrant that the information is accurate in every respect.  Author is not responsible for errors, omissions, or inaccuracies of the information or the results obtained from use of the information provided herein.  Users are always encouraged to check and confirm the information with other sources and through direct professional contact.</p>
<p style="padding-left: 30px;"><strong>Restriction of Liability</strong></p>
<p style="padding-left: 30px;">Author makes no claims, promises or guarantees about the accuracy, completeness, or adequacy of the contents of this web site and expressly disclaims liability for errors and omissions in the contents of this web site. No warranty of any kind, implied, expressed or statutory, including but not limited to the warranties of non-infringement of third party rights, title, merchantablility, fitness for a particular purpose and freedom from computer virus, is given with respect to the contents of this web site or its hyperlinks to other Internet resources. Reference in this web site to any specific commercial products, processes, or services, or the use of any trade, firm or corporation name is for the information and convenience of the public, and does not constitute endorsement, recommendation, or favoring by Author.</p>
<p style="padding-left: 30px;"><strong>Ownership</strong></p>
<p style="padding-left: 30px;">Information presented on this web site is considered public information and may be distributed or copied. However, all information submitted to Author via this site shall be deemed and remain the property of Author, except those submissions made under separate legal contract.  Author shall be free to use, for any purpose, any ideas, concepts, or techniques contained in information provided to Author through this site.</p>
<h2>Next Steps</h2>
<p>Congratulations!  You&#8217;ve now taken OpenEmbedded all the way from setup to deployment.  However, you may have run into some headaches along the way.  Very soon, we will investigate troubleshooting techniques and best practices to use with OE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2009/08/12/customizing-openembedded/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flashing the AT91SAM9263-EK Board</title>
		<link>http://www.headnut.org/2009/08/09/flashing-the-at91sam9263-ek-board/</link>
		<comments>http://www.headnut.org/2009/08/09/flashing-the-at91sam9263-ek-board/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 23:56:17 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[at91bootstrap]]></category>
		<category><![CDATA[at91sam9263]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[openembedded]]></category>
		<category><![CDATA[u-boot]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=72</guid>
		<description><![CDATA[In the previous post, we learned how to create an OpenEmbedded (OE) workspace that can successfully build images for the Atmel AT91SAM2963-EK board.  As it turns out, the default in OE is to build dataflash images for the AT91SAM9263-EK board, not nandflash.  If your particular board uses dataflash for its storage, then you&#8217;re all set!  [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.headnut.org/2009/08/08/building-oe-workspace/">previous post</a>, we learned how to create an <a href="http://www.openembedded.org">OpenEmbedded</a> (OE) workspace that can successfully build images for the <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057">Atmel AT91SAM2963-EK</a> board.  As it turns out, the default in OE is to build <em>dataflash</em> images for the AT91SAM9263-EK board, not <em>nandflash</em>.  If your particular board uses dataflash for its storage, then you&#8217;re all set!  But if your board is like mine and uses nandflash, we have a little more work to do first.</p>
<p>This post will focus on tweaking the OE tree to build nandflash images for the AT91SAM9263-EK and then finally uploading those images to the board.  The result (with either dataflash or nandflash) will be to have Angstrom 2008.1 booting on the board.<span id="more-72"></span></p>
<h2>Overview &amp; Key Files</h2>
<p>The result of the compile from the first post is a list of binary images:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> tree ~/workspace/tmp/deploy/glibc/images/at91sam9263ek/
<span style="color: #0000ff;">/home/chris/workspace/tmp/deploy/glibc/images/at91sam9263ek/</span>
|-- <span style="color: #0000ff;">Angstrom-console-image-glibc-ipk-2009.X-test-20090809-at91sam9263ek-testlab</span>/
|   |-- depends-nokernel-nolibc-noupdate-nomodules.dot
|   |-- depends-nokernel-nolibc-noupdate.dot
|   |-- depends-nokernel-nolibc.dot
|   |-- depends-nokernel.dot
|   |-- depends.dot
|   |-- files-in-image.txt
|   |-- installed-package-sizes.txt
|   `-- installed-packages.txt
|-- Angstrom-console-image-glibc-ipk-2009.X-test-20090809-at91sam9263ek.rootfs.jffs2
|-- <span style="color: #99ccff;">at91bootstrap.bin</span> -&gt; at91sam9263ek-dataflashcardboot-2.10-r1.bin
|-- at91sam9263ek-dataflashcardboot-2.10-r1.bin
|-- <span style="color: #99ccff;">console-image-at91sam9263ek.jffs2</span> -&gt; Angstrom-console-image-glibc-ipk-2009.X-test-20090809-at91sam9263ek.rootfs.jffs2
|-- modules-2.6.28-r11-at91sam9263ek.tgz
|-- u-boot-at91sam9263ek-2009.01-r1.bin
|-- <span style="color: #99ccff;">u-boot-at91sam9263ek.bin</span> -&gt; u-boot-at91sam9263ek-2009.01-r1.bin
|-- uImage-2.6.28-r11-at91sam9263ek.bin
`-- <span style="color: #99ccff;">uImage-at91sam9263ek.bin</span> -&gt; uImage-2.6.28-r11-at91sam9263ek.bin</pre>
<p>There are a few key files that we need going forward:</p>
<ul>
<li><em>at91bootstrap.bin</em>.  The  <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4093">AT91Bootstrap</a> program is a very small bootloader produced by Atmel that does initial configuration of the hardware and passes off control to the next application.  For our purposes, this next application will be <a href="http://www.denx.de/wiki/U-Boot">U-boot</a>, but with a few tweaks could pass control directly to the <a href="http://www.kernel.org">Linux kernel</a>.  As you can see from the tree above, this file is a symlink to <code>at91sam9263ek-dataflashcardboot-2.10-r1.bin</code>.  The &#8220;dataflashcardboot&#8221; string indicates which memory type this image supports.</li>
<li><em>u-boot-at91sam9263ek.bin</em>.  <a href="http://www.denx.de/wiki/U-Boot">U-boot</a> is the &#8220;universal bootloader&#8221; for embedded systems.  It is a very feature-rich bootloader that offers both LCD and command line support &#8212; great for recovery purposes in the event that an in-field upgrade goes awry.  Because the AT91SAM9263-EK requires the AT91Bootstrap program first, this is an optional but highly recommended component of your installation.  While the name of the symlink&#8217;d file does not reveal whether it supports dataflash or nandflash, the default settings in OE result in this image supporting dataflash.</li>
<li><em>uImage-at91sam9263ek.bin</em>.  This is a compressed version of the <a href="http://www.kernel.org">Linux kernel</a> for use with <a href="http://www.denx.de/wiki/U-Boot">U-boot</a>.  Once we get to the kernel, the distinction between dataflash and nandflash does not matter as much, though it is very likely that we will need to tweak the kernel&#8217;s configuration anyway.  More on this later.</li>
<li><em>console-image-at91sam9263ek.jffs2</em>.  The rest of the root filesystem is compressed as a <a href="http://en.wikipedia.org/wiki/JFFS2">JFFS2 image</a>.  This image holds the files related to the <a href="http://www.angstrom-distribution.org/">Angstrom distribution</a>.  The prefix of the filename (&#8220;console-image&#8221;) will match the <code>IMG</code> parameter from the <code>make image</code> command in the <a href="http://www.headnut.org/2009/08/08/building-oe-workspace/">first post</a>; remember that if no <code>IMG</code> parameter is given, the default value is <code>console-image</code>.</li>
</ul>
<p>These four files comprise all of the support needed to boot Linux.  If you have a board with dataflash, skip ahead to load the files onto the board.  If you have a nandflash board, step through the OE tree modification process with me to build the files that we need.</p>
<h2>The Machine Configuration File &amp; U-boot</h2>
<p>OE stores many of the definitions surrounding a board in <em>machine configuration files</em>.  These are located in <code>~/workspace/openembedded/conf/machine</code>.  If you take a peek, you&#8217;ll notice there is an <code>at91sam9263ek.conf</code> file for our particular board.  This is the file that needs to be modified to start the support of nandflash.</p>
<p>We are now faced with a question: how do we modify the file?  Beyond the <a href="http://en.wikipedia.org/wiki/Editor_war">holy war of editor selection</a>, remember that <code>~/workspace/openembedded</code> is an active git repository.  If we make changes inside the tree, future updates may clobber those changes.  Hours of work get tossed away with a simple make update.</p>
<p>The answer is lies in our <code>~/workspace/local</code> structure.  BitBake supports the concept of <a href="http://bitbake.berlios.de/manual/ch04s02.html">Collections</a>.  These allow us (at runtime) to overlay our own files on top of the ones in the OE repository, but still keep the static structure of the files separate.  Your workspace is already enabled with the concept; see the <code>local.conf</code> file from the first post.</p>
<p>We will need to mimick the OE structure slightly and copy the files that we want to modify:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> mkdir -p ~/workspace/local/conf/machine
<span style="color: #0000ff;">#</span> cp ~/workspace/openembedded/conf/machine/at91sam9263ek.conf \
     ~/workspace/local/conf/machine</pre>
<p>At this point, fire up your <a href="http://en.wikipedia.org/wiki/Editor_war">favorite editor</a> and modify ~/workspace/local/conf/machine/at91sam9263ek.conf so that it contains the changes in red below:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#@TYPE: Machine
#@Name: Atmel AT91SAM9263EK Development Platform
#@DESCRIPTION: Machine configuration for the at91sam9263ek development board with a at91sam9263 processor
</span>
TARGET_ARCH = "arm"
<span style="color: #0000ff;">#PACKAGE_EXTRA_ARCHS = "armv4t armv5te"
</span>
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_VERSION_linux = "2.6.28"
PREFERRED_PROVIDER_xserver = "xserver-kdrive"

KERNEL_IMAGETYPE = "uImage"
<span style="color: #ff0000;">UBOOT_MACHINE = "at91sam9263ek_nandflash_config"
</span>
PREFERRED_VERSION_at91bootstrap = "2.10"

<span style="color: #0000ff;">#don't try to access tty1
</span>USE_VT = "0"

MACHINE_FEATURES = "kernel26 alsa ext2 usbhost usbgadget screen touchscreen"
EXTRA_IMAGEDEPENDS += "u-boot"
EXTRA_IMAGEDEPENDS += "at91bootstrap"

<span style="color: #0000ff;"># used by sysvinit_2
</span>SERIAL_CONSOLE = "115200 ttyS0"
IMAGE_FSTYPES ?= "jffs2"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"

require conf/machine/include/tune-arm926ejs.inc</pre>
<p>At this point, you may be tempted to start making other changes.  DON&#8217;T!  Debugging an embedded system is difficult enough.  Making too many changes at once can lead to some very long nights banging your head against the keyboard.  Start small.</p>
<p>You may be wondering, &#8220;how did we know what to use for the <code>UBOOT_MACHINE</code> definition?&#8221;  The answer lies in a combination of the U-boot recipe and source code.  In the U-boot recipe (specifically <code>~/workspace/openembedded/recipes/u-boot/u-boot.inc</code>), the compile process is initiated through the following process:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">do_compile () {
        unset LDFLAGS
        unset CFLAGS
        unset CPPFLAGS
        <span style="color: #ff0000;">oe_runmake ${UBOOT_MACHINE}</span>
        oe_runmake all
}</pre>
<p>We see here that when OE runs automake inside the U-boot build tree, it passes the <code>UBOOT_MACHINE</code> variable verbatim.  When we look at the Makefile in the U-boot source tree (~/workspace/tmp/work/at91sam9263ek-angstrom-linux-gnueabi/u-boot-2009.01-r1/u-boot-2009.01/Makefile), we can see that several targets are supported for the AT91SAM9263-EK board:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #ff0000;">at91sam9263ek_nandflash_config</span> \
at91sam9263ek_dataflash_config \
at91sam9263ek_dataflash_cs0_config \
at91sam9263ek_config    :       unconfig
        @mkdir -p $(obj)include
        @if [ "$(findstring _nandflash,$@)" ] ; then \
                echo "#define CONFIG_SYS_USE_NANDFLASH 1"       &gt;&gt;$(obj)include/config.h ; \
                $(XECHO) "... with environment variable in NAND FLASH" ; \
        else \
                echo "#define CONFIG_SYS_USE_DATAFLASH 1"       &gt;&gt;$(obj)include/config.h ; \
                $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
        fi;
        @$(MKCONFIG) -a at91sam9263ek arm arm926ejs at91sam9263ek atmel at91</pre>
<p>So at this point, rebuilding U-boot would create a version that supported nandflash.  (We&#8217;re going to hold off on rebuilding at the moment and just do everything in one fell swoop.)</p>
<h2>AT91Bootstrap</h2>
<p>OE contains recent versions of AT91Bootstrap (v2.x and later).  Unfortunately, these versions appear to be broken for use with nandflash.  (Many thanks to Marcin Juszkiewicz for pointing that out!  His one sentence answer ended my hours of banging a head against the table.)  To work around the issue, we will add a new recipe for AT91Bootstrap v1.14.</p>
<p>First, create the directory to hold our new recipe:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> mkdir -p ~/workspace/local/recipes/at91bootstrap</pre>
<p>Next, create a file named <code>at91bootstrap_1.14.bb</code> in this directory.  You can either <a href="http://www.headnut.org/wp-content/uploads/2009/08/at91bootstrap_1.14.bb">download the file</a> or create it youself.  The file should contain the following:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">DESCRIPTION = "at91bootstrap: loaded into internal SRAM by AT91 BootROM"
SECTION = "bootloaders"
PR = "r0"

SRC_URI = " \
     ftp://www.linux4sam.org/pub/at91bootstrap/AT91Bootstrap${PV}.zip \
"

S = "${WORKDIR}/Bootstrap-v${PV}"
PACKAGE_ARCH = "${MACHINE_ARCH}"
EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} DESTDIR=${DEPLOY_DIR_IMAGE} REVISION=${PR}"

<span style="color: #ff0000;">AT91BOOTSTRAP_MEDIA ?= "nandflash"</span>

do_compile () {
     unset LDFLAGS
     unset CFLAGS
     unset CPPFLAGS

     rm -Rf ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.bin
     rm -Rf ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.elf
     rm -Rf ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.map
     oe_runmake -C ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA} AT91_CUSTOM_FLAGS="${AT91BOOTSTRAP_FLAGS}" rebuild
}

do_install () {
     install -d ${DEPLOY_DIR_IMAGE}
     install -m 0755 \
          ${S}/board/${MACHINE}/${AT91BOOTSTRAP_MEDIA}/${AT91BOOTSTRAP_MEDIA}_${MACHINE}.bin \
          ${DEPLOY_DIR_IMAGE}/${MACHINE}-${AT91BOOTSTRAP_MEDIA}boot-${PV}-${PR}.bin
     rm -Rf ${DEPLOY_DIR_IMAGE}/at91bootstrap.bin
     cd ${DEPLOY_DIR_IMAGE} \
          &amp;&amp; ln -sf ${MACHINE}-${AT91BOOTSTRAP_MEDIA}boot-${PV}-${PR}.bin at91bootstrap.bin
}</pre>
<p>The <code>AT91BOOTSTRAP_MEDIA</code> variable allows us to define the flash type (dataflash or nandflash) used on the machine in the machine configuration file.  The follow-up step, therefore, is to modify <code>~/workspace/local/conf/machine/at91sam9263ek.conf</code> to include this definition:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#@TYPE: Machine
#@Name: Atmel AT91SAM9263EK Development Platform
#@DESCRIPTION: Machine configuration for the at91sam9263ek development board with a at91sam9263 processor
</span>
TARGET_ARCH = "arm"
<span style="color: #0000ff;">#PACKAGE_EXTRA_ARCHS = "armv4t armv5te"
</span>
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_VERSION_linux = "2.6.28"
PREFERRED_PROVIDER_xserver = "xserver-kdrive"

<span style="color: #888888;">KERNEL_IMAGETYPE = "uImage"
UBOOT_MACHINE = "at91sam9263ek_nandflash_config"
</span><span style="color: #ff0000;">AT91BOOTSTRAP_MEDIA = "nandflash"

PREFERRED_VERSION_at91bootstrap = "1.14"
</span>
<span style="color: #0000ff;">#don't try to access tty1
</span>USE_VT = "0"

MACHINE_FEATURES = "kernel26 alsa ext2 usbhost usbgadget screen touchscreen"
EXTRA_IMAGEDEPENDS += "u-boot"
EXTRA_IMAGEDEPENDS += "at91bootstrap"

<span style="color: #0000ff;"># used by sysvinit_2
</span>SERIAL_CONSOLE = "115200 ttyS0"
IMAGE_FSTYPES ?= "jffs2"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"

require conf/machine/include/tune-arm926ejs.inc</pre>
<p>One final step needs to take place before the AT91Bootstrap recipe is complete.  In the <code>SRC_URI</code> variable, we&#8217;ve specified a new file to download, one which OE has never before seen.  For security reasons, one of the checks that OE performs before uncompressing source code is to check the MD5/SHA256 checksum of the compressed version to ensure that the content matches what is expected.  So we need to teach OE about this file.</p>
<p>Create a new file at <code>~/workspace/local/conf/checksums.ini</code> that contains the following:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">[ftp://www.linux4sam.org/pub/at91bootstrap/AT91Bootstrap1.14.zip]
md5=2942f22a101d61a34aaf48b0f6b88cba
sha256=90bfc6ecc53a3ee7bb5a3eb33bae3f8fd768165570046d92bb47462f629bdd11</pre>
<p>(The blank line at the end is important.  More on this in later posts.)</p>
<p>Once the recipe exists, the checksum data is added to the approved list, and the machine configuration file is updated, we&#8217;re ready to begin our build.</p>
<h2>Rebuilding AT91Bootstrap and U-boot</h2>
<p>After the steps from the previous sections have been completed, we&#8217;re now ready to build both AT91Bootstrap and U-boot.  The following two commands accomplish this task:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> cd ~/workspace
<span style="color: #0000ff;">#</span> make bb PACKAGE="at91bootstrap u-boot" <span style="color: #ff0000;">CMD="-c clean"</span>
<span style="color: #0000ff;">#</span> make bb PACKAGE="at91bootstrap u-boot"</pre>
<p>Note how the first <code>make</code> command overrides the command passed to BitBake, telling it to clean the existing builds off the system.  The second <code>make</code> command then tells BitBake to regenerate the builds.</p>
<p>Looking at our images tree, we now see the new files:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> tree --dirsfirst -F ~/workspace/tmp/deploy/glibc/images/at91sam9263ek/
<span style="color: #0000ff;">/home/chris/workspace/tmp/deploy/glibc/images/at91sam9263ek/
</span>|-- <span style="color: #0000ff;">Angstrom-console-image-glibc-ipk-2009.X-test-20090809-at91sam9263ek-testlab</span>/
|   |-- depends-nokernel-nolibc-noupdate-nomodules.dot
|   |-- depends-nokernel-nolibc-noupdate.dot
|   |-- depends-nokernel-nolibc.dot
|   |-- depends-nokernel.dot
|   |-- depends.dot
|   |-- files-in-image.txt
|   |-- installed-package-sizes.txt
|   `-- installed-packages.txt
|-- Angstrom-console-image-glibc-ipk-2009.X-test-20090809-at91sam9263ek.rootfs.jffs2
|-- <span style="color: #99ccff;">at91bootstrap.bin</span> -&gt; at91sam9263ek-nandflashboot-1.14-r0.bin*
|-- <span style="color: #ff0000;">at91sam9263ek-nandflashboot-1.14-r0.bin</span>*
|-- <span style="color: #99ccff;">console-image-at91sam9263ek.jffs2</span> -&gt; Angstrom-console-image-glibc-ipk-2009.X-test-20090809-at91sam9263ek.rootfs.jffs2
|-- modules-2.6.28-r11-at91sam9263ek.tgz
|-- <span style="color: #ff0000;">u-boot-at91sam9263ek-2009.01-r1.bin</span>*
|-- <span style="color: #99ccff;">u-boot-at91sam9263ek.bin</span> -&gt; u-boot-at91sam9263ek-2009.01-r1.bin*
|-- uImage-2.6.28-r11-at91sam9263ek.bin
`-- <span style="color: #99ccff;">uImage-at91sam9263ek.bin</span> -&gt; uImage-2.6.28-r11-at91sam9263ek.bin</pre>
<h2>Programming the AT91SAM9263-EK Board</h2>
<p><em><strong>IF USING DATAFLASH:</strong> The Tcl script and <code>ubootEnvtFileNandFlash.bin</code> below have been optimized for nandflash.  They will not behave properly with boards that use dataflash.  I will try to post instructions on how to get dataflash working later, but for now, you may have to tweak things on your own.</em></p>
<p>Once we have the appropriate dataflash/nandflash versions of the binary images, we are ready to upload the images to the AT91SAM9263-EK board.  To assist with this process, we will need two files.  You can either <a href="http://www.headnut.org/wp-content/uploads/2009/08/load_flash.zip">download them</a> or create them yourself:</p>
<p><code>~/workspace/tmp/deploy/glibc/images/at91sam9263ek/load_flash.bat</code></p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">sam-ba.exe \usb\ARM0 AT91SAM9263-EK load_flash.tcl &gt; logfile.log 2&gt;&amp;1
notepad logfile.log</pre>
<p><code>~/workspace/tmp/deploy/glibc/images/at91sam9263ek/load_flash.tcl</code></p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">#
# Derived from at91sam9263ek_demo_linux_nandflash.tcl
# Copyright (c) 2008 Atmel Corporation.
#

################################################################################
#  proc uboot_env: Convert u-boot variables in a string ready to be flashed
#                  in the region reserved for environment variables
################################################################################
proc set_uboot_env {nameOfLstOfVar} {
    upvar $nameOfLstOfVar lstOfVar

    # sector size is the size defined in u-boot CFG_ENV_SIZE
    set sectorSize [expr 0x20000 - 5]

    set strEnv [join $lstOfVar "\0"]
    while {[string length $strEnv] &lt; $sectorSize} {
       append strEnv "\0"
    }
    # \0 between crc and strEnv is the flag value for redundant environment
    set strCrc [binary format i [::vfs::crc $strEnv]]
    return "$strCrc\0$strEnv"
}

################################################################################
#  Main script: Load the linux demo in NandFlash
#               Update the environment variables
################################################################################
set bootstrapFile       "at91bootstrap.bin"
set ubootFile           "u-boot-at91sam9263ek.bin"
set ubootEnvFile        "ubootEnvtFileNandFlash.bin"
set kernelFile          "uImage-at91sam9263ek.bin"
set rootfsFile          "console-image-at91sam9263ek.jffs2"

## NandFlash Mapping
set bootStrapAddr       0x00000000
set ubootAddr           0x00020000
set ubootEnvAddr        0x00060000
set kernelAddr          0x00200000
set rootfsAddr          0x00400000

# u-boot variable
set kernelUbootAddr     0x00200000
set kernelLoadAddr      0x22200000

## NandFlash Mapping
set kernelSize    [format "0x%08X" [file size $kernelFile]]

lappend u_boot_variables \
 "<span style="color: #ff0000;">ethaddr=3a:1f:34:08:54:54</span>" \
 "bootdelay=3" \
 "<span style="color: #ff0000;">baudrate=115200</span>" \
 "stdin=serial" \
 "stdout=serial" \
 "stderr=serial" \
 "bootargs=mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2" \
 "bootcmd=nand read $kernelLoadAddr $kernelUbootAddr $kernelSize; bootm $kernelLoadAddr"

puts "-I- === Initialize the NAND access ==="
NANDFLASH::Init

puts "-I- === Erase all the NAND flash blocs and test the erasing ==="
NANDFLASH::EraseAllNandFlash

puts "-I- === Load the bootstrap: nandflash_at91sam9-ek in the first sector ==="
NANDFLASH::sendBootFile $bootstrapFile

puts "-I- === Load the u-boot in the next sectors ==="
send_file {NandFlash} "$ubootFile" $ubootAddr 0

puts "-I- === Load the u-boot environment variables ==="
set fh [open "$ubootEnvFile" w]
fconfigure $fh -translation binary
puts -nonewline $fh [set_uboot_env u_boot_variables]
close $fh
send_file {NandFlash} "$ubootEnvFile" $ubootEnvAddr 0

puts "-I- === Load the Kernel image ==="
send_file {NandFlash} "$kernelFile" $kernelAddr 0

puts "-I- === Load the linux file system ==="
send_file {NandFlash} "$rootfsFile" $rootfsAddr 0</pre>
<p>(Feel free to change the ethaddr and baudrate settings if your setup needs it.)</p>
<p><a href="http://www.headnut.org/wp-content/uploads/2009/08/ubootEnvtFileNandFlash.bin">Download the <code>ubootEnvtFileNandFlash.bin</code> file</a> and place it in <code>~/workspace/tmp/deploy/glibc/images/at91sam9263ek/</code>.  This file has been provided by Atmel (along with the original versions of the <code>.bat</code> and <code>.tcl</code> files above) to assist in the flashing of the board.  The Tcl file overwrites certain parameters before writing the contents to the ENV sector of flash.</p>
<p>To illustrate how this Tcl script works, let&#8217;s take a look at the memory map (derived from <a href="http://www.linux4sam.org/twiki/pub/Linux4SAM/GettingStarted/demo_nandflash_map.png">http://www.linux4sam.org/twiki/pub/Linux4SAM/GettingStarted/demo_nandflash_map.png</a>):</p>
<p style="text-align: center;">
<div id="attachment_76" class="wp-caption aligncenter" style="width: 580px"><img class="size-full wp-image-76  " title="AT91SAM9263-EK Memory Map for NandFlash" src="http://www.headnut.org/wp-content/uploads/2009/08/at91sam9263ek_nandflash_memory_map.png" alt="AT91SAM9263-EK Memory Map for NandFlash" width="570" height="439" /><p class="wp-caption-text">AT91SAM9263-EK Memory Map for NandFlash</p></div>
<p>The addresses on the left side of each box are memory locates in the nandflash.  AT91Bootstrap is loaded first at address <code>0x0</code>.  U-boot follows at address <code>0x20000</code>, with its environment close behind at address <code>0x60000</code>.  (A redundant environment is stored at address <code>0x80000</code>, but nothing needs to get loaded for this.)  The Linux kernel itself is way up at address <code>0x200000</code>, with the root filesystem coming last at address <code>0x400000</code>.</p>
<p>Later, we will investigate what to do if you want to change these address, but let&#8217;s leave them be for now.</p>
<p>The final tool in this puzzle is the <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3883">Atmel AT91 In-system Programmer (ISP)</a>.  The current version as of this writing is v1.13 for Windows XP/Vista and Linux.  Download the install package for your operating system from the <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3883">Atmel website</a> and run through the setup.  The AT91 ISP installs several utilities, one of which is named SAM-BA.  This program will be used to continue the flashing operation.</p>
<p>The next few steps will use Windows XP as the example system that is used to flash the board.  The process can be easily adopted for your particular operating system.</p>
<p>Follow the below steps to flash the Atmel AT91SAM9263-EK board:</p>
<ol>
<li>Power off the board.</li>
<li>Connect a USB cable from your computer to port J18 (USB device interface) on the AT91SAM9263-EK board.</li>
<li>Open (remove) jumper <code>J29</code> (NANDCS).</li>
<li>Power on the board.</li>
<li>Wait for your computer to recognize the AT91SAM9263-EK as a new USB device.  Install any drivers that it recommends using.</li>
<li>Close (add) jumper <code>J29</code> (NANDCS).</li>
<li>Run <code>load_flash.bat</code>.  Wait until the Notepad window appears.</li>
<li>Close Notepad.</li>
<li>Momentarily press the SPST switch <code>BP3</code> (RESET) to power cycle the board.</li>
</ol>
<p>At this point, if you have a serial console connected to <code>J14</code> (SERIAL DEBUG PORT) with the settings <code>115200 8-N-1</code> (no flow control), you should see the following sequence:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">RomBOOT
&gt;

U-Boot 2009.01 (Aug 09 2009 - 07:07:28)

DRAM:  64 MB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   macb0
macb0: Starting autonegotiation...
macb0: Autonegotiation timed out (status=0x7849)
macb0: link down (status: 0x7849)
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x200000, size 0x1d722c
 1929772 bytes read: OK
## Booting kernel from Legacy Image at 22200000 ...
 Image Name:   Angstrom/2.6.28/at91sam9263ek
 Image Type:   ARM Linux Kernel Image (uncompressed)
 Data Size:    1929708 Bytes =  1.8 MB
 Load Address: 20008000
 Entry Point:  20008000
 Verifying Checksum ... OK
 Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.............................................................
........................................ done, booting the kernel.
[    0.000000] Linux version 2.6.28 (chris@headnut.org) (gcc version 4.3.3 (GCC)) #1 PREEMPT Sun Aug 9 02:14:09 PDT 2009
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: Atmel AT91SAM9263-EK
[    0.000000] Ignoring unrecognised tag 0x54410008
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] Clocks: CPU 199 MHz, master 99 MHz, main 16.367 MHz
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2
[    0.000000] AT91: 160 gpio irqs in 5 banks
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
...[snipped]...</pre>
<p>If your screen looks like above, congratulations!  You have modified the default OE workspace and successfully built a nandflash version of images for the Atmel AT91SAM9263-EK.</p>
<p>If things are not working, step back through these instructions and double check everything.  You can try removing <code>~/workspace/tmp/</code> and restarting the entire build process from make.  This will sometimes work as items are not always cleared out of the BitBake cache properly.  If none of these suggestions help, there will be additional information on debugging embedded systems posted later.</p>
<p>Once you have a working system, you will be very tempted to start modifying things.  The next post will talk about exactly that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2009/08/09/flashing-the-at91sam9263-ek-board/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building an OpenEmbedded workspace</title>
		<link>http://www.headnut.org/2009/08/08/building-oe-workspace/</link>
		<comments>http://www.headnut.org/2009/08/08/building-oe-workspace/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 20:57:56 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[at91sam9263]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[openembedded]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=46</guid>
		<description><![CDATA[OpenEmbedded is a great tool for building Linux for an embedded system.  Over the next few posts, I hope to capture the step-by-step instructions needed to create a working Linux system for the Atmel AT91SAM9263-EK board. OpenEmbedded provides a framework that promotes cross compiling in a &#8220;emerge&#8221;-like manner.  Relying on BitBake (derived from &#8220;emerge&#8221;, in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.openembedded.org">OpenEmbedded</a> is a great tool for building Linux for an embedded system.  Over the next few posts, I hope to capture the step-by-step instructions needed to create a working Linux system for the <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057">Atmel AT91SAM9263-EK</a> board.</p>
<p>OpenEmbedded provides a framework that promotes cross compiling in a &#8220;emerge&#8221;-like manner.  Relying on BitBake (derived from &#8220;emerge&#8221;, in fact) as its under-the-hood workhorse, OE creates a sandboxed build system that is entirely self-contained.  Entire systems can be created with a single command and, more importantly, without having to understand the complexities of cross compiling!</p>
<p>This first post will focus on creating a working build system.  By the conclusion, you will be able to compile binary images for the target board.  Follow-up posts will show you how to load the binary images onto the target, create your own custom target board, and then roll your own Linux distribution.<span id="more-46"></span></p>
<p>Definitions:</p>
<ul>
<li><em>Architecture (ARCH).</em> The target&#8217;s CPU architecture &#8212; in our example, the <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=4056">AT91SAM9263 Rev B.</a> processor.</li>
<li><em>Build host.</em> A &#8220;regular&#8221; computer that will be used to compile all of the programs needed for the target.</li>
<li><em>OE.</em> Abbreviation for &#8220;OpenEmbedded.&#8221;</li>
<li><em>Target.</em> The embedded system on which we want Linux to run &#8212; in our example, the AT91SAM9263-EK board.</li>
</ul>
<p>OE requires certain prerequisites to start its build process.  You will need a PC running Linux as the build host.  OE supports many different distributions, so check for specific <a href="http://wiki.openembedded.net/index.php/OEandYourDistro">support required</a> for your particular Linux flavor. Regardless of distribution, you will likely need between 32 GB and 64 GB of free space to begin the process.</p>
<p>I use Gentoo as my build host, so the following instructions will add all prerequisites:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> emerge -n \
  psyco \
  ccache \
  patch \
  make \
  sed \
  dev-lang/python \
  m4 \
  bison \
  cvs \
  openjade \
  quilt \
  sgmltools-lite \
  docbook-xml-dtd \
  docbook-dsssl-stylesheets \
  xmlto \
  docbook-sgml-utils \
  libpcre \
  boost \
  subversion \
  texi2html \
  pysqlite</pre>
<p>First, create a directory for your workspace.  I literally use the name &#8220;workspace&#8221; unless there is a need to support several build systems at the same time.</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> mkdir ~/workspace</pre>
<p>Next, create a directory for all of the source files that are downloaded (tarballs, subversion snapshots, etc.)  Since these files can be shared across multiple workspaces &#8212; aren&#8217;t the GCC sources the same regardless of what platform you use? &#8212; we put them in a common location to avoid cluttering the hard drive:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> mkdir ~/sources</pre>
<p>While most instructions at this point will tell you to export a lot of system variables, I use a Makefile to help coordinate all of the building activities.  It helps when jumping from one workspace to another by providing a single set of commands that operate no matter which workspace you&#8217;re using.</p>
<p><a href="http://headnut.org/wp-content/uploads/2009/08/Makefile">Download the Makefile</a> and save it to <code>~/workspace/Makefile</code>.</p>
<p>Your directory structure resembles the following:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> tree --filelimit 5 --dirsfirst -F --noreport
<span style="color: #0000ff;">.</span>
|-- <span style="color: #0000ff;">sources</span>/
`-- <span style="color: #0000ff;">workspace</span>/
    `-- Makefile</pre>
<p>There are four basic targets (e.g. commands) supported:</p>
<pre style="padding-left: 3em; background: transparent; border: none;">make workspace
make update
make image [IMG="..."]
make bb PACKAGE="..." [CMD="..."]</pre>
<p>The first target, <code>make workspace</code>, downloads the Bitbake and OE files required.</p>
<p>The second target, <code>make update</code>, will update Bitbake and OE to the latest version in their respective repositories.  USE THIS COMMAND WITH CAUTION!  Your build may stop working if an upstream change breaks something unexpectedly.  Once you get a system running, you will almost never want to run this command.</p>
<p>The third target, <code>make image</code>, does the bulk of the work, creating the desired image.  To change the image created, either modify the target in the Makefile or pass the image name through the optional <code>IMG</code> variable.</p>
<p>The fourth target, <code>make bb</code>, executes Bitbake directly and is useful for package development.  The name of the package should go in the <code>PACKAGE</code> variable, while any particular command arguments for Bitbake should go in the optional <code>CMD</code> variable.</p>
<p>Next, modify <code>~/workspace/local/conf/local.conf</code> to define your particular target.  For the AT91SAM9263-EK target, the file should look something like this:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;">DL_DIR = "<strong>/home/chris</strong>/sources"

<span style="color: #0000ff;"># BitBake configuration
</span>BBFILES = "<strong>/home/chris</strong>/workspace/openembedded/recipes/*/*.bb"
BBFILES += "<strong>/home/chris</strong>/workspace/local/recipes/*/*.bb"
BBFILE_COLLECTIONS="upstream local"
BBFILE_PATTERN_upstream = "^/workspace/openembedded/"
BBFILE_PATTERN_local = "^/workspace/local/"
BBFILE_PRIORITY_upstream = "5"
BBFILE_PRIORITY_local = "10"
BBMASK = ""

<span style="color: #0000ff;"># Uncomment the next line to have BitBake output debug messages
# BBDEBUG = "yes"

# Uncomment the next line to have BitBake emit a log upon an error
</span>BBINCLUDELOGS = "yes"

<span style="color: #0000ff;"># OpenEmbedded configuration
</span>MACHINE="at91sam9263ek"
DISTRO="angstrom-2008.1"
IMAGE_FSTYPES = "jffs2"
ENABLE_BINARY_LOCALE_GENERATION = "0"
<span style="color: #0000ff;"># GLIBC_GENERATE_LOCALES = "en_US.UTF-8"
</span>
<span style="color: #0000ff;"># Select between multiple alternative providers, if more than one is eligible.
</span>PREFERRED_PROVIDERS = "virtual/qte:qte virtual/libqpe:libqpe-opie"
PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-x11"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-intermediate:gcc-cross-intermediate"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross"
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"</pre>
<p>Note in the file above, we did not use the <code>~/workspace</code> abbreviation of the path.  BitBake does not like the <code>~</code> operator, so we must use the fully-qualified directory name (FQDN) of <code>/home/chris/workspace</code> instead.  (Replace <code>/home/chris</code> with whatever ~ is for your system.)</p>
<p>Stop at this point and make sure that your directory structure resembles the following:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> tree --filelimit 5 --dirsfirst -F --noreport
<span style="color: #0000ff;">.</span>
|-- <span style="color: #0000ff;">sources</span>/
`-- <span style="color: #0000ff;">workspace</span>/
    |-- <span style="color: #0000ff;">bitbake</span>/
    |-- <span style="color: #0000ff;">local</span>/
    |   |-- <span style="color: #0000ff;">conf</span>/
    |   |   `-- local.conf
    |   `-- <span style="color: #0000ff;">recipes</span>/
    |       `-- <span style="color: #0000ff;">images</span>/
    |           `-- dummy-image.bb
    |-- <span style="color: #0000ff;">openembedded</span>/
    `-- Makefile</pre>
<p>We are now ready to begin the build process.  This will take a LONG time, even on the fastest of machines.  (My average compile from scratch takes approximately 4 hours on a dual-processor 2.4 GHz dedicated system with 4 GB of RAM.)  I recommend starting this when you have other things to do:</p>
<pre style="margin-left: 3em; padding: 1em; background: #050505; color: grey; border: thin solid grey; -moz-border-radius: 5px; -webkit-border-radius: 5px;"><span style="color: #0000ff;">#</span> make
BB_ENV_EXTRAWHITE="WORKSPACE" /home/chris/workspace/bitbake/bin/bitbake console-image
Foo None
NOTE: Handling BitBake files: | (5591/7047) [79 %]
   NOTE: Angstrom DOES NOT support bluez-utils because bluez-utils 3.x has been replaced by bluez4
NOTE: Handling BitBake files: \ (5600/7047) [79 %]
   NOTE: Angstrom DOES NOT support bluez-utils because bluez-utils 3.x has been replaced by bluez4
NOTE: Angstrom DOES NOT support bluez-libs because bluez-libs 3.x has been replaced by bluez4
NOTE: Angstrom DOES NOT support bluez-libs because bluez-libs 3.x has been replaced by bluez4
NOTE: Handling BitBake files: \ (5613/7047) [79 %]
   NOTE: Angstrom DOES NOT support bluez-libs because bluez-libs 3.x has been replaced by bluez4
NOTE: Handling BitBake files: / (7047/7047) [100 %]
NOTE: Parsing finished. 0 cached, 6757 parsed, 290 skipped, 0 masked.
NOTE: Resolving any missing task queue dependencies
...</pre>
<p>There is a slim chance that the build will exit prematurely, complaining of some error.  Try to fix whatever the problem is, then start <strong>make</strong> again to pick up where you left off.  Handling errors that occur during the build process will be a different posting.</p>
<p>If everything succeeds, you will be told so and dropped back to the command prompt.  Congratulations!  You have a working OpenEmbedded build system.</p>
<p>At this point, you&#8217;re ready to load the files onto the board.  But that is a discussion for the next posting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2009/08/08/building-oe-workspace/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Progress Tracker</title>
		<link>http://www.headnut.org/2009/06/14/progress-tracker/</link>
		<comments>http://www.headnut.org/2009/06/14/progress-tracker/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 02:53:38 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=26</guid>
		<description><![CDATA[No, I&#8217;m not at goal yet (the 190 lbs limit shown is incorrect), but the linear progress is quite hopeful! ]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-27" title="WW Progress Tracker" src="http://www.headnut.org/wp-content/uploads/2009/06/Picture-1.png" alt="WW Progress Tracker" width="625" height="280" /></p>
<p>No, I&#8217;m not at goal yet (the 190 lbs limit shown is incorrect), but the linear progress is quite hopeful!  <img src='http://www.headnut.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2009/06/14/progress-tracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5% Goal!</title>
		<link>http://www.headnut.org/2009/06/07/5-percent-goal/</link>
		<comments>http://www.headnut.org/2009/06/07/5-percent-goal/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 21:00:25 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[weight watchers]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=24</guid>
		<description><![CDATA[At this morning&#8217;s WW meeting, the scale read 190.2 &#8212; for a total of 10 lbs. of weight loss in a month and a half! That means I&#8217;ve lost 5% of my starting weight (201 lbs). I&#8217;m still trying to decide what my goal weight should be.  The book&#8217;s &#8220;healthy weight range&#8221; is between a [...]]]></description>
			<content:encoded><![CDATA[<p>At this morning&#8217;s <a href="http://www.weightwatchers.com">WW</a> meeting, the scale read 190.2 &#8212; for a total of 10 lbs. of weight loss in a month and a half!  That means I&#8217;ve lost 5% of my starting weight (201 lbs).</p>
<p>I&#8217;m still trying to decide what my goal weight should be.  The book&#8217;s &#8220;healthy weight range&#8221; is between a <a href="http://www.nhlbisupport.com/bmi/">BMI</a> of 20 and 25.  I&#8217;m currently at 24.4 with today&#8217;s weigh-in.  I think I&#8217;d like to split the range and focus on 23 as my target BMI; this translates to a weight of 185 lbs for the upper limit (23.8) and 180 lbs for the lower limit (23.1).</p>
<p>Only 5 pounds to go until I start on maintenance!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2009/06/07/5-percent-goal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nine pounds down</title>
		<link>http://www.headnut.org/2009/06/06/nine-pounds-down/</link>
		<comments>http://www.headnut.org/2009/06/06/nine-pounds-down/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 06:54:58 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[weight watchers]]></category>

		<guid isPermaLink="false">http://www.headnut.org/?p=13</guid>
		<description><![CDATA[After finishing SJSU last month, I decided to work off the twenty pounds that I gained while in school.  Sadly, I hit the dreaded number that I had never hit before &#8212; 200.  That was the final straw. Now, one month and five Weight Watchers meetings later, I&#8217;m now down almost ten pounds, with about [...]]]></description>
			<content:encoded><![CDATA[<p>After finishing <a href="http://www.sjsu.edu">SJSU</a> last month, I decided to work off the twenty pounds that I gained while in school.  Sadly, I hit the dreaded number that I had never hit before &#8212; 200.  That was the final straw.</p>
<p>Now, one month and five <a href="http://www.weightwatchers.com">Weight Watchers</a> meetings later, I&#8217;m now down almost ten pounds, with about five to ten left.  Half-way there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.headnut.org/2009/06/06/nine-pounds-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

