Seabright Technology Header Image

Building the Ubuntu PandaBoard Kernel

So that I can find it next time I need it, here’s what you need to do to checkout and build the Ubuntu kernel for a PandaBoard:

First up, clone it using git:

  • git clone git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git

You can see the current list of kernels on the getweb page.

Branch the remote ti-omap4 branch and check it out locally:

  • git branch --track ti-omap4 remotes/origin/ti-omap4
  • git checkout ti-omap4

Set up your environment:

  • export ARCH=arm
  • export CROSS_COMPILE=arm-linux-gnueabi-

Grab the default configuration:

  • cp debian.ti-omap4/config/config.common.ubuntu .config

Configure it for your needs:

  • make oldconfig
  • make menuconfig

And build away!

  • make uImage -j3

Thanks rsalveti on #ubuntu-arm!

Automatically trimming matplotlib images

matplotlib is a great mathematics and plotting package for Python. I’m using it to report on some benchmarking numbers but needed a way to automatically trim the extra whitespace before putting onto a web page. Here’s the ImageMagick command I ended up using:

convert input.png -bordercolor white -border 1x1 -trim +repage -alpha off +dither -colors 32 PNG8:output.png

To break it down:

  • -bordercolor white -border 1x1 – add a one pixel white border to make sure trim trims the right colour, and to remove a single pixel artifact in the top left.
  • -trim – trim the extra whitespace
  • +repage – recentre the image on the canvas
  • -alpha off – drop the alpha channel, if any
  • +dither -colors 32 – dither down to 32 colours
  • PNG8:output.png – write out to output.png in 256 colour mode.

The PNG8: is the secret sauce – for every other option I tried, ImageMagick would still write out a 32 bit colour file.

These together shrink 592 kB of images down to 144 kB.

Efika pricing

Sorry for the commercial post, but Genesi have been a good friend to Linaro and Emdebian.

If you’re looking for a small ARM-based machine, have a look at the Efika MX series from Genesi as they’ve just come down in price. The Smarttop is $129 US while the Smartbook is down to a much more respectable $199 US. Both are based on the 800 MHz Cortex-A8 i.MX515. Linaro has support for at least the Smarttop.

The Smarttop is particularly interesting. It’s the same price as the BeagleBoard but has twice the RAM, an 8 GB SSD, Ethernet, WiFi, and, very importantly, comes in a case.

Running the Fedora ARM beta on qemu-linaro

The Fedora ARM project have released beta 1 of Fedora 13 for ARM. Chris Tyler has instructions for trying it out under Fedora, so I thought I’d give it a quick go with Ubuntu and qemu-linaro. Here’s the steps:

  • Download, build, and install qemu-linaro. I used the 2011.02-0 release.
  • See Chris’s page for the Fedora download link.
  • Download the RPM package with the QEMU image.
  • Go to a temporary directory and extract the RPM using rpm2cpio ~/Downloads/armvm-f13beta1-15.fc13.noarch.rpm | cpio -idmv
  • Change to var/lib/libvirt/images. You might need to install the rpm package to get rpm2cpio.
  • Start qemu-linaro using something similar to ~/opt/bin/qemu-system-arm -m 256 -M versatileab -kernel zImage-versatile-2.6.24-rc7.armv5tel -append root=0800 -hda f13-arm-beta1-rootfs.img

The root password is fedoraarm.

Working with other Linaro releases

chdist is a nice tool that makes working with different releases much easier. You can use it to poke into and download packages from different releases without setting up a chroot for each one. I use from my Maverick host to grab the source packages from Natty when trying to track down a bug.

For example, I’m looking into adding cortex-strings into the Natty libc6. Install chdist using:
apt-get install devscripts

Tell chdist about Natty:
chdist create natty

Update the list of packages:
chdist apt-get natty update

Check which version is currently uploaded:
chdist apt-cache natty show libc6

Grab the source:
chdist apt-get natty source libc6

The distributions and configuration files end up under ~/.chdist such as ~/.chdist/natty/etc/apt/.

Efika MX shoutout

I’d like to say thanks to the people at Genesi. I was a lucky recipient of one of the many EFIKA MX Smartbooks they gave away at the Linaro November LDS. It’s a nice little ARM-based smartbook with a 10″ screen, decent processing power, decent storage, and a quite good keyboard. My day-to-day machine is a hefty IBM R500 Thinkpad and compared to that the EFIKA is a breath of fresh air.

The CPU is a 800 MHz Freescale i.MX515. The Cortex-A8 core inside has roughly the same performance per MHz as an Atom and about twice what you’d see in a ARM9 and, as it has decent memory bandwidth unlike earlier ARMs, it can much better drive and fill the 1024×600 screen. The internal NAND storage is quite quick (much faster than any SD card I’ve seen). The software stack needs a bit of work as they’re taking the pure approach so things like graphics acceleration, video decoding, and faultless suspend need improving.

Something I find very interesting about this machine and similar ones like the Toshiba AC100 or anything Ingenic based is you stand a chance of controlling every part of your device from bootloader to UI meaning that you really own it, not just use it by someone else’s permission.

Check out their technical blog at http://blog.efikamx.info/.

Tidying up ARM boards

My office was getting a bit messy so I re-purposed an old PC case and mounted my ARM boards, a switch, and far too many power supplies into it:

The case

It turns out that my Pandaboards and KwikByte Beagleboard clones fit well into a 5 1/4″ floppy drive adapter while keeping the Ethernet and power out the back and storage accessable out the front:

Pandaboard mounted in a floppy drive adapter

PandaBoard mounted in a floppy drive adapter

A 6x OMAP3 Gumstix Stagecoach board goes where the motherboard used to:

Side view showing the Stagecoach

with a switch down the bottom to keep the cables tidy.

2x PandaBoards, 2x BeagleBoards, a Stagecoach, and far too many twist ties gives 12 cores for a total of 9.76 GHz of processing… not as cool as David’s box, but I like it.

Recording conference calls

Linaro is an open organisation, and as part of that I’ve been recording our meetings so that people can catch up with them later. Here’s what I use:

  • Skype, to call into the meeting
  • rec-applet, to record the audio from Skype off into an ogg file
  • Audacity, to trim, normalise, and noise reduce the file
  • WordPress, to host as a Podcast for easy downloading

Once you’ve installed rec-applet from the PPA, right click on the top panel, select Add to Panel..., then select Audio Recorder Applet. You can turn the volume on your machine all the way down but make sure you don’t mute it. Also ensure that you mute your microphone in Skype.

I’m not sure if rec-applet also records what you say. I normally use a plain old phone for calling in as the latency over Skype from NZ is too high.

lk bootloader

Ran across this:
The (L)ittle (K)ernel Android bootloader

u-boot has always seemed a bit big to me and not so appropriate for a final product. The lk bootloader is a thin, Snapdragon focused bootloader that gives you the basic initial startup, splash screen, kernel loading, and handoff. It looks like there’s basic Beagleboard and ATSAM7 support as well.

The code is here:
http://android.git.kernel.org/?p=kernel/lk.git;a=tree

Building a ARM cross toolchain

Projects like Emdebian and Linaro provide good, pre-packaged ARM cross compilers but cross compilers for bare metal are still a bit of a mess.

The CodeSourcery ARM Lite Edition is a really good bet. There’s the ridiculous crosstool-NG. My favourite is summon-arm-toolchain which is a nice, readable shell script that handles the download and multi-stage build for you.

I’ve done a little bit of work on it at http://github.com/nzmichaelh/summon-arm-toolchain to tidy up the download process and support for the Linaro ARM toolchain.