Title: Embedded Systems Programming
1Embedded Systems Programming
- Introduction to cross development techniques
2What is cross development
- Cross development is the process of developing
code on one machine the host, to run on another
machine the target - The host will be a normal, powerful machine
running an operating system - The target will often be a single board computer
that may have no or limited software and hardware
resources
3Targets
Host System
4Features of cross development
- The code created cant run on the host system
- Sometimes an emulator is used
- Special tools are required
- The standard PC compiler wont do!
- The code has to be downloaded
5Why cross develop?
- Code is cross developed for a number of reasons
- Frequently the development cant be done on the
board - The board has no disc, compiler, screen etc
- The development environment is very powerful and
fast - Games developers do this
- Often the development might be done by a team on
networked machines
6Cross development tools
- In order to do cross development you need special
tool kits, sometimes called toolchains. These
consist of - Cross compiler, assembler and linkers
- Downloading and conversion software
- Remote debuggers
- Useful utilities
- Files to dump or strip binary files, all in
binutils.
7Cross compilers
- Before we understand what cross compilers do it
might be worth reviewing what compilers do - Simply put they take an input text source program
file and output an executable binary output file
(or some error messages!)
Compiler
Source Program file
Executable Binary File
8The compilation processmode detail
cc flags myfile.c thisfile.o
Preprocessing
Compilation
Optimisation
Link/loading
Assembler or Object format
Relocatable Object file
Executable Binary
Text
includes .h header files defines
Object files Library file Start-up code
optional
9High Address Args and env vars Command line arguments and environment variables
StackV
Unused memory
Heap
Uninitialized Data Segment (bss) Initialized to zero by exec.
Initialized Data Segment Read from the program file by exec.
Low Address Text Segment Read from the program file by exec.
- Text Segment The text segment contains the
actual code to be executed. It's usually
10Program Segments
char strnghello int count, this,
that main() int i, j, k char sp .. for
(i0i ! 100i) sp (char)
malloc(sizeof(i))
11(No Transcript)
12(No Transcript)
13(No Transcript)