Cross-Compilation Tools for
Embedded Systems
(LITE5200, EDB9315A, TS-7800, AT91SAM99260-EK,
PCM3350, DaVinci, etc.)

 

Currently, still under heavy development.
Until a stable version is available
this is mainly experimental
and provided solely  as reference.

What It Is

How to build an embedded Linux system anyway?

Prerequisites

The 3 steps for building a complete flash root filesystem

Useful Links and Tips - Various Boot Setup (ramdisk, NFA, Flash, etc.)

C/C++ Cross-Development Tools

LINUX

Libraries/Utilities

How long it take to build things

Download

What It Is

This is a set of shell scripts and patches to help you to build a complete embedded Linux system from scratch, including the host GNU development tools, for several reference boards (x86, PowerPC and Arm9 based):

a GNU cross-compiler (C, C++) and associates utilities and libraries,

a 2.6.x Linux kernel,

several useful libraries (ssl, zlib, expat, xlib, sqlite, etc.) and utilities (busybox, ssh, etc.),

a complete root filesystem

for

the Freescale LITE5200 evaluation board (PowerPC MPC5200);

the Cirrus Logic EP9315A (ARM9-based SOC);

the Advantech PCM-3350 (Geode GX1) [works also for an old Cyrix Media GXm 233 MHz board I have];

the Evalue EEV-EX01 (with an ESM-CN700 module)

the TI DaVinci DVEVM board;

the Technologic Systems TS-7800 board (Marvell ARM9 SOC)

the Freescale MPC8249E-mITX evaluation board..

the Atmel AT91SAM9260-EK evaluation board

from

a Linux-based host cross-development machine.

or (maybe!) a Windows machine (using Cygwin).

 

It took me sometime to be successful, so I thought this work might be useful to the community. I either own or have used all these references boards, and I have tested at some point all the scripts with the boards I reference.

 

This project allows you to build the cross-development tools, including the GLIB C/C++ libraries, all additional libraries and utilities, the kernel and finally the root file system from the sources.

 

Please be aware that building everything from the sources is a relatively long process which can take up to an hour or so.

How to build an embedded Linux system anyway?

In order to be able to build an embedded Linux system, obviously you need:

The GNU cross-development tools installed on your host machine (presumably a Linux PC machine).

Your target system will need to have these different pieces of software:

Firmware (or boot loader), such as u-boot, redboot or a BIOS: you can these choose to boot from Flash, network (tftp), or disk;

Kernel (linux): the kernel must be compiled with support for your board (cpu and peripherals);

Root file system (contains the C/C++ libraries, the shell, etc.).

If your board comes with a ‘good’ firmware, you might not need at all a JTAG programmer. Using the firmware, you might be able to program the flash with the kernel and/or the root filesystem. Both u-boot and redboot let you do this, assuming they have the drive for the Flash you are using.

Prerequisites

The 3 steps for building a complete flash root filesystem

Introduction

There are basically 5 major steps to follow:

Download all requested packages.

Build the C/C++ cross-compilers and the C/C++ librariesThis has to be done only once. This step can take a significant time (for instance about 20 minutes on a 2 GHz machine). Obviously you need to do this only for the processor you are interested in (PowerPC, ARM or x86).

Build the linux kernel. Unless you want to change your kernel configuration (new driver, new filesystem, etc), this can be done also only once.

Build libraries and utilities (busybox, ssl, ssh, etc.). This step takes also a significant time (about 20-25 minutes on a 2 GHz machine).

Create the root file system (ramdisk, flash, NFS, disk).

 

The good news is that all steps 1, 2, 3, 4 and 5 are combined into a single script: build-rootfs.sh. This shell script contains a section that can be edited (using your favorite text editor) to customize the root file system: do you want X ? Which file system ? Do you want use ssh or telnet ? Do you want to include SQLite ? etc.

LITE5200 (PowerPC 603e)

To build everything (cross-compiler, kernel, all libraries, and finally the root file system), you need to do this:

~$ svn co https://svn.sourceforge.net/svnroot/cross-stuff cross-stuff
~$ cd cross-stuff/common/scripts/ 
~/cross-stuff/ppcbe/LITE5200/scripts$ ./build-rootfs.sh

Where:

build-rootfs.sh:           build to root filesystem (ramdisk, nfs mounted, Flash).

PCM3350 (Pentium)

To build everything (cross-compiler, kernel, all libraries, and finally the root file system), you need to do this:

~/cross-stuff/common/scripts$ cd cross-stuff/x86/PCM3350/scripts/ 
~/cross-stuff/x86/PCM3350/scripts$ ./build-rootfs.sh

