0% found this document useful (0 votes)
60 views70 pages

Embedded Software Development Tools

The document discusses embedded software development tools, emphasizing the importance of host and target machines in the development process. It outlines various software tools, including SDKs, IDEs, and compilers, and explains the roles of linkers, locators, and debugging techniques in ensuring effective software deployment and testing. Additionally, it covers methods for transferring software to target systems, such as PROM programmers and in-circuit emulators.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views70 pages

Embedded Software Development Tools

The document discusses embedded software development tools, emphasizing the importance of host and target machines in the development process. It outlines various software tools, including SDKs, IDEs, and compilers, and explains the roles of linkers, locators, and debugging techniques in ensuring effective software deployment and testing. Additionally, it covers methods for transferring software to target systems, such as PROM programmers and in-circuit emulators.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UNIT – 5

Embedded software development Tools


• "Embedded software" is the software that is embedded
in an electronic product to control its operation.
• Embedded software developers need embedded
software development tools to develop embedded
software.
• An embedded software development environment is an
integrated collection of software development tools that
manage the entire embedded software development
process: analyzing, designing, documenting, writing,
compiling, debugging, testing, optimizing, and verifying
software.
Host and Target Machines
• Introduction:
– Many embedded systems employ microprocessors or
microcontrollers intimately bound into dedicated
equipment. Such systems require a special approach to
software development.
– The target system is not often capable of supporting
the editors, compilers, linkers, debugging and code
control tools essential for the development task. So, a
larger computer is used for the actual code production.
• This is the host platform and is commonly a desktop PC
running Windows or a version of Unix.
• In this way all the hardware and software facilities of a larger
computer system can be utilized during the development
process.
Host and Target Machines
• If the selected target system has a different CPU to that in
the host computer, The executable code built on the host
machine can’t be run on the target machine.
• Most of the time host and target machines differ so that
programs built on the host machine can’t be run on the
target machine. These differences may take many forms.
• Some common differences between host and target
machines are:
– different operating system
– different system boards
– different processor.
• Additional problems occur with the need for cross-
compilers and associated target libraries.
• The host file system has to be carefully organized so as to
keep the native and cross-compilers and libraries well apart.
Host Machine
• A typical, general purpose computer or
workstation used for:
– Programming
– compiling
– (testing/emulation)
• Vast computing resources
– support sophisticated IDEs
– compilers and debugging environments.
• Where the embedded software is developed,
compiled, tested, debugged, optimized, and prior
to its translation into target device.
Target machine
• The Target machine is the embedded Hardware platform
• Target hardware consists of
– processor, memory, I/O
– Runtime environment (Operating System/Kernel)
– Target hardware platform contains only what is needed for
final deployment
– Target hardware platform does not contain development
tools (editor, compiler, debugger)
– Special purpose
• selected and supports:
– Testing
– Integration
– execution
– Deployment
Host and Target Machines
• Host: computer where tools are run „
• Target: processor you are shipping „
• Native tools – run on the host „
– Compilers
– Assemblers
– E.g. Windows NT compiler produces binary Pentium instructions (great
for Pentium, worthless for Motorola 68000) „
• Cross-Compilers „
– Runs on your host, but produces binary instructions for your target from
your C/C++ programs. „
• Cross-Assemblers „
– Runs on your host, but produces binary instructions for your target from
your assembly programs. „
• Tool Chains „
– Named because output of one tool becomes the input for the next tool „
– Tools compatible with a particular target are called a “Tool Chain” and
are available from different vendors.
Software Tools
• Software Development kit (SDK)
• Source-code Engineering Software tool
• Integrated Development Environment
• Editor
• Interpreter
• Testing and debugging tools
• Locator
Software development kit (SDK)
• A software development kit (SDK or devkit) is typically a set of
software development tools that allows
– the creation of applications for a certain software package, software
framework,
– hardware platform,
– computer system,
– video game console,
– operating system, or similar development platform.
• It may be something as simple as the implementation of one or more
application programming interfaces (APIs) in the form of
some libraries to interface to a particular programming language or
to include sophisticated hardware that can communicate with a
particular embedded system.
• Common tools include debugging facilities and other utilities.
Source Code Engineering Tool
• Typical tool Features Typical tool Features
– Comprehension, Navigation and browsing.
– Editing, Debugging,
– Configuring (disabling and enabling specific C++
features) and Compiling.
– Searches and lists the definitions, symbols, hierarchy
of the classes, and class inheritance trees.
– Symbols include the class members.
– Searches and lists the dependencies of symbols and
defined symbols, variables and functions.
Integrated Development Environment (IDE)
• An integrated development environment (IDE) is a
software suite that consolidates the basic tools,
developers need to write and test software.
• In embedded system development context, IDE stands
for an integrated environment for developing and
debugging the target processor specific embedded
firmware.
• Typically, an IDE contains a code editor, a cross-compiler
or interpreter, linker and a debugger that the developer
accesses through a single graphical user interface (GUI).
• Some IDEs may provide interface to Target board
emulators, Target flash memory programmer.
• An IDE may be a standalone application, or it may be
included as part of one or more existing and compatible
applications.
• IDEs are typically designed to integrate with third-party
version control libraries, like GitHub or Apache Subversion.
• IDEs used in embedded firmware development slightly
different from the generic IDEs used for high level language
based development for desktop applications.
• In embedded applications, the IDE is either supplied by
target manufacturer or by third party vendors as open
source.
• Some commonly used IDEs for embedded systems are:
– The GNU compiler (gcc),
– Eclipse (open source IDE)
– Android Studio,
– Keil µ vision (third party IDE )
– Code warriors by Metrowerks for ARM family of controllers.
– MPlab (supplied by Microchip for PIC family controllers)
Editor
• A source code editor is a text editor program
designed specifically for editing source code to
control embedded systems.
• The code editor allows code to be written, changed
and saved as files in folders called project folder.
• It may be a standalone application or it may be
built into an integrated development environment
(e.g. IDE).
• Source code editors may have features specifically
designed to simplify and speed up input of source
code, such as syntax highlighting and auto
complete functionality.
Compiler
• A compiler is a computer program that translates the
source code into computer (Target) language (object
code).
• Commonly the output has a form suitable for
processing by other programs (e.g., a linker), but it may
be a human-readable text file.
• A compiler translates source code from a high level
language to a lower level language (e.g., assembly
language or machine language).
• The most common reason for wanting to translate
source code is to create a program that can be
executed on a computer or on an embedded system.
Cross Compiler
• A cross compiler is a compiler capable of creating object
code (Target language) for a platform other than the one
on which the compiler is running.
• For example, a compiler that runs on a Windows 7 PC
but generates code that runs on Android Smartphone is
a cross compiler.
• For embedded systems the compiler always runs on
another platform, so a cross compiler is needed.
• A cross compiler is a tool that one must use for a
platform where it is inconvenient or impossible to
compile on that platform, like micro controllers that run
with a minimal amount of memory for their own
purpose.
• Since many embedded systems have limited resources,
cross-compiling is very common.
• Assembler
– An assembler is a program that converts assembly
language into machine code.
– It takes the basic commands and operations from
assembly code and converts them into binary code that
can be recognized by a specific type of processor.
• Cross Assembler
– A cross assembler is a program which generates
machine code for a processor other than the one it is
currently run on.
– Cross assemblers are generally used to develop
programs which are supposed to run on game consoles,
appliances and other specialized embedded systems
which are not able to run a development environment.
Interpreter
• An interpreter is a computer program that
translates a program line-by-line (statement-by-
statement) and carries out the specified actions
in sequence.
– In contrast, an assembler or compiler completely
translates a program written in a high-level
language (the source code) into a machine-language
program (the object code) for later execution.
– Whereas a compiled-program executes much faster
than an interpreted-program, an interpreter allows
examination and modification of the program while
it is running (executing).
The embedded
software
development
process

