PandaBoard ES

From Crashcourse Wiki

Jump to: navigation, search

Contents

[edit] TO DO

Just a general list of things to get to some day:

  • Document ES-specific sysboot switch.
  • Building and running Android.
  • Building and running Angstrom.
  • Geexbox?
  • Add OMAP4460 support to Barebox, so it can be used in place of U-Boot.
  • Touchscreen?
  • Camera?

[edit] Overview

This page (and any eventual subpages) describes how to work specifically with the Pandaboard ES (in my case, a Rev B1). The idea here is not to try to be general and cover various revisions, or Linux on OMAP in general. The idea here is to pick a specific revision of a specific board, and show how to get it up and running and do as many things as possible with it.

My motivation is that I want to use this board as the basis of upcoming embedded Linux courses, which means that things simply have to work. As much as possible, I want to avoid descending into apologetics like, "Try A. If that doesn't work, try B ..." That sort of thing just doesn't fly in a classroom of paying customers, so my plan is to personally test everything that shows up on this page to make sure it works as described.

While I want to play with as many installs as possible (Angstrom, Ubuntu, Android), I'll focus mostly on Ubuntu on the ES; specifically Robert Nelson's ongoing builds, since that seems like the most solid and well-maintained platform to work with. If you want to play along, pick up an ES, follow along, test what you can and send me any observations at rpjday@crashcourse.ca.

Finally, if you know of something that should work on an ES, drop me a note. It can be as simple as, say, writing a C program that blinks the LED, or something like that. If I test it, and it works, I'll add it to this page somewhere, or just link appropriately.

[edit] Differences between the regular PandaBoard and the ES

You can read about the official differences here, but here are a couple simple examples you'll run into:

  • You can download a Panda validation image from here, but if you run the LED validation step, it will work fine for both LEDs on an original Panda, but LED 2 won't light up on an ES.
  • Currently, the Barebox bootloader has decent Panda (OMAP4430) support, but is still lacking in functional ES (OMAP4460) support.

There's more -- you get the idea.

[edit] Online resources

[edit] The bits and pieces for the perfect working environment

In addition to a Ubuntu development host and PandaBoard ES, here's the shopping list for each student kit:

  • USB-serial cable
  • 5V power supply (min 2A)
  • powered USB hub
  • USB mouse and keyboard
  • SD card
  • headphones
  • microphone(?)
  • network cable to connect to DHCP-enabled router (unless onboard wi-fi works)
  • HDMI-HDMI cable (or HDMI-DVI cable until HDMI works out of the box)
  • ideally, full HD (1920x1080) HDMI-capable flat panel display

Optionally, depending on how far we want to push this:

  • some device to hang off USB OTG port
  • Flyswatter 2 for JTAG ddebugging, plus any other cool toys from tincan tools like their Beacon Board
  • nice case for panda
  • Anything else?

Any extra shopping items will depend on specialized labs.

[edit] Setting up your (64-bit Ubuntu) development host

Since I'm using 64-bit Ubuntu 11.10, I'm going to restrict myself to discussing only that as a development platform.

[edit] Getting Linaro tools for Ubuntu

If you want to start working with Linaro's tools, most pages you find (like this one) advise you to add another PPA to your Ubuntu system software sources. However, if you just need what's in the linaro-image-tools package, that's already part of the stock "universe/devel" repo in Ubuntu 11.10, so you can just:

$ sudo apt-get install linaro-image-tools

No need for additional PPAs.

[edit] Toolchains

[edit] Overview

There are a number of viable toolchains when you're ready to start compiling, so let's summarize things here. Much more coming ...

[edit] Ubuntu's gcc-arm-linux-gnueabi

The current version of 4:4.6.0-8 is broken in that it won't compile U-Boot in some circumstances:

