It took me several days to get started with the beagleboard so I'm
posting here my findings. Hope it will be useful to somebody.
What I want is to use the beagleboard as a main board on my robot. And
I want to directly develop on the beagleboard not build an image using
open embedded. If you follow this guide, at the end you should be able
to connect via ssh to the beagleboard and remotely edit files, then
use a remote shell to compile and run them.
--------------------------------
Basic hardware setup
--------------------------------
This page has some nice information.
http://code.google.com/p/beagleboard/wiki/HowToGetAngstromRunning
Basically:
- power the board using 5V power supply or AC-DC converter, or from a
USB to barel converter and plug it to a computer.
- We want to use it as a mother board, so the USB-OTG socket must be
used as a host socket. For this, either plug in a mini-A type
connector (could not get one), or connect together pin 4 and 5 of the
socket and plug a regular mini USB cable (mini-B). Either solder them
together, add a jumper, or simply manually connect them using a
metallic pointer while the kernel is booting.
- Plug a USB hub in the OTG socket, and there plug in mouse and
keyboards and ethernet converter and everything you want. The hub
needs to be powered!
-----------------------------
Installing Angstrom
-----------------------------
Angstrom is a Linux based OS designed for embedded system and supports
ARM processors, including the one on the BeagleBoard.
The SD card must be formated in a special way (number of heads and
sectors, ...). Two partitions are required: one FAT32 which serves as
a boot partition, and an EXT3 partition which holds the linux root
file system (rootfs). This is because the boot loader in the NAND does
not support loading the kernel from and EXT3 partition.
Demo image from Koen
----------------------------------
Follow this tutorial:
http://code.google.com/p/beagleboard/wiki/HowToGetAngstromRunning
It includes where to find the files required, how to format the SD
card and place required files on it, how to update the boot loader and
how to configure it to automatically boot Angstrom (need to be done
only once).
This works fine and yields an OS with a nice GUI, and plenty of
applications: browsers (firefox and epiphany) games, multimedia
players...
Minimum system
--------------------------
The goal here is to get the minimum packages required to get the card
running with a command line OS with a working ethernet connection and
SSH server.
1) Get a base image from Narcissus
Narcissus is an online tool to build an Angstrom image from a selected
list of packages:
http://amethyst.openembedded.net/~koen/narcissus/
It produces 2 files: a .tar.bz2 archive containing the rootfs and
a .img.gz compressed image to be written to the SD card with dd. It
create the FAT and EXT3 partition and copy the necessary files in the
FAT partition. (however, the EXT3 partition needs to be recreated to
accomodate the size of the SD card.)
- In Narcissus: build a start image with the following packages: task-
base, “busybox replacement” (task-proper-tools) and “all
modules” (this adds support for the USB-Ethernet device).
- Download and install the images.
- boot and login as root. By default there is no password. You can set
one using command passwd.
2) Networking
Run udhcpc to setup the interface with DHCP (simply type udhcpc).
In order to ease development, and for situations when it's not
convenient to connect a monitor and a keyboard to the board, we want
to be able to connect to the beagleboard via SSH from the console and
alsa from the linux explorer (Nautilus, Konqueror, ...) and editors.
This allow to work on the files on the beagleboard from a linux
desktop.
I found that this does not work with the lightweight ssh server
installed by default (dropbear). So we will remove it and install
openssh instead. This is easily done using opkg, the package manager.
opkg update
opkg -force-removal-of-dependent-packages dropbear
opkg install openssh openssh-sftp-server
The first command get the list of packages from the repository. The
second command removes dropbear and the task-base metapackage that
depends on it. The third command installs openssh, openssh-scp,
libcrypto, openssh-ssh, openssh-sshd, ssh-keygen and openssh-sftp-
server.
It seems to be necessary to set a root password (use command passwd).
You might also want to configure your network / router so that the
board always get the same IP or so that you can find it by its
hostname.
Last but not least, we want the board to automatically set up and
configure the Ethernet interface at boot up. This is normally done in /
etc/network/interfaces by setting interface eth0 as auto and dhcp.
However it does not work in this case, most likely because the usb
driver + host mode setting seems to take too long and the /etc/init.d/
networking start script will fail with an unknown interface. So one
way is to create a boot up script that gets executed last:
- Create a /etc/init.d/run_udhcpc file and make it executable (chmod
+x run_udhcpc). It contains only one line: “udhcpc”.
- Type update-rc.d run_udhcpc defaults
- Reboot to test. After reboot, when you type ifconfig you should see
interface eth0 with an IP address.
3) Set date, time and time zone
Set the time zone in /etc/profile: find the line TZ=”UTC” and set it
to TZ=”SGT-8”
Then reload the file: source /etc/profile
Finally install packages to automatically get the time from a server:
opkg ntpdate
------------------------------------------------
C/C++ development environment
------------------------------------------------
The following command installs the whole C/C++ toolchain (compiler,
make, autoconf, ...)
opkg install task-native-sdk cpp gccmakedep
Try to compile a hello world example.