Debug Hardware

Download Report

Transcript Debug Hardware

Real-Time Trace
Coresight™ support in
ARM Cortex™-M3 based devices
V1.0, 08
1
Content




Introduction to Coresight
 ARM Debug Technology
 Serial Wire debug and Real-Time Trace capabilities
 Comparison with standard JTAG
Real-Time Trace and tools
 Using Serial Wire Viewer Trace
 RealView MDK and ULINK2
Examples
 Example and Device support
Summary
V1.0, 08
2
Tools for ARM-Powered Devices
RealView
Real-Time Library
RealView C/C++ Compiler
RTX Source Code
RTX RTOS Kernel
TCP/IP Suite
µVision
Device Database & IDE
Flash File System
µVision
Debugger & Analysis Tools
USB Device Interface
Complete Device Simulation
CAN Interface
Examples and Templates
Examples and Templates
Third Party Utilities
RealView Microcontroller
Development Kit
Target Debug
Evaluation Boards
ULINK2 USB-JTAG Adapter
ARM7, ARM9 and Cortex-M3
with Real-Time Trace (Serial Wire Viewer)
based MCU devices
V1.0, 08
3
Coresight - Introduction
New debug and trace technology in Cortex-M3 devices, enhances
EmbeddedICE technology of ARM7 and ARM9 devices.

Delivers new debugging modes and features:
 Standard JTAG
 Traditional 5 wire interface + extra functionality offered by Coresight
 New Serial Wire (SW) Mode - 2 wire interface



 Offers extra functionality over JTAG using less I/O
Serial Wire Viewer (SWV) – 1 extra pin
 Offers Real-Time Trace with no extra hardware
SW and SWV are included on the standard JTAG connector
 No need for new connectors or debug hardware adapters
Supported in:
 RealView MDK 3.15+ and ULINK2/ULINKME
 Cortex-M3 devices – Luminary Micro and STMicroelectroncs
V1.0, 08
4
ARM-Debug Technology
ARM7 & ARM9 - EmbeddedICE
Cortex-M3 - Coresight
Provides run-time control of CPU
Run-control direct from Cortex-M3 CPU
ETM - only trace option
High speed instruction and data trace
No ETM, no trace capability
Separate connectors for JTAG and ETM
Two trace options – ETM or ITM
SWJ-DP – provides SW, SWV & JTAG output
JTAG connector supports SW, SWV & JTAG
ETM 1 - 32bit trace via separate connector
Cortex-M3 Microcontroller
ARM7 or ARM9 Microcontroller
Optional ETM
Optional ETM
ARM7 or ARM9
CPU
Trace Connector
4, 8, 16 bit
trace
Trace Port
TPIU
EmbeddedICE
JTAG Port
ETM
Trace Connector
ETM
Cortex-M3
CPU
ETM
Trace
ITM
TPIU
Serial Wire Viewer
SWJ-DP
Coresight Debug Technology
JTAG Connector
JTAG Connector
TPIU – Trace Port Interface Unit
ITM – Instrumented Trace Unit
V1.0, 08
5
EmbeddedICE Technology
Traditional debug for ARM7 and ARM9 devices.


EmbeddedICE allows
 Start and stop program
 Single Step one source or assembler line
 Read and write memory only when CPU is stopped
 No integrated Trace support – requires optional ETM
Sometimes called Stop and Go debugging.
 Struggles with modern embedded system debug
 Program Halt is not practical in many applications
 Keil offer Real-Time Agent to enhance ARM7 and ARM9 debug
V1.0, 08
6
Coresight – Debugging
Adds new features for Cortex-M3 based devices,
compared to to those offered by EmbeddedICE.

Coresight adds enhanced functionality
 Running System Debug
 On-the-fly memory access during program execution
 Read memory while CPU is running
 No additional software overhead (monitor) or hardware
 8 hardware break points



EmbeddedICE (ARM7 & ARM9) only have 2 hardware breakpoints
Integrated Trace Technology independent of ETM
Multiple interface modes
 Coresight debug available via JTAG and SW interfaces
V1.0, 08
7
Coresight – Serial Wire (SW)
Reduces interface to just 2 wires and
adds new features to those offered by standard JTAG!


2-Wire Serial Interface
 Serial Data + Clock
 Replaces JTAG (5-wire) interface
 Throughput speed is about the same as JTAG
Standard JTAG Connector
 JTAG and SW use the same 20-pin or 10-pin JTAG connector

