Module 5(Lecture 7)
Module 5(Lecture 7)
SYSTEMS (17EC62)
Signal source
Emulator-Target Board
interface (JTAG/BDM/Pin to
pin socket)
Emulator
Development PC
(Host)
Target board
PCB fabrication
files
Multimeter il-tt
Logic analyser
Fig.: The Embedded
System Development Hardware debugging tools
Environment
Embedded System Development
Environment - Block Diagram
• The Integrated Development Environment (IDE) and Electronic Design
Automation (EDA) tools are selected based on the target hardware development
requirement and they are supplied as Installable files in CDs by vendors.
• These tools need to be installed on the host PC used for development activities.
• These tools can be either freeware or licensed copy or evaluation versions.
• Licensed versions of the tools are fully featured and fully functional whereas
trial versions fall into two categories, tools with limited features, and full
featured copies with limited period of usage.
Integrated Development
Environment (IDE)
• In embedded system development context, Integrated Development
Environment (IDE) stands for an integrated environment for developing and
debugging the target processor specific embedded firmware.
• IDE is a software package which bundles a
• Debugger.
Integrated Development
Environment (IDE)
• IDEs used in embedded firmware development are slightly different from the
generic IDs used for high level language based development for desktop
applications.
• In embedded applications, the IDE is either supplied by the target
processor/controller manufacturer or by third party vendors or as Open Source.
• Keil ^Vision from Keil software is an example for a third party IDE, which is
used for developing embedded firmware for 8051 family
microcontrollers and also ARM microcontrollers.
• MPLAB is an IDE tool supplied by microchip for developing embedded
firmware using their PIC family of microcontrollers.
• CodeWarrior by Metrowerks is an example of IDE for ARM family of
Disassembler/Decompiler
• Disassembler is a utility program which converts machine codes into target
processor specific Assembly codes/instructions.
• The process of converting machine codes into Assembly code is known as
'Disassembling'.
• In operation, disassembling is complementary to assembling/cross-assembling.
• Reverse engineering is the process of revealing the technology behind the working
of a product.
• Reverse engineering in Embedded Product development is employed to find out
the secret behind the working of popular proprietary products.
• Disassemblers/Decompilers help the reverse engineering process by translating
the embedded firmware into Assembly/high level language instructions.
• Disassemblers/Decompilers are powerful tools for analysing the presence of
malicious codes (virus information) in an executable image.
Simulators
• Simulator is a software tool used for simulating the various conditions for
checking the functionality of the application firmware.
• The Integrated Development Environment (IDE) itself will be providing
simulator support and they help in debugging the firmware for checking its
required functionality.
• Simulators simulate the target hardware and the firmware execution can be
inspected using simulators.
• The features of simulator based debugging are:
• Purely software based
• Doesn't require a real target system
• Very primitive (Lack of featured I/O support. Everything is a simulated
one)
• Lack of Real-time behaviour
Simulators
• Advantages of Simulator Based Debugging
• User only needs to know about the memory map of various devices
within the target board and the firmware should be written on the basis of
it.
• Since the real hardware is not required, firmware development can start well
in advance immediately after the device interface and memory maps
are finalised.
Simulators
• Simulate I/O Peripherals
• Using simulator's I/O support, the values for I/O registers can be edited
and
can be used as the input/output value in the firmware execution.
• Hence it eliminates the need for connecting I/O devices for debugging
the
firmware.
• With simulator's simulation support, you can input any desired value for
any parameter during debugging the firmware and can observe the
• Even though the cost of developing an emulator is high, it proves to be the more cost
efficient solution over time.
• Emulators allow software exclusive to one system to be used on another.
• It is more difficult to design emulators and it also requires better hardware than the
original system.
Simulator vs. Emulator
• Simulator is a software application • Emulator is a self-contained hardware
that precisely duplicates (mimics) device which emulates the target CPU.
the target CPU and simulates the • The emulator hardware contains
various features and instructions necessary
supported by the target CPU. emulation logic and it is hooked to the
• The simulator is a host-based debugging application running on the
program that imitates the development PC on one end and connects
functionality and instruction set of
the target processor. to the target board through some interface
• In summary, the simulator
'simulates' the target board CPU. on the other end.
Debuggers
• Debugger is a software tool that is used to detect the source of program or script
errors, by performing step-by-step execution of application code and viewing the
content of code variables.
• Debugging, in embedded application, is the process of diagnosing the firmware
execution, monitoring the target processor's registers and memory while the firmware
is running and checking the signals from various buses of the embedded hardware.
• Debugging process in embedded application is broadly classified into two, namely,
hardware debugging and firmware debugging.
• Hardware debugging deals with the monitoring of various bus signals and checking the
status lines of the target hardware.
• Firmware debugging deals with examining the firmware execution, execution flow,
changes to various CPU registers and status registers on execution of the firmware to
ensure that the firmware is running as per the design.
Firmware Debugging
• Firmware debugging is performed to figure out the bug or the error in the
• In this technique, the code is separated into different functional code units.
• Instead of burning the entire code into the EEPROM chip at once, the code is burned in
incremental order.
• This means the code corresponding to all functionalities are separately coded, cross-
compiled and burned into the chip one by one.
• In this technique, we are not doing any debugging, but we are observing the status of
firmware execution as a debug method.
• Incremental firmware burning technique is widely adopted in small, simple system
developments and in product development where time is not a big constraint (e.g. R&D
projects).
• It is also very useful in product development environments where no other debug tools
are available.
Inline Breakpoint Based Firmware
Debugging
• This is another primitive method of firmware debugging.
• Within the firmware where you want to ensure that firmware execution is reaching
up to a specified point, an inline debug code is inserted immediately after the point.
• The debug code is a printf() function which prints a string given as per the
firmware.
• The debug codes (printf() commands) can be inserted at each point where you
want to ensure the firmware execution is covering that point.
• The source code is cross-compiled along with the debug codes embedded within it.
• The corresponding hex file is burned into the EEPROM.
Target CPU
Monitor ROM
Target board
Von-Neumann RAM
In circuit emulator
Signal lines
PC COM/USB port
(Flat Cable
Target Board
• With a magnifying glass (lens), the surface of the target board can be examined
thoroughly for dry soldering of components, missing components, improper placement of
components, improper soldering, track (PCB connection) damage, short of tracks, etc.
• Nowadays high quality magnifying stations are available for visual inspection.
• The magnifying station incorporates magnifying glasses attached to a stand with CFL
tubes for providing proper illumination for inspection.
• The station usually incorporates multiple magnifying lenses.
• The main lens acts as a visual inspection tool for the entire hardware board whereas the
other small lens within the station is used for magnifying a relatively small area of the
board which requires thorough inspection.
Multimeter
• A multimeter is used for measuring various electrical quantities like voltage (Both AC
and DC), current (DC and AC), resistance, capacitance, continuity checking, transistor
checking, cathode and anode identification of diode, etc.
• Any multimeter will work over a specific range for each measurement.
• The digital version is preferred over analog the one for various reasons like readability,
accuracy, etc.
Digital CRO
• Cathode Ray Oscilloscope (CRO) is used for waveform capturing and analysis, measurement of
signal strength, etc.
• CRO is a very good tool in analysing interference noise in the power supply line and other signal
lines.
• Monitoring the crystal oscillator signal from the target board is a typical example of the usage of
CRO for waveform capturing and analysis in target board debugging.
• CROs are available in both analog and digital versions.
• Though Digital CROs are costly, featurewise they are best suited for target board debugging
applications.
• Digital CROS are available for high frequency support and they also incorporate modern
techniques for recording waveform over a period of time, capturing waves on the basis of a
configurable event (trigger) from the target board.
• Most of the modern digital CROs contain more than one channel and it is easy to capture and
analyse various signals from the target board using multiple channels simultaneously.
• Various measurements like phase, amplitude, etc. is also possible with CROs.
Logic Analyser
• Logic analyser is used for capturing digital data (logic 1 and 0) from a digital circuitry
whereas CRO is employed in capturing all kinds of waves including logic signals.
• A logic analyser contains special connectors and clips which can be attached to the target
board for capturing digital data.
• In target board debugging applications, a logic analyser captures the states of various
port pins, address bus and data bus of the target processor/controller, etc.
• Logic analysers give an exact reflection of what happens when particular line of
firmware is running.
• This is achieved by capturing the address line logic and data line logic of target
hardware.
• Most modern logic analysers contain provisions for storing captured data, selecting a
desired region of the captured waveform, zooming selected region of the captured
waveform, etc.
Function Generator
• Function generator is not a debugging tool.