Booting Linux on the BeagleBoard-xM

Get started with this small, open platform for device development

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

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.

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.

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.

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 Related topics 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 )

) and U-boot ( ) 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:

Navigate to the Angstrom BeagleBoard demo page and read the instructions. 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 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 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? 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 . 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 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 When all operations are done, synchronize file systems and unmount partitions: sync ; sudo umount /dev/sdg? 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.

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 ). Unpack the tarball: tar zxvf beagleboard-xm.tar.gz Read the instructions in README.txt. 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 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? 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.

Read the instructions on the Ubuntu OMAP Maverick Install page. 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. 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 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? 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.

Downloadable resources

Related topics