Trace32 基础配置与调试
- 格式:pdf
- 大小:2.11 MB
- 文档页数:58
目录1.系统组成1.1硬件1.1.1主机1.1.2调试电缆1.1.3通过USB与PC连接1.1.4通过JTAG与目标连接1.1.5对PC硬件的要求1.1.6对目标板硬件的要求1.1.7加电1.2软件1.2.1驱动程序的安装2.PowerView调试界面的使用3.1 打开调试界面3.2 JTAG连接设置3.3 运行脚本文件3.4 观察/修改寄存器3.5 观察/修改存储器3.6 下载程序3.7 观察符号表3.8 打开程序列表窗口3.9 单步执行程序3.10 设置软件断点3.11 设置Onchip硬件断点3.12 设置数据观察断点3.13 全速运行程序3.14 停止运行程序3.15 观察变量3.16 观察堆栈3.17 在线Flash编程1.系统组成TRACE-ICP调试系统由硬件和软件两部分组成,硬件是自行研发的,软件是第三方的。
下面分成硬件和软件两部分来介绍。
1.1硬件TRACE-ICP的硬件设计采用模块化的结构,分为主机和调试电缆两部分。
1.1.1主机下面三张照片是TRACE-ICP主机的顶视图和前视图以及后视图。
图一、TRACE-ICP顶视图图二、TRACE-ICP前视图图三、TRACE-ICP后视图在图二中的连接器是标准DB25/M连接器,用于连接调试电缆。
在图三中,有两个连接器和一个LED指示灯。
左边的连接器是USB接口,用于通过USB电缆和PC连接。
右边的连接器是TRACE-ICP的外接5VDC电源接口。
TRACE-ICP可以通过USB供电,在USB供电不足的情况下,使用外接电源。
LED指示灯是TRACE-ICP的电源指示灯。
1.1.2调试电缆下图是TRACE-ICP的调试电缆的照片。
图四、TRACE-ICP的调试电缆TRACE-ICP的调试电缆有两个连接端,一个是标准的DB25/F连接器,用于和TRACE-ICP主机相连,另一个是针距为2.54毫米的标准IDC20连接器,用于和目标板连接。
Trace32基本原理Trace32是一款用于调试和分析嵌入式系统的实时追踪工具。
它提供了强大的功能,可以帮助开发人员在嵌入式系统中定位和解决各种问题。
本文将详细介绍Trace32的基本原理,包括调试器的结构、调试会话的建立和调试过程中的基本操作。
1. 调试器的结构Trace32调试器的整体结构由多个模块组成,包括调试程序、调试接口、调试硬件和调试API。
下面将依次介绍每个模块的功能和原理。
1.1 调试程序:Trace32调试程序是一个运行在宿主主机上的软件,负责控制调试会话的建立、维护和管理。
它提供了用户界面和命令行接口,可以通过图形界面或命令行输入指令来控制调试会话。
1.2 调试接口:Trace32调试接口是连接目标系统和调试程序的桥梁,用于传输调试指令和数据。
它可以通过串口、以太网、USB等方式与目标系统进行通信。
调试接口还负责解析和执行调试指令,并将调试结果返回给调试程序。
1.3 调试硬件:Trace32调试硬件是一种嵌入在目标系统中的硬件模块,用于实时监控和跟踪目标系统的运行状态。
它可以通过调试接口与调试程序进行通信,并提供实时调试数据的获取和传输功能。
1.4 调试API:Trace32调试API是一组用于访问和控制Trace32调试器的接口和函数。
开发人员可以使用这些API来编写自定义的调试脚本和工具,实现自动化的调试和分析过程。
2. 调试会话的建立为了开始调试一个目标系统,首先需要建立一个调试会话。
调试会话是Trace32与目标系统之间的通信通道,通过这个通道可以传输和接收调试指令和数据。
建立调试会话的过程一般包括以下几个步骤:2.1 配置调试硬件:首先需要连接和配置Trace32调试硬件与目标系统的连接方式。
可以通过串口、以太网、USB等方式连接调试硬件,并设置相应的通信参数。
2.2 加载调试程序:在宿主主机上启动Trace32调试程序,并加载与目标系统对应的调试程序。
调试程序将根据目标系统的体系结构和硬件情况,自动适配对应的调试接口和硬件。
Blackfin Debugger Release 09.2023Blackfin DebuggerTRACE32 Online HelpTRACE32 DirectoryTRACE32 IndexTRACE32 Documents ......................................................................................................................ICD In-Circuit Debugger ................................................................................................................Processor Architecture Manuals ..............................................................................................Blackfin ....................................................................................................................................Blackfin Debugger (1)Introduction (4)Brief Overview of Documents for New Users4 Demo and Start-up Scripts5 Location of Debug Connector5Warning (5)Quick Start JTAG (6)Troubleshooting (8)SYStem.Up Errors8FAQ (8)Configuration (9)System Overview9Blackfin specific SYStem Commands (10)SYStem.CONFIG Configure debugger according to target topology10 Daisy-Chain Example13 TapStates14 SYStem.CONFIG.CORE Assign core to TRACE32 instance15 SYStem.CPU CPU type selection16 SYStem.JtagClock JTAG clock selection17 SYStem.LOCK Lock and tristate the debug port17 SYStem.MemAccess Real-time memory access (non-intrusive)18 SYStem.Mode System mode selection19 SYStem.Option.IMASKASM Interrupt disable19 SYStem.Option.IMASKHLL Interrupt disable20Breakpoints (21)Software Breakpoints21 On-chip Breakpoints21 Breakpoint in ROM21Example for Breakpoints22 Memory Classes (23)CPU specific TrOnchip Commands (24)JTAG Connector (25)Blackfin DebuggerVersion 10-Oct-2023 IntroductionThis document describes the processor specific settings and features for the Blackfin Embedded Media Processor. TRACE32-ICD supports all Blackfin devices which are equipped with the JT AG debug interface.Please keep in mind that only the Processor Architecture Manual (the document you are reading at the moment) is CPU specific, while all other parts of the online help are generic for all CPUs supported by Lauterbach. So if there are questions related to the CPU, the Processor Architecture Manual should be your first choice.If some of the described functions, options, signals or connections in this Processor Architecture Manual are only valid for a single CPU the name is added in brackets.Brief Overview of Documents for New UsersArchitecture-independent information:•“Training Basic Debugging” (training_debugger.pdf): Get familiar with the basic features of a TRACE32 debugger.•“T32Start” (app_t32start.pdf): T32Start assists you in starting TRACE32 PowerView instances for different configurations of the debugger. T32Start is only available for Windows.•“General Commands” (general_ref_<x>.pdf): Alphabetic list of debug commands.Architecture-specific information:•“Processor Architecture Manuals”: These manuals describe commands that are specific for the processor architecture supported by your Debug Cable. T o access the manual for your processorarchitecture, proceed as follows:-Choose Help menu > Processor Architecture Manual.•“OS Awareness Manuals” (rtos_<os>.pdf): TRACE32 PowerView can be extended for operating system-aware debugging. The appropriate OS Awareness manual informs you how to enable theOS-aware debugging.Demo and Start-up ScriptsLauterbach provides ready-to-run start-up scripts for known Blackfin based hardware.To search for PRACTICE scripts, do one of the following in TRACE32 PowerView:•Type at the command line: WELCOME.SCRIPTS•or choose File menu > Search for Script.Y ou can now search the demo folder and its subdirectories for PRACTICE start-up scripts(*.cmm) and other demo software.Y ou can also manually navigate in the ~~/demo/blackfin/ subfolder of the system directory ofTRACE32.Location of Debug ConnectorLocate the debug connector on your target board as close as possible to the processor to minimize the capacitive influence of the trace length and cross coupling of noise onto the JT AG signals. WarningSignal LevelThe debugger output voltage follows the target voltage level. It supports a voltage range of 0.4…5.2V. ESD ProtectionNOTE:T o prevent debugger and target from damage it is recommended to connect ordisconnect the debug cable only while the target power is OFF.Recommendation for the software start:•Disconnect the debug cable from the target while the target power is off.•Connect the host system, the TRACE32 hardware and the debug cable.•Start the TRACE32 software.•Connect the debug cable to the target.•Switch the target power ON.Power down:•Switch off the target power.•Disconnect the debug cable from the target.Quick Start JTAGStarting up the debugger is done as follows:1.Select the device prompt B: for the ICD Debugger, if the device prompt is not active after the TRACE32 software was started.2.Select the CPU type to load the CPU specific settings.3.Enter debug mode:This command resets the CPU and enters debug mode. After the execution of this command access to the registers and to memory is possible. Before performing the first access to external SDRAM or FLASH the External Bus Interface Unit (EBIU) must be configured.4.The following command sequence is for the BF537 processor and configures the SDRAM controller with default values that were derived for maximum flexibility. They work for a system clock frequency between 54MHz and 133MHz.In the example a ST M29W320DB flash device is used in 16-bit mode. All four memory banks and CLKOUT are enabled.B:SYStem.CPU BF537SYStem.Up; configure SDRAM controllerData.Set 0xFFC00A1sLONG 0x0091998D Data.Set 0xFFC00A14 %WORD 0x0025Data.Set 0xFFC00A1C %WORD 0x03A0; EBIU_SDGCTL ; EBIU_SDBCTL ; EBIU_SDRRC; enable all flash memory banks and clock outData.Set 0xFFC00A00 %WORD 0x00FF; EBIU_AMGCTL; ST M29W320DB flash device in 16-bit modeFLASH.Create 1. 0x20000000--0x20003FFF 0x4000 AM29LV100 Word FLASH.Create 1. 0x20004000--0x20007FFF 0x2000 AM29LV100 Word FLASH.Create 1. 0x20008000--0x2000FFFF 0x8000 AM29LV100 Word FLASH.Create 1. 0x20010000--0x203FFFFF 0x10000 AM29LV100 Word5.Load the program.Data.LOAD.Elf demo.dxe; The file demo.dxe is in ELF format The option of the Data.LOAD command depends on the file format generated by the compiler. A detailed description of the Data.LOAD command is given in the “General Commands Reference”. The start-up sequence can be automated using the programming language PRACTICE. A typical start sequence is shown below. This sequence can be written to a PRACTICE script file (*.cmm, ASCII format) and executed with the command DO<file>.B::; Select the ICD device promptWinClear; Delete all windowsSYStem.CPU BF537; select the processorSYStem.Up; Reset the target and enter debug modeData.Load.Elf sieve.dxe; Load the applicationRegister.Set PC main; Set the PC to function mainList.Mix; Open disassembly window *) Register.view; Open register window *) PER.view; Open window with peripheral register *) Break.Set sieve; Set breakpoint to function sieveBreak.Set 0x1000 /p; Set on-chip breakpoint to address 1000; Refer to the restrictions in; On-chip Breakpoints.*) These commands open windows on the screen. The window position can be specified with the WinPOS command.TroubleshootingSYStem.Up ErrorsThe SYStem.Up command is the first command of a debug session where communication with the target is required. If you receive error messages while executing this command this may have the following reasons.All The target has no power.All There are additional loads or capacities on the JTAG lines.All The JTAG clock is too fast.FAQPlease refer to https:///kb.Configuration System OverviewBlackfin specific SYStem CommandsSYStem.CONFIG Configure debugger according to target topologyThe four parameters IRPRE, IRPOST , DRPRE, DRPOST are required to inform the debugger about the T AP controller position in the JT AG chain, if there is more than one core in the JT AG chain (e.g. ARM + DSP). The information is required before the debugger can be activated e.g. by a SYStem.Up . See Daisy-chain Example .For some CPU selections (SYStem.CPU ) the above setting might be automatically included, since the required system configuration of these CPUs is known.T riState has to be used if several debuggers (“via separate cables”) are connected to a common JT AG port at the same time in order to ensure that always only one debugger drives the signal lines. T APState and TCKLevel define the T AP state and TCK level which is selected when the debugger switches to tristate mode. Please note: nTRST must have a pull-up resistor on the target, TCK can have a pull-up or pull-down resistor, other trigger inputs need to be kept in inactive state.Format:SYStem.CONFIG <parameter> <number_or_address>SYStem.MultiCore <parameter> <number_or_address> (deprecated)<parameter>:CORE <core><parameter>:(JTAG):DRPRE <bits>DRPOST <bits>IRPRE <bits>IRPOST <bits>DAPDRPOST <bits>DAPDRPRE <bits>DAPIRPOST <bits>DAPIRPRE <bits>TAPState <state>TCKLevel <level>TriState [ON | OFF ]Slave [ON | OFF ]DEBUGPORTTYPE [JTAG | SWD ]SWDPIDLEHIGH [ON | OFF ]SWDPTargetSel <value>CORE For multicore debugging one TRACE32 PowerView GUI has to be startedper core. To bundle several cores in one processor as required by thesystem this command has to be used to define core and processorcoordinates within the system topology.Further information can be found in SYStem.CONFIG.CORE.… DRPOST <bits>Defines the TAP position in a JT AG scan chain. Number of TAPs in theJTAG chain between the TDI signal and the TAP you are describing. InBYPASS mode, each TAP contributes one data register bit. See possibleTAP types and example below.Default: 0.… DRPRE <bits>Defines the TAP position in a JT AG scan chain. Number of TAPs in theJTAG chain between the TAP you are describing and the TDO signal. InBYPASS mode, each TAP contributes one data register bit. See possibleTAP types and example below.Default: 0.… IRPOST <bits>Defines the TAP position in a JT AG scan chain. Number of InstructionRegister (IR) bits of all TAPs in the JT AG chain between TDI signal andthe TAP you are describing. See possible T AP types and example below.Default: 0.… IRPRE <bits>Defines the TAP position in a JT AG scan chain. Number of InstructionRegister (IR) bits of all TAPs in the JTAG chain between the T AP you aredescribing and the TDO signal. See possible TAP types and examplebelow.Default: 0.TAPState(default: 7 = Select-DR-Scan) This is the state of the TAP controller whenthe debugger switches to tristate mode. All states of the JTAG T APcontroller are selectable.TCKLevel (default: 0) Level of TCK signal when all debuggers are tristated. TriState(default: OFF) If several debuggers share the same debug port, thisoption is required. The debugger switches to tristate mode after eachdebug port access. Then other debuggers can access the port. JT AG:This option must be used, if the JTAG line of multiple debug boxes areconnected by a JTAG joiner adapter to access a single JTAG chain. Slave(default: OFF) If more than one debugger share the same debug port, allexcept one must have this option active.JTAG: Only one debugger - the “master” - is allowed to control the signalsnTRST and nSRST (nRESET).DEBUGPORTTYPE [JTAG | SWD]It specifies the used debug port type “JT AG”, “SWD”. It assumes the selected type is supported by the target.Default: JT AG.SWDPIdleHigh [ON | OFF]Keep SWDIO line high when idle. Only for Serialwire Debug mode. Usually the debugger will pull the SWDIO data line low, when no operation is in progress, so while the clock on the SWCLK line is stopped (kept low).Y ou can configure the debugger to pull the SWDIO data linehigh, when no operation is in progress by usingSYStem.CONFIG SWDPIdleHigh ONDefault: OFF.SWDPTargetSel<value>Device address in case of a multidrop serial wire debug port.Default: none set (any address accepted).Daisy-Chain ExampleBelow, configuration for core C.Instruction register length of •Core A: 3 bit •Core B: 5 bit •Core D: 6 bitSYStem.CONFIG.IRPRE 6.; IR Core D SYStem.CONFIG.IRPOST 8.; IR Core A + B SYStem.CONFIG.DRPRE 1.; DR Core D SYStem.CONFIG.DRPOST 2.; DR Core A + BSYStem.CONFIG.CORE 0. 1.; Target Core C is Core 0 in Chip 1Core A Core B Core CCore D TDOTDI Chip 0Chip 1TapStates0Exit2-DR1Exit1-DR2Shift-DR3Pause-DR4Select-IR-Scan5Update-DR6Capture-DR7Select-DR-Scan8Exit2-IR9Exit1-IR10Shift-IR11Pause-IR12Run-Test/Idle13Update-IR14Capture-IR15Test-Logic-ResetSYStem.CONFIG.CORE Assign core to TRACE32 instance Format:SYStem.CONFIG.CORE<core_index><chip_index>SYStem.MultiCore.CORE<core_index><chip_index> (deprecated) <chip_index>:1 (i)<core_index>:1…kDefault core_index: depends on the CPU, usually 1. for generic chipsDefault chip_index: derived from CORE= parameter of the configuration file (config.t32). The COREparameter is defined according to the start order of the GUI in T32Start with ascending values.T o provide proper interaction between different parts of the debugger, the systems topology must bemapped to the debugger’s topology model. The debugger model abstracts chips and sub cores of these chips. Every GUI must be connect to one unused core entry in the debugger topology model. Once the SYStem.CPU is selected, a generic chip or non-generic chip is created at the default chip_index.Non-generic ChipsNon-generic chips have a fixed number of sub cores, each with a fixed CPU type.Initially, all GUIs are configured with different chip_index values. Therefore, you have to assign thecore_index and the chip_index for every core. Usually, the debugger does not need further information to access cores in non-generic chips, once the setup is correct.Generic ChipsGeneric chips can accommodate an arbitrary amount of sub-cores. The debugger still needs information how to connect to the individual cores e.g. by setting the JT AG chain coordinates.Start-up ProcessThe debug system must not have an invalid state where a GUI is connected to a wrong core type of a non-generic chip, two GUIs are connected to the same coordinate or a GUI is not connected to a core. The initial state of the system is valid since every new GUI uses a new chip_index according to its CORE= parameter of the configuration file (config.t32). If the system contains fewer chips than initially assumed, the chips must be merged by calling SYStem.CONFIG.CORE.SYStem.CPU CPU type selection Format:SYStem.CPU <cpu><cpu>:BF531 | BF532 | BF533 | BF534…Default selection: BF534.Selects the CPU type.SYStem.JtagClock JT AG clock selection Format:SYStem.JtagClock [<frequency>]SYStem.BdmClock<frequency>(deprecated)Default frequency: 1MHz.Selects the JT AG port frequency (TCK). Any frequency up to 50MHz can be entered, it will be generated by the debuggers internal PLL.For CPUs which come up with very low clock speeds it might be necessary to slow down the JT AGfrequency. After initialization of the CPUs PLL the JT AG clock can be increased.SYStem.LOCK Lock and tristate the debug port Format:SYStem.LOCK [ON | OFF]Default: OFF.If the system is locked, no access to the debug port will be performed by the debugger. While locked, the debug connector of the debugger is tristated. The main intention of the SYStem.LOCK command is to give debug access to another tool.SYStem.MemAccess Real-time memory access (non-intrusive) Format:SYStem.MemAccess Denied | StopAndGo | BTCBTC“BTC” allows a non-intrusive memory access while the core is running, if aBackground T elemetry Channel (BTC) is defined in your application. Anyinformation on how to create such a channel can be found in AnalogDevices’ VisualDSP++ user’s manual. The JT AG clock speed should be asfast as possible to get good performanceDenied Real-time memory access during program execution to target is disabled.StopAndGo Temporarily halts the core(s) to perform the memory access. Each stoptakes some time depending on the speed of the JT AG port, the number ofthe assigned cores, and the operations that should be performed.SYStem.Mode System mode selectionFormat:SYStem.Mode <mode>SYStem.Attach (alias for SYStem.Mode Attach)SYStem.Down (alias for SYStem.Mode Down)SYStem.Up (alias for SYStem.Mode Up)<mode>:DownGoAttachUpDown Disables the debugger.Go Resets the target with debug mode enabled and prepares the CPU fordebug mode entry. After this command the CPU is in the system.upmode and running. Now, the processor can be stopped with the breakcommand or if a break condition occurs.Attach User program remains running (no reset) and the debug interface isinitialized.Up Resets the target and sets the CPU to debug mode. After execution ofthis command the CPU is stopped and prepared for debugging.StandBy Not supported.NoDebug Not supported.SYStem.Option.IMASKASM Interrupt disable Format:SYStem.Option.IMASKASM [ON | OFF]Mask interrupts during assembler single steps. Useful to prevent interrupt disturbance during assembler single stepping.SYStem.Option.IMASKHLL Interrupt disable Format:SYStem.Option.IMASKHLL [ON | OFF]Mask interrupts during HLL single steps. Useful to prevent interrupt disturbance during HLL single stepping.BreakpointsThere are two types of breakpoints available: software breakpoints and on-chip breakpoints. Software BreakpointsSoftware breakpoints are the default breakpoints. A special breakcode is patched to memory so it only can be used in RAM or FLASH areas.There is no restriction in the number of software breakpoints.On-chip BreakpointsThe Blackfin processor has a total of six instruction and two data on-chip breakpoints.A pair of two breakpoints may be further grouped together to form a range breakpoint. A range breakpointcan be including or excluding. In the first case the core is stopped if an address in the range is detected, in the second case the core is stopped when an address outside of the range is observed.Breakpoint in ROMWith the command MAP.BOnchip<range> it is possible to inform the debugger about ROM(FLASH,EPROM) address ranges in target. If a breakpoint is set within the specified address range the debugger uses automatically the available on-chip breakpoints.Example for BreakpointsAssume you have a target with FLASH from 0x20000000 to 0x200FFFFF and RAM from 0x0 to 0x1000000. The command to configure TRACE32 correctly for this configuration is: Map.BOnchip 0x20000000--0x200FFFFFThe following breakpoint combinations are possible.Software breakpoints:Break.Set 0x0 /Program; Software Breakpoint 1Break.Set 0x1000 /Program; Software Breakpoint 2On-chip breakpoints:Break.Set 0x20000100 /Program; On-chip Breakpoint 1Break.Set 0x2000ff00 /Program; On-chip Breakpoint 2Memory ClassesThe following memory classes are available: Memory Class DescriptionP ProgramD DataCPU specific TrOnchip CommandsThe TrOnchip command group is not available for the Blackfin debugger.JTAG ConnectorSignal Pin Pin SignalGND12EMU-N/C34GNDVDDIO56TMSN/C78TCKN/C910TRST-N/C1112TDIGND1314TDOJTAG Connector Signal Description CPU Signal TMS JTAG-TMS,TMSoutput of debuggerTDI TDI JTAG-TDI,output of debuggerTCK TCK JTAG-TCK,output of debugger/TRST /TRST JTAG-TRST,output of debuggerTDO TDO JTAG-TDO,input for debugger/EMU JTAG Emulation Flag /EMUVDDIO VDDIO This pin is used by the debugger to sense the targetI/O voltage and to set the drive levels accordingly. Ifthe sensed voltage level is too low (e.g. target has nopower) the debugger powers down its drivers toprevent the target from damage.。
T race T utorial Release 02.2023TRACE32 Online HelpTRACE32 DirectoryTRACE32 IndexTRACE32 Debugger Getting Started ..............................................................................................Trace Tutorial (1)History (3)About the Tutorial (3)What is Trace? (3)Trace Use Cases4Trace Methods (5)Simulator Demo (6)Trace Configuration (7)Trace Recording (8)Displaying the Trace Results (10)Trace List10 Displaying Function Run-Times13 Graphical Charts13 Numerical Statistics and Function Tree14 Duration Analysis15 Distance Analysis16 Variable Display17 Track Option18Searching Trace Results (19)Trace Save and Load (20)Version 10-Feb-2023 History18-Jun-21New manual.About the TutorialThis tutorial is an introduction to the trace functionality in TRACE32. It shows how to perform a tracerecording and how to display the recorded trace information.For simplicity, we use in this tutorial a TRACE32 Instruction Set Simulator, which offers a full tracesimulation. The steps and features described in this document are however valid for all TRACE32 products with trace support.The tutorial assumes that the TRACE32 software is already installed. Please refer to “TRACE32Installation Guide” (installation.pdf) for information about the installation process.Please refer to “ICD Tutorial” (icd_tutorial.pdf) for an introduction to debugging in TRACE32 PowerView. What is Trace?T race is the continuous recording of runtime information for later analysis. In this tutorial, we use the term trace synonymously with core trace. A core trace generates information about program execution on a core,i.e. program flow and data trace. The TRACE32 Instruction Set Simulator used in this tutorial supports a fulltrace simulation including the full program flow as well as all read and write data accesses to the memory. A real core may not support all types of trace information. Please refer to your Processor Architecture Manual for more information.Trace Use CasesT race is mainly used in the following cases:1.Understand the program execution in detail in order to find complex runtime errors more quickly.2.Analysis of the code performance of the target code3.Verification of real-time requirements4.Code-coverage measurementsTrace MethodsTRACE32 supports various trace methods. The trace method can be selected in the Trace configuration window, which can be opened from the menu Trace > Configuration…If a trace method is not supported by the current hardware/software setup, it is greyed out in the trace configuration window. NONE means that no trace method is selected.We use in this tutorial the trace method Analyzer. Please refer to the description of the commandTrace.METHOD for more information about the different trace methods.Simulator DemoWe use in this tutorial a TRACE32 Simulator for Arm. The described steps are however valid for the TRACE32 Simulator for other core architectures.T o load a demo on the simulator, follow these steps:1.Start the script search dialog from the menu File > Search for scripts…2.Enter in the search field “compiler demo”3.Select a demo from the list with a double click, a PSTEP window will appear. Press the“Continue” button.We will use here the demo “GNU C Example for SRAM”.Trace ConfigurationIn order to set up the trace, follow these steps:1.Open the menu Trace > Configuration… The trace method Analyzer [A] should be selected perdefault. If this is not the case, select this trace method2.Clear the contents of the trace buffer by pressing the Init button [B].3.Select the trace operation mode [C].In mode Fifo , new trace records will overwrite older records. The trace buffer includes thus always the last trace cycles before stopping the recording.In Mode Stack , the recording is stopped if the trace buffer is full. The trace buffer always includes in this case the first cycles after starting the recording.Mode Leash is similar to mode Stack , the program execution is however stopped when the trace buffer is nearly full.TRACE32 supports other trace modes. Some of these modes depend on the core architecture. Please refer to the documentation of the command Trace.Mode for more information. We will keep here the default trace mode selection, which is Fifo .4.The SIZE field [D] indicates the size of the trace buffer. As we are using a TRACE32 Simulator, the trace buffer is reserved by the TRACE32 PowerView application on the host. It is thuspossible to increase the size of this buffer. If a TRACE32 trace hardware is used with a real chip, the size of the trace buffer is limited by the size of the memory available on the trace tool.In order to have a longer trace recording, we will set the trace buffer size to 10000000.BACDThe same configuration steps can be performed using the following PRACTICE script:Trace RecordingPress the Go button to start the program execution.The trace recording is automatically started with the program execution. The state in the Trace window changes from OFF to Arm [A]. The used field displays the fill state of the trace buffer [B].In order to stop the trace recording, stop the program execution with the Break button. The state in the trace window changes to OFF .Trace.METHOD Analyzer Trace.InitTrace.Mode FifoTrace.SIZE 10000000.BACThe trace recording is automatically started and stopped when starting and stopping the program execution because of the AutoArm[C] setting in the Trace window, which is per default enabled. The trace recording can also be started/stopped manually while the program execution is running using the radio buttons Armand OFF of the Trace window [A].Displaying the Trace ResultsTRACE32 offers different view for displaying the trace results. This document shows some examples.Please note that the trace results can only be displayed if the trace state in the Trace window is OFF. It is not possible to display the trace results while recording.The caption of a TRACE32 window includes the TRACE32 command that can be executed in the TRACE32 command line or in a PRACTICE script to open this window, e.g. here Trace.ListTrace ListA list view of the trace results can be opened from the menu T race > List > Default. The same window canbe opened from the Trace configuration window by pressing the List button.The Trace.List window displays the recorded trace packets together with the corresponding assembler and source code.In our case, trace packets are program fetches (cycle fetch) or data accesses (e.g. wr-long and rd-long for 32bit write and read accesses). Each trace packet has a record number displayed in the record column. The record number is a negative index for Fifo mode.As we are using a Simulator, each assembly instruction has an own trace packet. This is not the case with a real hardware trace.The displayed information can be reduced using the Less button. By pressing Less three times, only the high-level source code is displayed. This can be reverted using the More button.A double click on a line with an assembly instruction or high-level source code opens a List window showing the corresponding line in the code.Using the TRACE32 menu Trace > List > Tracing with Source , you get a Trace.List and a List /Track window. When doing a simple click on a line in the Trace.List window, the List window will automaticallydisplay the corresponding code line.The timing information (see ti.back column) is generated in this case by the TRACE32 Instruction Set Simulator. With a real core trace, timestamps are either generated by the TRACE32 trace hardware or by the onchip trace module.Double clickSimpleclickDisplaying Function Run-TimesTRACE32 supports nested and flat function run-time analysis based on the trace results. Please refer to the video “Flat vs. Nesting Function Runtime Analysis” for an introduction to function run-time analysis inTRACE32:/tut_profiling.htmlGraphical ChartsBy selecting the menu Trace > Chart > Symbols, you can get a graphical chart that shows the distribution of program execution time at different symbols. The displayed results are based on a flat analysis:The corresponding nesting analysis can be displayed using the menu Perf > Function Runtime > Show as Timing.The In and Out buttons can be used to zoom in/out. Alternatively, you can select a position in the window and then use the mouse wheel to zoom in/out.Numerical Statistics and Function TreeThe menu entry Perf > Function Runtime >Show Numerical displays numerical statistics for each function with various information as total run-time, minimum, maximum and average run-times, ratio, and number of function calls.ABParents [A] displays for example a caller tree for the selected function. By doing a right mouse click on func1 and selecting Parents, we see the run-times of the functions func2 and func9, which have called func1 in thetrace recording.Children [B] displays the run-times of the functions called by the selected function, for example here the function subst called by the function encode.A function call tree view of all function recorded in the trace can be displayed using the menu entries Perf >Function Runtime > Show as Tree or Perf > Function Runtime > Show Detailed Tree.Duration AnalysisBy doing a right mouse click on a function in the numerical statistics window (Trace.STATistic.Func) then selecting Duration Analysis, you get an analysis of the function run-times between function entry and exit including the time spent in called subroutines, e.g. here for the function subst (P:0x114C corresponds to the start address of the subst function):The time interval can be changed using the Zoom buttons.Distance AnalysisBy doing a right mouse click on a function in the numerical statistics window (Trace.STATistic.Func) then selecting Distance Analysis, you can get run-times between two consecutive calls of the selected function,e.g. here for the function subst (P:0x114C corresponds to the start address of the subst function):Variable DisplayThe Trace.ListVar command allows to list recorded variables in the trace. If the command is used without parameters all recorded variables are displayed:Y ou can optionally add one or multiple variables as parameters.Example: display all accesses to the variables plot1 and plot2The Draw button can then be used to plot the displayed variables graphically against time. This corresponds to the following TRACE32 command:Please refer for more information about the Trace.DRAW command to “Application Note forTrace.DRAW” (app_trace_draw.pdf).Trace.ListVar Trace.ListVar %DEFault plot1 plot2Trace.DRAW.Var %DEFault plot1 plot2Track OptionThe /Track options allows to track windows that display the trace results. Y ou just need to add the /Track option after the command that opens a trace window, e.g.Trace.List /TrackThe cursor will then follow the movement in other trace windows, e.g. Trace.Chart.Func. Default is time tracking. If no time information is available, tracking to record number is performed.TRACE32 windows that displays the trace results graphically, e.g. Trace.Chart.Func, additionally accept the /ZoomTrack option. If the tracking is performed with another graphical window, the same zoom factor is used in this case.Trace.Chart.Func /ZoomTrackSearching Trace ResultsThe Find button allows to search for specific information in the trace results.Example 1: find the first call of function func21.Enter “func2” under address / expression2.Select Program under cycle3.Press the Find First button. The next entries to func2 in the trace can then be found using theNext buttonExample 2: Find all write accesses to the variable mstatic1 with the value 0x01.Enter “mstatic1” under address / expression2.Select Write under cycle3.Enter 0x0 under Data4.Press the Find All buttonPlease refer to “Application Note for Trace.Find” (app_trace_find.pdf) for more information about Trace.Find.Trace Save and LoadThe recorded trace can be stored in a file using the command Trace.SAVE , e.g.The saved file can then be loaded in TRACE32 PowerView using the command Trace.LOADThe TRACE32 trace display windows will show in this case a LOAD message in the low left cornerPlease note that TRACE32 additionally allows to export/import the trace results in different formats. Refer to the documentation of the command groups Trace.EXPORT and Trace.IMPORT for more information. Trace.SAVE file.adTrace.LOAD file.ad。
TRACE32调试技巧1.掌握TRACE32命令语法。
TRACE32使用一种类似于汇编语言的命令语法,了解和熟悉这些命令可以提高对调试环境的理解和使用。
2.使用TRACE32的源代码浏览和功能。
TRACE32可以直接打开源代码文件,并支持跳转、和定位到指定代码位置。
这个功能非常有用,可以提供更详细的调试信息。
3.使用断点和观察点。
TRACE32支持不同类型的断点和观察点,包括地址断点、条件断点、数据断点等。
合理使用这些断点和观察点可以精确地定位问题和跟踪变量值的变化。
4.使用TRACE32的软件仿真功能。
TRACE32可以模拟目标系统的操作环境,并在主机上进行软件调试。
这种模拟可以提供更快速和安全的调试环境,同时也方便了调试任务的并行执行。
5.学会使用TRACE32的事件记录功能。
TRACE32可以记录目标系统的事件流,并生成详细的事件记录文件。
这些文件可以被用于分析目标系统的运行状态、调试问题和优化性能。
6.添加自定义的TRACE32脚本和命令。
TRACE32支持用户自定义脚本和命令,可以根据实际需要扩展和定制TRACE32的功能。
这可以帮助提高调试效率,并解决特定的调试问题。
7.学习TRACE32的调试工具链集成。
TRACE32可以与其他开发工具集成,包括编译器、汇编器、链接器和性能分析器等。
学习如何使用TRACE32和这些工具一起工作,可以提供更完整的调试解决方案。
8.利用TRACE32的调试数据可视化功能。
TRACE32可以通过图表、图像和统计数据来展示和分析调试数据。
这可以帮助开发人员更直观地理解和评估调试结果。
9.使用TRACE32的远程调试功能。
TRACE32支持通过网络远程调试目标系统,这对于分布式系统开发和调试非常有用。
远程调试可以提供灵活性和便利性,减少不必要的移动和安装工作。
10.参考TRACE32的在线文档和示例。
TRACE32提供了全面的在线文档和示例,可以帮助开发人员更好地理解和使用TRACE32、学习这些文档和示例是提高TRACE32调试技巧的有效途径。
TRACE32调试技巧1. 调试步骤l 连接好 TRACE32-ICD 和目标板,注意不要带电插拔 JTAG ,容易损坏 TRACE32 或目标板,然后依次打开 TRACE32-ICD 和目标板的电源。
l 开启调试软件 TRACE32l 设置 CPU 类型,状态等,可以通过命令或菜单,命令如下:sys.resetsys.CPU ARM7TDMI ; 这里设置 CPU 类型sys.up ; 启动调试,如果正常的话,状态为 system.ready; 否则会报错,需要检查 CPU 设置是否正确,TRACE32 和目标板的连接和电源是否正常如果调试正常启动后,就可以下载编译好的文件(可以是 .elf 、 .binary 等文件)到 RAM 或 FLASH 中调试了l 下载编译文件,命令如下:data.load.elf E:/source/test.elf /PATH E:/source这里的/PATH选项是用来指明源代码的路径,在调试时TRACE就可以查找到源代码了。
这里 TRACE会根据 .elf 文件里包含的目标代码起始地址加载到 RAM 的对应地址上,也可以指定加载到 RAM 的地址,但须和编译时的设置一致,否则程序不能正常运行。
注: TRACE 也可以把编译目标文件烧录到 flash 中进行调试,需要使用 flash 烧录相关命令,这里就不详述了。
l 然后就可以设置断点进行调试了,如:break.set 0x0c008000TRACE32 的断点有两种,一种是硬件断点(在 FLASH 中的断点),另一种是软断点(在 RAM 中的断点);硬件断点需要 CPU 的支持,如 ARM7 最多只支持 2 个硬件断点,如果使用了软断点的话,就只能使用一个硬断点了;而软断点没有限制,可以设置很多个。
注:在TRACE32中,如果要使用硬件断点,需要先设置好FLASH内存映射范围,如下命令:Map.bonchip 0x0000--0xfffff ; 具体范围根据目标板 FLASH 的范围设置l 设置好断点就可以正常调试了。
trace32使用手册-图文Trace32是一款功能强大的实时调试和跟踪工具,它支持多种处理器和微控制器的开发和调试。
它具有丰富的调试功能和直观的图形用户界面,可帮助开发人员快速定位和解决软件缺陷。
本文将详细介绍Trace32的使用方法,包括环境配置、调试基本操作以及常用命令。
一、环境配置在开始使用Trace32之前,我们需要进行一些环境配置。
首先,我们需要将Trace32安装到开发计算机上。
在安装完成后,我们需要配置Trace32与目标设备的连接。
具体步骤如下:1. 连接目标设备的调试接口和开发计算机的引导接口。
这样,我们就可以通过Trace32连接到目标设备。
2. 启动Trace32,并选择"Connect"选项。
然后,选择适配器和目标设备的连接方式。
3.配置连接选项,包括目标设备的型号和调试接口。
4. 完成连接配置后,点击"Connect"按钮,Trace32将尝试与目标设备建立连接。
二、调试基本操作Trace32提供了一系列的调试工具和选项,可以帮助开发人员定位和修复软件错误。
下面是一些常见的调试操作:2. 设置断点。
Trace32允许我们在软件的特定位置设置断点,以便在执行到断点位置时暂停软件运行。
我们可以通过命令行或图形界面设置断点,以及设置条件断点和硬件断点。
3.单步调试。
当软件执行到断点或者处于暂停状态时,我们可以使用单步调试功能,逐条指令地执行软件。
这样,我们可以更加详细地了解软件的执行过程,并分析软件的状态和变量值。
4. 查看寄存器和变量值。
Trace32允许我们查看目标设备上的寄存器和变量的值。
我们可以通过Trace32的寄存器窗口或变量窗口查看这些值,并在调试过程中对这些值进行修改。
5. 追踪函数调用和函数返回。
Trace32可以追踪函数的调用和返回过程,以帮助开发人员理解软件的执行流程和函数调用关系。
6. 监视程序性能。
Trace32可以监视程序的性能指标,如执行时间、内存占用等。
trace32 基本原理Trace32是一款非常强大的调试工具,能够为嵌入式系统调试提供丰富的支持。
那么,Trace32是如何实现这些功能的呢?下面我们来分析一下Trace32的基本原理。
一、Trace32的基本组成部分Trace32由两个主要组成部分组成:第一部分是宿主机软件,主要是调试器;第二部分是目标系统模块,主要是调试接口。
1.宿主机软件:Trace32调试器运行在宿主机上,包含了各种调试工具和特性,主要负责对目标系统进行控制和监视。
2.目标系统模块:目标系统模块主要是负责将目标系统的状态信息传输给宿主机,包括CPU寄存器、内存,以及外设的状态信息。
二、Trace32的工作原理Trace32的工作原理可以分为以下几个部分:1.调试连接建立:连接建立是Trace32的第一步,在连接建立过程中,调试器会扫描目标系统的CPU状态和内存状态,以确定目标系统的当前状态。
2.数据采集:采集数据是Trace32的核心功能之一,通过Trace32能够采集目标系统的各种信息,包括内存、外设和CPU等。
3.数据传输:Trace32采集到的数据需要传输给宿主机,以便分析和调试。
可以通过Trace32提供的各种接口和协议来实现数据传输。
4.数据分析和调试:Trace32在传输数据的同时,提供了丰富的分析和调试工具,包括数据跟踪、事件控制、信号分析等,以帮助开发人员快速发现并解决系统问题。
三、Trace32的特性和优点除了基本原理,Trace32还具有以下特性和优点:1.支持多种处理器架构:Trace32支持多种处理器架构,如ARM,MIPS 等。
2.快速的操作速度:Trace32具有快速的操作速度,能够实时监视和控制目标系统,以及快速数据传输和分析。
3.非常丰富的调试工具:Trace32提供了丰富的调试工具和特性,包括数据跟踪、事件控制、信号分析等等,以帮助开发人员快速发现和解决系统问题。
4.简单易用的用户界面:Trace32具有简单易用的用户界面,能够帮助开发人员快速上手并快速调试。
RT O S -S C I O P T AT e c h n i c a l I n f o r m a t i o n13.03.19RTOS-SCIOPTARTOS Debugger for SCIOPTA■Real time, non-intrusive display of Sciopta system resources■Sciopta specific display of analyzer listing■Statistic evaluation and graphic display of task run times■Task related evaluation of function run times ■Task stack coverage ■Task context display■PRACTICE functions for OS data ■Sciopta related pull-down menuThe TRACE32 System includes a configurable RTOSdebugger to provide symbolic debugging in real time oper-ating systems. Our software package contains a ready-to-run configuration for the Sciopta Real Time Kernel from Sciopta Systems AG.In close cooperation with Sciopta we built a special RTOS support for Sciopta. This leaflet will guide you through the additional implemented features in TRACE32, to do an effective debugging on Sciopta systems.ARMPowerPCRTOS Debugging in TRACE32 with ScioptaReal Time, Non-Intrusive Display of Sciopta System ResourcesThe TRACE32 RTOS debugger for Sci-opta provides display functions to show internal information. The systemresources modules, processes, pools and queues can be displayed. If the tar-get allows memory reads while run-ning, the display of all these regions can be viewed non-intrusively in real time. The tables are updated perma-nently (“On The Fly”), without affecting the application at all.Process Related BreakpointsAny breakpoint set in the TRACE32 debugger can be set dependent to a specific process. This means, that the breakpoint will then only halt, if hit bythe specified process. This allows pro-cess related debugging even in sharedcode.Module list, process list and pool displayBreakpoint list window with process specific breakpointsProcess Context DisplayThe TRACE32 RTOS debugger pro-vides an easy way to switch the current displayed context to another process. Normally all register related windows (e.g. listing at current PC, local vari-ables of function call stack) are dis-played related to the actual context (i.e. current executed process). Y ou can switch to the context of another pro-cess to see all this information at the time this process was scheduled.Process Stack CoverageIn real time systems it is quite impor-tant to know, how much stack space each process consumes. For this pur-pose a special window shows the cur-rent and the maximum usage of eachseparate process.Function call hierarchy of a specific processProcess stack coverage windowDynamic Process Performance MeasurementWhile Sciopta is running, TRACE32 is capable of recurrently evaluating the current running process and collecting the results. The percentage, each pro-cess consumes of the system, is thendisplayed graphically and updated per-manently. The longer time you let the measurement run, the more exact are the results. This feature is available even without any hardware trace.Sciopta Specific Display of Trace ListingThe data recorded in the real time trace buffer (if available) can be displayed and interpreted specific to the operat-ing system. The process switches aredisplayed symbolically, either exclu-sively or in addition to other informa-tion.Statistic Evaluation and Graphic Display of Process Run TimesOut of the real time trace buffer (if avail-able), the analyzer can calculate statis-tic tables of process run times and process switches. A graphical diagramshows which process was active at a specific time, giving a clear view of thebehavior of the system.Performance measurement listStatistics and flow of processesProcess Related Evaluation of Function Run TimesThe statistic and graphic evaluation of function calls and function run times (if available) can be done dependant to the actual running process. This is nec-essary, if different processes call one single function at the same time, or if a process switch occurs in between the function.PRACTICE Functions for OS DataThe support includes extended PRAC-TICE functions for OS specific data. E.g. the function “task.config(sciopta)”returns the address of the Sciopta base structure.Sciopta Related Pull-Down MenuBecause the menu bar of theTRACE32 user interface can be fully customized, you can create a new pull down menu, including operating sys-tem specific commands. We deliverSciopta support with an example for such specific menues, which provides fast and easy access to the Sciota spe-cific features.TRACE32 with source window and opened Sciopta specific displaysContactInternational RepresentativeArgentinaAnacom Eletronica Ltda.Mr. Rafael SoriceRua Nazareth, 807, BarcelonaBR-09551-200 São Caetano do Sul, SP Phone: +55 11 3422 4200FAX: +55 11 3422 4242EMAIL:******************.br AustraliaEmbedded Logic Solutions P/LMr. Ramzi KattanSuite 2, Level 3144 Marsden StreetParramatta NSW 2150Phone: +61 2 9687 1880FAX: +61 2 9687 1881EMAIL:*****************.au AustriaLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** BelgiumTritec Benelux B.V.Mr. Robbert de VoogtStationspark 550NL-3364 DA SliedrechtPhone: +31 184 41 41 31FAX: +31 184 42 36 11EMAIL:******************BrazilAnacom Eletronica Ltda.Mr. Rafael SoriceRua Nazareth, 807, BarcelonaBR-09551-200 São Caetano do Sul, SP Phone: +55 11 3422 4200FAX: +55 11 3422 4242EMAIL:******************.br CanadaLauterbach Inc.Mr. Udo Zoettler4 Mount Royal Ave.USA-Marlborough, MA 01752 Phone: +1 508 303 6812FAX: +1 508 303 6813EMAIL:********************** China BeijingLauterbach Technologies Co., LtdMr. Linglin HeBeijing OfficeA3,South Lishi Road, XiCheng District Beijing 100037, P.R. ChinaPhone: +86 10 68023502FAX: +86 10 68023523EMAIL:************************* China ShenzhenLauterbach Technologies Co., Ltd1406/E Xihaimingzhu BuildingNo.1 Taoyuan Road, Nanshan District Shenzhen 518052, P.R. China Phone: +86 755 8621 0671FAX: +86 755 8621 0675EMAIL:**************************China SuzhouLauterbach Technologies Co., Ltd Mr. Linglin HeHengyu Square, Rm 709No. 188, Xing Hai StreetSuzhou, 215021 P.R. of China Phone: +86 512 6265 8030FAX: +86 512 6265 8032EMAIL:********************** Czech. RepublicLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 130FAX: +49 8102 9876 187EMAIL:******************** DenmarkNohau Danmark A/SMr. Flemming JensenHørkær 26, Plan 4DK-2730 HerlevPhone: +45 44 52 16 50FAX: +45 44 52 26 55EMAIL:*************EgyptLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 130FAX: +49 8102 9876 187EMAIL:******************** FinlandNohau Solutions FinlandMr. Martti ViljainenTekniikantie 14FI-02150 EspooPhone: +358 40 546 0142FAX: +358 9 2517 8101EMAIL:**************FranceLauterbach S.A.R.L.Mr. Jean-Pierre ParadisoEuroparc - Le Hameau B135 Chemin Des BassinsF-94035 Créteil CedexPhone: +33 1 49 56 20 30FAX: +33 1 49 56 20 39EMAIL:********************** GermanyLauterbach GmbHSales Team GermanyAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** GreeceLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** HungaryLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:********************India-BangaloreElectro Systems Associates Pvt. Ltd. Mr. G. V. GurunathamS-606, World Trade CenterMalleswaram West, No.26/1, Dr. Rajkumar RoadIndia - Bangalore 560055Phone: +91 80 67648888FAX: +91 80 23475615EMAIL:************************* India-ChennaiElectro Systems Associates Pvt. Ltd. Mr. D. KannanNo.109 /59A , Ground FloorIV Avenue, Ashok NagarIndia - Chennai - 600 083 Tamilnadu Phone: +91 044-24715750FAX: ++91 44 24715750EMAIL:********************India-DelhiElectro Systems Associates Pvt. Ltd. Mr. R.K. BhandariNo. 705, 7th Floor, Laxmi Deep ShivajinagarIndia - Delhi - 110 092Phone: +91 11-22549351FAX:EMAIL:******************India-HyderabadElectro Systems Associates Pvt. Ltd. Mr. C.V.M. Sri Ram MurthyShop No. 14, "Global Enclave" Bhagyanagar Colony, Kukat pallyIndia - Hyderabad 500 072Phone: +91 40-23063346FAX: +91 40-23063346EMAIL:**********************India-KolkataElectro Systems Associates Pvt. Ltd. Mr. Arun RoyIndia - KolkataPhone: +91 98305 78843FAX:EMAIL:********************India-PuneElectro Systems Associates Pvt. Ltd. Mr. R K BhandariShriram Complex,1126/1, Model Colony ShivajinagarIndia - Pune - 411 016Phone: +91 20 - 30462035 / 25663FAX: +91 20-25677202EMAIL:*****************IrelandLauterbach Ltd.Mr. Richard Copeman11 Basepoint Enterprise Centre Stroudley RoadBasingstoke, Hants RG24 8UPPhone: 0044-118 328 3334FAX:EMAIL:**********************IsraelItec Ltd.Mr. Mauri GottliebP.O.Box 10002IL-Tel Aviv 61100Phone: +972 3 6491202FAX: +972 3 6497661EMAIL:***************.ilItalyLauterbach SrlMr. Maurizio MenegottoVia Enzo Ferrieri 12I-20153 MilanoPhone: +39 02 45490282FAX: +39 02 45490428EMAIL:**********************JapanLauterbach Japan, Ltd.Mr. Kenji Furukawa3-8-8 ShinyokohamaKouhoku-ku, Nisso 16th BuildingY okohama-shi, Japan 222-0033 Phone: +81 45 477 4511FAX: +81 45 477 4519EMAIL:******************.jp LuxembourgTritec Benelux B.V.Mr. Robbert de VoogtStationspark 550NL-3364 DA SliedrechtPhone: +31 184 41 41 31FAX: +31 184 42 36 11EMAIL:****************** MalaysiaFlash TechnologyMr. Teo Kian HockNo 61, # 04-15 Kaki Bukit Av 1Shun Li Industrial ParkSGP-Singapore 417943Phone: +65 6749 6168FAX: +65 6749 6138EMAIL:*******************.sg MexicoLauterbach Inc.Mr. Udo Zoettler4 Mount Royal Ave.USA-Marlborough, MA 01752 Phone: +1 508 303 6812FAX: +1 508 303 6813EMAIL:********************** NetherlandsTritec Benelux B.V.Mr. Robbert de VoogtStationspark 550NL-3364 DA SliedrechtPhone: +31 184 41 41 31FAX: +31 184 42 36 11EMAIL:******************New ZealandEmbedded Logic Solutions P/LMr. Ramzi KattanSuite 2, Level 3144 Marsden StreetParramatta NSW 2150Phone: +61 2 9687 1880FAX: +61 2 9687 1881EMAIL:*****************.au NorwayNohau Solutions ABMr. Jörgen NilssonDerbyvägen 6DSE-21235 MalmoePhone: +46 40 592 206FAX: +46-40 592 229EMAIL:*********************** PolandQUANTUM Sp. z o.o.Mr. Aleksander Bilul. Jeleniogorska 654-056 WroclawPhone: +48 71 362 6356FAX: +48 71 362 6357EMAIL:****************.pl PortugalCaptura Electronica,SCCLMr. Juan Martinezc/Duero, 40E-08031 BarcelonaPhone: +34 93 429 5730FAX: +34 93 407 0778EMAIL:******************* RomaniaLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 130FAX: +49 8102 9876 187EMAIL:********************RussiaRTSoftMr. Alexey IsaevNikitinskaya 3RUS-105037 MoscowPhone: +7 495 742 6828FAX: +7 495 742 6829EMAIL:****************.ruSingaporeFlash TechnologyMr. Teo Kian HockNo 61, # 04-15 Kaki Bukit Av 1Shun Li Industrial ParkSGP-Singapore 417943Phone: +65 6749 6168FAX: +65 6749 6138EMAIL:*******************.sgSouth Korea, PangyoHancom MDS Inc.Mr. Dongwook Jun3FL. Hancom Tower49, Daewangpangyo-ro 644, Bundang-gu Seongnam-si, Gyeonggi-do, 463-400, ROK Phone: +82-31-627-3000FAX: +82-31-627-3100EMAIL:*********************SpainCaptura Electronica,SCCLMr. Juan Martinezc/Duero, 40E-08031 BarcelonaPhone: +34 93 429 5730FAX: +34 93 407 0778EMAIL:*******************SwedenNohau Solutions ABMr. Jörgen NilssonDerbyvägen 6DSE-21235 MalmoePhone: +46 40 592 206FAX: +46 40 592 229EMAIL:*********************** SwitzerlandJDT Jberg DatenTechnikMr. Andreas JbergZimmereistrasse 2CH-5734 Reinach AGPhone: +41 62 7710 886FAX:EMAIL:********************TaiwanSuperlink Technology Corp.Mr. Sulin Huang3F-8,No.77,Sec.1,Xintaiwu Rd.,Xizhi District, New Taipei City 22101, Taiwan, R.O.C. Phone: +886 2 26983456FAX: +886 2 26983535EMAIL:**********************.tw TunisiaLauterbach Consulting S.A.R.L.Mr. Khaled JmalRoute El Ain Km 3.5TN-3062 SfaxPhone: +216-31361061FAX: +216-74611723EMAIL:********************** Turkey-1Tektronik Muh. ve Tic. A.S.Mr. Hakan Y avuzCyberPlaza B-Blok, 702BBilkent06800 AnkaraPhone: +90 312 437 3000FAX: +90 312 437 1616EMAIL:******************.tr Turkey-2G3TEK Embedded Technologies Ltd. Mr. Celal AygunIlkyerlesim Mah. 445.Sok. No: 4806370 Batikent/AnkaraPhone: +90 312 3324769FAX: +90 312 3324769EMAIL:**************UKLauterbach GmbHMr. Richard CopemanAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** USA EastLauterbach Inc.Mr. Udo Zoettler4 Mount Royal Ave.USA-Marlborough, MA 01752 Phone: +1 508 303 6812FAX: +1 508 303 6813EMAIL:********************** USA WestLauterbach Inc.Mr. Bob Kupyn1111 Main Street, Suite 620USA-Vancouver, WA. 98660 Phone: +1 503 524 2222FAX: +1 503 524 2223EMAIL:************************Additional InformationLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-SiegertsbrunnTel. ++49 8102 9876-0 FAX -999*******************uterbach.deLauterbach Inc.4 Mount Royal Ave.Marlboro MA 01752Phone (508) 303 6812 FAX (508) 303 6813 ********************** Lauterbach Ltd.11 Basepoint Enterprise Ctre Stroudley Road Basingstoke, Hants RG24 8UPPhone ++44-1256-333-690 FAX -661**********************http:/Lauterbach S.A.R.L.135 Chemin Des BassinsF-94035 Créteil CedexPhone ++33-149-562-030FAX ++33-149-562-039**********************http:/uterbach.fr Lauterbach Japan, Ltd.3-9-5 Shinyokohama Kouhoku-kuY okohama-shi Japan 222-0033Phone ++81-45-477-4511 FAX -4519*********************uterbach.co.jp Lauterbach s.r.l.Lauterbach s.r.l.Via Enzo Ferrieri 12I-20153 MilanoPhone ++39 02 45490282FAX ++39 02 45490428*********************uterbach.itSuzhou Lauterbach Consulting Co.,Ltd.Room 1605, Xing Hai International Square No.200, Xing Hai StreetSuzhou, 215021 PR of ChinaPhone: 0086-512 6265 8030FAX: 0086-512 6265 8032*********************DisclaimerThe information presented is intended to give overview information only.Changes and technical enhancements or modifications can be made with-out notice.。
Application Note for iAMP Debugging Release 09.2023TRACE32 Online HelpTRACE32 DirectoryTRACE32 IndexTRACE32 Documents ...................................................................................................................... Multicore Debugging ..................................................................................................................... Application Note for iAMP Debugging . (1)SMP, iAMP or AMP? (3)iAMP Setup (7)Example iAMP Setup10Version 09-Oct-2023 11-Nov-2021New manual.SMP, iAMP or AMP?TRACE32 offers various configuration possibilities for debugging multi-core target systems. This chapter explains the basic differences between:•SMP (Symmetrical MultiProcessig)•iAMP (integrated Asymmetrical MultiProcessing)•AMP (Asymmetrical MultiProcessig)This application note focuses on iAMP. It gives you a basic overview of the iAMP concept and helps you to choose the right configuration for your setup. For further details about iAMP and the commands used here, you can also see the “General Reference Guide” (general_ref_<x>.pdf) or contact**********************.If you want to create a new TRACE32 setup for any multicore system, one of the very first decisions you have to make is “AMP or SMP or iAMP?”. In some cases, only one of the possibilities is supported by TRACE32, for example: if you have several cores of different architectures (like one Arm core, one Xtensa core and one RISC-V core), then AMP is the only possible option. But in many cases, you have a choice.Let’s first take a look at the key properties of the three concepts:•All cores have the same instruction set.•All cores use the same instance of an OS (when not bare-metal and unless you are using a hypervisor (“Hypervisor Debugging User Guide” (hypervisor_user.pdf)).•All cores use the same memory model and same address translations (unless you are using a hypervisor).•All cores share the same physical and logical address space.•All cores share the same debug symbols (typically the same elf file).•All cores are debugged from a single TRACE32 PowerView instance. Y ou can have up to 1024cores.•TRACE32 starts and stops all cores simultaneously (even though you can temporarily single out one core for independent start/stop).iAMP (integrated asymmetrical multiprocessing):•All cores have the same instruction set.•There are typically multiple OS instances (if not bare metal).•There is just one global physical address space but each OS maintains its own set of virtual address spaces.•All cores are debugged from a single TRACE32 PowerView GUI. The number of cores is limited just by the core architecture used and can be very high.•TRACE32 allows to group cores logically into machines; this grouping depends on the logical structure of the system under debug - each machine consists of one or more cores. Up to30machines are possible.•Each machine has its own OS instance (if not bare metal).•Each machine has its own memory model, address translations and debug symbols.•TRACE32 starts and stops all cores simultaneously (even though you can temporarily single out one core for independent start/stop).•AMP can bundle single cores, as well as SMP and iAMP subsystems.•Mixing of different core architectures with different instruction sets is possible.•Each core/subsystem has its own TRACE32 PowerView GUI.•Each core/subsystem has its own (different) memory models, address translations, elf files and debug symbols.•Each core/subsystem can have its own physical address space.•Each core/subsystem has its own logical address spaces.•Each core/subsystem starts and stops independently but can also be synchronized.•AMP is limited to 16 TRACE32 PowerView GUIs.An example of an AMP system that bundles single cores, an SMP and an iAMP subsystem can be found on page10.The most important questions for the decision are:•Do all my cores use the same instruction set?If not, it is definitely AMP.•Do all my cores of the same instruction set run a single instance of OS?If yes, these cores form an SMP (sub)system.•Are there SMP subsystems and single cores of the same instruction set? Does it make sense to configure them as an iAMP system and debug them from a single TRACE32PowerView instance?Y es, if they are all using a global physical address space.Y es, if they logically belong together; that means they work together or in parallel on the same tasks.Y es, if you want or need to reduce the number of TRACE32 PowerView instances.The following table provides a systematic overview:SMP AMP iAMP Homogeneous cores (cores of the same instruction set)✓✓✓Heterogeneous cores✓Single TRACE32 instance/GUI✓✓Multiple TRACE32 instances/GUIs 16Hypervisor with statically assigned guests (core identity)✓✓✓Hypervisor with dynamic core assignment (core sharing)✓SMP OS (a single OS managing multiple cores)✓Multiple OSes without hypervisor✓Synchronous run✓✓✓Asynchronous run✓iAMP is available for selected core architectures like Arm, Hexagon and T riCore. If you need iAMP and your platform does not support it yet, please contact your local Lauterbach representative or**********************.Some of the decision criteria are easy to evaluate (like more than 16 CPUs) but some of them are quite fuzzy - talking to Lauterbach representative or Lauterbach support might help you with the decision.iAMP SetupThe basis for an iAMP system is that cores are grouped into machines.The SYStem.Option.MACHINESPACES ON command creates the basis for this.All cores that use the same instance of an OS (when not bare-metal) can be grouped and assigned to a machine by the TASK.Create.MACHINE command.Example :This will create two machines, each of them with two cores. Their setup can be then displayed using the commandTASK.List.MACHINES :The columns name and cores in the screenshot are self-explaining, ‘mid’ displays the machine ID, other columns are not relevant for our example.It may be necessary to use the CORE.ASSIGN command beforehand to assign the physical cores to the logical cores of the iAMP system.Use the command CORE.select <logical_core> to switch to the core of interest and the TRACE32PowerView GUI will display the system information from the perspective of the selected core. T o understand how this works, think that “the machine is never selected directly but always follows selected core”.By default, all cores are started and stopped simultaneously , but you can single out a single core for independent start/stop by using the CORE.SINGLE <logical_core> command.The CORE.select command without an argument can be used to reverse this selection after the core is stopped.It is imperative to ensure that the symbols loaded by any of the Data.LOAD.* commands will be added to the right machine space. When loading executables and symbol information, the safest way is to explicitly select the core to which the executable belongs – it then explicitly defines both the core and machine. One of the reasons is that registers like PC might be pre-initialized during Data.LOAD so by selecting the correct core it becomes clear where the register(s) are to be set:TASK.Create.MACHINE , 0. "main0" /CORE 0. 1.TASK.Create.MACHINE , 1. "main1" /CORE 2. 3.CORE.select 0.Data.LOAD.Elf application_subsystem0.elf CORE.select 2.Data.LOAD.Elf application_subsystem1.elf /NoClearOn the other hand, when you load only symbol information and no register content, it is sufficient to specify only the machine; knowledge of the specific core is not required. T o specify only the machine, use theloading offset parameter to Data.LOAD.* where this offset contains the machine number. In most cases you use zero as offset (unless you need to shift the data to another base address).Loading symbols using the machine ID makes them machine aware as can be seen in the image below.The machine name can be explicitly specified in a symbol name using triple-backslash (“\\\”) syntax.Example :This command will show the source of the symbol start from the module Global on the machine named main1.The general format for symbol names becomes:[\\\<machine_name>]\\[<program_name>]\[<module_name>]\<symbol_name>Both <program_name> and <module_name> may be omitted if there is no ambiguity with another symbol but the appropriate backslashes must remain to indicate where they were, for example:\\\<machine_name>\\\<symbol_name>So, our example of \\\main1\\Global\start now becomes \\\main1\\\\startWhen you activate the iAMP mode, the behavior of many commands changes. The commands now also consider the correct machine scope, for example:Data.LOAD.Elf application_subsystem0.elf 0x0:::0 /NoCODE /NoRegData.LOAD.Elf application_subsystem1.elf 0x1:::0 /NoClear /NoCODE /NoRegNOTE:This concept is extended to allow you to access a logical address on any machine and works like this:[<access_class>:][<machine_id>:::]<address_offset> Example:P:1:::0x1234000 means program address P:0x1234000 on machine 1.R:0:::0x81021864 means AArch32 Arm code at address R:0x81021864 on machine 0.List.Asm \\\main1\\\Global\startNormally, MMU.DUMP.TLB shows the only TLB in the system (where available). With iAMP, the contents displayed by MMU.DUMP.TLB will update after every change of machine and always show the TLB of the currently selected machine.The program counter is now shown everywhere with the machine number included - like in this CORE.List window:The machine number is also included in many other outputs and windows, almost everywhere where you see an address. The screenshot below shows the sYmbol.List.SECtion window. It can be seen that sections from all machines and all addresses include the machine number.Example iAMP SetupAssume the following system, based on a TDA4VM chip from T exas Instruments:•Four Cortex-R5 cores, grouped in two core pairs, called “main0” and “main1”. These four cores form our example iAMP system.Each core pair has its own symbols and ELF file (app_ddr.elf and app_sram.elf ).Both core pairs use logical memory but have their own translations.•In addition to that, there is also a Cortex-M3 core (“master”), Cortex-R5 (“mcu”) based SMP subsystem and a TI C71x (“dsp”) on the chip, which all need to be debugged as well.Four TRACE32 PowerView GUIs are needed to debug this AMP system:1.GUI to control the Cortex-R5 based iAMP subsystem 2.GUI to control a single Cortex-M33.GUI to control the Cortex-R5 based SMP subsystem4.GUI to control a single C71x DSPTRACE32 PowerDebugDebug Port®iAMP main0 + main1Cortex-M3masterSMP 2x Cortex-R5mcuC71x dspApplication Note for iAMP Debugging | 11©1989-2023 L auterbach So, let's focus on the iAMP subsystem - we want to preload all elf files, execute all startups immediately after loading, and then start the execution of all cores/machines from the symbol main simultaneously. For this setup, the following script can be used:The other subsystems of SoC are initialized as usual with their own scripts.The structure of the whole system can be then displayed via the command TargetSystem ALL .sYmbol.RESetSYStem.Option.MACHINESPACES ONTASK.CREATE.MACHINE , 0. "main0" /CORE 0. 1.TASK.CREATE.MACHINE , 1. "main1" /CORE 2. 3.CORE.select 0.Data.LOAD.Elf app_ddr.elfCORE.select 2.Data.LOAD.Elf app_ram.elf /NoClearCORE.SINGLE 0. ; enter single core execution mode Go mainWAIT !STATE.RUN()CORE.SINGLE 2. ; enter single core execution mode Go mainWAIT !STATE.RUN()CORE.select 0. ; leaving single core execution mode PRINT "Now we are ready to debug from main"。
T raining Simulator and Demo SoftwareRelease 09.2023TRACE32 Online HelpTRACE32 DirectoryTRACE32 IndexTRACE32 Training ............................................................................................................................Training Simulator and Demo Software (1)About the Demo (3)Starting the TRACE32 Simulator (3)User Interface - TRACE32 PowerView (4)TRACE32 Command Line and Softkeys6 Window Captions - What Makes Them Special in TRACE327Debugging the Program (8)Basic Debug Commands8 Debug Modes9 Displaying the Stack Frame11Breakpoints (12)Setting Breakpoints12 Listing all Breakpoints13 Setting Read/Write Breakpoints14Variables (15)Displaying Variables15 Displaying Variables of the Current Program Context16 Using the Symbol Browser16 Formatting Variables17 Modifying Variables18Memory (19)Displaying Memory19 Modifying Memory20Version 10-Oct-2023About the DemoWhat is this? This is a guided tour through TRACE32 - a tutorial. We use a simple program example in C to illustrate the most important debug features, and give lots of helpful tips & tricks for everyday use.How long does this tutorial take? 0.5 to 1 hrs.How can I learn most from this tutorial? Work completely through all chapters in sequence and then do the quiz at the end.Where can I download the TRACE32 Simulator for the hands-on debug session? From:https:///download.html . You do not need any hardware for this tutorial.Starting the TRACE32 Simulator1.Unzip the downloaded file. Y ou do not need to install the TRACE32 Simulator.2.Double-click the t32m <architecture>.exe file (e.g. t32m arm .exe ) to start the demo debug session. When the TRACE32 Instruction Set Simulator starts, a start-up PRACTICE script that sets up a debug session is automatically executed.Y ou can manually execute the same start-up PRACTICE script by choosing File menu > Run Script .PRACTICE, the Lauterbach script language, is used for automating tests, configuring the TRACE32 PowerView GUI and your debug environment.For our demo debug session, the PRACTICE start-up script armc.cmm loads the application program armle.axf and generates a TRACE32 internal symbol database out of the loaded information.By default, TRACE32 executes the autostart.cmm script on start-up.User Interface - TRACE32 PowerViewThe graphical user interface (GUI) of TRACE32 is called TRACE32 PowerView.The following screen shot presents the main components of the user interface.We’ll briefly explain the GUI using the List command and List window as an example.A video tutorial about the TRACE32 PowerView GUI is available here:/kb/articles/introduction-to-trace32-gui Do one of the following to open the List window:•Choose View menu > List Source•or, at the TRACE32 command line, type: List (or L )Main Menu Bar Main Tool BarC o n t e x t M e n uLocal ButtonsMessage Line SoftkeyLine State LineWindow AreaCommand LineThe List window displays the code in assembler mnemonic and HLL (HLL stands for High-Level Language and means the programming language of your source code).In the List window, the gray bar indicates the position of the program counter (PC). Right now, it is located on the symbolic address of the label main .A video tutorial about the source code display in TRACE32 is available here:/kb/articles/displaying-the-source-codeT o summarize it, you can execute commands in TRACE32 PowerView via the usual suspects:1.Menus on the menu bar2.Buttons on the main toolbar and the buttons on the toolbars of TRACE32 windows3.Context menus in TRACE32 windowsAdditionally in TRACE32, you can execute commands via the TRACE32 command line.Opens the List windowProgram counter (PC)TRACE32 Command Line and SoftkeysTRACE32 commands are not case sensitive: register.view is the same as Register.view UPPER CASE letters indicate the short forms of commands and must not be omitted. All lower case letters can be omitted. This makes short forms an efficient time saver when you are entering frequently-used commands in the command line. Examples:•Instead of the long form Register.view type just the short form r or R •Instead of the long form List type just the short form l or LThe softkeys are below the command line. The camel casing (i.e. upper and lower case letters) on any softkey tells you the long form of a command. The softkeys guide you through the command input, displaying all possible commands and parameters.Example - To assemble the Data.dump command using the softkeys:1.Click Data .2.Click dump .3.Type the <range> or <address> you want to dump. For example, 0x1000--0x20004.Click [ok] to execute the command. The Data.dumpwindow opens.SoftkeysCommand lineWindow Captions - What Makes Them Special in TRACE32The command with which you open a window will be shown as the window caption. The parameters and options are also included in the window caption.You can re-insert a command from a window caption (a) into the command line (b) in order to modify the command. Let’s do this with the Register window.1.Choose View menu > Register . 2.Right-click the window caption (a).3.Modify the command, e.g. by adding the /SpotLight option: It will highlight changed registers.4.Click [ok] to execute the modified command.5.Click Single Step on the TRACE32 toolbar. Changed registers are highlighted immediately.(a)(b)Debugging the ProgramBasic Debug CommandsThe basic debug commands are available via the Run menu, the toolbar of the List window, the main toolbar, and via the TRACE32 command line.Single steppingis one of the basic debug commands.TRACE32 provides also more complex debug control commands. Y ou can step until an expression changes or becomes true.Example: Var.Step.Till i>11. single-steps the program until the variable i becomes greater than 11. Please note that TRACE32 uses a dot to denote decimal numbers.Step over function calls or subroutinesGo to the next code line written in the program listing Go Return / Go to the last instruction of the current functionUseful e.g. to leave loopsSingle StepStop the program executionGo / Start program executionGo Up / return to the caller functionStep till next unreached lineDebug ModesT ake a look at the state line at the bottom of the TRACE32 main window:6.On the toolbar of the Listwindow, clickMode to toggle the debug mode to HLL .The state line tells you:A The (symbolic) address of the current cursor position.The program counter (PC) is highlighted in gray.B The state of the debugger: stopped means program execution is stopped. Y ou can now, for example, inspect or change memory.C The state line displays the currently selected debug mode: The code display will beHLL (High Level Language) or ASM (assembler) or a MIX ed mode with HLL and its corre-sponding assembler mnemonic.AB CDebug mode HLLDebug mode MIXStep.7.ClickThe step you are taking is debug mode HLL goes to the next source code line.8.ClickMode again to toggle the debug mode to MIX.Step.9.ClickThis time, the step executes one assembler line.10.Right-click a code line, and then select Go Till.The program execution starts. It stops when the program reaches the selected code line.Displaying the Stack FrameFor the following example, let’s assume we have the following call hierarchy: main() calls func2() and func2() calls func1():Choose Show Stack in the Var menu. The Frame.view window displays the call hierarchy.•The /Locals option shows the local variables of each function.•The /Caller option shows a few source code lines to indicate where the function was called.This screenshot corresponds to the calling hierarchy shown above.BreakpointsVideo tutorials about breakpoints in TRACE32 are available here:/kb/articles/using-breakpoints-in-trace32Setting BreakpointsLet’s set a breakpoint to the instruction prime = i + i + 3 and the instruction k += prime1.Double-click a code line to set a program breakpoint.2.Make sure to click the white space in the code line, and not the code literal.All code lines with a program breakpoint are marked with a red vertical bar.T o set a breakpoint to an instruction that is not in the focus of the current source listing1.Choose Var menu > Show Function.The sYmbol.Browse.Function window opens.2.Select the function you are interested in e.g. sieve.The List window opens, displaying this function. This window is now fixed to the start address ofthe function sieve and does not move with the program counter cursor.Listing all Breakpoints1.Choose Break menu > List to list all breakpoints.The Break.List window opens, providing an overview of the set breakpoints.2.On the toolbar, clickGoto start the program execution. 3.When the program execution stops at a breakpoint, it is highlighted in the Break.List window.A Address of the breakpoint.B Breakpoint type.C Breakpoint method: SOFTware, ONCHIP or DISABLED.D Symbolic address of the breakpoint. Example:•sieve\11 means source code line 11 in function sieve .AB C DSetting Read/Write BreakpointsY ou can set a breakpoint that stops the program execution at a read or write access to a memory location(e.g. global variable). T o set a breakpoint on the array flags for instance, do a right mouse click on thearray name in the List window then select Breakpoints > Write.VariablesVideo tutorials about variable display in TRACE32 are available here:/kb/articles/variable-logging-and-monitoring-in-trace32Displaying VariablesLet’s display the variables flags, def, and ast.1.Choose Var menu > Watch...The Var.AddWatch window opens, displaying the variables known to the symbol database.2.Double-click the variable flags.The Var.Watch window opens, displaying the selected variable.steps:3. Alternative-In the Var.Watch window, click Watch, and then double-click the variables def and ast to add them to the Var.Watch window.-From a List window, drag and drop any variable you want into the Var.Watch window.-In a List window, right-click any variable, and then select Add to Watch window from the context menu.-If you want to display a more complex structure or an array in a separate window, choose Var menu >View.Displaying Variables of the Current Program Context1.Set the program counter (PC) to sieve() by typing at the TRACE32 command line:2.Choose Var menu > Show Current Vars .The Var.REF window opens, displaying all variables accessed by the current program context.3.Click Step on the TRACE32 toolbar to execute a few single steps. TheVar.REFwindow is updated automatically.Using the Symbol BrowserThe symbol browser provides an overview of the variables, functions, and modules currently stored in the symbol database.1.ChooseVar menu > Watch...The Var.AddWatch window lets you browse through the contents of the symbol database. Global variables are displayed in black and functions in gray. By double-clicking a function, its local variables are displayed.2.In the Var.AddWatch window, double-click func2.Register.Set PC sieve ;The command short form is: r.s pc sieveTo format the display of variables - global settings:1.Choose Var menu > Format.2.In the SETUP.Var window, make your settings. Decimal and Hex are useful global settings.TRACE32 applies your settings to all Var.view windows that you open afterwards.To format the display of an individual variable:1.At the command line, type: Var.view ast (The variable ast is included in this demo.)2.In the Var.view window, right-click ast, and then click Format.The Change Variable Format dialog opens.3.Select the Type check box to display the variable ast with the complete type information.4.Click Apply. The format of ast in the Var.view window is updated immediately.5.For more complex variable select TREE in the Change Variable Format dialog box.Click + and - to expandand collapse the tree.1.Double-click the variable value to modify the value. The Var.set command will be displayed in thecommand line. The short form of the command is V or v2.Enter the new value directly after the equal sign and confirm with [ok].MemoryDisplaying Memory1.To display a memory dump in a Data.dump window, do one of the following:-Choose View menu > Dump,-or click Memory Dump on the toolbar,-or, at the TRACE32 command line, type: Data.dumpY ou can also specify an address or symbol directly, e.g.: Data.dump flags2.In the Data.dump dialog, enter the data item, e.g. flags-Alternatively click to browse through the symbol database.3.In the Browse Symbols window, double-click the symbol flags to select it, and then click OK.Double-click flags.In the following screenshot, theData.dump window is called via the TRACE32 command line.There are different ways to define an address range:•<start_address>--<end_address> (SD is an access class)•<start_address>++<offset>Modifying Memory1.In a Data.dumpwindow, double-click the value you want to modify.A Data.Set command for the selected address is displayed in the command line. The short form of the command isD.S or d.s2.Enter the new value directly after %LE , and then confirm with [ok].(%LE stands for Little Endian).Data.dump SD:0x5530--SD:0x554FData.dump cstr1++0x1f /Byte ;start at cstr1 plus the next 0x1f bytesAccess Class + AddressHEX ASCIITraining Simulator and Demo Software | 21©1989-2023 L auterbach。
基于TRACE32仿真器对CPU模块的一种调试方法首先,单步调试功能是基于TRACE32仿真器非常重要的一个功能。
通过单步调试,可以逐条执行程序指令,并观察每一条指令执行后CPU模块的状态。
要使用单步调试功能,首先需要加载可执行文件并进行仿真器初始化。
然后,通过在TRACE32的命令窗口中输入“t32scc命令”开始单步调试模式。
在单步调试模式下,可以使用“go”命令运行程序,使用“s.step”命令单步执行程序指令,以及使用其他一些命令如“p.print”查看寄存器、内存等信息。
通过单步调试功能,可以逐条检查程序的运行情况,方便发现和解决问题。
其次,断点设置是基于TRACE32仿真器另一个重要的调试功能。
通过设置断点,可以在程序执行到指定指令或指定地址时暂停程序的运行,以便检查程序的状态。
要设置断点,首先需要确定断点的位置,可以是指令地址也可以是地址。
然后,在TRACE32命令窗口中使用“bp”命令进行断点设置。
例如,如果要设置一个指令地址上的断点,可以使用“bp.my_address”命令;如果要设置一个地址上的断点,可以使用“bp.system_address.data_access”命令。
通过设置断点,可以在程序执行到指定位置时停止,方便进行进一步的调试操作。
最后,TRACE32还提供了一些其他的调试功能,如查看寄存器、内存等。
通过使用“r.regname”命令可以查看指定寄存器的值,例如“r.pc”可以查看程序计数器的值。
通过使用“d.data_address”命令可以查看指定地址上的内存内容,例如“d.0x1000”可以查看地址0x1000上的内容。
通过查看寄存器、内存等信息,可以了解CPU模块的当前状态,帮助定位和解决问题。
总的来说,基于TRACE32仿真器的CPU模块调试方法主要包括单步调试、断点设置和查看寄存器、内存等功能。
通过这些调试功能,可以对CPU模块进行深入的调试,并快速定位和解决问题。
R TO S -O S E KT e c h n i c a l I n f o r m a t i o n13.03.19RTOS-OSEKRTOS Debugger for Freescale OSEK■Real time, non-intrusive display of OSEK system resources■OSEK specific display of analyzer listing■Statistic evaluation and graphic display of task run times■Statistic evaluation and graphic display of service run times■Task related evaluation of function run times ■Task stack coverage■PRACTICE functions for OS data ■OSEK related pull-down menuThe TRACE32 System includes a multitask debugger to provide symbolic debugging in real time operating sys-tems. Our software pack-age contains a ready-to-run con-figuration for the OSEK/VDX conform Real Time Kernel OSEK from Freescale.Based on the ORTI (OSEK Runtime Interface) all informa-tions of the OSEK RTOS and its configuration can be explored. This leaflet will guide you through the additional implemented features in TRACE32, to do an effective debugging on OSEK systems.PowerPC 55568HC12Multitask Debugging on TRACE32 with Motorola OSEKReal time, non-intrusive display of Motorola OSEK sys-tem resourcesThe TRACE32 multitask debugger for OSEK provides special display func-tions. The system resources such as task list, messages, counters, alarms, stacks and resources can be displayed. In addition, by using the emulatorsdual-port memory, the display of all these regions can be viewed non-intru-sively in real time. The tables are updated permanently (“On The Fly”),without affecting the application at all.Task list window, message window and alarm windowConfiguration of OSEK operating system windowMotorola OSEK specific display of analyzer listingStatistic evaluation and graphic display of task run timesThe analyzer can calculate statistic tables of task run times and task switches. A graphical diagram shows which task was active at a specific time, giving a clearview of the behaviour of the system.Analyzer listing, task selective recording, display of taskswitches and assembler mne-monicsThe data recorded in the ana-lyzer can be displayed and interpreted specific to the oper-ating system. T ask switchesare displayed symbolicallyStatistics and flow of tasksStatistic evaluation and graphic display of service run timesThe statistic and graphic evaluation of service calls and service run times can be done . This is necessary, if one ser-vice need much time and is called very often the performance of the operatingsystem goes down..Statistics and flow of servicesTask related evaluation of function run timesThe statistic and graphic evaluation of function calls and function run times can be done dependant to the actual running task. This is necessary, if dif-ferent tasks call one single function at the same time, or if a task switchoccurs in between the function.Analyzer listing, function call hierarchy and process switchesStatistics on function hierarchy, process relatedTask Stack CoverageIn real time systems it is quite impor-tant to know, how much stack space each task consumes. For this purpose a special window shows the current and the maximum usage of each seperate task.PRACTICE functions for OS data The support includes extended PRAC-TICE functions for process specificdata. E.g. the function “TASK.CON-FIG(magic)” returns the address of theso called magic value.Process stack coverage windowMotorola OSEK related pull-down menuBecause the menu bar of theTRACE32 user interface can be fully customized, you can create a new pull down menu, including operating sys-tem specific commands. We deliver OSEK support with an example for such specific menues, which providesfast access to the OSEK features.TRACE32 with OSEK menuContactInternational RepresentativeArgentinaAnacom Eletronica Ltda.Mr. Rafael SoriceRua Nazareth, 807, BarcelonaBR-09551-200 São Caetano do Sul, SP Phone: +55 11 3422 4200FAX: +55 11 3422 4242EMAIL:******************.br AustraliaEmbedded Logic Solutions P/LMr. Ramzi KattanSuite 2, Level 3144 Marsden StreetParramatta NSW 2150Phone: +61 2 9687 1880FAX: +61 2 9687 1881EMAIL:*****************.au AustriaLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** BelgiumTritec Benelux B.V.Mr. Robbert de VoogtStationspark 550NL-3364 DA SliedrechtPhone: +31 184 41 41 31FAX: +31 184 42 36 11EMAIL:******************BrazilAnacom Eletronica Ltda.Mr. Rafael SoriceRua Nazareth, 807, BarcelonaBR-09551-200 São Caetano do Sul, SP Phone: +55 11 3422 4200FAX: +55 11 3422 4242EMAIL:******************.br CanadaLauterbach Inc.Mr. Udo Zoettler4 Mount Royal Ave.USA-Marlborough, MA 01752 Phone: +1 508 303 6812FAX: +1 508 303 6813EMAIL:********************** China BeijingLauterbach Technologies Co., LtdMr. Linglin HeBeijing OfficeA3,South Lishi Road, XiCheng District Beijing 100037, P.R. ChinaPhone: +86 10 68023502FAX: +86 10 68023523EMAIL:************************* China ShenzhenLauterbach Technologies Co., Ltd1406/E Xihaimingzhu BuildingNo.1 Taoyuan Road, Nanshan District Shenzhen 518052, P.R. China Phone: +86 755 8621 0671FAX: +86 755 8621 0675EMAIL:**************************China SuzhouLauterbach Technologies Co., Ltd Mr. Linglin HeHengyu Square, Rm 709No. 188, Xing Hai StreetSuzhou, 215021 P.R. of China Phone: +86 512 6265 8030FAX: +86 512 6265 8032EMAIL:********************** Czech. RepublicLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 130FAX: +49 8102 9876 187EMAIL:******************** DenmarkNohau Danmark A/SMr. Flemming JensenHørkær 26, Plan 4DK-2730 HerlevPhone: +45 44 52 16 50FAX: +45 44 52 26 55EMAIL:*************EgyptLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 130FAX: +49 8102 9876 187EMAIL:******************** FinlandNohau Solutions FinlandMr. Martti ViljainenTekniikantie 14FI-02150 EspooPhone: +358 40 546 0142FAX: +358 9 2517 8101EMAIL:**************FranceLauterbach S.A.R.L.Mr. Jean-Pierre ParadisoEuroparc - Le Hameau B135 Chemin Des BassinsF-94035 Créteil CedexPhone: +33 1 49 56 20 30FAX: +33 1 49 56 20 39EMAIL:********************** GermanyLauterbach GmbHSales Team GermanyAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** GreeceLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** HungaryLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:********************India-BangaloreElectro Systems Associates Pvt. Ltd. Mr. G. V. GurunathamS-606, World Trade CenterMalleswaram West, No.26/1, Dr. Rajkumar RoadIndia - Bangalore 560055Phone: +91 80 67648888FAX: +91 80 23475615EMAIL:************************* India-ChennaiElectro Systems Associates Pvt. Ltd. Mr. D. KannanNo.109 /59A , Ground FloorIV Avenue, Ashok NagarIndia - Chennai - 600 083 Tamilnadu Phone: +91 044-24715750FAX: ++91 44 24715750EMAIL:********************India-DelhiElectro Systems Associates Pvt. Ltd. Mr. R.K. BhandariNo. 705, 7th Floor, Laxmi Deep ShivajinagarIndia - Delhi - 110 092Phone: +91 11-22549351FAX:EMAIL:******************India-HyderabadElectro Systems Associates Pvt. Ltd. Mr. C.V.M. Sri Ram MurthyShop No. 14, "Global Enclave" Bhagyanagar Colony, Kukat pallyIndia - Hyderabad 500 072Phone: +91 40-23063346FAX: +91 40-23063346EMAIL:**********************India-KolkataElectro Systems Associates Pvt. Ltd. Mr. Arun RoyIndia - KolkataPhone: +91 98305 78843FAX:EMAIL:********************India-PuneElectro Systems Associates Pvt. Ltd. Mr. R K BhandariShriram Complex,1126/1, Model Colony ShivajinagarIndia - Pune - 411 016Phone: +91 20 - 30462035 / 25663FAX: +91 20-25677202EMAIL:*****************IrelandLauterbach Ltd.Mr. Richard Copeman11 Basepoint Enterprise Centre Stroudley RoadBasingstoke, Hants RG24 8UPPhone: 0044-118 328 3334FAX:EMAIL:**********************IsraelItec Ltd.Mr. Mauri GottliebP.O.Box 10002IL-Tel Aviv 61100Phone: +972 3 6491202FAX: +972 3 6497661EMAIL:***************.ilItalyLauterbach SrlMr. Maurizio MenegottoVia Enzo Ferrieri 12I-20153 MilanoPhone: +39 02 45490282FAX: +39 02 45490428EMAIL:**********************JapanLauterbach Japan, Ltd.Mr. Kenji Furukawa3-8-8 ShinyokohamaKouhoku-ku, Nisso 16th BuildingY okohama-shi, Japan 222-0033 Phone: +81 45 477 4511FAX: +81 45 477 4519EMAIL:******************.jp LuxembourgTritec Benelux B.V.Mr. Robbert de VoogtStationspark 550NL-3364 DA SliedrechtPhone: +31 184 41 41 31FAX: +31 184 42 36 11EMAIL:****************** MalaysiaFlash TechnologyMr. Teo Kian HockNo 61, # 04-15 Kaki Bukit Av 1Shun Li Industrial ParkSGP-Singapore 417943Phone: +65 6749 6168FAX: +65 6749 6138EMAIL:*******************.sg MexicoLauterbach Inc.Mr. Udo Zoettler4 Mount Royal Ave.USA-Marlborough, MA 01752 Phone: +1 508 303 6812FAX: +1 508 303 6813EMAIL:********************** NetherlandsTritec Benelux B.V.Mr. Robbert de VoogtStationspark 550NL-3364 DA SliedrechtPhone: +31 184 41 41 31FAX: +31 184 42 36 11EMAIL:******************New ZealandEmbedded Logic Solutions P/LMr. Ramzi KattanSuite 2, Level 3144 Marsden StreetParramatta NSW 2150Phone: +61 2 9687 1880FAX: +61 2 9687 1881EMAIL:*****************.au NorwayNohau Solutions ABMr. Jörgen NilssonDerbyvägen 6DSE-21235 MalmoePhone: +46 40 592 206FAX: +46-40 592 229EMAIL:*********************** PolandQUANTUM Sp. z o.o.Mr. Aleksander Bilul. Jeleniogorska 654-056 WroclawPhone: +48 71 362 6356FAX: +48 71 362 6357EMAIL:****************.pl PortugalCaptura Electronica,SCCLMr. Juan Martinezc/Duero, 40E-08031 BarcelonaPhone: +34 93 429 5730FAX: +34 93 407 0778EMAIL:******************* RomaniaLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 130FAX: +49 8102 9876 187EMAIL:********************RussiaRTSoftMr. Alexey IsaevNikitinskaya 3RUS-105037 MoscowPhone: +7 495 742 6828FAX: +7 495 742 6829EMAIL:****************.ruSingaporeFlash TechnologyMr. Teo Kian HockNo 61, # 04-15 Kaki Bukit Av 1Shun Li Industrial ParkSGP-Singapore 417943Phone: +65 6749 6168FAX: +65 6749 6138EMAIL:*******************.sgSouth Korea, PangyoHancom MDS Inc.Mr. Dongwook Jun3FL. Hancom Tower49, Daewangpangyo-ro 644, Bundang-gu Seongnam-si, Gyeonggi-do, 463-400, ROK Phone: +82-31-627-3000FAX: +82-31-627-3100EMAIL:*********************SpainCaptura Electronica,SCCLMr. Juan Martinezc/Duero, 40E-08031 BarcelonaPhone: +34 93 429 5730FAX: +34 93 407 0778EMAIL:*******************SwedenNohau Solutions ABMr. Jörgen NilssonDerbyvägen 6DSE-21235 MalmoePhone: +46 40 592 206FAX: +46 40 592 229EMAIL:*********************** SwitzerlandJDT Jberg DatenTechnikMr. Andreas JbergZimmereistrasse 2CH-5734 Reinach AGPhone: +41 62 7710 886FAX:EMAIL:********************TaiwanSuperlink Technology Corp.Mr. Sulin Huang3F-8,No.77,Sec.1,Xintaiwu Rd.,Xizhi District, New Taipei City 22101, Taiwan, R.O.C. Phone: +886 2 26983456FAX: +886 2 26983535EMAIL:**********************.tw TunisiaLauterbach Consulting S.A.R.L.Mr. Khaled JmalRoute El Ain Km 3.5TN-3062 SfaxPhone: +216-31361061FAX: +216-74611723EMAIL:********************** Turkey-1Tektronik Muh. ve Tic. A.S.Mr. Hakan Y avuzCyberPlaza B-Blok, 702BBilkent06800 AnkaraPhone: +90 312 437 3000FAX: +90 312 437 1616EMAIL:******************.tr Turkey-2G3TEK Embedded Technologies Ltd. Mr. Celal AygunIlkyerlesim Mah. 445.Sok. No: 4806370 Batikent/AnkaraPhone: +90 312 3324769FAX: +90 312 3324769EMAIL:**************UKLauterbach GmbHMr. Richard CopemanAltlaufstr. 40D-85635 Höhenkirchen-Siegertsbrunn Phone: +49 8102 9876 190FAX: +49 8102 9876 187EMAIL:******************** USA EastLauterbach Inc.Mr. Udo Zoettler4 Mount Royal Ave.USA-Marlborough, MA 01752 Phone: +1 508 303 6812FAX: +1 508 303 6813EMAIL:********************** USA WestLauterbach Inc.Mr. Bob Kupyn1111 Main Street, Suite 620USA-Vancouver, WA. 98660 Phone: +1 503 524 2222FAX: +1 503 524 2223EMAIL:************************11 Additional InformationLauterbach GmbHAltlaufstr. 40D-85635 Höhenkirchen-SiegertsbrunnTel. ++49 8102 9876-0 FAX -999*******************uterbach.deLauterbach Inc.4 Mount Royal Ave.Marlboro MA 01752Phone (508) 303 6812 FAX (508) 303 6813 ********************** Lauterbach Ltd.11 Basepoint Enterprise Ctre Stroudley Road Basingstoke, Hants RG24 8UPPhone ++44-1256-333-690 FAX -661**********************http:/Lauterbach S.A.R.L.135 Chemin Des BassinsF-94035 Créteil CedexPhone ++33-149-562-030FAX ++33-149-562-039**********************http:/uterbach.fr Lauterbach Japan, Ltd.3-9-5 Shinyokohama Kouhoku-kuY okohama-shi Japan 222-0033Phone ++81-45-477-4511 FAX -4519*********************uterbach.co.jp Lauterbach s.r.l.Lauterbach s.r.l.Via Enzo Ferrieri 12I-20153 MilanoPhone ++39 02 45490282FAX ++39 02 45490428*********************uterbach.itSuzhou Lauterbach Consulting Co.,Ltd.Room 1605, Xing Hai International Square No.200, Xing Hai StreetSuzhou, 215021 PR of ChinaPhone: 0086-512 6265 8030FAX: 0086-512 6265 8032*********************DisclaimerThe information presented is intended to give overview information only.Changes and technical enhancements or modifications can be made with-out notice.。
ARM trace32 内存调试命令调试方法教程1 IEEE Standard 1149.1 - Test Access Port and Boundary-Scan Architecture既然是介绍JTAG调试,还是让我们从IEEE的JTAG调试标准开始吧。
JTAG是JOINT TEST ACTION GROUP的简称。
IEEE 1149.1标准就是由JTAG这个组织最初提出的,最终由IEEE批准并且标准化的。
所以,这个IEEE 1149.1这个标准一般也俗称JTAG调试标准。
接下来的这一部分,主要简单的介绍了TAP (TEST ACCESS PORT) 和BOUNDARY-SCAN ARCHITECTURE的基本构架。
虽然不是很全面,但对了解JTAG的基本原理来说,应该是差不离了。
如果希望更全面深入的了解JTAG的工作原理,可以参考IEEE 1149.1标准。
这篇文章主要介绍ARM JTAG调试的基本原理。
基本的内容包括了TAP (TEST ACCESS PORT) 和BOUNDARY-SCAN ARCHITECTURE的介绍,在此基础上,结合ARM7TDMI详细介绍了的JTAG调试原理。
这篇文章主要是总结了前段时间的一些心得体会,希望对想了解ARM JTAG调试的网友们有所帮助。
我个人对ARM JTAG的理解还不是很透彻,在文章中,难免会有偏失和不准确的地方,希望精通JTAG调试原理的大侠们不要拍砖,有什么问题提出来,我一定尽力纠正。
同时也欢迎对ARM JTAG调试感兴趣的朋友们一起交流学习2-1 边界扫描在JTAG调试当中,边界扫描(Boundary-Scan)是一个很重要的概念。
边界扫描技术的基本思想是在靠近芯片的输入输出管脚上增加一个移位寄存器单元。
因为这些移位寄存器单元都分布在芯片的边界上(周围),所以被称为边界扫描寄存器(Boundary-Scan Register Cell)。
TRACE32调试技巧TRACE32是一款功能强大的软件调试工具,广泛应用于嵌入式系统的调试和测试。
它提供了丰富的调试功能和强大的分析能力,可以帮助开发人员快速定位故障和优化系统性能。
下面将介绍一些TRACE32的调试技巧,帮助开发人员更好地使用这个工具。
1.使用实时跟踪功能:TRACE32支持实时跟踪功能,可以实时收集目标系统的执行信息。
通过实时跟踪,开发人员可以查看程序的执行路径、函数调用关系、指令执行时间等信息,帮助快速定位程序错误和优化系统性能。
2.设置断点和触发条件:TRACE32支持设置断点和触发条件,可以在软件运行过程中暂停程序执行。
开发人员可以根据需要设置断点,然后在断点处查看当前程序状态和变量值,帮助分析程序执行流程和调试错误。
3.使用慢速模式:TRACE32支持慢速模式,在这种模式下,可以减慢目标系统的执行速度,帮助开发人员更好地观察和分析程序的执行情况。
慢速模式可以有效地帮助调试时间较短的代码片段,并且可以避免程序执行过快导致的观察困难。
4.使用非侵入式调试功能:TRACE32支持非侵入式调试功能,可以在不停止目标系统的情况下进行调试。
这对于那些不能中断执行的实时系统非常有用,可以帮助开发人员在不中断系统运行的情况下进行调试和分析。
5.使用时间相关分析功能:TRACE32还提供了强大的时间相关分析功能,可以帮助开发人员分析程序的响应时间、任务调度时间等性能指标。
通过时间相关分析,开发人员可以发现程序中的时间瓶颈,并做出相应的优化措施。
6.使用多核调试功能:TRACE32支持多核调试功能,可以帮助开发人员调试多核处理器上的并行程序。
通过多核调试,开发人员可以查看每个核心上的程序执行情况,帮助分析并行程序的运行状态和调试错误。
7.使用快速调试功能:TRACE32拥有快速调试功能,可以加快调试过程。
通过快速调试,开发人员可以在源代码级别进行调试,而无需重新编译和烧写目标系统。
8.使用数据跟踪功能:TRACE32支持数据跟踪功能,可以帮助开发人员收集指定变量的值和修改历史。