EDB9315A (ARM9)

To build everything (cross-compiler, kernel, all libraries, and finally the root file system), you need to do this:

~/cross-stuff/common/scripts$ cd cross-stuff/armle/EDB9315A/scripts/ 
~/cross-stuff/armle/EDB9315A /scripts$ ./build-rootfs.sh

 

 

Useful Links and Tips - Various Boot Setup (ramdisk, NFA, Flash, etc.)

PCM3350

EDB9315A

LITE5200

TS-7800

AT91SAM9260-EK

C/C++ Cross-Development Tools

The first thing we need for sure is a cross-compiler! In the past, after several long evenings of real frustration I was finally able to build a PowerPC cross-compiler for GCC 2.95.3. I never quite succeeded with GCC 3. After a couple of Google search, I finally found the Dan Kegel web site. After a few months, I decided to switch to uclibc, for 2 main reasons:

o                     better support when it comes to builld cross-compilers

o                     smaller than glibc (still important in the embedded space).

 

To build the C/C++ cross-compilers and libraries, I use buildroot.

 

LINUX

Using the cross-compiler, it is then pretty straightforward to cross-compile Linux for the board, assuming the board vendor provides a patch to the kernel to support all or most of all peripherals.

Libraries/Utilities

All the build scripts are the same for all supported architectures (x86, ppcbe and armlet).

You can take a look at them on-line here.

 

Name

Version

Comment

Notes/Status

busybox

1.10.3

Common UNIX utilities into a single small executable

ok

udev

124

Allows Linux users to have a dynamic /dev directory and it provides the ability to have persistent device names.

ok

OpenSSL

0.9.8g

SSL v2/v3 and TLS protocols

Ok

OpenSSH

4.7.1p1

SSH1 and SSH2 implementation

ok

libiconv

1.12

 

 

readline

5.2

 

ok

termcap

1.3.1

 

ok

zlib

1.2.3

 

ok

SQLite

3.5.7

Embedded SQL library

ok

popt

1.7

 

 

raidtools

1.00.3

 

 

uuid

 

 

ok

dosfstools

2l11

Create and check MS-DOS filesystems under Linux (includes support for FAT32 and VFAT.

ok

jfsutils

1.1.12

 

ok

xfsutils

2.9.8-16

High-performance journaling filesystem

nok (uclibc misses aio)

e2fsprogrs

1.40.7

Ext2 Filesystem Utilities

ok

mtd

snapshot 20060415

 

ok

gdb

6.8

The GNU Project Debugger

ok

live555

2007.08.03a

RTP/RTSP library

compiled, not tested

avahi

0.6.22

Service discovery on a local network

not fully tested

expat

2.0.1

 

ok

lsof

4.78

 

ok

ncurses

5.6

 

ok

procps

3.2.7

 

ok

vsftpd

2.0.3

 

 

curl

7.18.0

command line tool for transferring files

not tested

libjpeg

6b

JPEG image compression library

not tested

libpng

1.2.25

PNG image compression library

not tested

module-init-tools

3.2

 

ok

lua

 

 

 

pdel

0.5.3

 

 

xfree86

4.4.0

kdrive / tinyX

ok

glib2

2.8.6

 

ok

gtk2

2.8.17

 

* work in progress *

lwm

1.2.1

lightweight Window Manager

fails to load font

ffmpeg

snapshot 20060519

A/V codecs and file format

ok

mplayer

1.0pre7try2

Movie player

* work in progress *

minicom

2.3

Communication program

ok

gc

7.0

A garbage collector for C and C++

not tested

ppp

2.4.4b1

High Quality Rendering Engine for C++

not tested

cherokee

0.6.1

Web Server

not tested

gmp

3.4.2

Free library for arbitrary precision arithmetic

not tested

tesseract

2.01

OCR

not tested

SDL

1.2.13

Cross-platform multimedia library

not tested

agg

2.5

High Quality Rendering Engine for C++

not tested

 

How long it take to build things

My home machine is an AMD Athlon 4200 desktop, with an Intel Core 2 Duo @ 2.0 GHz and 2 GB Ram.

It takes about 15 to 20 minutes to build the C and C++ cross-compilers and the C and C++ libraries, depending of the target architecture (arm, PowerPC or X86).

Download

Shell scripts, Patches

svn co https://cross-stuff.svn.sourceforge.net/svnroot/cross-stuff

Anonymous SVN access
(current code)

Browse SVN repository

Project Statistics

Usage Statistics

 

Olivier Singla

Pages created:
Sometimes in 2005

Pages last revised:
June 13th 2008

SourceForge.net Logo