Tool chain for building embedded software


Linker
• A linker is a program that takes one or more objects generated by
compilers and assemblers and combine them into a single executable
program or a library that can later be linked to in itself.
• All of the object files resulting from compiling must be combined in a
special way before the program can be executed.
• The object files themselves are individually incomplete, most notably is
that some of the internal variable and function references have not yet
been resolved.
• The job of the linker is to combine these object files and, in the
process, to resolve all of the unresolved symbols.
• Linkers can take objects from a collection called a library. Some linkers
do not include the whole library in the output. They only include its
symbols that are referenced from other object files or libraries.
• Libraries for diverse purposes exist, and one or more system libraries
are usually linked in by default.
• The Linker combines object files (from compiler) and
resolves variable and function references
– Source code may be contained in >1 file, which must be
combined
– Resolve variables which may be referenced in one file and
defined in another file
– Resolve calls to library functions, like sqrt
– May include operating system
• Linker creates a “relocatable” version of the program
– Program is complete, except no memory addresses
assigned
Locator
• The tool that performs the conversion from
relocatable program to executable binary image is
called a locator.
• It takes responsibility for the easiest step of the
build process.
– we have to provide information about the memory on
the target board as input to the locator.
• The locator uses information (Target memory as
input) to assign physical memory addresses to
each of the code and data sections.
• It will produce an output file that contains a binary
image that can be loaded into the target ROM.
• Functions performed by locator, normally left for
operating systems:
– address binding
– Determines what goes in ROM and what goes in RAM
– Divide program into appropriate number of segments
and assign to appropriate memory types
– I/O routine inclusion
– Assign startup code to designated address on
controller
– Range of addresses for ROM and RAM
– Desired location for different modules
Intel Hex File Format
Getting Embedded Software Into
Target System
• The locator will build a file as an image for the
target software.
• There are few ways to getting the embedded
software file into target system.
– PROM programmers - actual ROM „
– ROM emulators - hardware thinks it’s a ROM „
– In-circuit emulators - replaces entire processor on
hardware board „
– FLASH - if target stores program separately „
– Monitors - program in target to receive program
- for debugging mainly
PROM Programmers:
• The classic way to get the software from the locator output
file into target system by creating file in ROM or PROM.
• Creating ROM is appropriate when software development
has been completed, since cost to build ROMs is quite high.
Putting the program into PROM requires a device called
PROM programmer device.
• PROM is appropriate if software is small enough, if you plan
to make changes to the software and debug. To do this,
place PROM in socket on the Target than being soldered
directly in the circuit (the following figure shows).
PROM Programmers:
• We need small tool called chip puller
(inexpensive) to remove PROM from the
socket.
• We can insert the PROM into socket without
any tool than thumb (see figure8).
• If PROM programmer and the locator are from
different vendors, its upto us to make them
compatible.
ROM Emulators:
• Other mechanism is ROM emulator which is used to get software
into target.
• ROM emulator is a device that replaces the ROM into target system.
– It just looks like ROM, as shown figure9;
• ROM emulator consists of large box of electronics and a serial port
or a network connection through which it can be connected to your
host.
• Software running on your host can send files created by the locator
to the ROM emulator.
• Ensure the ROM emulator understands the file format which the
locator creates
In circuit emulators:
• Means In-Circuit Emulator
• A circuit for emulating target system remains
independent of a particular targeted system
and processor
• Interface COM port of a computer
• Emulates target MCU IOs
• ICE socket connects MCU externally
In circuit emulators:
In circuit emulators:
• Emulator or ICE provides great flexibility and
ease for developing various applications on a
single system in place of testing that multiple
targeted systems.
• Emulates MCU inputs from sensors
• Emulates controlled outputs for the peripheral
interfaces/systems
• Emulates target MCU IOs and socket to
connect externally MCU
Back support hardware package and
ICE Subunits
• Interface circuit
• Socket
• External Memory
• Emulator-board display unit
• Twenty-keys pad
• Registers
• Connectors
Flash
• If target stores its program in flash memory, then
one option is to place the flash in a socket and
treat it like an EPROM. Most PROM programmers
can program memory parts.
• If target has serial port, network connection, or
some other mechanism for communicating with
outside world, we can write a piece of software
to receive new programs from host across the
communication link and write them into flash.
Monitors
• It is a program that resides in target ROM and
knows how to load new programs onto the
system.
• A typical monitor allows you to send the data
across a serial port, stores the software in the
target RAM, and then runs it.
• Sometimes monitors will act as locator also,
offers few debugging services like setting break
points, display memory and register values.
Debugging Embedded Software
• Now that the software has been downloaded
to the target processor, how do we know if it is
working?
• Run-time errors are not as obvious
– Most embedded systems do not have a screen.
– When a program fails, usually causes the processor
to crash or lock-up
• Logic errors
– If program runs, is it performing the correct steps?
Debugging Techniques
• Debugging is a methodical process to find and
reduce the number of bugs in a computer
program or a piece of electronic hardware, so
that it works as expected.
• Debugging is difficult when subsystems are
tightly coupled, because a small change in one
subsystem can create bugs in another.
• The debugging tools used in embedded systems
differ greatly in terms of their development
time and debugging features.
Debugging Techniques
• The following debugging Techniques are −
– Testing on host machine
• Find the bug
• Develop reusable, repeatable tests
• Audit trail of test results
• Calling interrupt routines
• Scaffold test
• Assert macro
– Using Simulators (or Instruction set simulators)
– Using Laboratory Tools
– Using Emulator (In Circuit Emulator, ROM emulator)
– Integrated Development Environment(IDE)
What is testing?
• Testing is an organized process to verify the
behaviour, performance, and reliability of a
device or system against designed
specifications.
• It ensures a device or system to be as defect-
free as possible.
• Expected behaviour, performance, and
reliability must be both formally described
and measurable.
Verification vs Testing
• Verification or debugging is the process of
removing defects ("bugs") in the design phase
to ensure that the synthesized design, when
manufactured will behave as expected.
• Testing is a manufacturing step to ensure that
the manufactured device is defect free.
• Testing is one of the detective measures, and
verification one of the corrective measures of
quality.
Testing on Host Machine
• Find bugs early
• Exercise all of the code
• Develop reasonable, repeatable tests
• Leave an “audit trail” of test results
– .....all of this is hard to do on the target system
– Therefore...use host as much as possible
• Test at initial stages is done on the host machine.
• Host machine is used to test hardware
independent codes.
• Host machine is also used to run simulator.
Testing on the Host
• Figure shows the test system in a development process.
• It shows host and hardware system, and host dependant,
target independent, and target dependent code.
– The code has two parts
• hardware dependent
• hardware independent codes.
Testing on the Host
Testing steps at Host machine
• Initial tests: test each module or segment at initial stage
itself and on host itself.
• Test data: All possible combinations of data are
designed and taken as test data.
• Exception condition test: consider all possible
exceptions for the test.
• Tests-1: test hardware independent code
• Tests-2: test scaffold software (scaffold software is
software running on the host system of the target
dependent codes and which have the same start code
and port and device addresses at the hardware)
• Test-ISR hardware dependent part: this section of ISRs
are called, which are hardware independent and tested.
• Timer tests: Hardware dependent code has timing
functions and uses a timing device. Timer related
routines such as clock tick set, counts get, counts put,
delay are tested.
• Scripts and Output Files
– a script that the program uses to simulate input to the
program
• Assert macro test: the use of assert macro is an
important test technique. We insert the codes in the
program that check whether a condition or parameter
actually turns true or false. If it turns false, the program
stops. We can use assert macro in different critical
places in the application program.
Scripts and Output Files
• Pre-write a script that the program uses to
simulate input to the program.
• Test scaffold “simulates” hardware interrupts –
calls hardware-independent code to deal with
the input data/condition.
• Test scaffold intercepts outgoing hardware
commands and handles handshaking
• Useful for repeated testing
• Useful to create strange timing conditions
The assert Macro
• Useful for application programmers –
embedded programmers generally have to
implement by hand „
• assert() takes 1 argument, and on fail, causes
program to crash right away. „
• Use it to check things you normally assume to
be true (assignments, logical, etc.) „
• Allows bugs to be found very early in
development cycle
Target hardware debugging
• Laboratory Tools
– Volt meters and ohm meters (or) Multi-meters
– Oscilloscope (CRO)
– Logic Probe
– Bit Rate meter
– Logic Analyzer
• Simulator
• Emulator
– In-Circuit Emulator(ICE)
– ROM emulator
• Integrated Development Environment(IDE)
• Monitors
– Volt meters and ohm meters „
• useful for checking the power supply voltage at source
• voltage levels at chips power input pins, and port pins initial at
start
• final voltage levels after the software run,
• checking broken connections,
• improper ground connections, and
• burnout resistances and diodes.
– Oscilloscopes „
• Monitor signals over time „
• Monitor more than 1 signal „
• Trace buffer allows storing data „
• Triggers „
• Checking clock signals „
• Checking output hardware control lines „
• Glitches and spikes „
Use of Logic Probe
• Simplest hardware test device.
• Handheld pen like device with LEDs – Glows
green for ‘1’ and red for ‘0’
• Important tool when studying the long port-
delay effects (>1s).
• Delay program tests the presence of system
clock ticks
Logic Analyzer
• A logic analyzer is an electronic instrument that captures
and displays multiple signals from a digital system or
digital circuit.
• Logic Analyzers have advanced triggering capabilities,
and are useful when a user needs to see the timing
relationships between many signals in a digital system.
• Essentially a logic analyzer enables traces of logic signals
to be seen in such a way that the operation of several
lines in a digital circuit can be monitored and
investigated.
• A logic analyzer contains special connectors and clips
which can be attached to the target board for capturing
digital data.
Logic Analyzer
Logic Analyzer
• A powerful hardware tool for checking multiple
lines carrying address, data and control bits, IO
buses, ports, peripherals and clock.
• Recognizes only discrete voltage conditions, '1'
and '0'.
• Collects, stores and tracks multiple signals and
bus transactions simultaneously and successively.
• Reads multiple input lines (24 or 48) and later
displays, using this tool, each transaction on each
of these on computer monitor (screen) observed.
• Catches intermittent bugs
Logic Analyzer
• In target board debugging applications, a logic analyzer
capture the states of various port pins, address bus and
data bus of the target processor/controller etc.
• Logic analyzers give an exact reflection of what happens
when a particular line of firmware is running.
• Most modern logic analyzers contain provisions for
storing captured data, selecting a desired region of
captured waveform, zooming selected region of the
captured waveform, etc.
• Most widely used logic analyzers in the market are:
– Tektronix
– Agilent
Simulator
• A simulator is a software that duplicates some processor in almost all
the possible ways. Simulators try to model the behavior of the
complete microcontroller in software.
• Simulation is the imitation of the operation of a real-world process
or system over time.
• The act of simulating something first requires that a model be
developed; this model represents the key characteristics, behaviours
and functions of the selected physical or abstract system or process.
• The model represents the system itself, whereas the simulation
represents the operation of the system over time.
• A simulator is a program which runs on the development system (i.e.
your PC) and imitates the architecture of the target processor.
• You can run your program in this simulator and verify the
functionality.
• You can single step your program, run it upto a certain address, add
breakpoints etc.
• Some simulators have small separate window which can be used to
simulate the serial port as well as LCDs, LEDs, Keypads, ADCs etc.
Simulator
• Simulator have some useful abilities
– Determining response and throughput
– Testing assembly language code
– Resolving portability issues
– Testing code dealing with peripherals built in to
processor/controller
• Simulator cannot help you with this problems
– Shared data bugs
– Other hardware
• Simulator will simulate the processor, the ROM/RAM, the built
in peripherals,
• The simulator cannot help for specialised radio, sensors, ASICs
etc.
Functions of Simulators
• A simulator performs the following functions −
– Defines the processor or processing device family as well as its various
versions for the target system.
– Monitors the detailed information of a source code part with labels and
symbolic arguments as the execution goes on for each single step.
– Provides the status of RAM and simulated ports of the target system for
each single step execution.
– Monitors system response and determines throughput.
– Provides trace of the output of contents of program counter versus the
processor registers.
– Provides the detailed meaning of the present command.
– Monitors the detailed information of the simulator commands as these
are entered from the keyboard or selected from the menu.
– Supports the conditions (up to 8 or 16 or 32 conditions) and
unconditional breakpoints.
– Provides breakpoints and the trace which are together the important
testing and debugging tool.
– Facilitates synchronizing the internal peripherals and delays.
Advantages and disadvantages of Simulator
• Simulator based debugging techniques are simple
and straight forward.
• The major advantages:
– No need of original Target board
– Simulate I/O peripherals
– Simulate abnormal conditions
• You can input any desired value for any parameter during
debugging and you can observe the flow control of firmware.
• Limitations:
– Deviation from real behaviour
– Lack of real timeliness
• It is not real time in behaviour.
In Circuit Emulator(ICE)
• Emulator supports debugging of the program
while it executes on the target processor.
• An emulator typically consists of a debugger
coupled with a device board connected to the
desktop processor via a cable.
• An in circuit emulator sometimes referred as
Emulators.
• An in-circuit emulator (ICE) is a hardware device
that allows a programmer to change or debug the
software in an embedded system.
• It replaces the processor/microcontroller in the
target system.
• ICE consists of the following:
– An emulator pod with a ribbon cable, which
extends to a processor/controller socket of the
target system.
• We later insert the processor IC in the socket.
– The pod links serially to COM port of a computer.
• The pod gets the downloaded code from the host.
ROM Emulators
• ROM emulator emulates(imitates) only a ROM.
• ROM emulator is used for getting software into target
system for debugging purpose.
• ROM emulator is a device that replaces the ROM in the
target system.
• The target connects though ROM socket and also connects
to the computer(host).
Logic Analyzer
• Views signals external to processor
• Cannot control software execution flow
• Useful only with debuggers
• Troubleshoots digital hardware
• Dozens or hundreds of inputs
– Detect each signal is high or low

You might also like