No need for new connectors or debug hardware adapters
V1.0, 08
8
Coresight – Serial Wire Viewer (SWV)
Serial Wire Viewer delivers Real-Time Trace with only one extra pin and
no additional hardware or software – only MDK + ULINK2

Real-Time Trace provides:
 Data read and write of selected variables and PC values
 Event counters that show CPU cycle statistics
 Indicate required device wait states or the idle time
 Exception and Interrupt execution with timing statistics
 Helps to optimize interrupt functions.
 Periodic samples of the program counter
 Enables location of end-less loops
 Trace data be used for timing analysis or simple printf-style debugging.
V1.0, 08
9
Coresight vs EmbeddedICE Overview
Cortex-M3 devices with Coresight combine the features of EmbeddedICE
plus new features and Real-Time Trace, with no additional tool costs.
Feature
EmbeddedICE
(ARM7 & ARM9)
Coresight
(Cortex-M3)
JTAG
JTAG or Serial Wire
Hardware Breakpoints
2 Execution or 1-2 Access
8 Execution and 4 Access
Software Breakpoints
Unlimited
Unlimited
Yes using Real-Time Agent in
user application
Yes, supported by hardware
Instruction Trace
Via ETM
Via ETM
Data Trace
Via ETM
Yes
Event Trace
No
Yes
Instrumented Trace
No
Yes
Debug Interface
Memory Access – during
program execution
V1.0, 08
10
Real-Time Trace
Using Serial Wire Viewer
with RealView MDK and ULINK2
V1.0, 08
11
Real-Time Trace (SWV)
No additional software or hardware is required.
Just MDK + ULINK2 (or ULINK-ME)……..and a PC with USB.
V1.0, 08
12
SWV – Easy Configuration
SWV is easy to use and configure, data is displayed in real time
up to 3 times a second.
 Configure debug for Serial Wire Mode
 Configure Trace to display data you wish to capture
V1.0, 08
13
SWV – view it how you want to
µVision provides 3 different ways in which to view variables.
Memory Window – View > Memory Window
Watch Window – View > Watch and Call Stack Window
ITM Viewer – View > Serial Window > ITM Viewer
V1.0, 08
14
Trace Windows
Different types of Trace Data can be viewed in µVision’s
three Trace Windows and the Logic Analyzer.

Easy configuration
 Cortex-M Target Driver
Setup window.

Four Trace Views:
 Trace Records
 Logic Analyzer
 Exceptions
 Counters
V1.0, 08
15
Trace Windows - Trace Records
Automatically displays variables which
have been selected to capture trace data

Trace Records capture:
 Timestamp, PC sample, Read/Write PC selectable.
 Filter window to remove certain lines.
 Can be changed
while CPU is running.
 Time delay and lost
cycles are noted.
V1.0, 08
16
Trace Windows - Logic Analyzer
The µVision Logic Analyzer displays value changes of up to four selected
variables over time, including global, static and struct members.
V1.0, 08
17
Trace Windows - Exception Trace
Displays statistical information about program exceptions.
 Displays:
 Exception name & number, number of times entered
 Max and Min time spent in and out of exceptions
 First and Last time entered
V1.0, 08
18
Trace Windows - Event Counters
Displays real-time values of the specific event counters.
 Event Counters
 Shows the number of times counter ‘rolls over’, updated in real time.
 Can be cleared by clicking on the “0”.
V1.0, 08
19
Real-Time Trace Examples
STM32 and Luminary Stellaris Devices
V1.0, 08
20
Examples for STM32
Serial Wire examples included in MDK, ready to run on the Keil
MCBSTM32 Evaluation Board
 Keil\ARM\Boards\Keil\MCBSTM32\STLIB_Blinky
 Keil\ARM\Boards\Keil\MCBSTM32\STLIB_RTX_Blinky
V1.0, 08
21
Examples for Luminary Devices
Serial Wire examples included in MDK, ready to run on the
Luminary LM3S2965 Evaluation Board
 Keil\ARM\Boards\Luminary\ek-lm3s8962\Blinky
V1.0, 08
22
Summary

Coresight offers three debug interfaces
1) Regular JTAG
2) Serial Wire (SW)
3) Serial Wire Viewer (SWV)


Serial Wire Debug delivers new features Today
 Running system Debug – no need to stop the CPU
 2-wire serial interface
 Real-Time Trace using Serial Wire Viewer
New benefits using standard tools!
 Real-Time Trace has serious benefits for embedded developers
 Uses MDK and ULINK2 tools
 No need for additional software overhead or hardware tools
