lauter bach trace 32 ug

Upload: prasannanp

Post on 02-Mar-2016

32 views

Category:

Documents


0 download

TRANSCRIPT

  • DLauteTar

    Freescale Semiconductor, Inc.

    For Morebugger

    rbach TRACE32 get Interface

    e Information: www.freescale.com

  • Product Manual Manual Date

    DebuggerDebugger - Lauterbach Trace 32 Target Interface

    02/99

    Freescale Semiconductor, Inc.

    For More Information: www.freescale.com

  • 3 Copyright 2002 Metrow

    ContentsLauterbach TRACE32 Target Interface . . . . . . . . . . . . 5

    Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Interfacing Your System and the Target . . . . . . . . . . . . . . . . . . . . . 6Loading the TRACLoad TRACE32 D

    Configuration of theConfiguration of theThethe Debugger De

    Default Target SetTRACE32 Paramete

    Trace32 Menu EntReset . . . . . . . . . . . Connect to TRACE3CPU Identification Bus Tracing . . . . . .

    Bus Analyzer . . . Introduction to the BUsing the Bus AnalyConfigure the Bus ACollecting Data . . . Viewing Collected DAdd / Remove ItemsScrolling the DisplaCommands in the R

    TRACE32 Boot CTRACE32 Target TRACE32 Reset CTRACE32 Analyz

    TRACE32 CommIndex . . . . . . . . .

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    E32 Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6river program . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 CPU used by the debugger . . . . . . . . . . . . . . . . . . . . . . . . . . 9 TRACE32 system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9bugger Status Bar for the TRACE32. . . . . . . . . . . . . . . . . . 10

    up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10rs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11ries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14us Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14zer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14nalyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17ata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 in the Trace Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    y. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22un Menu in the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . 23ommand File . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Startup File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29ommand File . . . . . . . . . . . . . . . . . . . . . . . . . . 29er Setup File . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    ands . . . . . . . . . . . . . . . . . . . . . . . . . .31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37

    Information: www.freescale.com

  • 4

    Copyright 2002 Metrow

    Freescale Semiconductor, Inc.

    Fo

    erks Debuggerr More Information: www.freescale.com

  • 5 Copyright 2002 Metrow

    Lauterbach TRACE32 Target Interface

    IntroductioAnother advanced feature load different target compTRACE32 Development SLauterbach DatentechniDebugger supports the emIn this document, the specWith this interface, an exeexternal target system basereal target system behavioDebugger will fully supervtion such as read and writerun/stop processes in the C

    Note: Unconceexternal MCtarget compowill therefor

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    nof Debugger for the embedded systems development world is the ability to onents, which implements the interface with target systems. The ystem is introduced in this document. The TRACE32 is a product from

    k GmbH. ulator (ICE) and the background debug mode (BDM, ICD) interface.ific features of the TRACE32 target component are described. cutable program from the Debugger environment can be downloaded to an d on a Motorola MCU, which will execute it and give the feedback of the

    ur to Debugger. ise and monitor the MCU of the target system and control the CPU execu- in internal/external memory (even with the CPU running), single-step/PU and the set of breakpoints in the code.

    rned Components As the code is executed by an U the memory statistics are not available with the TRACE 32 nent and Profiling, Coverage analysing and I/O Simulation

    e not work with the TRACE 32 target component.

    Information: www.freescale.com

  • 6

    Copyright 2002 Metrow

    GeneralIn this chapter the specific features of the TRACE32 are described in detail. This includes a detailed description of the function and purpose of the Bus analyzer. The corresponding windows and dialog boxes are also explained together with the features they belong to.

    TRACE32 The TRACE32 is an emulator system for MCUs, that provides emulation memory and a bus state analyzer.

    Interfaces BeforeTRACE32 host driver proFor communication with tInterface (API) deliveredinterface with the TRACEAPI requests to the TRACface.

    InterfacingFirst the TRACE32 host dthe In Circuit Emulator m(Ethernet, parallel, optical

    Preparing the TRured for a usage with a remgramming Interface (API)CONFIG.T32 file:

    IMPORTANT: Make sureThe port number used her

    Hardware Conneation System Manual.

    Loading thUsually the target is set in

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    any communication between TRACE 32 and the Debugger is possible, the gram delivered from Lauterbach GmbH must be loaded.he TRACE32 system, the Debugger uses the Application Programming from Lauterbach GmbH. This interface (API) communicates via a socket 32 host driver program. The TRACE32 host driver program just routes the E32 system. This can be done with an Ethernet, parallel or optical inter-

    Your System and the Targetriver program from Lauterbach GmbH for the In Circuit Debugger or for ust be installed. Be sure that the installation is correct for the used interface ...).

    ACE32 driver The TRACE32 host driver program has to be config-ote control, such as the Debugger which uses itself the Application Pro-

    . To allow and set up a remote control, add the following lines to the

    RCL=NETASSISTPACKLEN=1024PORT=20000

    to have an empty line before RCL=NETASSIST.e must correspond with the configuration of the UDP port in the Debugger.

    ction For the hardware connection, please refer to the TRACE32 Oper-

    e TRACE32 Target the PROJECT.INI file, where Target=Trace32.

    r More Information: www.freescale.com

  • 7 Copyright 2002 Metrow

    If the connection between the Debugger and the TRACE32 system is not already set, a Load TRACE32 Driver dialog pops up and you can set yourself the path and name of the TRACE32 host driver program and the UDP port. Please see the following section Load TRACE32 Driver.If no target is set in the PROJECT.INI file or if a different target is set, you can load the TRACE32 target component selecting in the main menu Component | Set Target... as shown below and choose Trace32 in the list of proposed targets.

    After a successful target lo

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    ading, the Target menu item is replaced by Trace32.

    Information: www.freescale.com

  • 8

    Copyright 2002 Metrow

    Load TRACE32 Driver programWhile the Trace32 target component is loaded and the Trace32 Driver is not yet opened, the dialog shown below will pop up.

    Make sure that the parameUDP port corresponds witbetween the Debugger and

    Load TRACE32 DTrace32 target is loaded, abelow.

    .Enter the path and name oon button Browse to find tSet the UDP port on the saUDP port is 20000.

    While the TRACE32 Drivpops up. The boot process

    Note: This dialog can also be opened selecting Trace32 | Connect... when previ-ous connection attempts with a TRACE32 failed or if the communication was lost.

    Note: The name ofthrough thisof the DEFAU

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    ters on your host computer are correctly configured. Check that the used h the port specified in the CONFIG.T32 file, otherwise no communication the target is possible.

    river If the TRACE32 Driver program is not yet opened and the dialog box Load TRACE32 Driver pops up in the Debugger as shown

    f the TRACE32 Driver program in the TRACE32 Driver edit box or click he program. The default path is C:\T32\T32W95.EXE.me value as specified in the CONFIG.T32 file and click OK. The default

    er is loading and the TRACE32 system is booting, the following dialog can last up to a minute and can be aborted by pressing the Abort button.

    the TRACE32 Driver and the UDP port which are saved dialog, override the environment variables DRIVER and PORT LT.ENV file.

    r More Information: www.freescale.com

  • 9 Copyright 2002 Metrow

    The program name and thebe established, press Aboring Trace32 | Connect.

    Configuration oThe Lauterbach debugger nected derivative. Usuallylocated in the prog directoIf the debugger can not retIdentification dialog is dis

    This dialog allows to selecby the Lauterbach debuggselected CPU is set and thFor more information regaIdentification in this manu

    Configuration oAfter the boot process, thetent of this file consists ofbe adapted depending on tBoot Command File sectio

    Note: This dialog crently set CPTrace32.ini f

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    used UDP port are saved for later debug sessions. If no connection could t button, check if the used parameters are correct and try it again by choos-

    f the CPU used by the debuggerreturns a string which can be used to retrieve the CPU of the currently con- this CPU identification is handled in the TRACE32.INI file which is ry of your installation.rieve the current CPU identification from the derivative string, the CPU played.

    t the CPU corresponding to the string describing the derivative returned er. Use the CPU list box to select the correct CPU. When clicking OK, the e TRACE32.INI file is created/updated.rding this dialog, please refers to section Trace32 Menu Entries, CPU al.

    f the TRACE32 system TRACE32 system is configured by calling the BOOT.CMD file. The con- commands from Lauterbach to correctly set the emulator. This file must he MCU used. Examples of BOOT.CMD files are given in the TRACE32 n of this manual.

    an also be opened selecting Trace32 | Set CPU... if the cur-U does not match the current derivative or to update the ile.

    Information: www.freescale.com

  • 10

    Copyright 2002 Metrow

    Thethe Debugger Debugger Status Bar for the TRACE32

    When the TRACE32 TargDebugger status bar (fromDebugger status.

    Default TarAs any other target, the TRset as a default target in thtory.Example of PROJECT.I

    Note: For details about the Configuration please see the TRACE32 manuals from Lauterbach GmbH.

    Note: For further ger manual.

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    et Component has been loaded, specific information are given in the left to right): the BUS analyzer mode, the MCU of the probe and the

    get SetupACE32 target component can be loaded from the Target menu or can be

    e PROJECT.INI file which should be located in the current project direc-

    NI file.[HI-WAVE]Window0=Source 0 0 50 40Window1=Assembly 50 0 50 40Window2=Register 50 40 50 30Window3=Memory 50 70 50 30Window4=Data 0 40 50 25Window5=Command 0 65 50 20Window6=Module 0 85 50 15Target=Trace32

    [TRACE32]PORT=20000SHOWPROT=1DRIVER=C:\T32\T32w95.exe (emulator driver) orDRIVER=C:\T32BDM\T32m12.exe (BDM, ICD driver)

    information about the PROJECT.INI file please see the Debug-

    r More Information: www.freescale.com

  • 11

    Copyright 2002 Metrow

    TRACE32 ParametersUnder normal usage, these parameters are once interactively set at installation in the PROJECT.INI file and used in the future debugging sessions.

    DRIVER This parameter specifies the path and the name of the TRACE32 Driver program. C:\T32\T32W95.EXE is the default driver program name for PCs. Example: DRIVER=C:\T32\T32w95.exe

    PORT The UDP Ponumber must correspond wExample:

    SHOWPROT Thiit) at the first communicatcheck the Show Protocol cthe Command Line compoPlease see section Load TR

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    rt used between the Debugger and TRACE32 Driver program. This port ith the port specified in the CONFIG.T32 file. PORT=20000

    s variable is set to 0 or 1 (1 to show the communication protocol, 0 to hide ion attempt with the target. In the Load TRACE32 Driver dialog, you can heckbox to decide if you want to display the communication protocol in nent window. This option is saved under the SHOWPROT variable.ACE32 Driver program, Load TRACE32 Driver.

    Information: www.freescale.com

  • 12

    Copyright 2002 Metrow

    Trace32 Menu Entries

    ResetThe Trace32 | Reset commlocated in the current proj

    Connect to TRIf Trace32 | Connect is selthere is no connection to t

    TRACE32 Driver TRACE32 Driver edit boxC:\T32\T32w95.exe.

    UDP Port Set the default UDP port is 20000

    Show Protocol command line window, ch

    Please see section Load T

    Note: This feature

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    and resets the CPU and executes the RESET.CMD file, which must be ect directory.

    ACE32ected, the TRACE32 system is initialized by calling the BOOT.CMD file. If he TRACE32 system, the following dialog is displayed.

    Enter the path and name of the TRACE32 Driver program in the or click on button Browse to find the program. The default path is

    UDP port on the same value as specified in the CONFIG.T32 file. The .

    To report all the used TRACE32 API functions with there parameters in the eck the check box Show Protocol.

    RACE32 Driver program, Load TRACE32 Driver.

    is used by support personnel from Metrowerks.

    r More Information: www.freescale.com

  • 13

    Copyright 2002 Metrow

    CPU IdentificationThe TRACE32.INI file is used to provide the information on the currently used CPU from a string describing the derivative returned by the Lauterbach Trace32 debugger. If this information is corrupted or missing, select TRACE32 | Set CPU... to specify the CPU corre-sponding to the MCU you are using. The CPU Identification dialog is displayed.

    This dialog allows to selecby the Lauterbach debugg

    Select from the CPU list b CPU08 for M68HC08 CPU11 for M68HC11 CPU12 for M68HC12 CPU32 for M68K deriWhen clicking OK, the cothe TRACE32.INI file lo

    Bus TracingSelect TRACE32 | Bus Train this document.

    Note: This dialog ireturned from

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    t the CPU corresponding to the string describing the derivative returned er.

    ox the CPU corresponding to the derivative you are using: derivatives,derivatives, derivatives,vatives. rrect CPU is set in the debugger and the information is saved/updated in cated in the prog directory of your installation.

    ce to run the Bus Analyser. For all details please see section Bus Analyser

    s also opened if the trace32.ini file is missing or if the string the Lauterbach device is no present in this file.

    Information: www.freescale.com

  • 14

    Copyright 2002 Metrow

    Bus Analyzer

    Introduction to the Bus AnalyzerBesides the emulation of the target system MCU, the most important feature that can be offered by a microcontroller development tool is an instrument to analyse program execution activities on the tar-get MCU bus. This analyse allows the user to determine what is occurring in a system without actu-ally affecting it.

    Trace Modes If tmeans: The AutoArm option i

    gram is started, and sw The FIFO operation m

    recording. The SLAVE and PrePo

    program is running angram.

    The size of the trace bIt is possible to set up the component window or in

    Textual or Graphcally. Use the horizontal athe display of the trace bu

    Using the Bus The Bus analyzer functiontures of the TRACE32 Bumenu and the display winThis menu is also availablFrom the user's perspectivdesired bus data (running

    Note: The Bus anadoes not sho

    Note: For details aof Lauterbac

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    he bus analyzer has not been configured, the default settings are used. That

    s enabled, i.e the analyzer will be armed automatically when the user pro-itched to off, after the program has been stopped. ode is used, i.e the analyzer records the last cycles before stopping the

    st mode are enabled, i.e the analyzer samples only cycles while the user d the first and last cycle is always sampled, regardless of the trigger pro-

    uffer is 32676 records.bus analyzer by using Command Line commands in the Command Line the ANALYZER.CMD file. This file is called when selecting Trace | Setup.

    ical The Bus analyzer can display the data either textually or graphi-nd vertical scroll bars, as in other Windows applications, to move around ffer contents.

    Analyzers like any Debugger component, and has its own menu to control the fea-s analyzer hardware. This menu entry is called Trace in the Debugger main dow is also called Trace. Choose Trace... to find the menu shown below. e as a pop-up menu in the Trace window when right-clicking. e, using the Bus analyzer requires two steps. These steps are, collecting the the program) and viewing the collected data.

    lyzer in the TRACE32 shows the logical state of the MCU bus. It w signal hold and setup times.

    bout the Bus analyzer please see to the corresponding manuals h GmbH.

    r More Information: www.freescale.com

  • 15

    Copyright 2002 Metrow

    The Trace windo

    Configure the BThe Trace32 Emulator allowhich describes the triggeloaded into the Trace32. Since this procedure needswhich allows to configurethe full set of features. Thure all the items from the dditions, the TRACE32 hosHowever, if the Trace32 B

    Quick Trace CoSelect the Trace | Configu

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    w popup menu

    us Analyzerws to configure very complex triggers. This is done by writing a program r conditions and the behaviour of the trace logic. This program is then

    some efforts to learn, the Trace32 target component contains a dialog the most common trigger functions interactively without having to know ere are also several command line commands which will allow to config-ialog also on the Debugger command line. For more complex trigger con-t driver program can still be used in parallel to the Debugger. us Analyzer was not configured, all cycles are recorded.

    nfigurationre... Item to open the following dialog:

    Information: www.freescale.com

  • 16

    Copyright 2002 Metrow

    Triggers There areCharly. Each trigger can bWrite accesses of each Tricorresponding trigger groumal values.

    Address Each triselected, the address Itemsists of a single address anresponding trigger.

    Data Each trigger gone in the Mask field are uItem is ignored in the trigg

    External Trigger be specified in the Data fiebits that corresponds to ontrigger port used for the co

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    three Trigger groups labelled Trigger Alpha, Trigger Beta and Trigger e disabled by checking the corresponding Disable checkbox. Read- and/or gger can be specified by checking the Read and/or Write checkbox of the p. The values entered in these trigger groups are interpreted as hexadeci-

    gger group contains an Address Item. There are three modes: If Disable is is ignored in the trigger. When Address is selected, the address Item con-d if Range is selected, an address range is used as address Item in the cor-

    roup contains a Data Item. All bits of the Data field which corresponds to sed in the corresponding trigger. If the Disable box is checked, the Data er.

    Each trigger group contains an External Trigger Item. An 8-bit value can ld that defines trigger input signals on the Trace32 for the trigger. Only the e in the Mask field are used in the trigger. A and B specifies the external rresponding trigger. If Disable is selected, the external trigger Item is

    r More Information: www.freescale.com

  • 17

    Copyright 2002 Metrow

    ignored in the trigger.

    Sequencer Mode There are six different modes for the recording. All cycles records all cycles continuously. Recording stops when the number of cycles specified in the Post Trigger Counter is reached, if enabled.Events only records all cycles where a trigger triggers. Recording stops when the number of cycles specified in the Post Trigger Counter is reached, if enabled.A -> C, B -> C stops recordinTrigger Counter is enabledCounter is reached.A + B -> C stops recordingThe sequencer can be simpbled. If the Post Trigger Cthe Post Trigger Counter.

    Post Trigger Couends after the value specifrecording if the Stop progr

    Collecting Data

    Arming the Analywill be armed automaticalIn the other case, if the AuChoose the entry Trace | Aclicked, the entry changes

    Disarming the Anwill be switched to off autIn the other case, if the Authe analyzer. After the DisThe status of the Bus analythe main window.

    Start Emulation any other command whicha breakpoint, a watchpoindow is updated (see below

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    as two-event sequence by leaving trigger B disabled. If the Post Trigger ing stops after the number of cycles specified in the Post Trigger Counter

    after either trigger A or trigger B or trigger C. If the Post Trigger Counter ds after the number of cycles specified in the Post Trigger Counter is

    g after three events, A then B then C occurring in sequence. If the Post , recording stops after the number of cycles specified in the Post Trigger

    on either of two events trigger A or trigger B then followed by trigger C. lified to involve fewer than three triggers by leaving trigger A or B disa-

    ounter is enabled, data storage ends after the specified number of cycles in

    nter If the Enable post counting mode box is checked, recording data ied in Post Trigger Count is reached. The application is also stopped after am when recording terminated box is checked.

    zer If the AutoArm option is enabled (default option), the analyzer ly when the user program is started.toArm option is disabled, the Bus analyzer has to be armed to collect data. rm Analyzer to arm the Bus analyzer. After the Arm Analyzer entry was to Disarm Analyzer.

    alyzer If the AutoArm option is enabled (default option), the analyzer omatically, after the program has been stopped.toArm option is disabled, select the entry Trace | Disarm Analyzer to stop arm Analyzer entry was clicked, the entry changes to Arm Analyzer.zer is shown in the title bar of the analyzer window and in the status bar of

    To begin emulation use the command Run | Continue in the Debugger or starts program execution. Emulation continues until it is stopped by either t or manually. When the emulation stops, the data in the Bus analyzer win-).

    Information: www.freescale.com

  • 18

    Copyright 2002 Metrow

    Status Bar When the Bus analyzer is activated manually (if the AutoArm option is not used), the MBA status shown on the status bar at the bottom of the main window changes to ARMED, to indicate that the Bus analyzer is ready to begin to collect data. When emulation begins, the MCU sta-tus shown on the status bar changes to RUNNING. When the Bus analyzer collects data, the Bus ana-lyzer state changes to ANALYZING.

    Halt Data Collection To manually halt data collection, the user must select the submenu Trace | Disarm Analyzer.Disarming the analyzer stops data collection without stopping emulation.

    Halt Emulation In the other case, data collSLAVE option is disabled

    Recording Bus Doperation mode is used, thSTACK operation mode is

    Viewing Collec

    View Cycles When the desired cycles hods to view those cycles. Aest numbered frames are uframes stored before the trWhen the Bus analyzer isin the Trace window.

    Textual, Graphicset the display of the bus dThe contents of the Bus anframes or just the frames w| Items... dialog select the

    Textual DisplayIf the Textual format is chtextual form, as shown belat the bottom to display otThe marker consists of twnumber of the marked framThe Trace window containremove any item. Please s

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    if the AutoArm option is enabled (default option), data collection is halted. ection is halted, but the analyzer leaves armed. If the AutoArm- and , data collection is not halted.

    ata There are two different modes to recording bus data. If the FIFO e analyzer records the last cycles before stopping the recording. If the used, the analyzer stops recording, when the trace buffer is full.

    ted Data

    ave been collected, the Bus analyzer software provides a variety of meth-t this point, the trace buffer contains up to 32,767 stored frames. The high-

    sually the post-trigger frames. The lower-numbered frames are those igger occurred, if any were stored.

    deactivated (not in ANALYZING or ARMED state), the data is displayed

    al or Instructions To specify select one in the Trace popup menu to ata.alyzer can be displayed as text or as graphic. In the text representation, all here an instruction starts, can be displayed. The user can also in the Trace

    items which have to be displayed.

    osen the software displays all the frames of the trace buffer contents in a ow. Use the scroll bar at the right to display other frames. Use the scroll bar her signals. o horizontal lines, which are used to mark a specific frame. The frame

    e is inverted. A line of the display corresponds to the data of a frame. s the following basic items described below. It is possible to add or

    ee section Adding / Removing Items in the Trace Window.

    r More Information: www.freescale.com

  • 19

    Copyright 2002 Metrow

    Frame Is the cyclerecently stored frame is frfewer than 32768 frames h

    Address Is the adis the address on the addre

    Data Is the data buthe value on the data bus w

    Time Tag Containinto the trace buffer. The t

    Instruction If the

    Trigger A/B Cont

    Time Measuring taneously type the key 'Z' obus cycle of this frame.

    Control Signals control signals.

    Instructions OnlIf the Instructions only forcontents in a text format w

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    or the frame number 1 - 32768, that identifies the frame. The most ame 32768 (or the highest-numbered frame that has been stored when ave been stored).

    dress bus value stored in the frame, displayed as hexadecimal digits. This ss bus when the frame is strobed into the trace buffer.

    s value stored in the frame, displayed as four hexadecimal digits. This is hen the frame is strobed into the trace buffer.

    s a representation of the time tag count stored when the frame is strobed ime tag is displayed as a number of seconds or fractions of seconds.

    frame contains an instruction start, the instruction is displayed.

    ains a representation of the external triggers A and B.

    to reference a frame with a tag value of zero click on an entry and simul-n the keyboard. All other time tag values are now displayed relative to the

    The remaining fields in the Trace dialog box contain the values of the

    y Displaymat is chosen the software only displays those frames of the trace buffer here an instruction starts.

    Information: www.freescale.com

  • 20

    Copyright 2002 Metrow

    Graphical DisplaThe figure below shows thof the Bus analyzer data gdisplay formats can easilyleftmost sections of the Fiwith information about fraetc...

    Zoom In or Out see more details or to get menu.To zoom in select Trace |

    Figure above shows the grshows more detail.To zoom out select Trace

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    ye graphical display of the Bus analyzer data. The graphical representation

    ives a better overview than the textual one. Switching between the different be done at any time by selecting the menu entries in the Trace menu. The gures above and below display a textual description of the current frame me number, events, values on the data and address bus, time tag value,

    In the graphical display it is possible to 'zoom in' or to 'zoom out' either to a better general view. Zoom in / Zoom out are displayed in the Trace popup

    Zoom In or type 'I' on the keyboard.

    aphical display of the Bus analyzer data which is zoomed in and therefore

    | Zoom Out or type O on the keyboard.

    r More Information: www.freescale.com

  • 21

    Copyright 2002 Metrow

    Dragging the marker overnent windows, e.g. the southoroughly examined in ththe cursor over the graphicposition of the marker and

    ShowLocation Ilyzer menu, the marker cadows are automatically upIf the option Trace | Showonly updated, if the marke

    Add / Remove The Trace window can beare displayed in the windopossible to add new kindsthem. It is possible to perm

    To edit an item, to set its c

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    the display of the Bus analyzer data, may also generate updates in compo-rce and assembly windows. Thus the Bus analyzer data can be viewed and e continually updated windows as the marker is moved with the help of or text display of the Bus analyzer data. The vertical bar indicates the displays all the information of the current frame.

    f the option Trace | ShowLocation check box is checked in the Bus Ana-n be positioned with a left mouse click and the source and assembly win-dated as well.Location check box is not checked, the source and assembly windows are r is dragged with a right mouse click.

    Items in the Trace Window supplied with new items. In the default configuration, the following items w: Frame, Events, Address, Data, Time Tag, Instruction and R/W. It is of items (predefined and given in a list box in this dialog) and to remove

    ute items in text or graphic mode simply dragging them into the window.

    olour or to give a specific name select More.

    Information: www.freescale.com

  • 22

    Copyright 2002 Metrow

    Scrolling the DScrolling can be done in ddisplay can be scrolled to tern (see below).

    Search for a FraSelect Trace | Go to Framnumber. If a frame with thble, the Bus analyzer windmessage is shown in a mo

    Search for a PaTo search for a frame withbus cycles that match the command, e.g analyzer.findata byte. Select Trace | S

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    isplayifferent ways. The scrollbars can be used as in Windows applications or the a specific trace buffer frame. It is also possible to search for a specific pat-

    mee... to search for an occurrence of a frame and enter the desired frame is number is found, the frame is selected. If the selected frame is not visi-ow is scrolled to make the frame visible. If no frame can be found an error dal dialog box.

    ttern a specific pattern define the search pattern to use in order to find all stored pattern. The pattern can be defined as string which consists of a TRACE32 d, address 100--200 data.b 55 will search for matching address range and earch|Pattern...

    r More Information: www.freescale.com

  • 23

    Copyright 2002 Metrow

    The Bus analyzer will loopattern and display this ar

    Cancel Button TCancel.

    Forward Button frame which matches the s

    Backward Buttonlast frame which matches

    Next Pattern To | Next Pattern. If the patte

    Previous Patternrence of the pattern. If the

    Commands in These menu commands coprocedure menu.

    Continue Continutime error is detected. Exe

    Halt This commandtion program.

    Step If the applicaticution continues until the

    Flat Is very similar t

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    k at specific collected cycles, matches the specific frame that shows the ea in the window of the Debugger.

    o remove the dialog box without any parameter being changed, select

    To search forwards select Forward and a search is done to find the first pecified pattern.

    To search backwards select Backward and a search is done to find the the specified pattern.

    search for the next occurrence of the pattern select the entry Trace |Search rn is not found, an error message is shown in a modal dialog box.

    Select Trace |Search | Previous Pattern to search for the previous occur- pattern is not found, an error message is shown in a modal dialog box.

    the Run Menu in the Debuggerntrol the program flow and are equivalent to the commands found in the

    es execution of a halted program until it reaches a breakpoint or until a run cution also continues until a program is halted by the Halt command.

    stops the target processor and allows to examine the state of the applica-

    on is halted, this command performs a single step on source level, i.e. exe-next source reference is reached.

    o single stepping, but no stepping into called procedures.

    Information: www.freescale.com

  • 24

    Copyright 2002 Metrow

    Asm Step A halted program continues for one machine instruction from the point it was halted. This command is the same command as the single step command in the assembly window.

    Freescale Semiconductor, Inc.

    Fo

    erks Debuggerr More Information: www.freescale.com

  • 25

    Copyright 2002 Metrow

    Dumping the Bus analyzer data to a file To dump the Bus analyzer data to a file choose Trace | Dump...

    Dump File The Duand dump them to a file. OThe group box Dump File written, can be entered.

    Select When the bufile is than displayed in th

    Frames to Dumpframes that have to be dumJust the frames within the

    All To dump all the f

    Instructions To dthe selected range, select I

    OK Button When

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    mp... command creates a modal dialog box which allows to select frames nly the items actually displayed in the Bus analyzer window are dumped.contains an edit field where the name of the file to which the data has to be

    tton Select is pressed, a standard file select box is opened and the selected e edit field.

    The elements in the group box Frames to Dump allow to select the ped to the file.

    range defined by the two edit fields From: and To: are dumped to the file.

    rames within the selected range to the file, select All.

    ump just the frames where an instruction starts and this instruction is in nstructions.

    the OK button is pressed, the dialog box is removed and the Bus analyzer

    Information: www.freescale.com

  • 26

    Copyright 2002 Metrow

    data is dumped to the file.

    Cancel Button When the Cancel button is pressed, the dialog box is removed without any data being dumped to a file.

    Note: For more details about the Bus Analyser, please refer to TRACE32 State Analyzer User's Guide (version 96/01/08) from Lauterbach Datentechnik GmbH .

    Freescale Semiconductor, Inc.

    Fo

    erks Debuggerr More Information: www.freescale.com

  • 27

    Copyright 2002 Metrow

    TRACE32 Boot Command FileThe BOOT.CMD command file is needed to configure the TRACE32 system and is started while the boot process. The boot command file contains a basic configuration and can be adapted if necessary. The commands listed below might be present in this file. This is not an exhaustive list, other might also be present.system.up or system.mode aloneintBefore any communication to the TRACE32 system is possible, the system must be powered up. The operating mode is set automatically according the available signals. system.mode aloneint should be used when usingsystem.access cpuThe access to the emulatioused emulation probe.map.def 0200--0fffThrough this command, mmode is selected and the mmay cause problems with map.opfetch 08000-The opfetch command defgram fetches and what aremap.ram 0200--0fffThrough this command, mmap.internUsing this command, the wsystem.option mapgThis command can be usedthe MCU embedded mem

    An example for a BOOT.C

    An example for a BOOT.C

    An example for a BOOT.C

    An example for a BOOT.C

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    an emulator with only the probe.

    n probe must be enabled. The keyword used after access depends on the

    femory is mapped from address 0x200...0xFFFF. The slow mapper emory is mapped intern. Do not map memory to the register map, this

    the IPRU.-08fff

    ines program area. For the emulator it is necessary to know what are pro- data fetches. This command depends on the used emulation probe.femory is mapped from address 0x200 to 0xFFFF.

    hole address range is mapped to internal, the emulation memory is used.ap on if necessary to map the locations with no internal ram or rom while using

    ory.

    MD file used for the emulator with a HC08 probe (M68HC08AZ):SYSTEM.Option MAPGAP ONSYSTEM.Mode aloneint

    ;Disable Watchdog for the M68HC08AZ probeData.Set D:1F 1

    MD file used for the emulator with a HC11 probe:system.up map.ram 0000--00fffmap.ram 01040--0ffff map.intern

    MD file used for the emulator with a HC12 probe:system.upsystem.access cpumap.def 0200--0ffffmap.opfetch 08000--08fff

    MD file used for the HC12 ICD/BDM:

    Information: www.freescale.com

  • 28

    Copyright 2002 Metrow

    system.cpu m68HC12Bsystem.up

    An example for a BOOT.CMD file used for the emulator with a M68K probe (M68332):; system upsystem.mode aloneint; map emulation memorymap.def 0--0ffffmap.opfetch 01000--03fffmap.ram 04000--043ff

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    ; disable watchdogdata.set 0fffa21 40; define pinassignmentdata.set 0fffa44 %w 1557data.set 0fffa46 %w 155

    r More Information: www.freescale.com

  • 29

    Copyright 2002 Metrow

    An example for a BOOT.CMD file used for the M68K ICD/BDM:system.cpu M68332system.up

    TRACE32 TThe startup command file TRACE32 target driver haAny Debugger command introduced in the DebuggeExample of a startup.

    TRACE32 RTo execute the TRACE32This file must be located infile.

    TRACE32 ATo setup the Bus analyzer,file, select Setup in the TraDebugger command can b

    Note: For details about the Configuration please see the TRACE32 manuals from Lauterbach GmbH.

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    arget Startup FileSTARTUP.CMD is executed by the Debugger immediately after the s been loaded. This file must be located in the current project directory. can be used in this file and advantage taken of the wide set of commands r manual.cmd file content:

    wb 0x0035 0x00wb 0x0012 0x11

    eset Command File reset command file RESET.CMD select Reset in the Trace32 menu. the current project directory. Any Debugger command can be used in this

    nalyzer Setup File the ANALYZER.CMD file can be used. To execute the analyzer command ce menu. This file must be located in the current project directory. Any e used in this file.

    Information: www.freescale.com

  • 30

    Copyright 2002 Metrow

    Freescale Semiconductor, Inc.

    Fo

    erks Debuggerr More Information: www.freescale.com

  • 31

    Copyright 2002 Metrow

    TRACE32 Commands

    This section describes the TRACE32 specific commands.TRACE32 specific commands are used like any other commands when typing them in the Command Line component or when inserting them into a command file.For further details about cCommands and also sectio

    PROTOCOLIf this command is used, amand Line component win

    Syntax: PROTOCO

    Example PROTOC

    Pass Through PThis command executes alows the PT command, anthe TRACE32 command,

    Syntax: PT

    , address 100--200 data.b 55

    PU and executes the reset.cmd file.

    is used by support personnel from Motorola or Metrowerks.

    Information: www.freescale.com

  • 32

    Copyright 2002 Metrow

    TRACE32 CommandsThe TRACE32 commands listed below can be used directly. For the word before the dot, the short form is not allowed.

    Syntax: .

    Example ANALYZER.f , address 100--200 data.b 55 The following TRACE32 commands are available:ANALYZER ,BREAK, CMMU, MODE, NAME, ORUNTIME, SETUP, SPTERM, TRADDRESS, T

    Clear TriggerThe CT command clears tcommand also disables thafter the Trigger Program Trigger (ST) command, anthe Trigger Enable (TE) cSequencer mode and the P

    Syntax: CT listlist specifies a list of tr* specifies all triggers (A,

    Example CT A

    Set TriggerThe ST command sets thethe trigger id is entered, thlog, with which the user sTrace32 after the Trigger

    Syntax: ST [i[([;

    id Specifies the trigger id

    Note: For more detor Referenc

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    OUNT ,DATA, EXCEPTION, FLAG, FLASH, FPU, GO, MAP, N, PER, PULSE, PULSE2, REFRESH, REGISTER, REST32, OT, STEP, STORE, SYMBOL, SYNCH, SYSTEM, TASK, REVENT, TRIN, TRIGGER, VCO

    he values of specified bus analyzer triggers (events), A, B and/or C. The e cleared triggers. The trigger are cleared in the trigger unit of the Trace32 (TP) command has been executed. The trigger values are set by the Set d the Quick Trace Configuration dialog windows. Triggers are enabled by

    ommand; Triggers are disabled by the Trigger Disable (TD) command. The ost trigger counter are not concerned from the Clear Trigger command.

    | *igger identifiers. B and C).

    value of one of the three triggers. If no parameters are specified or if only e command interpreter will display the Quick Trigger Configuration dia-

    ets a trigger value interactively. The trigger is set in the trigger unit of the Program (TP) command has been executed.

    d [(address|addressRange|,) data|,)[clipsId clips)]]] R|;W|;RW][;D]] of the analyzer trigger, A, B or C.

    tails about these commands, please refer to TRACE32 Emula-e (version 96/01/08) from Lauterbach Datentechnik GmbH.

    r More Information: www.freescale.com

  • 33

    Copyright 2002 Metrow

    address: An address to which a trigger is set. The address is specified with an address constant, as follows:addressRange: A range of addresses within which a trigger is set. The address range can be spec-ified with a starting and ending address constant, or with a starting address and a length value, as fol-lows:start-address[..end-address]orstart-address[::length], The comma indicates that the address, address range, data or clips has been omitted. The omitted item is ignored in the triggdata: A data value that dvalue[:mask]When a mask is entered, ocomparison.clipsId specifies the eclips: A 8-bit value thatvalue is specified as followclips[:mask]When a mask is entered, ocomparison.;R: Trigger on a read bus ;W: Trigger on a write bus;RW: Trigger on read and ;D: Disable trigger; i.e., s

    example: STA 0xSets analyzer trigger A to

    example: STB , Sets analyzer triggers B to

    example: STC ,,Sets analyzer triggers C totrigger is set to 0xFF that

    Enable TriggerThe TE command enablesgers are set by the Set Trigmand. Another related comenabled in the trigger unitcuted.

    Syntax: TE listlist: A list of triggers tolowing trigger by a comm

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    er.efines the trigger. The value is specified as follows:

    nly the bits of the value that correspond to ones in the mask are used in the

    xternal trigger port A or B. defines logic clip signals on the Trace32 analyzer for the trigger. The s:

    nly the bits of the value that correspond to ones in the mask are used in the

    cycle only. cycle only.write bus cycleset trigger value and disable trigger.

    1000match accesses at address $1000.

    4 match accesses with a data value of 4, at any address.

    A 0x11:0xFF match external trigger A with data signals 0x11. The mask for the external means that all 8 bit are used in comparison.

    specified triggers, whether these triggers have been set or disabled. Trig-ger (ST) command, and are disabled by the Trigger Disable (TD) com-mand, the Trigger Clear (CT) command, clears all triggers. The trigger is

    of the Trace32 after the Trigger Program (TP) command has been exe-

    | * be enabled; each trigger is either A, B or C and is separated from any fol-a.

    Information: www.freescale.com

  • 34

    Copyright 2002 Metrow

    *: All triggers (A, B and C).

    example: TE A,BEnables triggers A and B.

    example: TE *Enables all triggers.

    Disable TriggerThe TD command disablegers are set by the Set TrigAnother related commandbled in the trigger unit of

    Syntax: TD listlist: A list of triggers tolowing trigger by a comm*: All triggers (A, B and C

    example: TD A,BDisables triggers A and B

    example: TD *Disables all triggers.

    Set Sequencer The SQ command sets theinterpreter displays the Quthe sequencer interactivelyTrigger Program (TP) com

    Syntax: SQ [modmode: Specifies the sequALL ReEVENT ReSEQ0 SeSEQ1 SeSEQ2 SeSEQ3 SeFor details about the sequcount: Sets the post trigpost trigger counter is spe

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    s specified triggers, whether these triggers have been set or enabled. Trig-ger (ST) command, and are enabled by the Trigger Enable (TE) command. , the Trigger Clear (CT) command, clears all triggers. The trigger is disa-the Trace32 after the Trigger Program (TP) command has been executed.

    | * be disabled; each trigger is either A, B or C and is separated from any fol-a.).

    .

    Mode analyzer sequencer mode. If no parameters are specified, the command ick Trace Configuration dialog window with which the user can program . The sequencer mode is set in the trigger unit of the Trace32 after the mand has been executed.

    e [count[;S]]]

    encer mode. The following modes are available: cords all bus cycles.cords events only.quential recording mode: A -> C, B B -> Cquential recording mode: A + B -> Cential recording mode please see in chapter Quick Trace Configuration.ger counter. The recording stops after the specified value is reached. If the cified it is enabled automatically.

    r More Information: www.freescale.com

  • 35

    Copyright 2002 Metrow

    ;S: If this option is set, the program is also stopped after the recording is terminated.

    example: SQ EVENT 100;SWith this settings, only the events are recorded. After 100 events the recording and the application is stopped.

    Set EventThe SE command sets theTrigger. If no parameters aration dialog window withautomatic if the Trigger issible to enable and disableof the Trace32 after the Tr

    Syntax: SE[id[(id: Specifies the trigger i, The comma indicates thnot modified.addressMode: Specifiedis disaddress a srange andataMode: Specifies theen endis disclipsMode: Specifies thdis disA usB us

    example: SEA adWith this settings, a singleger A. The data mode is n

    Trigger ProgramThe TP loads the settings dof the Trace32.

    Syntax: TP

    example: TP Loads the current settings

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    mode of the different input events (address, data or clips) for the specified re specified, the command interpreter displays the Quick Trace Configu- which the user can program the sequencer interactively. The mode is set set with the ST Command. However, through the SE Command it is pos- single input events of each Trigger. The events are set in the trigger unit igger Program (TP) command has been executed.

    addressMode|,)[(dataMode|,)[clipsMode]]]]

    d of the analyzer trigger, A, B or C.at the addressMode or dataMode, has been omitted. The omitted item is

    s the address mode. The following modes are available: able address event in the triggeringle address is used in the trigger address range is used in the trigger data mode. The following modes are available:ables data eventables data evente clips mode. The following modes are available:ables external trigger event

    e external trigger port Ae external trigger port B

    dress,A address and the external trigger port A is used as trigger events in the trig-ot modified.

    one through the commands TE, TD ,ST ,CT, SQ and SE in the trigger unit

    into the trigger unit.

    Information: www.freescale.com

  • 36

    Copyright 2002 Metrow

    Freescale Semiconductor, Inc.

    Fo

    erks Debuggerr More Information: www.freescale.com

  • Index 37

    Copyright 2002 Metrow

    Index

    AANALYZER.CMD 14, 29

    BBDM12 10BOOT.CMD 9, 27, 28, 29Bus Analyzer 14

    CCollecting Data 17Commands 31Communication ConfiguraCONFIG.T32 6CPU Identification dialogCPU08 27CPU11 27CPU12 27CT 32

    DData Dump 25Display

    Graphical 20Instructions Only 19Textual 18

    DRIVER 10, 11

    EExternal Trigger 16

    HHardware Connection 6HC08 27HC11 27HC12 27

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    tion 6

    9, 13

    Information: www.freescale.com

  • 38

    Copyright 2002 Metrow

    MM68K 28map.def 27map.intern 27map.opfetch 27map.ram 27

    PPORT 10, 11Post Trigger Counter 17PROJECT.INI 6, 10PROTOCOL 31PT 31

    QQuick Trace Configuratio

    RRESET 31RESET.CMD 29Run Menu 23

    SScrolling Display 22SE 35Search

    Frame 22Pattern 22

    Sequencer Mode 17SHOWPROT 10, 11SQ 34ST 32STARTUP.CMD 29system.access cpu 27system.option mapgap onsystem.up 27

    TTD 34TE 33TP 35TRACE32 6, 8, 9, 10TRACE32.INI 9, 13

    Freescale Semiconductor, Inc.

    Fo

    erks Debugger

    n 15

    27

    r More Information: www.freescale.com

  • Index 39

    Copyright 2002 Metrow

    Triggers 16

    UUDP port 6

    VViewing Data 18

    WWindow

    Bus Analyzer 14Bus Analyzer Textual Bus Analyzer ZoomedDump Bus Analyzer F

    Freescale Semiconductor, Inc.

    For More

    erks Debugger

    Display 19 In Display 20rames 25

    Information: www.freescale.com

  • 40

    Copyright 2002 Metrow

    Freescale Semiconductor, Inc.

    Fo

    erks Debuggerr More Information: www.freescale.com

    ContentsLauterbach TRACE32 Target InterfaceIntroductionGeneralInterfacing Your System and the TargetLoading the TRACE32 TargetLoad TRACE32 Driver programConfiguration of the CPU used by the debuggerConfiguration of the TRACE32 systemThethe Debugger Debugger Status Bar for the TRACE32

    Default Target SetupTRACE32 Parameters

    Trace32 Menu EntriesResetConnect to TRACE32CPU IdentificationBus Tracing

    Bus AnalyzerIntroduction to the Bus AnalyzerUsing the Bus AnalyzerThe Trace window popup menu

    Configure the Bus AnalyzerQuick Trace Configuration

    Collecting DataViewing Collected DataTextual DisplayInstructions Only DisplayGraphical Display

    Add / Remove Items in the Trace WindowScrolling the DisplaySearch for a FrameSearch for a Pattern

    Commands in the Run Menu in the DebuggerDumping the Bus analyzer data to a file

    TRACE32 Boot Command FileTRACE32 Target Startup FileTRACE32 Reset Command FileTRACE32 Analyzer Setup File

    TRACE32 CommandsPROTOCOLPass Through PTRESETTRACE32 CommandsClear TriggerSet TriggerEnable TriggerDisable TriggerSet Sequencer ModeSet EventTrigger Program

    IndexABCDEHMPQRSTUVW