clocks.c: In function ‘enable_non_essential_clocks’:
clocks.c:420:13: internal compiler error: in decode_addr_const, at varasm.c:2638
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/cceRJr9M.out file, please attach this to your bugreport.
make[1]: *** [clocks.o] Error 1
make[1]: Leaving directory `/home/rpjday/uboot/linaro/u-boot-linaro-stable/arch/arm/cpu/armv7/omap4'
make: *** [arch/arm/cpu/armv7/omap4/libomap4.o] Error 2

So until that's fixed, Ubuntu's ARM toolchain doesn't appear to be an option.

[edit] DENX's ELDK toolchain

The newest 5.1 version is not available for 64-bit so I'm currently using an older version:

$ arm-linux-gcc --version
arm-linux-gcc (GCC) 4.2.2
... snip ...

More toolchains coming (CodeSourcery, Linaro, etc).

[edit] Downloadable and runnable images

[edit] The current list of SD card images

[edit] The validation image

You can find a basic PandaBoard validation image here. Some of the validation tests contained in that image don't work for an ES but you should simply be able to confirm that your ES boots to a shell prompt. However, there is an issue with this image that won't show up until later.

If you stop in U-Boot and check the environment, you'll see that part of the bootargs variable is the string init=/linuxrc. This works fine for booting to that script, but if you decide to rebuild your bootloader later and let your board boot to the regular init process, you'll discover that the /etc/inittab inside that image contains:

null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -t sysfs sysfs /sys
null::sysinit:/bin/mount -t usbfs usbfs /proc/bus/usb
null::sysinit:/bin/mount -o remount,rw /
null::sysinit:/etc/init.d/udev
null::sysinit:/usr/sbin/alsactl -f /etc/asound.state restore
#null::sysinit:/bin/start-tests.sh

which is just silly and will cause init errors. That's something that should be fixed in a new validation image.

More images coming shortly as I download and test them.

[edit] Building an image using Robert Nelson's setup_sdcard.sh script

[edit] The basic recipe

Beyond using raw downloadable, SD card-ready images, you can keep up with Robert Nelson's ongoing work in packaging Ubuntu for ARM platforms. As simply as possible, here's how you can build a new Ubuntu image for your Panda ES (all of this is covered in far more detail here, even though that page seems to be focused on the BeagleBoard).

  • Download the latest version of Robert's root filesystem tarballs from here. Obviously, that's a pre-release version of Ubuntu but you want to live life on the edge, right? Just grab whatever looks like the most recent version.
  • Untar (actually, unxz).
  • Insert empty SD card, note device name (let's assume /dev/sdc for brevity).
  • Run setup_sdcard.sh with the appropriate options to create a bootable SD card.

For your Panda ES, the simplest recipe would involve running:

$ sudo ./setup_sdcard.sh \
   --mmc /dev/sdc \         # Or whatever is correct for you.
   --uboot panda_es
... much output snipped ...
$

Once you're done, you can boot your Panda ES with that SD card and log in with the name/password "ubuntu/temppwd".

NOTE: All of this is presented in far more detail here.

IMPORTANT: Robert's images are currently set up to use the DVI-D port, not HDMI.

[edit] DIGRESSION: Getting an updated version of setup_sdcard.sh

While each tarball above comes with its own copy of the setup_sdcard.sh script, you can get the latest version of that script with enhancements here as Robert occasionally adds new features between official tarball releases.

I regularly check for newer versions and use those, even if they don't appear to have any changes that will affect working with a Panda ES.

[edit] Booting from your new SD card

On my Panda ES, it just works. Not sure what else to say here. Once you get to the login prompt, use the username and password "ubuntu" and "temppwd".

[edit] Connecting your ES to a monitor

Currently, Robert Nelson's images support connecting an external display to only the (outer) DVI-D port, not the HDMI one (that's coming soon). That means you have at least a couple options for connecting a display to your Panda ES:

  • DVI-HDMI cable, plugged into the DVI port of the display, with monitor selecting DVI as input source, or
  • HDMI-HDMI cable, plugged into the HDMI port of the display, with monitor selecting HDMI as input source

In both cases, of course, you'll be connected to the DVI port of the Pandaboard.

[edit] In brief, adding extra functionality to your ES

Over the next few sections, I'll describe the various ways you can start extending your stock Robert Nelson-provided Ubuntu image, and I want to do it in several stages (assuming you have network connectivity):

  • Simply updating the install. Might hold off on that since it might be dangerous messing with a tested, validated image.
  • Configuring already-installed software. Given what comes with Robert's images, I'm sure there are numerous things that can be configured and activated that don't require any extra software.
  • Installing and configuring packages available from the universe and multiverse repos.
  • Finally, adding extra repositories like the TI OMAP PPA.

You can see that these steps go from simplest to most complicated, and that's the way I'd like to approach them.

[edit] Validating the current install

At this point, I'll fill in a number of things you should be able to do to ensure everything is working properly. At the very least, you should make sure your networking is functioning since you'll be installing additional software shortly. I'll probably steal some of the validation scripts from the official Pandaboard validation image above.

Quite simply, what I want to list here are things a new user can do to poke around his newly-running system and check out its properties.

[edit] Adding X and the Openbox window manager

(An alternative OMAPpedia writeup can be found here.)

Add X and the lightweight Openbox window manager with:

$ sudo apt-get install xorg openbox

You can start it manually with:

$ startx

but it needs further configuration -- you can read the online docs here.

Depending on how complete you want to make your desktop, there are additional Openbox-related packages:

  • obmenu
  • openbox-xdgmenu
  • python-xdg (for openbox-xdg-autostart)

Currently, this Ubuntu image uses the standard fbdev driver. There are some old, OMAP-related drivers but they're apparently not worth the trouble. There's a new X11 driver for OMAP4 under development here which will be integrated into Precise, so you can try that development driver or just stick with fbdev for now, which works just fine. NOTE: If you want to test that development driver and it works, please let me know and I'll write it up here.

[edit] Rebuilding MLO/SPL and U-Boot for the ES

As a first step to creating your own distro for the ES, you can try configuring, building and installing your own versions of MLO and u-boot.img on your bootable SD card, replacing what's there. While you can use mainline U-Boot for this, the Linaro checkout is significantly more advanced so that's what we'll use. For purposes of comparison, it doesn't hurt to have both checked out so you can see the differences between files:

$ git clone git://git.denx.de/u-boot.git
$ git clone git://git.linaro.org/boot/u-boot-linaro-stable.git

Briefly, to build new boot files, use the Linaro checkout and:

$ export CROSS_COMPILE=arm-linux-              [or whatever you're using]
$ make omap4_panda_config
$ make

Once this finishes (and it should work), the files you care about are:

$ ls -l MLO u-boot.img
-rw-rw-r-- 1 rpjday rpjday  35100 2012-02-02 16:30 MLO
-rw-rw-r-- 1 rpjday rpjday 263004 2012-02-02 16:30 u-boot.img
$

To test them, mount the partitions on your validation SD card, and simply copy these two files into the boot partition -- this will overwrite the existing MLO file, and add the u-boot.img file, which will be used in place of the existing u-boot.bin file (which you can remove if you want -- the newer U-Boot now checks for u-boot.img).

if you boot from this modified validation SD card and stop in U-Boot, you should now see something similar to:

Panda # version

U-Boot 2011.12 (Feb 02 2012 - 16:30:01)
arm-linux-gcc (GCC) 4.2.2
GNU ld (GNU Binutils) 2.17.90.20070806
Panda #

You can let your board boot fully, which will verify that your bootloader files work but will also demonstrate the problem I mentioned earlier with /etc/inittab in the current validation image:

... snip ...
INIT: version 2.86 booting
INIT: /etc/inittab[2]: duplicate ID field "null"
INIT: /etc/inittab[3]: duplicate ID field "null"
INIT: /etc/inittab[4]: duplicate ID field "null"
INIT: /etc/inittab[5]: duplicate ID field "null"
INIT: /etc/inittab[6]: duplicate ID field "null"
INIT: /etc/inittab[11]: id field too long (max 4 characters)

Enter runlevel: 

but that's fine, since all you wanted to do was verify the proper operation of your new MLO and u-boot.img files.

As a final point, if you use the Linaro checkout instead of mainline, you can take advantage of the newer support for the uEnv.txt file for the PandaBoard, as you can see in the include/configs/omap4_common.h header file in the Linaro tree:

#define CONFIG_EXTRA_ENV_SETTINGS \
        "loadaddr=0x82000000\0" \
        "console=ttyO2,115200n8\0" \
        "usbtty=cdc_acm\0" \
        "vram=16M\0" \
        "mmcdev=0\0" \
        "mmcroot=/dev/mmcblk0p2 rw\0" \
        "mmcrootfstype=ext3 rootwait\0" \
        "mmcargs=setenv bootargs console=${console} " \
                "vram=${vram} " \
                "root=${mmcroot} " \
                "rootfstype=${mmcrootfstype}\0" \
        "bootscr=boot.scr\0" \
        "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} ${bootscr}\0" \
        "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
                "source ${loadaddr}\0" \
        "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
        "importbootenv=echo Importing environment from mmc ...; " \
                "env import -t $loadaddr $filesize\0" \
        ... etc etc ...

If you're feeling ambitious, compare both the omap4_panda.h and omap4_common.h header files in those two trees to see the additional features supported by the Linaro U-Boot tree not (yet?) avavilable in mainline.

Personal tools