BeagleBoardAngstrom
Contents
Angstrom on the BeagleBoard-xM
Installing
To install Angstrom for the first time on the BeagleBoard-xM, try following either one of these step by step guides:
Trey Weaver's Guide to Installing Angstrom on BeagleBoard-xM
How to Boot 3 Different Linux OSs on the BeagleBoard-xM: Angstrom, Android, and Ubuntu
Configuring for different options
If you want to change certain things about the way your board works, (for instance, changing the default display options in order to configure s-video for use with video glasses), you will be asked to "configure the bootargs". On the BeagleBoard-xM this is done a little bit differently than on the original BeagleBoard. (I think- but I don't know about the original BeagleBoard. Correct this/add to this section if you know about the original version)
In order to "configure the bootargs" on current versions of the BeagleBoard-xM, you simply edit the uEnv.txt file in the boot partition of your SD card (which should, of course, already contain MLO, u-boot.bin, and uImage). If uEnv.txt is not there already, simply create a new .txt file and name it uEnv. Current versions of the BB-xM no longer require the files cmd.boot and cmd.boot.scr which were used in previous versions to the same thing. cmd.boot is a human readable file that can be edited by the user and cmd.boot.scr is the script file created from with mkimage which executes the commands contained in cmd.scr. These files still can be used in current versions, but using a uEnv.txt file will almost certainly be easier (Using cmd.boot.scr takes requires an extra step, and you still need a uEnv file saying something like
bootenv=boot.scr loaduimage=fatload mmc ${mmcdev} ${loadaddr} ${bootenv} mmcboot=echo Running boot.scr script from mmc ...; source ${loadaddr}
which would just tell the computer to go to cmd.boot.scr. So why would you do that?
The uEnv.txt file contains a series of parameters and then the command boot
on the last line, or alternately, uenvcmd= run loaduimage; run mmcboot
. (I don't know what the difference is. I recommend that if you have problems, you try both).
Configuring uEnv.txt to set s-video as the default display
To set s-video as the default display in order to use an RCA composite device as the default display, the one from which you want to click on things, surf the web, etc, your uEnv.txt file should contain
defaultdisplay=tv buddy=unknown bootargs=console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} camera=${camera} vram=${vram} omapfb.mode=tv:ntsc omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype} omapdss.tvcable=composite uenvcmd= run loaduimage; run mmcboot
The "defaultdisplay=tv" is important, or else it will just flash the color test bars and then switch to displaying on the DVI-D monitor. With the following settings, you will be able to see everything on the RCA composite video screen.
Angstrom on the original BeagleBoard
These are instructions on how to get your Beagle up and running. This will lead you to getting a Linux prompt on the console on the serial port. The next instructions will show how to set up a monitor, keyboard and mouse.
Before you start
Get Linux running on your host computer (ECE497 VirtualBox Notes or ECE597 Installing Ubuntu in VMware Player), then gather the hardware you'll need:
- BeagleBoard
- The course hardware kit which includes:
- Serial Cable Adaptor
- USB to Serial Adapter if your computer doesn't have a serial port. Serial cable if it does.
- 5V Supply
- Empty 4G SD card
- SD card reader
Finding a precompiled image
There are a few places where one can get a precompiled Angstrom image for the Beagle. I show three here. This is how they differ.
- From beagleboard-validation.s3.amazonaws.com
- This site has a complete SD card image you can download and copy to your SD card. Just plug the card into your Beagle and boot.
- From www.angstrom-distribution.org/beagleboard-demo-image-available
- This site has the files you need to put on your Beagle. You'll have to format your SD card and place the files in the correct place. It's a bit more work, but you get to see how the SD card is laid out.
- From Narcissus
- This site is a difference approach. It will compile an SD image for you. All you do is download it and boot. The difference is, you can specify what does on the image. The download can be large. See details here ECE497_Lab01_Installing_Angstrom_via_Narcissus.
If you aren't sure what to do, just do the first one.
From beagleboard-validation.s3.amazonaws.com
This method downloads an entire SD disk image and copies it to the SD card. No need to partition or format. There are several images here. I'd pick one that has demo and configured. demo means it has lots of interesting apps in it and configured means it has already been booted up and many of the time consuming things that happen during the first boot have already been run.
- Get the image here. Of if you are on campus:
$ sftp username@dfs.rose-hulman.edu Connecting to dfs.rose-hulman.edu... username@rose-hulman.edu's password: sftp> cd Users/Y/yoder/Shared/BeagleBoard sftp> ls sftp> get SPEd.img.zip
- Run
sudo zcat SPEd.img.zip | sudo dd of=/dev/of/your/sd bs=8225280
- or Run
sudo tar xjOf SPEd.img.tar.bz2 | sudo dd of=/dev/of/your/sd bs=8225280
if it's a bz2 file. - dd gives no progress information, but you can get information by sending the USR1 signal to dd. This site has more details. In a nutshell, open a new terminal, and type the following command:
$ sudo pkill -USR1 dd
The output will show up in the terminal where dd is running.
- Plug the SD card in your Beagle and power up.
From www.angstrom-distribution.org/beagleboard-demo-image-available
Here are instructions that will show you how to partition and format your SD card and what to load in each of the partitions. After going through the process you should have a foundation for understanding the Linux boot processing.
Getting a console prompt
Follow these instructions. This will tell you how to talk to the Beagle via the serial port, format the card, copy Linux to it, and boot. There are a couple of images to choose from. I picked the ones with multi-config-cpuidle in the name.
The link is taking a long time, so I've posted the root file system image on DFS. Here's how to get to it.
$ sftp username@dfs.rose-hulman.edu Connecting to dfs.rose-hulman.edu... username@rose-hulman.edu's password: sftp> cd Users/Y/yoder/Shared/BeagleBoard sftp> ls sftp> get <filename>
Hints:
- Untarring the Angstrom file took me 17 minutes before I got a prompt back. Even then there were still several files in the write buffer. Run
sync
to force all the files to be written. - There seems to be an issue with the SD Card Reader in the Class of 2011 Laptop. The device will spontaneously unmount in the process of Untarring the Angstrom file. To solve this try using a USB Card Reader.
- The serial port ribbon cable is connected just below the 5V power connector. The black colored wire is pin 1. Be sure it is connected on the side opposite the 5V connector.
- Be sure to get these following files.
- Here's what you'll be running.
Here's a quick description of each file. We'll go into more details on these later.
- Angstrom-Beagleboard-demo-image-glibc-ipk-2011.1-beagleboard.rootfs.tar.bz2
- is a collection of all the files needed for the distribution. They will be 'unzipped' onto the SD card.
- MLO-beagleboard-1.44+r20+gitr24b8b7f41a83540433024854736518876257672c-r20
- is just a signed version of x-loader. That last sentence will make more sense later. When the Beagle is first powered up it has just enough smarts to read the SD and look for a file called MLO. MLO is small enough that it fits entirely in on-chip memory. It configure the off-chip memory so u-boot can run. u-boot is too large to fit in on-chip memory. Google Understanding MLO and X-loader for more details.
- modules-2.6.32-r98+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155-beagleboard.multi-config-cpuidle.tgz
- are the modules the kernel dynamically loads in when it needs them.
- u-boot-beagleboard-2010.03+r72+gitrca6e1c136ddb720c3bb2cc043b99f7f06bc46c55-r72.bin
- is a boot loader. It's what prints the prompt and runs your commands before the kernel starts.
- uImage-2.6.32-r98+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155-beagleboard.multi-config-cpuidle.bin
- is the Linux kernel. It has some special things added to it so u-boot knows how to run it.
- x-load.bin.ift
- is the same as MLO.
After following the instructions above you should see:
.-------. | | .-. | | |-----.-----.-----.| | .----..-----.-----. | | | __ | ---'| '--.| .-'| | | | | | | | |--- || --'| | | ' | | | | '---'---'--'--'--. |-----''----''--' '-----'-'-'-' -' | '---' The Angstrom Distribution beagleboard ttyS2 Angstrom 2009.X-stable beagleboard ttyS2 beagleboard login:
Login as root
(no password) and explore!
Running X-Windows
The Beagle is fun to explore through the serial port; however it's better when viewed on a monitor with the network working. Here's how to set up a monitor, keyboard, mouse etc. Before you start gather the additional hardware you'll need:
- USB to Ethernet (in kit)
- USB Powered HUB (in kit)
- HDMI to DVI Cable (in kit)
- DVI monitor
- USB keyboard
- USB mouse
Wire your Beagle as shown .
Reboot your Beagle and the screen below should appear on the monitor.
Setting up an Account
Once you have the Angstrom demo image running there are a few thing you can do that will make life easier.
Getting the network running
Often the network isn't ready when Angstrom first boots up.
First you have to register your ethernet adapters MAC address. To do this, go back to the minicom window and login as root and run the ifconfig
command:
.-------. | | .-. | | |-----.-----.-----.| | .----..-----.-----. | | | __ | ---'| '--.| .-'| | | | | | | | |--- || --'| | | ' | | | | '---'---'--'--'--. |-----''----''--' '-----'-'-'-' -' | '---' The Angstrom Distribution beagleboard ttyS2 Angstrom 2009.X-stable beagleboard ttyS2 beagleboard login: root root@beagleboard:~# root@beagleboard:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:50:B6:06:C4:57 inet addr:137.112.41.111 Bcast:137.112.41.255 Mask:255.255.255.0 inet6 addr: fe80::250:b6ff:fe06:c457/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15354 errors:0 dropped:0 overruns:0 frame:0 TX packets:17551 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1701782 (1.6 MiB) TX bytes:13514892 (12.8 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:12 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:600 (600.0 b) TX bytes:600 (600.0 b) root@beagleboard:~#
The digits following HWaddr
are the MAC address (00:50:B6:06:C4:57). Your address will be different.
Instructions on registering your MAC address at Rose-Hulman.
After your MAC address is registered do the following.
$ ping -c3 google.com
You should see google answering back. If not, get help.
Fixing the Serial Port
The current precompiled download seems to have a problem with the serial port timing out and getting set in the wrong mode. Try running to following to fix it.
Serial port garbage
This appears to be (for me anyway) a problem with the serial port going to sleep. Most of the time it just generates some junk which can be cleared with CTRL-U or backspace. However, if it happens at the login prompt then getty thinks the terminal is 7-bit with parity (rather than 8-bit raw). If this happens and you continue to login the whole session appears to be scrambled - if you press CTRL-D you can login again provided you don't stop typing... :]
I have simply added the following two lines to root's .profile
:
stty -parenb -parodd cs8 -inpck -istrip echo 0 > /sys/class/tty/ttyS2/device/sleep_timeout
A better fix would probably be to just add the second line to a rc.d startup script somewhere.
This suggestion came from this posting.
Running a VNC Server
The last line you put in the go.txt
file starts a VNC server. This allows you to see and interact with the Beagle's display via the internet. To do this:
- Download a VNC client. I like realVNC. It's simple and free.
- If you are using Ubuntu there is a default VNC client program
~ sudo apt-get install vncviewer
- On your Beagle run
ifconfig
again to get your IP address. It's the number afterinet addr
. Mine is (from above) 137.112.41.111. - To start a VNC server on the Beagle use command
~x11vnc -display :0 &
- Run your VNC client and attach to the IP address.
- You should now see the Beagle display on your host computer.
If you are having trouble with uppercase characters not working, this post suggests In addition, you may want to add -nomodtweak to the file in /etc/X11/Xinit.d/02vnc. Otherwise, the server does not handle shift keys properly on US keyboards.
This is how we will run many of our labs. Rather than attaching displays to the Beagles, we'll just go through the network. (Can your PIC do this?)