Booting Linux on the BeagleBoard-xM

Get started with this small, open platform for device development

BeagleBoard.org recently introduced BeagleBoard revision xM, a new edition of the highly successful open-hardware BeagleBoard currently at revision C. This article describes the necessary environment and steps for booting Linux® on the BeagleBoard-xM with Angstrom Linux, Android, and Ubuntu.

Share:

Jeffrey M. Osier-Mixon, Technical Writer, MontaVista Software, Inc.

Author photo - Jeffrey Osier-MixonJeffrey Osier-Mixon is a technical writer, open source advocate, and community manager. He blogs about open source software, runs the Meld embedded Linux community, and speaks at Linux conferences.



14 December 2010

Also available in Portuguese

Introducing the BeagleBoard-xM

The BeagleBoard is a pocket-sized reference board containing a Texas Instruments Open Multimedia Application Platform (OMAP) 3 system-on-a-chip (SoC) processor, which includes an ARM Cortex-A8 core, Texas Instruments C64x+ digital signal processor (DSP), and onboard graphics engine, as well as integrated dual data rate (DDR) random-access memory (RAM). The BeagleBoard is an inexpensive platform for hobbyists, academics, and professionals who are learning Linux and small systems. Figure 1 shows the BeagleBoard-xM.

Figure 1. BeagleBoard-xM
Picture of the BeagleBoard-xM

In a previous developerWorks article, I explored booting Linux on BeagleBoard revision C, which hosts a 600MHz OMAP3530 processor, 256MB RAM, and 256MB NAND flash memory. Revision xM is more robust with a 1GHz OMAP3730 processor and 512MB RAM. It boots from the microSD card with no flash memory and hosts new interfaces, including a DB-9 serial connector, integrated 4-port Universal Serial Bus (USB) hub, and integrated Ethernet port. The BeagleBoard-xM retains many revision C features, including Digital Visual Interface (DVI)-D output, S-video, audio, Joint Test Action Group (JTAG), and a large expansion header.


Building your working environment

The following sections show you how to source required components, set up, and test the console.

Sourcing components

The BeagleBoard-xM is packaged with a preformatted 4GB microSD card along with an adapter so you can plug the card into a standard Secure Digital (SD)/MultiMediaCard (MMC) slot, but no cables. You need the following:

Powering the BeagleBoard-xM

Traditionally, the BeagleBoard is powered from either an external 5V power source or a USB On-The-Go (OTG) cable. These cables, however, provide only up to 500mA, barely enough to power the xM. It is highly recommended that you use an external power supply—either a 5V power brick with a 2.1mm barrel (positive center) or a Y cable that plugs into two USB ports on your host.

  • Power supply
    Use a 5V external power supply.
  • Serial cable
    The BeagleBoard-xM provides a female DB9 port and requires a serial cable to connect the console to your host system. Use a straight-through (not null-modem) cable. If your host system has no serial port, use a DB9-to-USB cable.
  • USB keyboard and USB mouse
  • DVI-D capable monitor and a DVI-D to High-Definition Multimedia Interface (HDMI) cable
    Note that the board does not emit Video Graphics Array (VGA) signals through this connector, so a standard DVI-to-VGA converter cable won't work.
  • 4GB+ microSD cards and a card reader
    You can overwrite the data on the provided card, but it is better to purchase a few cards to use with different distributions. Use a USB card reader if your host has no integrated reader.

Setting up the console

Linux users can use minicom, shown in the examples that follow. Microsoft® Windows® users can use Hyperterminal or PuTTy, and Mac users can use screen, ZTerm, or MacWise.

Connect the serial cable to the BeagleBoard-xM's DB9 port and your host, and launch minicom in setup mode as root:

sudo minicom -s

Listing 1 shows the minicom configuration menu.

Listing 1. minicom configuration menu
            +-----[configuration]------+
            | Filenames and paths      |
            | File transfer protocols  |
            | Serial port setup        |
            | Modem and dialing        |
            | Screen and keyboard      |
            | Save setup as dfl        |
            | Save setup as..          |
            | Exit                     |
            | Exit from Minicom        |
            +--------------------------+

