Trace32 Basic
Trace32 Basic
About it.
Revision history
Aug.09, 2010 Sangcheol Lee First edition
About it.
This document contains intellectual property and educational information for TRACE32 Basic Course and it only be used in allowed companies. It is not allowed to disclose, transmit or use this document to the third parties without the prior written consent of MDS technology, by any form or means. If you are not the intended reader or company, please notify the MDS technology immediately and do not disclose the contents and destroy all copies of the original message.
3
Contents
Introduction TRACE32 Installation TRACE32 Beginning Debug Image Download Menu & Features Practice Language
4
Introduction
In this chapter,
Understand
Basic concept of Debugger & Emulator Basic principle of JTAG
10
JTAG / IEEE1149.1
Background
Test Access Port TAP Boundary Scan Cell in CPU
11
JTAG / IEEE1149.1
JTAG features
Use on-chip debug features like on-chip breakpoint. Memory access, logic debice programming like flash memory. Five signal line is used.
nTRST TMS TDI / TDO TCK
12
JTAG / IEEE1149.1
JTAG Architecture
Core logic and JTAG block TAP controller and registers in JTAG block JTAG operation is controlled by TAP Controller Data transferring through TDI and TDO
TDI
TDO
13
JTAG / IEEE1149.1
D2 D1 D0 0 1 0 1 0 1 0 1 0 1 0 1 TDI Bypass Instruction Identification TMS TCK TRST TAP Controller TDO Memory 0 1 0 1 0 1 0 1 0 1 0 1 A2 A1 A0
0 1 0 0
0x7
0x4
JTAG / IEEE1149.1
D2 D1 D0 1 1 1 1 1 A2 A1 A0
1 1 1 1
0x7
0x4
TDI
TDO
Memory
0x7
JTAG / IEEE1149.1
Daisy-chain
16
1 3 5 7 9
2 4 6 8 10
NC GND GND GND GND GND GND GND GND GND VCCS nTRST TDI TMS TCK TDO VCCS
1 3 5 7
2 4 6 8
1 3 5 7
2 4 6 8
11 12 13 14 15 16 17 18 19 20
9 10 11 12 13 14
9 10 11 12 13 14
20 pin connector
14 pin connector
TRACE32 Installation
In this chapter,
Understand
Installation TRACE32 Software PowerView How to check problem of TRACE32 How to update firmware of TRACE32 USB module How to check PowerView version
TRACE32 S/W installation TRACE32 H/W connection with target Firmware update and version check
19
S/W installation
Installation guide
TRACE32 installation DVD MDS technology homepage : www.mdstec.com
Registration is needed [] -> [Edu text / Sample] -> Article number 21
This document is based in Korean, But you can understand easily what it mean. Just follow images in that guide.
Article number 28 is English version Installation guide, which included in Dec 2009 version of Installation DVD.
20
S/W installation
21
22
SELECT
Indicate current status of PowerDebug. It is blinking before executing PowerView. After that, LED is turns on
23
24
TRACE32 Beginning
25
In this chapter,
Understand
Three initialization files of PowerView Meaning of SYStem window
Run a TRACE32 PowerView config.t32 / T32.men / T32.cmm SYStem window Practice
diag 0x3400 Making simple target initialzation cmm script
26
27
T32.men
PowerView basic menu configuration User menu configuration
T32.cmm
Define extended menu and window configuration of user.
28
SYStem window
Establishing target interface with TRACE32
29
SYStem window
Mode
Down
PowerView cannot detect target status whether physically connection is made or not.
Attach
Basically, drive nTRST to make connection with target. It doesnt drive nSRST signal to maintain target operation.
Up
Drive both nTRST and nSRST to make target interface from earlier stage.
30
SYStem window
JtagClock
Set up TCK frequency which delivering JTAG commands and datas from / to TRACE32
ARM core uses 10.mhz basically but RTCK must be set if ARMxxx-S is used. E.g ARM1176jzf-s, AR926/946ej-s
CONFIG
Must be set if target CPU is Multi-core Specify which core is connected with TRACE32
31
Practice
Check commuication with TAP controller
Not with ARM core. Just testing communication between TRACE32 and JTAG TAP controller
Run TRACE32 PowerView. Make SYStem.Down status. Open AREA window Just typing area in command line Try diag 0x3400 in command line
B:: diag 0x3400
32
Practice
Simple initialization cmm script
Make cmm script, naming as you want.
pedit system.cmm
Setting the options of SYStem window. Grammar is same as contents of SYStem window
33
34
In this chapter,
Understand
How to download the image file to to target. What is binary, what is ELF format? The meaning of download command Making improved cmm script to download ELF image.
Download File format Binary and ELF Download using TRACE32 Download command Make improved system.cmm file
35
Download
Download is
Copy the image (BIN / HEX / S3 / ELF / EXE ..) files that is compiled and linked in host PC to the target memory.
download
HOST PC
36
Binary Code
Binary Part
Symbol Part
Logical structure of ELF Format
38
Downloading binary / ELF image file is possible even if UART / USB / Ethernet port is not implemented on target. Supporting NOR, NAND, mDOC, OneNAND and so on. Fast download speed
RAM : 2Mbyte/sec Flash : 2Mbyte/min depends on CPU or Flash type
39
ICD
Binary part of phone.elf
ARM 7,9,10
ARM CORE CORE
FLASH FLASH
Sym bol
RAM
Binary
Phone.elf
HOST PC
SRAM
TARGET PHONE
40
?
FLASH
8Mbyte FLASH
ICD
phone.elf
12Mbyte
RAM
SRAM
41
HOST PC
Download command
Data.LOAD.ELF <filename> [/option] Data.LOAD.Binary <filename> <address> [/option]
Options
Compare
Data is compared with the downloading file, memory is not changed. The load stops when difference is found.
NOCODE
Suppress the code download. Only symbol information is loaded.
NosYmbol
No symbol information is loaded.
NoClear
Preserve existing symbol information. It should be used if several symbol information is needed.
42
Practice
Make improved system.cmm
43
Practice
Meaning of each line
RESet
Reset the interface between TRACE32 and target
SYStem.CPU s3c2410x
Select the CPU of target. If CPU is not listed, select the CORE.
SYStem.JtagClock 10.mhz
Select the clock frequency of TCK signal
SYStem.Up
Reset the system with debug mode enabled and halt the target.
44
Practice
Meaning of each line
Data.LOAD.ELF c:\T32\edu\... /nocode
Select corresponding file formant and download to target.
sYmbol.SPATH + c:\t32\...
Specify the loacation of ther source files In case of the source files are moved to other directory after build, TRACE32 cannot getting and displaying source code in Data.List window. With this command, you could match the source path with downloaded binary. If you still couldnt see anything, it means there are no source filess or wrong path information is given.
45
Practice
Meaning of each line
do c:\t32\window.cmm
cmm script files could call other cmm script file. In this case, window configuration is called.
map.bonchip 0x0--0x3FFFFF
Specify area where only onchip breakpoint is used. For instance, flash device area is used.
46
In this chapter,
Understand
Customizing the menu of TRACE32 How to modify and create menu bar or main toolbar Practice how to run system.cmm file by user made menu.
Customizing the GUI Customizing the menu bar Customizing the main toolbar
48
TRACE32 menu
Main menubar Main toolbar
Local buttons
Local popup
49
Make new *.men file user can create own *.men file
B::MENU.Program <file>
50
Make new *.men file user can create own *.men file
51
DL "Data.ListHll"
ADD TOOLBAR ( SEPARATOR TOOLITEM "List Hll Source" "Data.ListHll" [ <space for toolimage> ] ; (use bitmapedit refer next page) )
52
Push the save button to save the bitmap to the menu file Define bitmap for the TOOLITEM
53
TRACE32 Features
In this chapter,
Understand
The basic features for debugging Breakpoint and practice how to use it
Data.List window sYmbol.Browse window Data.dump window Register window Var.Watch window Var.Frame window Breakpoint
56
57
58
sYmbol.Browse ( View->Symbols )
Displays all loaded symbols User can see the source code and set the breakpoint Content of the sYmbol.Browse
Application (*.elf, *.axf, *.exe..) C source Function & variables
60
Data.dump ( View->Dump )
Find Modify Long E Track Hex / ascii Find the value user want in the memory Modify the value of the memory Support byte, word, long, quad.. formats To see the changes of the memory during the target running. SYStem.CpuAccess.Enable is needed Tracking source location in Data.List window Display the data in two kinds of formats
61
Register ( View->Registers )
Display register value of CPU Possible to modify or set the value Register Up/Down Register Copy Register Swap Register Undo Change register values to the end of prior function. Copy the value of the current register Return to the state of the time that user did Register.Copy Return the value of the register at the last target break.
62
Var.Watch ( View->Watch )
Variable tracking Possible to modify or set the value Replace printf style debugging Variable input window i Watch View
Add the variable to watch window directly Show the symbol browser Add a variable to watch window Display the information of the variable
63
Var.Watch ( View->Watch )
User can change the display format
64
Var.Frame (Var->Stackframe...)
Display the information of the function call stack with nesting structure
Up Down Args Locals Caller Return to the last condition of the prior function Vice versa of Up Display the value of the arguments Show the local variables of the function Show caller instruction / function or not
Local variables of function
65
Breakpoint
Core providing Breakpoint type
Onchip Breakpoint
Breakpoint set address is stored into ICE breaker register ARM7/9 has two and ARM11 and Cortex has 6 (Average) Everywhere if there is address
Software Breakpoint
Using trap code 0xBEBEBEBE to halt the target Backup original code into inst cache Target halt Original code is restored Trap code inserting
66
Breakpoint
Breakpoint of TRACE32
Program Breakpoint
Set the BP at the program address. Double click in Data.List
Spot Brekapoint
To monitor the value of memory or variable
67
Breakpoint
Breakpoint set
Toggle as your double clicking on source line
68
Breakpoint
Read / Write Breakpoint
Target halt when specific variable of memory is read or written. Because of its definition, TRACE32 cannot sense the memory / variable access if it is not happened by CPU.
69
Breakpoint
Read / Write Breakpoint
70
Breakpoint
Spot Breakpoint
To see the continuous change of variable / regiater value Need a target halt. Not realtime Program execution is stopped shortly to update the screen. As soon as the screen is updated, target runs again.
71
Breakpoint
Spot Breakpoint
72
In this chapter,
Understand
Definition and role of cmm script How to make a cmm script How to make a debugging sequence simply with cmm
CMM script basic Window storing to cmm Command logging Basic practice commands
74
75
Window storing
SYStem window
B::STOre file_name.cmm system
76
77
Command logging
Command log
To save the commands that user did. B::log.open file_name.cmm
Then debug your target With log.close command, command logging is ended
78
Function
To get the state information of the target like run() r(pc)
Comments
; or //
Label
Append : after nale like LABEL:
79
References
Technical support
Http://www.mdstec.com Support->FAQ, Q&A, Download, TRACE32 technical support E-mail: [email protected]
website
company: http://www.mdstec.com
manual
Refer Help of TRACE32 PowerView Refer *.pdf files in PDF forder which is created in T32 folder automatically after TRACE32 PowerView installation
81
Q &A
82