2. Setting up the ARM Lab

This section shows how to setup a simple ARM development and testing environment in your PC, using Qemu and the GNU toolchain. Qemu is a machine emulator capable of emulating various machines including ARM based machines. You can write ARM assembly programs, compile them using the GNU toolchain and execute and test them in Qemu.

2.1. Qemu ARM

Qemu will be used to emulate a PXA255 based connex board from Gumstix. You should have at least version 0.9.1 of Qemu to work with this tutorial.

The PXA255 has an ARM core with a ARMv5TE compliant instruction set. The PXA255 also has several on-chip peripherals. Some peripherals will be introduced in the course of the tutorial.

2.2. Installing Qemu in Debian

Debian Etch has a qemu package, but the version is 0.8.2, which does not have the connex board emulation. Debian Etch backports has version 0.9.1 of qemu. To install from backports:

  1. Add the following line to /etc/apt/source.list

    deb http://www.backports.org/debian etch-backports main contrib non-free
  2. Add the archive’s key to apt.

    $ wget -O - http://backports.org/debian/archive.key | apt-key add -
  3. Run apt-get update.
  4. Install qemu from backports

    $ apt-get -t etch-backports install qemu

2.3. Installing GNU Toolchain for ARM

  1. Folks at codesourcery.com have been kind enough to make GNU toolchains available for various architectures. Download the GNU toolchain for ARM, available from from http://www.codesourcery.com/gnu_toolchains/arm
  2. Extract the tar archive, to ~/toolchains.

    $ mkdir ~/toolchains
    $ cd ~/toolchains
    $ tar -jxf ~/downloads/arm-2008q1-126-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
  3. Add the toolchain to your PATH.

    $ PATH=$HOME/toolchains/arm-2008q1/bin:$PATH
  4. You might want to add the previous line to your .bashrc.