Select Serial port setup. The resulting sub-menu is shown in Listing 2.

Listing 2. minicom serial port setup menu
    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyS0                                |
    | B - Lockfile Location     : /var/lock                                 |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 115200 8N1                                |
    | F - Hardware Flow Control : No                                        |
    | G - Software Flow Control : No                                        |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+
            | Screen and keyboard      |
            | Save setup as dfl        |
            | Save setup as..          |
            | Exit                     |
            | Exit from Minicom        |
            +--------------------------+

If your cable is a straight-through serial cable, the serial device is /dev/ttyS0. If you use a USB converter, use /dev/ttyUSB0. If no text appears in the next step, it is possible your host assigned a different device, so increment 0 to 1 and try again. For all devices, the settings are 115200, 8 bits, no parity, 1 stop bit, and no hardware or software flow control.

When your settings are correct, save this setup as the default by choosing Save setup as dfl and then Exit. The minicom welcome message appears, as shown in Listing 3.

Listing 3. minicom welcome message
Welcome to minicom 2.3

OPTIONS: I18n
Compiled on Oct 24 2008, 06:37:44.
Port /dev/ttyS0

       Press CTRL-A Z for help on special keys

To verify, apply power to your BeagleBoard-xM, and type a key to stop the boot countdown. Boot-loader messages appear showing the X-loader and U-boot version, date of build, and output, with U-boot showing specifics about system memory, input and output channels, expansion board information, and the board's revision and die ID, as shown in Listing 4.

Listing 4. X-Loader and U-Boot
Texas Instruments X-Loader 1.4.4ss (Aug 19 2010 - 02:49:27)
Beagle xM Rev A
Reading boot sector
Loading u-boot.bin from mmc


U-Boot 2010.03-dirty (Aug 20 2010 - 20:50:46)

OMAP3630/3730-GP ES1.0, CPU-OPP2, L3-165MHz,
OMAP3 Beagle board + LPDDR/NAND
I2C:   ready
DRAM:  512 MB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial

Probing for expansion boards, if none are connected you'll see a harmless I2C error.

No EEPROM on expansion board
Beagle xM Rev A
Die ID #77f600001bf00000015739ea0701c021
Hit any key to stop autoboot:  0
OMAP3 beagleboard.org #

Unplug power from your BeagleBoard-xM.

Preparing to boot Linux

Monitor cable

Make sure to never plug the monitor cable in while the board is powered, because that could damage the board. Always unplug the power first.

Plug your keyboard and mouse into the USB sockets on the BeagleBoard-xM. Plug a network cable, if available, into the Ethernet jack. Connect the HDMI-to-DVI cable between the board and a DVI-D monitor.

The following instructions are intended only to get your board up and running with these three Linux distributions. The links in Resources contain development kits, toolchains, and instructions for setting up full development environments.


Booting Angstrom Linux

Angstrom Linux is an operating system developed specifically for small computers such as the BeagleBoard-xM. The fastest way to boot Angstrom on the BeagleBoard-xM is with the microSD card that comes with the board, which contains an Angstrom image. However, the image on that card is a verification image, which means that it is provided only to verify the board's operation. It does not contain a graphical user interface (GUI) and boots by default as a RAM disk; thus any changes you make are lost when you unplug.

The included microSD card contains a single File Allocation Table (FAT) partition of approximately 117MB, containing the following:

  • Boot loaders X-loader (MLO) and U-boot (u-boot.bin)
  • Linux kernel (uImage)
  • Boot script (user.scr)
  • RAM disk root file system (ramdisk.gz)
  • md5sum file to check file sizes

The rest of the card is unformatted.

To boot, insert the microSD card and apply power. After the boot countdown, the system automatically invokes the boot script. The boot-loader text is shown again on the console, followed by boot messages showing the boot processes, including execution of the script itself, loading the kernel and RAM disk, and finally starting the kernel, as shown in Listing 5.

Listing 5. Booting Angstrom
mmc1 is available
The user button is currently NOT pressed.
reading boot.scr

** Unable to read "boot.scr" from mmc 1:1 **
reading user.scr

755 bytes read
Running bootscript from mmc ...
## Executing script at 80200000
mmc1 is available
reading ramdisk.gz

