Presentation is loading. Please wait.

Presentation is loading. Please wait.

Embedded Systems Programming Introduction to cross development techniques.

Similar presentations


Presentation on theme: "Embedded Systems Programming Introduction to cross development techniques."— Presentation transcript:

1 Embedded Systems Programming Introduction to cross development techniques

2 What 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

3 Host System Targets

4 Features of cross development The code created can’t run on the host system –Sometimes an emulator is used Special tools are required –The standard PC compiler won’t do! The code has to be downloaded

5 Why cross develop? Code is cross developed for a number of reasons –Frequently the development can’t 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

6 Cross 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.

7 Cross 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!) Source Program file Executable Binary File

8 The compilation process mode detail cc –flags myfile.c thisfile.o PreprocessingCompilationOptimisation*Link/loading #includes.h header files #defines Text Assembler or Object format Relocatable Object file Executable Binary Object files Library file Start-up code *optional

9 High AddressArgs and env vars Command line arguments and environment variables Stack | V Unused memory ^ | Heap Uninitialized Data Segment (bss) Initialized to zero by exec. Initialized Data Segment Read from the program file by exec. Low AddressText Segment Read from the program file by exec. Text Segment: The text segment contains the actual code to be executed. It's usually

10 Program Segments Code Data BSS Stack Heap char strng=“hello”; int count, this, that; main() { int i, j, k; char *sp; …….. for (i=0;i != 100;i++) …… sp= (char*) malloc(sizeof(i));

11

12

13


Download ppt "Embedded Systems Programming Introduction to cross development techniques."

Similar presentations


Ads by Google