Development Toolchain for Ubuntu 9.10

This manual is written to reproduce the steps to build an ARM/AVR Tool Chain. It applies to Ubuntu 9.10 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.10 Desktop Edition using ubuntu-9.10-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

If you are using VMware Workstation 7 you may alternatively use the VMware Tools that come with VMware. They install cleanly as well.

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 builds

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 (should already be installed, see above): libgmp3c2 libgmp3-dev libgmpxx4ldbl 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.

Packages needed for download and compilation libusb-dev and sharutils and subversion and avrdude (you need to have at least Version 5.8 to have ATmega328 Support) and gcc-avr and avr-libc.

Preparations for Fashing the FC Controller

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 faster in flashing. Applicable are

I am using the last one, OpenOCD USB (interface type oocdlink). Therefor you need the openocd package compiled from source. Get libfdti-dev and download OpenOCD Source Package and compile it.

Getting the Source

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

If you already have a branch in the repository

Compiling the FC Source

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.

Next time you compile you only need to do "make dev".

Flashing the FC Controller

For serial flashing use

For JTAG flashing

==== Using a Terminal Programm to communicate to Shell ====

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

Compiling the RC Source

Flash the RC Controller

I am using an USBprog from Embedded Projects as flashing device. Also supported is AVR Dragon. For USBprog you have to flash the fuses off the ATmega644p once. Than you flash the binaries.

Compiling the SB Source

Flash the RC Controller

I am using an USBprog from Embedded Projects as flashing device. Also supported is AVR Dragon. For USBprog you have to flash the fuses off the ATmega644p once. Than you flash the binaries.

Netbeans IDE

A useful tool for editing the source code Netbeans IDE. Download the needed Version from http://netbeans.org/downloads/. C/C++ Support is required. Also needed is Sun Java.

Start Netbeans and import the sources

Do this also for

Compile ng-tools

Development/BuildYourOwn/ARMToolchainUbuntu910 (last edited 2010-03-25 15:30:52 by RalfHager)