19960110 bytes read
reading uImage

3190568 bytes read
Booting from ramdisk ...
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   Angstrom/2.6.32/beagleboard
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3190504 Bytes =  3 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.....................................................................
[    0.000000] Linux version 2.6.32 (ubuntu@ip-10-204-115-71) (gcc version 4.3.3 .......

Linux boot messages follow, and then finally the Angstrom logo and a login prompt, as shown in Listing 6.

Listing 6. Angstrom login console
.-------.                                          
|       |                  .-.                     
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution beagleboard ttyS2

Angstrom 2010.7-test-20100820 beagleboard ttyS2

beagleboard login:

Log in as root, no password necessary. You can run basic Linux commands to test the system. Try running testled, and watch the light-emitting diodes (LEDs) on the BeagleBoard-xM.

To see Angstrom in action, you need a full root file system and a matching kernel. The following instructions show how to download and boot the demo image:

  1. Navigate to the Angstrom BeagleBoard demo page and read the instructions.
  2. Download the binary images for the boot loader and root file system from the Angstrom BeagleBoard demo page. There files you need are:
    • mkcard.txt
    • MLO
    • u-boot.bin
    • Angstrom-Beagleboard-demo-image-glibc-ipk-2010.3-beagleboard.rootfs.tar.bz2
  3. Insert a microSD card with at least 4GB capacity, and determine its device name. For example, if you are using a USB card reader, use fdisk and look for a disk matching the card's characteristics. The following example shows /dev/sdg:
    # fdisk -l
    ...
    Disk /dev/sdg: 3.9 GB, xxx bytes
    255 heads, 63 sectors/track, xxx cylinders
  4. Unmount any partitions on the card. Use your card's device name in place of /dev/sdg in the following example:
    sudo umount /dev/sdg?
  5. Format your SD card using the mkcard.txt script.

    Note: Be certain that you are targeting your SD card and not a system disk.

    Use your card's device name in place of /dev/sdg in the following example:

    chmod +x mkcard.txt ; sudo ./mkcard.txt /dev/sdg

    When the operation is done, your microSD card contains two primary partitions:

    • One 70MB FAT partition labeled boot.
    • One ext3 partition labeled Angstrom that takes up the rest of the card's capacity.

    If your system does not automatically mount these partitions after the script creates them, mount them by hand, replacing your card's device name for /dev/sdg in the following example:

    sudo mkdir -p /media/boot ; sudo mount /dev/sdg1 /media/boot
    sudo mkdir /media/Angstrom ; sudo mount /dev/sdg2 /media/Angstrom

    The rest of this example assumes these partitions are mounted as /media/boot and /media/Angstrom.

  6. Unpack files to the root file system partition (this command may take some time):
    sudo tar -C /media/Angstrom -xjvf \
     Angstrom-Beagleboard-demo-image-glibc-ipk-2010.3-beagleboard.rootfs.tar.bz2
  7. Copy files to the boot partition, noting that the kernel image comes directly from the root file system:
    cp MLO /media/boot
    cp u-boot.bin /media/boot
    cp /media/Angstrom/boot/uImage /media/boot
  8. When all operations are done, synchronize file systems and unmount partitions:
    sync ; sudo umount /dev/sdg?
  9. Insert the card into the BeagleBoard-xM and apply power.

    Note: If the first boot fails with an error like this:

     Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block...

    Restart the system, stop the boot countdown, and type the following command:

    setenv mmcroot /dev/mmcblk0p2 rw

    Then boot the system by typing boot.

The first boot takes a while as the system configures itself. The Angstrom logo appears on the monitor, while on the console each component is configured. After about 10 minutes, an Angstrom login screen appears on the monitor and a boot prompt on the console. Use the login screen to set up a new user and log in. You can also log in on the console as root, no password required.


Booting Android

Android has proven to be a popular operating system for the BeagleBoard, as the board is an inexpensive platform for Android application development and testing. There are several ports of Android to the BeagleBoard. This article uses the rowboat project. Be sure to connect a USB keyboard and mouse as well as a DVI monitor before starting.

  1. Download the precompiled binary tarball from the Texas Instruments Android DevKit page, making sure to identify the pre-built image for the BeagleBoard-xM (beagleboard-xm.tar.gz).
  2. Unpack the tarball:
    tar zxvf beagleboard-xm.tar.gz
  3. Read the instructions in README.txt.
  4. Insert a microSD card with at least 4GB capacity, and determine its device name. For example, if you are using a USB card reader, use fdisk and look for a disk matching the card's characteristics. The following example shows /dev/sdg:
    # fdisk -l
    ...
    Disk /dev/sdg: 3.9 GB, xxx bytes
    255 heads, 63 sectors/track, xxx cylinders
  5. Format your SD card using the provided script.

    Note: Be certain that you are targeting your SD card and not a system disk.

    Use your card's device in place of /dev/sdg in the following example:

    mkmmc-android.sh /dev/sdg

    When all operation is done, synchronize file systems and unmount partitions:

    sync ; sudo umount /dev/sdg?
  6. Insert the microSD card into the BeagleBoard-xM and apply power.

    The first boot takes a while as the system configures itself. After about four minutes, you should see the Android logo and then a home screen. If the network does not activate automatically, wait another five minutes and reboot. Note that the console remains active and automatically logs in as root.


Booting Ubuntu

Ubuntu is fast becoming a popular distribution for netbooks, mobile Internet devices (MIDs), and other small systems. Canonical, Ubuntu's parent company, has dedicated resources to porting Ubuntu to ARM processors such as the BeagleBoard. As with Android, make sure to plug in a monitor and USB keyboard and mouse before starting.

  1. Read the instructions on the Ubuntu OMAP Maverick Install page.
  2. Download the precompiled binary image. Make sure to identify the image for the BeagleBoard-xM: Preinstalled netbook image for TI OMAP3 computers (ubuntu-netbook-10.10-preinstalled-netbook-armel+omap.img.gz). Do not uncompress the image at this time.
  3. Insert a microSD card with at least 4GB capacity, and determine its device name. For example, if you are using a USB card reader, use fdisk and look for a disk matching the card's characteristics. The following example shows /dev/sdg:
    # fdisk -l
    ...
    Disk /dev/sdg: 3.9 GB, xxx bytes
    255 heads, 63 sectors/track, xxx cylinders
  4. Write the image directly to the card.

    Note: Be certain that you are targeting your SD card and not a system disk.

    Use your card's device in place of /dev/sdg in the following example:

    sudo sh -c 'zcat \
     ./ubuntu-netbook-10.10-preinstalled-netbook-armel+omap.img.gz > /dev/sdg'

    Note: If your BeagleBoard-xM is revision A3, you may need to download a different kernel. See the Ubuntu Maverick install page for details.

    When all operations are done, synchronize file systems and unmount partitions:

    sync ; sudo umount /dev/sdg?
  5. Insert the card into the BeagleBoard-xM and apply power.

    The first boot takes a while as the system configures itself, during which the monitor and console may stay dark. After about 5 minutes, the Ubuntu logo appears on the monitor, followed by a series of system configuration screens. Answer the configuration questions using the keyboard and mouse plugged into the BeagleBoard. If the network does not activate automatically, wait until the system is completely operational, shut it down (go to System and choose Shut Down), and then reboot.

The console does not remain active for Ubuntu. You must interact with the system through the monitor and keyboard or mouse. However, you can install a Virtual Network Computing (VNC) server from the Ubuntu Software Center and interact with the system through VNC.


Where to go from here

Each of these operating systems has its own community ecosystem, including web sites, wikis, mailing lists, and Internet Relay Chat (IRC) channels, as does the BeagleBoard itself. Take advantage of these excellent resources while you learn about the BeagleBoard-xM and your chosen operating system.

Resources

Learn

Get products and technologies

  • Evaluate IBM products in the way that suits you best: Download a product trial, try a product online, use a product in a cloud environment, or spend a few hours in the SOA Sandbox learning how to implement Service Oriented Architecture efficiently.

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Linux on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Linux, Open source
ArticleID=600987
ArticleTitle=Booting Linux on the BeagleBoard-xM
publish-date=12142010