Using the GNU Tools

Table of contents


This page is a work in progress, as of 6-12-2004.

Introduction

The GNU tools for ARM operate in exactly the same way as they do for, say, a Linux desktop. If you are used to a graphical IDE like Microsoft Visual Studio, the process if somewhat different - rather than making a Project in the GUI, you write a Makefile and run it with the make command.

Compiler Options

You will typically run the compiler from a Makefile in the same way you would do for PC development. Probably the only major difference you will encounter is the use of compiler options. Most options are set by a command line flag, which will be added to the CFLAGS variable in the Makefile. Look at the example Makefiles in the Example Programs, for more details.

Assembler

Entry Point

See boot.s in the Example Programs.

Linker Scripts

One major difference between the GNU linker for a PC, and an embedded GNU linker, is the use of Linker Scripts - while you can typically use a default linker script for building PC programs, this is rarely the case for embedded development, especially when an operating system like Linux is not being used. The linker script tells the linker what memory is available, what sections of the executable to include or discard, and where to put those sections in memory.

To get started, look at the linker script w90n740-ram.ld from Example Programs, which is set up to link code such that it runs from the SDRAM at address 0x8000.

For more detailed information, refer to the GNU Linker Manual (http://sources.redhat.com/binutils/docs-2.15/ld/Scripts.html#Scripts), or the relevant chapter in this (http://www.zws.com/publications/shoestring.html) book.

Debugging Techniques