V1.0, 08
23
Additional Information
JTAG Connector Pin-outs
ULINK2 and ULINK-ME
Glossary of Terms
V1.0, 08
24
ULINK2 – USB / JTAG Adapter
Standard, easy to use USB run control adapter,
supporting JTAG debug and Flash programming.

Features
 Serial Wire Debug and Trace Cortex-M3 and Cortex-M1
 Plug and Play USB Installation
 On-the-fly debugging with Real-Time Agent
 Supports 8, 16 & 32-bit device
 Standard USB connector
 Multiple JTAG connector support
 110 x 55mm (4 ¼” x 2 ¼ ”)
V1.0, 08
25
ULINK2 – USB / JTAG Adapter
Supports multiple architectures and JTAG pin-out schemes.
ARM 10-pin, 1.27mm (0.05”)
ARM 20-pin, 2.54mm (0.1”)
ARM 20-pin, 2.00mm (0.079”)
V1.0, 08
26
20-pin Connector (JTAG)
VTref
1
2
VSupply
nTRST
3
4
GND
TDI
5
6
GND
TMS
7
8
GND
TCK
9
10
GND
RTCK
11
12
GND
TDO
13
14
GND
nSRST
15
16
GND
DBGRQ
17
18
GND
DBGACK
19
20
GND
Original JTAG pin-out
V1.0, 08
27
20-pin Connector (JTAG + SW)
VTRef
1
2
VSupply
NC
(nTRST)
3
4
GND
NC
(TDI)
5
6
GND
SWDIO
(TMS)
7
8
GND
SWCLK (TCK)
9
10
GND
NC
(RTCK)
11
12
GND
SWO
(TDO)
13
14
GND
nSRST
15
16
GND
DBGRQ
17
18
GND
DBGACK
19
20
GND
Existing connection specification when Serial Wire Technology is mux’ed
with JTAG connections
V1.0, 08
28
10-pin Connector (JTAG + SW)
includes Serial Wire
VTref
1
2
SWDIO / TMS
GND
3
4
SWCLK / TCK
GND
5
6
SWO / TDO
KEY
7
8
NC/EXTb / TDI
GNDDetect
9
10
nRESET
Recommended connector for smallest footprint for either new JTAG
connections (no RTCK) and/or Serial Wire Technology
V1.0, 08
29
ULINKME – Low Cost Adapter
Low cost design for evaluation and starter kits,
with same functionality as ULINK2.

Features
 Cortex-M3 Serial Wire Debug and Trace
 Plug and Play USB Installation
 Target power via ULINK-ME
 Mini USB connector
 Small and low cost
 ARM 20-pin (0.1”) only
 28 x 80mm (1 ¼” x 3 ¼”)
V1.0, 08
30
ULINK2-ME Comparison
Low cost design for evaluation and starter kits,
with same functionality as ULINK2.
ULINK2
ULINK-ME
JTAG Clock (MHz)
<=10
<=10
Memory R/W (B/sec)
~28K
~28K
Flash R/W (B/sec)
~25K
~25K
~50
~50
Unlimited
2 max
6 max
Unlimited
2 max
6 max
Standard
Mini
Performance
Single-Step – Fast (Ins/sec)
RAM Breakpoints
ROM Breakpoints (ARM7/9)
ROM Breakpoints (Cortex-M3)
Features
Real-Time Agent
USB Connector
20-pin (0.1”) Connector
20-pin (0.079”) Connector
10-pin (0.05”) Connector
Custom Option
Custom Option
V1.0, 08
31
Glossary
V1.0, 08
32
Glossary








EmbeddedICE

Hardware debug block in ARM7 and ARM9 devices
ETM – Embedded Trace Macrocell

Provides trace information from CPU

Allows program to output additional data (such as printf) via the SWV output
 ARM7 & ARM9 – Instruction and Data Trace
 Cortex-M3 – Instruction Trace only (data trace via SWV)
ITM – Instrumented Trace Macrocell
JTAG – Joint Test Action Group


Standard 5-wire interface used for debugging CPU’s and other devices
Incorporates Rtck output for ARM7 and ARM9
SW – Serial Wire

Coresight 2-wire interface replacing JTAG interface
SWV – Serial Wire Viewer

Single Output pin provides trace information via a UART or Manchester encoded interface
SWJ-DP – Serial Wire / JTAG Debug Port

Combined SW, SWV and JTAG interface port, interface mode can be selected by user
TPIU – Trace Port Interface Unit

Collects trace information and outputs it via SWJ-DP or ETM trace connector
V1.0, 08
33
End
V1.0, 08
34