View
575
Download
4
Category
Tags:
Preview:
Citation preview
TRACE32TRACE32Basic CourseBasic Course
2About it.
Revision historySangcheol Lee First editionAug.09, 2010
3About 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.
4Contents
IntroductionIntroduction
TRACE32 InstallationTRACE32 Installation
TRACE32 BeginningTRACE32 Beginning
Debug Image DownloadDebug Image Download
Menu & FeaturesMenu & Features
Practice LanguagePractice Language
IntroductionIntroduction
6In this chapter,
Understand Basic concept of Debugger & Emulator Basic principle of JTAG
About Emulator / DebuggerJTAG / IEEE1149.1JTAG Pin Description
7Emulator & Debugger
What is the emulator? Tool or software which emulates operation of core
virtually instead of real target CPU
CPU emulator, Memory emulator
8Emulator & Debugger CPU Emulator TRACE32 ICE / FIRE
Embedding CPU same as target CPU or higher.
Memory emulation, trace and trigger, code coverage, performance feature.
Being in high price and difficult to make if target operates over 100Mhz.
Not easy to connect all pins between emulator and target.
9Emulator & Debugger
Debugger based on JTAG TRACE32 ICD Using JTAG port
Easy to make interface by using JTAG port pins
Possible to debug without any affection becauswe it doesnt use target resource such as memory or CPU
10
Emulator & Debugger
ETM PowerTrace It stands for Embedded Trace Macrocell
Instruction & data trace in real-timeNon-intrusive trace in full clock speed.
Code coverage & performance analyzing
11
JTAG / IEEE1149.1
Background Test Access Port TAP
Boundary Scan Cell in CPU
12
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 TMSTDI / TDOTCK
13
JTAG / IEEE1149.1
JTAG Architecture
TRST
InternalCoreLogic
Bypass
Instruction
Identification
TAP Controller
TMS
TDI
TCK
TDO
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
14
JTAG / IEEE1149.1
TRST
0
InternalCoreLogic
Bypass
Instruction
Identification
TAP Controller
TMS
TDI
TCK
TDO
IEEE 1149.1 Device Architecture
A0
A1
A2
D0D1D2
0x7 0x4
Memory
0
0
1
0
1
0
1
0
1
0
1
01 01 01 010
1
0
1
0
1
0
1
ex) static int a;read out variable a in address 0x4
15
JTAG / IEEE1149.1
TRST
InternalCoreLogic
Bypass
Instruction
Identification
TAP Controller
TMS
TDI
TCK
TDO
IEEE 1149.1 Device Architecture
0x7
Memory
0x4
A0
A1
A2
D0D1D2111 1
1
1
111
111 0x7
16
JTAG / IEEE1149.1
Daisy-chain
17
JTAG Pin description
ARM processor
14 pin connector
VCCS
nTRST
TDI
TMS
TCK
TDO
VCCS
GND
GND
GND
GND
GND
nRESET
GND
135791113
2468
101214
VTref
nTRST
TDI
TMS
TCK
RTCK
TDO
nSRST
EDBGRQ
DBGACK
NC
GND
GND
GND
GND
GND
GND
GND
GND
GND
135791113151719
2468
101214161820
20 pin connector
TMS
TDI
VTREF
TDO
RTCK
TCK
EMU0
nTRST
GND
GND
GND
GND
GND
EMU1
135791113
2468
101214
Texas Instruments 14 pin connector
TRACE32TRACE32InstallationInstallation
19
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 installationTRACE32 H/W connection with targetFirmware update and version check
20
S/W installation
Installation guide TRACE32 installation DVD
MDS technology homepage : www.mdstec.comRegistration 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.
21
S/W installation
22
H/W connection .w target
To prevent TRACE32 H/W damage 1. Connect TRACE32 to PC then powered on 2. Connect TRACE32 with target board 3. Execute TRACE32 PowerView S/W on your PC 4. Target powered on
Dis-connection is vice-versa
23
H/W connection .w target
Meaning of LED on TRACE32 POWER
Indicate if power is supplied or not SELECT
Indicate current status of PowerDebug. It is blinking before executing PowerView. After that, LED is
turns on
24
Firmware update and version check
About TRACE32 to version check Firmware means S/W on USB module Recommand to use newly updated version About a year of S/W expiration date
About 1 year of S/W license expiration date is provided
25
Firmware update and version check
How to update your TRACE32 firmware
TRACE32TRACE32BeginningBeginning
26
In this chapter,
Understand Three initialization files of PowerView Meaning of SYStem window
Run a TRACE32 PowerViewconfig.t32 / T32.men / T32.cmmSYStem windowPractice
diag 0x3400 Making simple target initialzation cmm script
27
Run a TRACE32 PowerView
Run T32marm.exe START -> Program -> TRACE32 -> TRACE32 ICD ARM USB OR C:\T32\T32marm.exe
28
Run a TRACE32 PowerView
Three initialization files config.t32
Define interface between host PC and TRACE32 ICDUsing TRACE32 Start recently.
T32.menPowerView basic menu configurationUser menu configuration
T32.cmmDefine extended menu and window configuration of user.
29
SYStem window
Establishing target interface with TRACE32
30
SYStem window
Mode Down
PowerView cannot detect target status whetherphysically connection is made or not.
AttachBasically, drive nTRST to make connection with target. It doesnt
drive nSRST signal to maintain target operation.
UpDrive both nTRST and nSRST to make target interface from
earlier stage.
31
SYStem window
JtagClock Set up TCK frequency which delivering JTAG commands
and datas from / to TRACE32ARM 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
32
Practice
Check commuication with TAP controller Not with ARM core. Just testing communication between
TRACE32 and JTAG TAP controllerRun TRACE32 PowerView. Make SYStem.Down status.Open AREA window Just typing area in command lineTry diag 0x3400 in command line
B:: diag 0x3400
33
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
34
Firmware update and version check
How to update your TRACE32 firmware
Debug ImageDebug ImageDownloadDownload
35
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.
DownloadFile format Binary and ELFDownload using TRACE32Download commandMake improved system.cmm file
36
Download
Download is Copy the image (BIN / HEX / S3 / ELF / EXE ..) files that is
compiled and linked in host PC to the target memory.
HOST PC
SourceFiles
(*.s , *.c)
Image file
(BIN, ELF)Build
download
37
File format Binary and ELF
Binary format Pure codes to execute in target. No information such as address, symbol, checksum
Binary Code
EA000125EA00005DEA000062EA00006D
.. .. ..
.. .. ..
B 0x49CB 0x180B 0x198B 0x1C8
.. .. .. -- -- --
Disassembly
38
File format Binary and ELF
ELF format Executable and Linkable Format
Easy to relocate binary part & dynamic loading.
Debugging information used by TRACE32 is stored in the symbol part.
Header Part
Binary Part
Symbol Part
Logical structure of ELF Format
39
Download using TRACE32
Characteristic Support various file formats
ELF / COFF / BIN / EXE / S3record ..
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 speedRAM : 2Mbyte/secFlash : 2Mbyte/min depends on CPU or Flash type
40
Download using TRACE32
B:: Data.LOAD.ELF phone.elf
ICD
HOST PC
Phone.elf
FLASH
SRAM
B::Data.LOAD.Elf phone.elf
RAM
Binary part of phone.elf
TRACE32 SW
Symbol Part of phone.elf2
ARM 7,9,10 COREARM CORE
TARGET PHONE
FLASH
Symbol Binary
41
Download using TRACE32
Is it possible to download like below? Target Flash Size : 8Mbyte Image(phone.elf) size : 12Mbyte
ICD
HOST PC
ARM 7,9,1
0 CORE
FLASH
SRAM
ARMCORE
TARGET PHONE
FLASH8Mbyte
phone.elf12Mbyte RAM
?
42
Download command Data.LOAD.ELF [/option] Data.LOAD.Binary [/option]
OptionsCompare
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.
43
Practice
Make improved system.cmm
44
Practice
Meaning of each line RESet
Reset the interface between TRACE32 and target
SYStem.CPU s3c2410xSelect the CPU of target. If CPU is not listed, select the CORE.
SYStem.JtagClock 10.mhzSelect the clock frequency of TCK signal
SYStem.UpReset the system with debug mode enabled and halt the target.
45
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 filesIn 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.
46
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--0x3FFFFFSpecify area where only onchip breakpoint is used. For instance,
flash device area is used.
SYStem.Option EnReset / ResBreak / WaitResetAdjust reset signal timing drived by TRACE32
TRACE32TRACE32MenuMenu
CustomizationCustomization
48
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 GUICustomizing the menu barCustomizing the main toolbar
49
TRACE32 menu Main menubar
Main toolbar
Local buttons
Local popup
50
Customizing the GUI Use T32.men file Recommend
B::MENU c:\t32\t32.men
Use *.cmm file like t32.cmmB::MENU.ReProgram
Use this command in *.cmm file and the grammar is same as *.men file
Make new *.men file user can create own *.men fileB::MENU.Program
51
Customizing the GUI Use T32.men file Recommend Use *.cmm file like t32.cmm
Make new *.men file user can create own *.men file
52
Customizing the Main toolbar
ADDTOOLBAR(
SEPARATORTOOLITEM "List Hll Source" "Data.ListHll"[
]
; (use bitmapedit refer next page))
ADDTOOLBAR(
SEPARATORTOOLITEM "List Hll Source DL "Data.ListHll"
)
53
Customizing the Main toolbar
BITMAPEDIT toolbar.men Men files name could be anything as you want
Push the save buttonto save the bitmap to the menu file
choose the color
Define bitmap for the TOOLITEM
54
Customizing the Main toolbar After clicking the save button in front page, you can see the
.men file as you see below
B:: Menu.ReProgram .men
TRACE32TRACE32FeaturesFeatures
56
In this chapter,
Understand The basic features for debugging Breakpoint and practice how to use it
Data.List windowsYmbol.Browse windowData.dump windowRegister windowVar.Watch windowVar.Frame windowBreakpoint
57
Data.List ( View -> List Source ) Main window for debugging Display address, code, assembly code.
Also C source code, if debug symbol image is downloaded
58
Data.List ( View -> List Source )
Open the symbol browser of this source codeMain.c
Return to the function that called the current functionUp
Find the string in HLLFindRun till last instruction of functionReturn
HLL or MIX mode changeModeTo leave a loopNext
Stop program executionBreakExecute the functionOver
Start program executionGoExecute one line of HLL or ASMStep
59
Data.List ( View -> List Source )
To see the symbol information of the current sourceView Info
To edit the source fileEdit Source
Breakpoint configurationBreakpoint
Dialog box of the breakpointBreakpoint...
To open Data.List / View Detailed / Dump window with current address or code as a new address.
Display Memory
To set PC to the location of the current curser.Set PC Here
To run program till the location of the current cursor.Go Till Here
60
sYmbol.Browse ( View->Symbols ) Displays all loaded symbols User can see the source code and set the breakpoint
Content of the sYmbol.BrowseApplication (*.elf, *.axf, *.exe..)C sourceFunction & variables
61
Data.dump ( View->Dump )
Display the data in two kinds of formatsHex / asciiTracking source location in Data.List windowTrack
To see the changes of the memory during the target running. SYStem.CpuAccess.Enable is neededE
Support byte, word, long, quad.. formatsLongModify the value of the memoryModifyFind the value user want in the memoryFind
62
Register ( View->Registers ) Display register value of CPU Possible to modify or set the value
Copy the value of the current registerRegister Copy
Return the value of the register at the last target break.
Register Undo
Return to the state of the time that user did Register.Copy
Register Swap
Change register values to the end of prior function.
Register Up/Down
63
Var.Watch ( View->Watch ) Variable tracking Possible to modify or set the value Replace printf style debugging
Display the information of the variableView
Add a variable to watch windowWatchShow the symbol browseri
Add the variable to watch window directly Variable
input window
64
Var.Watch ( View->Watch ) User can change the display format
65
Var.Frame (Var->Stackframe...) Display the information of the function call stack with
nesting structure
Show caller instruction / function or notCaller
Show the local variables of the functionLocals
Display the value of the argumentsArgs
Vice versa of UpDown
Return to the last condition of the prior function Up
Local variables of function
Last instruction or function name
of caller function
66
Breakpoint
Core providing Breakpoint type Onchip Breakpoint
Breakpoint set address is stored into ICE breaker registerARM7/9 has two and ARM11 and Cortex has 6 (Average)Everywhere if there is address
Software BreakpointUsing trap code 0xBEBEBEBE to halt the targetBackup original code into inst cache Trap code inserting
Target halt Original code is restored
67
Breakpoint
Breakpoint of TRACE32 Program Breakpoint
Set the BP at the program address. Double click in Data.List
Read / Write BreakpointTarget halt when specific variable of memory is read or written.
Spot BrekapointTo monitor the value of memory or variable
Alpha / Beta BreakpointSet the BP on specific path of function call
68
Breakpoint
Breakpoint set Toggle as your double clicking on source line
69
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.
70
Breakpoint
Read / Write Breakpoint
71
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.
72
Breakpoint
Spot Breakpoint
Practice LanguagePractice Language-- CMM script CMM script --
74
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 basicWindow storing to cmmCommand loggingBasic practice commands
75
CMM script basic
Create / edit cmm script B::pedit file_name.cmm
Execute the cmm script B::do file_name.cmm
Debug cmm script
Practice stack display- Program nesting, local / global variable value
76
Window storing
SYStem window B::STOre file_name.cmm system
77
Window storing to cmm
Current window storing B:: STOre file_name.cmm win
78
Command logging
Command log To save the commands that user did.
B::log.open file_name.cmmThen debug your targetWith log.close command, command logging is ended
79
Basic practice commands
Program elements Commands : all commands used by PowerView
Target control : step, break, go...CMM script flow control : if, while, wait, repeat, goto... I/O commands : print, enter, inkey...
FunctionTo get the state information of the target like run() r(pc)
Comments ; or //
LabelAppend : after nale like LABEL:
80
Basic practice commands
Program elements Practice variable
Append & in front of the variable, like &variableDefault is local if declared as global
B::
&i=100 ; local variableGLOBAL &k ; global variable&k=1 ; value assigning&float=1.4e13 ; float is available&address=address.offset(sunny)
print &floatprint &address
ENDDO
&true=(1==1) or &true=(0==0)
&true=(1==0)
True boolean expression
False boolean expression
81
References
Technical support Http://www.mdstec.com Support->FAQ, Q&A, Download, TRACE32 technical support E-mail: trace32@mdstec.com
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
82
Q Q & AA
Recommended