This article is the first of a series that describe how to develop and run applications using Oracle's Java SE for Embedded -- a full Java SE platform designed for high-end embedded systems -- on ARM-based hardware, specifically the BeagleBoard. This article details how to get Linux running on ARM-based hardware, specifically the BeagleBoard. The next article describes how to develop Java applications and run them on the Beagleboard.
By the end of this article, you will be able to type commands into a console on the BeagleBoard. Your BeagleBoard will be connected to the Internet and fully prepared to install and run Oracle's Java SE for Embedded implementation for ARM. It should be noted that Java SE for Embedded should run fine on other popular embedded systems with properly installed Linux as well (for example a Sheevaplug or a PandaBoard). The procedure to install Linux however might differ on these alternate systems as compared to how it is done on the BeagleBoard.
Most of the processes described in this article are documented elsewhere, but this article condenses the steps in one place for convenience. The References section at the end of the article has links where you can find more information.
Although the information in this article (and the next) is useful in general, the specific hardware and software used in this article are as follow:
x86 laptop running Ubuntu 10.04
BeagleBoard RevC4, including various cables and adapters
These are the basic steps to install and run Linux on the BeagleBoard:
Copy boot files to a memory card.
Connect the BeagleBoard console to your computer.
Update the BeagleBoard's boot files.
Install Linux on a memory card.
Boot the BeagleBoard into Linux.
Configure the network.
The BeagleBoard contains boot files in its memory that enable it to launch an operating system such as Linux from a memory card. You must update the boot files so that the BeagleBoard is able to run the version of Linux you will be installing. Do this by placing the boot files on a memory card. When you start the BeagleBoard using the memory card, the boot files are copied into the BeagleBoard's memory.
The boot files are available here:
Make a new directory, flash-omap, and copy the files into it.
You are ready to copy the boot files to your memory card. This process destroys any information that exists on the card.
The BeagleBoard C4 described in this article comes with a 4 GB microSD memory card, which looks like this:
A USB adapter is also included. Plug the memory card in one end of the adapter and the other end of the adapter into your computer.
You can find out the device name of the memory card using the
alix@livadia:~$ dmesg | tail [29055.580434] sd 4:0:0:0: [sdb] Mode Sense: 0b 00 00 08 [29055.580441] sd 4:0:0:0: [sdb] Assuming drive cache: write through [29055.634766] sd 4:0:0:0: [sdb] Assuming drive cache: write through [29055.634799] sdb: sdb1 sdb2 [29055.677018] sd 4:0:0:0: [sdb] Assuming drive cache: write through [29055.677037] sd 4:0:0:0: [sdb] Attached SCSI removable disk [29059.965775] kjournald starting. Commit interval 5 seconds [29060.348999] EXT3 FS on sdb2, internal journal [29060.349020] EXT3-fs: recovery complete. [29060.358040] EXT3-fs: mounted filesystem with ordered data mode. alix@livadia:~$
These messages indicate that the memory card is represented by
/dev/sdb. On your computer, the device name might be different, so make a note of it.
Copy the boot files to the memory card using the following script. You must specify the device where you want the boot files to go. If you specify the wrong device, you could destroy the information on your hard disk; use caution. The script shows some information about your devices and prompts you to confirm your choice.
alix@livadia:~$ cd flash-omap alix@livadia:~/flash-omap$ ./mk_mmc.sh --mmc /dev/sdb I see... sudo sfdisk -l: Disk /dev/sda: 3916 cylinders, 255 heads, 63 sectors/track Disk /dev/sdb: 1017 cylinders, 125 heads, 62 sectors/track mount: /dev/sda1 on / type ext4 (rw,errors=remount-ro) /dev/sdb1 on /media/boot type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000, shortname=mixed,dmask=0077,utf8=1,flush) /dev/sdb2 on /media/rootfs type ext4 (rw,nosuid,nodev,uhelper=udisks) Are you 100% sure, on selecting [/dev/sdb] (y/n)? y Downloading X-loader and Uboot 2011-01-14 09:47:03 URL:http://rcn-ee.net/deb/tools/latest/bootloader [1866/1866] -> "/tmp/tmp.iSMarc49PQ/dl/bootloader"  . . . Formating Boot Partition mkfs.vfat 3.0.7 (24 Dec 2009) `/tmp/tmp.iSMarc49PQ/dl/MLO-beagleboard-1.44+r19+gitr6f3a26101303051e0f91b6213735b68 ce804e94e-r19' -> `/tmp/tmp.iSMarc49PQ/disk/MLO' `/tmp/tmp.iSMarc49PQ/dl/u-boot-beagleboard-2010.03+r68+gitrca6e1c136ddb720c3bb2cc043 b99f7f06bc46c55-r68.bin' -> `/tmp/tmp.iSMarc49PQ/disk/u-boot.bin' Image Name: Reset NAND Created: Fri Jan 14 09:47:15 2011 Image Type: ARM Linux Script (uncompressed) Data Size: 601 Bytes = 0.59 kB = 0.00 MB Load Address: 0x00000000 Entry Point: 0x00000000 Contents: Image 0: 593 Bytes = 0 kB = 0 MB done alix@livadia:~/flash-omap$
If all goes well, you see the
done message at the end of the output. Remove the memory card from your computer.
When you boot the BeagleBoard, you use a console to interact with it. The console works over a serial connection. The serial connector on the BeagleBoard is a DB9 male connector.
To connect the BeagleBoard's console to your computer, you need two cables. The first is a “null modem” cable, which has DB9 female connectors at both ends.
The second cable is a serial-to-USB adapter.
Plug the null modem cable into the BeagleBoard. Plug the serial-to-USB adapter into the other end of the null modem cable. Then, plug the adapter into your computer's USB port.
You must know where the adapter is located. To figure this out, enter the
dmesg command again:
alix@livadia:~$ dmesg | tail [48436.835875] usb 2-2: configuration #1 chosen from 1 choice [48436.909498] pl2303 2-2:1.0: pl2303 converter detected [48436.959169] usb 2-2: pl2303 converter now attached to ttyUSB1 [48546.375884] usb 2-2: USB disconnect, address 8 [48546.390204] pl2303 ttyUSB1: pl2303 converter now disconnected from ttyUSB1 [48546.390289] pl2303 2-2:1.0: device disconnected [48576.164547] usb 2-2: new full speed USB device using ohci_hcd and address 9 [48576.451372] usb 2-2: configuration #1 chosen from 1 choice [48576.537344] pl2303 2-2:1.0: pl2303 converter detected [48576.597908] usb 2-2: pl2303 converter now attached to ttyUSB1 alix@livadia:~$
In this example, the serial-to-USB adapter
pl2303 is located at
You must have a terminal program on your computer to enable you to interact with the console, such as
minicom or PuTTY. If you use
minicom, you can install it with the following command:
alix@livadia:~$ sudo apt-get install minicom
To run minicom, enter the following:
alix@livadia:~$ sudo minicom -s
A menu is displayed. Use the arrows to move down to Serial port setup and press Return.
+-----[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 | +--------------------------+
In the next menu, press A to change the serial device.
+-----------------------------------------------------------------------+ | A - Serial Device : /dev/ttyUSB1 | | 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? | +-----------------------------------------------------------------------+
Change the current value to the location of your serial-to-USB adapter. Press Return to go back to the original menu. Move down to Exit and press Return.
After a message about initializing a modem,
minicom displays a welcome message.
Welcome to minicom 2.4 OPTIONS: I18n Compiled on Jan 25 2010, 06:49:09. Port /dev/ttyUSB1 Press CTRL-A Z for help on special keys
Now, when you start the BeagleBoard, you will see the console output.
Take the memory card you prepared before and push it inside the SD card adapter.
Now, push the card adapter into the SD slot on the BeagleBoard. This is located below the serial connector for the console.
It is a tight fit if you have already attached the serial cable to the console connector. You might need to unplug the console cable, insert the memory card, then plug in the console cable again.
Find the BeagleBoard's power adapter and plug it in.
The BeagleBoard starts immediately. Messages will be shown in the console window, similar to this:
. . . NAND read: device 0 offset 0x280000, size 0x400000 4194304 bytes read: OK Wrong Image Format for bootm command ERROR: can't get kernel image! OMAP3 beagleboard.org #
The two lines beginning with
NAND read indicate the boot files were copied into the BeagleBoard. Ignore the
ERROR message; it means the BeagleBoard is now ready to boot an operating system, but it cannot find one on the card.
Remove the power connector from the BeagleBoard. Remove the memory card from the BeagleBoard and insert it into your computer again.
The Ubuntu Linux files for the BeagleBoard are in a 7-zip archive. If you do not have the
7za tool to unpack the archive, you can get it:
alix@livadia:~$ sudo apt-get install p7zip-full
The script that copies the Ubuntu Linux files to the card depends on some additional tools that you might need to install:
alix@livadia:~$ sudo apt-get install uboot-mkimage pv btrfs-tools
Get the archive of Ubuntu Linux files and unpack it:
alix@livadia:~$ wget \ http://rcn-ee.net/deb/rootfs/maverick/ubuntu-10.10-r3-minimal-armel.tar.7z alix@livadia:~$ 7za x ubuntu-10.10-r3-minimal-armel.tar.7z alix@livadia:~$ tar xf ubuntu-10.10-r3-minimal-armel.tar
Move into the new directory.
alix@livadia:~$ cd ubuntu-10.10-r3-minimal-armel
Copy the Ubuntu Linux files to the memory card using the following script. As with the script for the boot files, you must specify the device where you want the files to go. If the script is successful, it will take a minute or two to finish.
alix@livadia:~/ubuntu-10.10-r3-minimal-armel$ sudo ./setup_sdcard.sh --mmc /dev/sdb \ --uboot beagle I see... sfdisk -l: Disk /dev/sda: 3916 cylinders, 255 heads, 63 sectors/track Disk /dev/sdb: 1017 cylinders, 125 heads, 62 sectors/track mount: /dev/sda1 on / type ext4 (rw,errors=remount-ro) /dev/sdb1 on /media/boot type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000, shortname=mixed,dmask=0077,utf8=1,flush) Are you 100% sure, on selecting [/dev/sdb] (y/n)? y 1 / 9: Downloading X-loader and Uboot 2011-01-10 18:14:01 URL:http://rcn-ee.net/deb/tools/latest/bootloader [1678/1678] -> "/tmp/tmp.octAhpfx8V/dl/bootloader"  2011-01-10 18:14:02 URL:http://rcn-ee.net/deb/tools/MLO/MLO-beagleboard-1.44+r19+git r6f3a26101303051e0f91b6213735b68ce804e94e-r19 [23752/23752] -> "/tmp/tmp.octAhpfx8V/ dl/MLO-beagleboard-1.44+r19+gitr6f3a26101303051e0f91b6213735b68ce804e94e-r19"  2011-01-10 18:14:04 URL:http://rcn-ee.net/deb/tools/UBOOT/u-boot-beagleboard-2010.03 +r68+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r68.bin [209712/209712] -> "/tmp/t mp.octAhpfx8V/dl/u-boot-beagleboard-2010.03+r68+gitrca6e1c136ddb720c3bb2cc043b99f7f0 6bc46c55-r68.bin"  2 / 9: Unmountting Partitions 3 / 9: Creating Boot Partition . . . Finished populating Boot Partition 8 / 9: Populating rootfs Partition Be patient, this may take a few minutes 269MB 0:01:29 [3.01MB/s] [==================================================>] 100% Finished populating rootfs Partition 9 / 9: setup_sdcard.sh script complete alix@livadia:~/ubuntu-10.10-r3-minimal-armel$
Remove the memory card from your computer and put it into the BeagleBoard. Reboot the BeagleBoard. Watch the console output as Ubuntu starts. When you get to a login prompt, enter
ubuntu for the user name and
temppwd for the password.
. . . [ 2.798675] mmcblk0: mmc0:b368 USD 3.75 GiB [ 2.866912] mmcblk0: p1 p2 [ 3.600311] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem [ 3.610382] EXT4-fs (mmcblk0p2): write access will be enabled during recovery [ 6.057128] EXT4-fs (mmcblk0p2): recovery complete [ 6.434051] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) Ubuntu 10.10 omap ttyS2 omap login: ubuntu Password: Last login: Wed Jan 12 10:38:56 CST 2011 on ttyS2 Linux omap 126.96.36.199-l9 #1 PREEMPT Fri Dec 3 08:13:15 UTC 2010 armv7l GNU/Linux Ubuntu 10.10 Welcome to Ubuntu! * Documentation: https://help.ubuntu.com/ ubuntu@omap:~$
Congratulations! You are running Ubuntu Linux on an ARM-based BeagleBoard!
The next thing you must do is configure the network. Once the network is running properly, the BeagleBoard is connected to the Internet, which is useful for updates. Furthermore, you can transfer files from your computer to the BeagleBoard over the local network, which is more convenient than moving the memory card back and forth.
Your exact configuration is going to depend on the networks you have available. This article describes one possible configuration, based on the following assumptions:
Your computer has two network adapters.
Your computer is already connected to the Internet through one of the network adapters.
The second network adapter will be connected to an Ethernet network that also contains your BeagleBoard.
Your computer is running Ubuntu Linux.
On your computer, use Ubuntu's connection sharing feature to enable the BeagleBoard, on a local Ethernet network, to connect to the Internet. The connection sharing feature is described here:
On the BeagleBoard, add two lines to the
/etc/network/interfaces file. You can use
sudo vi to edit the file.
auto eth0 iface eth0 inet dhcp
The Beagleboard recognizes this USB-to-Ethernet network adapter:
Plug the USB-to-Ethernet adapter into the BeagleBoard's USB connector. It is a tight fit, next to the serial console connector.
Use an Ethernet cable to connect your computer and the BeagleBoard. You might be able to connect an Ethernet cable directly from your computer to the BeagleBoard's adapter, or you can connect through a hub.
Reboot the BeagleBoard. When it boots, the BeagleBoard finds the Ethernet adapter and picks up configuration information from your computer using DHCP.
ifconfig command to verify that the BeagleBoard received an IP address from your computer, and use the
ping command to verify that your computer and the BeagleBoard can see each other.
To make it easy to transfer files from your computer to the BeagleBoard, install the OpenSSH package on the BeagleBoard. Before installing OpenSSH, update Ubuntu Linux:
ubuntu@omap:~$ sudo apt-get update Hit http://ports.ubuntu.com maverick Release.gpg Ign http://ports.ubuntu.com/ubuntu-ports/ maverick/main Translation-en Ign http://ports.ubuntu.com/ubuntu-ports/ maverick/main Translation-en_US . . . Get:5 http://ports.ubuntu.com maverick-updates/multiverse armel Packages [1,297B] Fetched 295kB in 2s (121kB/s) Reading package lists... Done ubuntu@omap:~$
Now, install OpenSSH:
ubuntu@omap:~$ sudo apt-get install openssh-server Reading package lists... Done Building dependency tree Reading state information... Done . . . Setting up libwrap0 (7.6.q-19) ... Setting up openssh-server (1:5.5p1-4ubuntu4) ... Creating SSH2 RSA key; this may take some time ... Creating SSH2 DSA key; this may take some time ... [ OK ]pping OpenBSD Secure Shell server sshd ssh start/running, process 969 Setting up tcpd (7.6.q-19) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place ubuntu@omap:~$
After this step is finished, you can copy files from your computer to the BeagleBoard with the
scp command. Use a command similar to the following on your computer. In this example, the IP address of the BeagleBoard is 10.42.43.10.
alix@livadia:~$ scp filetocopy.zip email@example.com:/home/ubuntu
You must enter the password for the
ubuntu user, which is
temppwd. The file is copied to the
/home/ubuntu directory on the BeagleBoard.
In this article, you learned how to set up to boot a BeagleBoard using Ubuntu Linux. You connected the BeagleBoard to your computer and the Internet.