Professional Documents
Culture Documents
1
Performance of the Host Machine
Object
Object Object
Linker
Relocatble
Locator
Executable
Types of Embedded Tools
Embedded software tools
• Editor
• Assembler
• Compiler
• Linker
• Simulator
• Profiler
Embedded Hardware Tools’
• In-Circuit-Emulator
• Debugger
• Starter Kit
• Each can take one or more files as input and product a
single output file. This transformation process is
performed software running on a general purpose
computer
• Compiler, assembler, linker and locator run on a host
computer
• Embedded system of target platform runs only on its own
• These tools combined produce an executable binary image
• This output binary image runs on target embedded system
General Computer
• Create source file
• Type C code All these constitute the general procedure
• Build, Compile and Link
• Execute, Load and Runs
Embedded System
•Create Source file
•Type C code
•Compile/Asssemble (Translate into machine code on host)
•Link: Combine all object files and libraries resolve all symbols
•Locate: Assign memory address to code and data
•Execute: The excutable image is copied into the target processor
and Reset it
Embedded tools
Assembler -Programming language processor that translates an
assembly language program (the source program) to the machine
language program (the object program) executable by a computer.
Cross Compiler- This is a compiler that is capable of creating an
executable code for another platform or multiple platforms other
than the one on which it is running.
Emulator -This is a top end debugging tool that allows complex
real time evaluations to be carried out.
An Emulator cost more than other development tools because of
their high performance.
Simulator -A simulator is a program that runs on a PC and predicts
the outcome of the program. It allows the logic of the program to be
checked but cannot simulate hardware interface and timing factors.
Compiler
Linker
Etc.
Tools Processing
Source Code
Object Code
Preprocessor Linker
Libraries
Preprocessor Code Object Code
Compiler
Assembler
Compiling
13
C V/S EMBEDDED C
File.i File.s
File.c
Preprocessor Compiler Assembler
File.o
Library files
File.map File.hex
17
Code Compilation process
Preprocessing
It is the first stage of compilation. It processes preprocessor directives like
include-files, conditional compilation instructions and macros.
Compilation
It is the second stage. It takes the output of the preprocessor with the
source code, and generates assembly source code.
Assembler stage
It is the third stage of compilation. It takes the assembly source code and
produces the corresponding object code.
Linking
It is the final stage of compilation. It takes one or more object files or
libraries and linker script as input and combines them to produce a
single executable file. In doing so, it resolves references to external
symbols, assigns final addresses to procedures/functions and variables,
and revises code and data to reflect new addresses (a process called
relocation). 18
Timers
Timers are used to measure specific time intervals. But in electrical
engineering terms, timers are also referred to as counters often.
They are used to keep a record of time for different events
occurring in an embedded systems.
The timer is a simpler binary counter which is configured in a circuit
or a system as per the need to count the pulses in the system.
The value of the timer is automatically set to zero once it is at its
maximum value. Once the maximum value for the timer is reached,
an interrupt is generated with an overflow flag.
The timer can be used to measure the time elapsed or the external
events occurring for a specific time interval.
They are used to maintain the operation of the embedded system in
sync with the clock. The clock can be an external clock or the
system clock.
Functionality of timer devices in embedded systems
A timer is a device that generates a signal pulse at specified time intervals.
A time interval is a real-time measure of time, such as 4 milliseconds.
Internally, a simple timer may consist of a register, a counter, and a simple controller
Number of clock cycles = Desired real-time value / Clock cycle
To obtain a duration of 3 milliseconds from a clock cycle of 10 nanoseconds (100