Vous êtes sur la page 1sur 16

Debugging

Why debug
Verify actual performance of software
in detail
Remove issues in software
Software is never 100% correct
..etc

Debugging
Methods
Verify manually
Use debugger software's
JTAG/SWD

JTAG
An Industry Standard IEEE Std
1149.1-1990(JTAG)
In 1985, an ad hoc group composed of
key electronic manufacturers joined to
form the Joint Test Action Group (JTAG).
Objective: to establish a solution to the
problems of board test and to promote a
solution as an industry standard.
Solution : Boundary scan through TAP

Boundary scanning

Boundary scanning

JTAG Interface Signals


Interface Signals
The JTAG interface, collectively known as a Test Access Port, or TAP,
uses the following signals to support the operation of boundary scan.
TCK(Test Clock) this signal synchronizes the internal state machine
operations.
TMS(Test Mode Select) this signal is sampled at the rising edge of
TCK to determine the next state.
TDI(Test Data In) this signal represents the data shifted into the
device's test or programming logic. It is sampled at the rising edge of
TCK when the internal state machine is in the correct state.
TDO(Test Data Out) this signal represents the data shifted out of
the device's test or programming logic and is valid on the falling
edge of TCK when the internal state machine is in the correct state.
TRST(Test Reset) this is an optional pin which, when available, can
reset the TAP controller's state machine

Serial Wire Debug (SWD)


Serial Wire Debug (SWD) provides a debug port for severely pin limited
packages, often the case for small package microcontrollers but also
complex ASICs where limiting pin-count is critical and can be the
controlling factor in device costs.
SWD replaces the 5-pin JTAG port with a clock + single bi-directional data
pin, providing all the normal JTAG debug and test functionality plus realtime access to system memory without halting theprocessor or requiring
any target resident code.
Only 2 pins required - vital for very low connectivity devices or packages
Provides debug and test communication to JTAG TAP controllers
Enables the debugger to become another AMBA bus master for access to system
memory and peripheral or debug registers
High performance data rates -4 Mbytes/sec @50 MHz
Low power - no extra power or ground pins required
Small silicon area - 2.5k additional gates
Low tools costs, $100 build costs - may be built in to evaluation boards
Reliable - built in error detection
Safe - protection from glitches on pins when tools not connected

SWD

SWJ
The known JTAG Debug Port (JTAG-DP) is
supported furthermore. Both debug ports, the SWD
and the alternative JTAG debug port can be
combined to the Serial Wire JTAG Debug Port (SWJDP), the CoreSight standard port.
When using SWD, the TDO signal can provide trace
event messages via the Serial Wire Output (SWO).
This behaviour can be used by the Serial Wire Viewer
(SWV) to output system events via a single pin:
Instrumentation trace ITM (printf-like Debugging)
Watchpoint Trace DWT, Instruction Pointer Trace
Event Trace (Interrupts)

JTAG Connectors

Signal descriptions

SWD Interface

KEIL Debug features

Vision provides the following debugging windows and dialogs:


Breakpointsdefine stop conditions for program execution.
Call Stack and Locals Window view objects that are currently in the call tree.
Code Coverageexamine statistics about code execution, including branch
testing.
Command Windowenter and view executed commands.
Disassembly Window test programs at the level of assembly instructions.
Event Viewerexamine the history of task-switching events.
Execution Profilerexamine time and call statistics on instruction level.
Instruction Trace Window view the instruction history for devices not based
on a Cortex-M processor.
Logic Analyzerinvestigate value changes of peripherals, registers, and
variables on a time graph.
Memory Mapevaluate memory areas and their access rights.
Memory Windowanalyze and modify memory content.

KEIL Debug features


Performance Analyzerevaluate time and call statistics on module or function
level.
Registers Windowview and modify register content.
Serial Windowis a communication interface between the application and the
PC.
Status Barview debugging status information.
Symbols Windowfind debug symbol information used in program.
System Viewerfind peripheral register information and change property values
at runtime.
System and Thread Viewershows system and thread information for an RTOS
application.
Toolboxuse and define configurable buttons for executing debugging
commands interactively.
Trace Data Windowanalyze the instruction history for Cortex-M processorbased devices.
Trace Navigationscroll through captured trace data records.
Watch Windowdisplay and modify program variable values at runtime.

Vous aimerez peut-être aussi