Development Toolchain for Ubuntu 9.04

This manual is written to reproduce the steps to build an ARM/AVR Tool Chain. It applies to Ubuntu 9.04 Desktop Edtion.

It describes the installation process starting from a clean Ubuntu installation. It describes the download, compilation of source packages und the needed packages of the Ubuntu distribution. Ubuntu packages may be installed with the graphical package manager Synaptics or the CLI command of apt and dpkg:

OS Installation

Install a clean Ubuntu 9.04 Desktop Edition using ubuntu-9.04-desktop-i386.iso

Logon to GUI

Open Shell Window

Update the Ubuntu System

If you are in a VMware VM install the VMware Tools for optimization

For have a working compiler environment you need the meta package build-essential. For testing do dpkg -l build-essential

Needed for makeinfo for some builts

For the GCC crosscompiler we need libraries and headers for GMP (Gnu multiple-precision arithmetic library) and MPFR (multiple-precision floating-point computations with correct rounding). The following packages are needed: libgmp3 libgmp3-dev libgmpxx4ldbl libmpfr libmpfr-dev ( libgmp3, libmpfr already there )

For Insight Debugger we need libx11-dev and libncurses5-dev

The arm-elf- Toolchain

First we start creating a temp folder in our home directory, where we will download and compile our packages.

Now we must download the source tarballs for the toolchain. The arm-elf toolchain consists of the following packages, where the used version number is recommended for propper functionality. For example it is not recommended to use GCC 4.3.2 which will not work!

For downloading in a shell we use wget

Now extract the archives

We now have to use full path names and architecture names for which we will use variables. These variables wont work with sudo. Therefore we use all the following commands in a root shell.

For compiling we prepare some build dirctories.

Now we start with Binutils which contains the linker. The --disable-werror flag may be unneeded depending on GCC version, since Ubuntu has a default -Wformat=2 flag, but without the compile process may stop. If you want to be more clean you may have to use same patches, hints see here

Now it is GCC. We need libraries and headers (see above): libgmp3 libgmp3-dev libgmpxx4ldbl libmpfr libmpfr-dev

First we have to compile a GCC Bootstrap compiler to build a Newlib, then build the rest of GCC.

We have to do a change in GCC source files to be able to compile mixed ARM and Thumb code

Search for the following two lines

...and complete with

...and save.

Now for Newlib. Use --disable-newlib-supplied-syscalls be able to define Syscall functions in NG code.

Now the rest of GCC.

At last the Insight Debugger as graphical frontend to gdb. We need libx11-dev and libncurses5-dev.

References:

http://wiki.ubuntuusers.de/GNU_ARM-Toolchain

NG Source Code Development

This part describes the SVN download, compile and flash procedure.

For fashing you may use serial connection, but you will reach problems on version updates when the ARM memory block containing configuration section differs to much and the boot process hangs. So i recommend using a JTAG interface which allows erasing of the configuration block and is much, much fater in flashing. Applicable are

I am using the last one, OpenOCD USB (interface type oocdlink). Therefor you need the openocd package

Further needed for compiling libusb-dev and sharutils

For SVN access you need subversion

Get the sources from the SVN server ( You need to have a developer account! )

If you already have a branch in the repository

Edit a file myconfigure file in your home directory containing the following configure line. Never mind the --with-openocd-olimex-cfg and the --with-openocd-olimex-bin parameter are used for the OpenOCD-USB adapter - it works for us. --with-isp-port describes your serial device, if you are flashing serial.

For serial flashing use

For JTAG flashing

As terminal program for NG console you may use minicom. For serial settings use 115200 8N1 no flow control.

Development/BuildYourOwn/ARMToolchainUbuntu (last edited 2009-10-23 10:12:51 by RalfHager)