background image

HC08 Full Chip Simulation

Configuration Procedure

311

Microcontrollers Debugger Manual 

* The following descriptors give the information to the PC what type of
* USB device this is and what its capabilities are. They are retrieved
* during the configuration phase.

* Note that the Vendor and Product IDs specified in this demo are
* invalid USB IDs and are given for demonstration purposes only!

* Device Descriptor
Dev_Desc:
       db  {DDesc_End-Dev_Desc} ; Descriptor Length
       db  $01                  ; Descriptor Type (Device)
       db  $00,$02              ; USB specification Release (2.00)
       db  $00                  ; Class Code
       db  $00                  ; Subclass Code
       db  $00                  ; Protocol Code
       db  $08                  ; Maximum Packet Size for EP0 (8 bytes)
       db  $00,$00              ; Vendor ID=none
       db  $00,$00              ; Product ID=none
       db  $01,$00              ; Device Release Number (1.00)
       db  $01                  ; Index to Manufacturer String Descriptor
       db  $02                  ; Index to Product String Descriptor
       db  $00                  ; Index to Device Serial Number String
                                ; Descriptor
       db  $01                  ; Number of possible configurations (1)
DDesc_End:

* Configuration Descriptor
Con_Desc:
       db  {CDesc_End-Con_Desc} ; Descriptor Length
       db  $02                  ; Descriptor Type (Configuration)
       db  {E2Desc_End-Con_Desc},$00 ; Total data length (Config-
                                     ; Interface-EP)
       db  $01                  ; Interfaces supported
       db  $01                  ; Configuration Value
       db  $00                  ; Index to String Descriptor
       db  $C0                  ; Self powered
       db  $00                  ; Maximum power consumption=0mA 
                                ; (not applicable)
CDesc_End:

* Interface Descriptor
Int_Desc:
       db  {IDesc_End-Int_Desc} ; Descriptor Length
       db  $04                  ; Descriptor Type (Interface)
       db  $00                  ; Number of Interface
       db  $00                  ; No alternate setting
       db  $02                  ; Number of endpoints

Summary of Contents for Microcontrollers

Page 1: ...Microcontrollers Debugger Manual Revised 22 October 2007 ...

Page 2: ...an and do vary in different applications and actual performance may vary over time All operating parameters including Typ icals must be validated for each customer application by customer s technical experts Freescale Semiconductor does not convey any license under its patent rights nor the rights of others Freescale Semiconductor products are not de signed intended or authorized for use as compon...

Page 3: ...26 Demo Version Limitations on Components 26 2 Debugger Interface 27 Introduction 27 Application Programs 27 Starting the Debugger 28 Starting from within the IDE 28 Debugger Command Line Start 29 Debugger Main Window 32 Debugger Main Window Toolbar 33 Debugger Main Window Status Bar 33 Main Window Menu Bar 33 Component Menu 47 Window Menu 50 Help Menu 51 Component Associated Menus 52 Component Ma...

Page 4: ...nts 61 Connection Components 62 Loading Component Windows 62 General Debugger Components 64 Assembly Component 64 Command Line Component 69 Coverage Component 73 DA C Link Component 76 Data Component 79 Memory Component 90 Module Component 102 Procedure Component 104 Profiler Component 106 Recorder Component 109 Register Component 111 Source Component 115 Terminal Component 125 Trace Component 130...

Page 5: ...9 Watchpoints 170 Watchpoints Tab 172 Multiple Selections 173 Checking Syntax 173 Setting Watchpoints 174 Setting a Read Watchpoint 174 Setting a Write Watchpoint 175 Defining a Read Write Watchpoint 175 Defining a Counting Watchpoint 176 Defining a Conditional Watchpoint 177 Deleting a Watchpoint 178 Associate a Command with a Watchpoint 178 Markpoints 179 Markpoints Tab 181 Setting Markpoints 18...

Page 6: ...p in the Application 203 On Source Level 203 Step Over a Function Call Flat Step 204 Step on Assembly Level 205 How to Work on Variables 205 Display Local Variable from a Function 205 Display Global Variable from a Module 206 Change Format for Variable Value Display 207 Modify a Variable Value 208 Get the Address Where a Variable is Allocated 208 Inspect Memory Starting at a Variable Location Addr...

Page 7: ...Configuring The Tools 226 Debugger Interface 230 DA C IDE and Debugger Communication 230 Synchronized Debugging 233 Troubleshooting 234 Book II HC08 Debug Connections Book II Contents 237 10 Microcontroller Debugging First Steps 239 Technical Considerations 239 Full Chip Simulation Considerations 239 HC08 Serial Monitor Considerations 240 ICS MON08 Interface Connection 240 P E Multilink Cyclone Pr...

Page 8: ...odule 265 External Interrupt Module 268 Keyboard Interrupt Module 269 Multi Master Inter Integrated Circuit Module 272 FCSMSCAN Controller Module 276 FCS Programmable Timer Interrupt Module 291 FCS Serial Communications Interface Module 292 FCS Slave LIN Interface Controller Module 296 FCS Serial Peripheral Interface Module 300 FCSTimer Interface Module 304 FCS Universal Serial Bus USB Module 309 ...

Page 9: ... 374 Active Mode Menu Options 375 Debugging Limitations 379 Debugging Tips 379 Device Class Description 380 Class 5 Device 380 Class 7 Device 380 Class 8 Device 380 15 HC08 ICS P E Multilink Cyclone Pro Connections 381 Connection Procedure 382 Advanced Settings Tab 384 Target MCU Security Bytes 387 STATUS Area 387 Active Mode Menu Options 390 Device Class Description 393 Class 5 Device 393 Class 7...

Page 10: ...m 405 Setting Up the Hardware 405 Establishing Communication 407 Communication Through Ethernet Port 407 Communication Through USB Port 408 Setting Up the System 409 Specifying A Connection 409 Specifying Communication Information 410 Assigning an IP Address to FSICEBASE 412 Specifying a Memory Map 414 Specifying the Clock Speed 417 Emulation System Reset 419 Setting Up Logic Cables and Connectors...

Page 11: ...nu Description 470 Active Mode Menu Options 471 20 HCS08 Open Source BDM Connection 477 HCS08 Open Source BDM Technical Considerations 477 CodeWarrior IDE and HCS08 Open Source BDM Connection 477 First Steps Using the Stationery Wizard 478 First Steps From Within an Existing Project 479 HCS08 Open Source BDM Menu Options 480 HCS08 Open Source BDM Setup Dialog Box 482 Select Derivative Dialog Box 4...

Page 12: ...out Dialog Box 502 23 HCS08 On Chip DBG Module 503 Reference Document 503 DBG Features 503 Specific Connection Menu Options 504 Context Menu Entries in Source Data Assembly and Memory Windows 505 Source and Assembly Windows 505 Trigger Stored as Markpoints 508 Data and Memory Windows 509 Expert Triggers 512 Trigger Settings 514 Trigger Module Usage 515 DBG Support Status Bar Item 515 Trigger Modul...

Page 13: ...6 Clearing Frames 536 Limitations 538 HCS08 DBG V3 New Features 538 MMU and Extended Address Space 538 LOOP1 mode 538 Ability to record until Reset and from Reset 539 Expert Triggers tab extended 543 Book IV RS08 Debug Connections Book IV Contents 545 24 RS08 Full Chip Simulation 547 Configuration Procedure 547 Connection RS08FCS Menu 548 Peripheral Modules Commands 552 25 RS08 P E Multilink Cyclo...

Page 14: ...x 566 27 SofTec RS08 Connection 567 SofTec RS08 Technical Considerations 567 CodeWarrior IDE and SofTec RS08 Connection 567 First Steps Using the Stationery Wizard 568 First Steps From Within an Existing Project 570 SofTec RS08 Menu Options 571 MCU Configuration Dialog Box 572 Communication Settings Dialog Box 572 About Dialog Box 573 Book V ColdFire V1 0 Debug Connections Book V Contents 575 28 C...

Page 15: ...ation 638 Stimulation Program Examples 638 Stimulation Input File Syntax 645 Electrical Signal Generators and Signals Application to Device Pins 647 Signal IO Component 647 Signal Description File EBNF 647 Base Signal Files Provided 652 Virtual Wire Connections with the Pinconn IO Component 652 Command Set to Apply Signal on ATD Pin 654 FCS Tutorials 654 Guess the Number 654 PWM Sample 663 29 Cold...

Page 16: ...ofTec ColdFire Menu Options 681 SofTec Coldfire Setup Dialog Box 682 Target Connection Dialog Box 683 Communication Settings Dialog Box 684 Set Derivative Dialog Box 685 About Dialog Box 686 31 ColdFire On Chip DBG Module 687 DBG Features 687 Context Menu Entries in Source Data Assembly and Memory Windows 688 Trigger Module Settings Window 689 Trigger Module Usage DBG Module Setup 689 General Sett...

Page 17: ...onsiderations 709 HCS08 CPU devices 709 HCS08 CPU devices with banked paged EEPROM 709 ColdFire CPU devices 709 NVMC Commands 710 33 Debugging Memory Map 715 Introduction 715 The DMM GUI 715 Edition dialog and memory range edition 717 Remarks 720 CPU Core Types and Priorities 721 DMM Commands 722 Debugging Memory Map Manager command set 722 Book VII Commands Book VII Contents 729 34 Debugger Engin...

Page 18: ... Variables 850 Search Order for Source Files 857 In the Debugger for C Source Files c cpp 857 In the Debugger for Assembly Source Files dbg 857 In the Debugger for Object Files HILOADER 858 Debugger Files 858 36 Connection Specific Environment Variables 861 Connection Specific Environment Variables 861 Book IX Debugger Legacy Book IX Contents 863 37 Legacy PEDebug Target Interface 865 New P E Conn...

Page 19: ...ntents 19 Microcontrollers Debugger Manual 38 Legacy Target Interfaces Removed 867 39 HC S 08 Full Chip Simulator Components No Longer Supported 869 List of HC S 08 FCS Components No Longer Supported 869 Index 871 ...

Page 20: ...Table of Contents 20 Microcontrollers Debugger Manual ...

Page 21: ...ized Debugging Through DA C IDE Book 2 HC08 Debugger Connections defines the connections available for debugging code written for HC08 CPUs Microcontroller Debugging First Steps HC08 Full Chip Simulation MON08 Interface Connection ICS MON08 Interface Connection HC08 P E Multilink Cyclone Pro Connection HC08 ICS P E Multilink Cyclone Pro Connections SofTec HC08 Connection HC08 FSICEBASE Emulator Bo...

Page 22: ...ands Debugger Engine Commands Book 8 Environment Variables Debugger Engine Environment Variables Connection Specific Environment Variables Book 9 Debugger Legacy Legacy PEDebug Target Interface Legacy Target Interfaces Removed HC S 08 Full Chip Simulator Components No Longer Supported NOTE The Flexis series of devices is the 8 to 32 bit connection point on the Freescale Controller Continuum where ...

Page 23: ...ce Chapter provides all details about the Debugger user interface environment i e menus toolbars status bars and drag and drop facilities The Debugger Components Chapter contains descriptions of each basic component and visualization utility The Control Points Chapter is dedicated to the control points and associated windows The Real Time Kernel Awareness Chapter contains descriptions of the Real ...

Page 24: ...Book I Contents 24 Microcontrollers Debugger Manual ...

Page 25: ...d processor I O chip Building a target application using an object oriented approach Building a host application controlling a plant using an object oriented approach Debugger Application A Debugger Application contains the Debugger Engine and a set of debugger components bound to the task that the components must perform for example a simulation and debugging session The Debugger Engine is the he...

Page 26: ...iting of user defined objects Visualization functions Smart interactions with objects Extensibility function Both Powerful Simulation Debugger Show Me How Tool GUI graphical user interface version including command line Context sensitive help Configurable GUI with Tool Bar Smooth integration into third party tools Supports both Freescale and ELF DWARF Object File Format and S Records Demo Version ...

Page 27: ...ugger main window allows you to manage the layout of the different component windows Window menu of the Debugger application Component windows are organized as follows Tiled arrangement Auto tiled component windows are automatically resized when the main window is resized Component windows are overlapped Component windows that are currently minimized are Debugger Main window icons Application Prog...

Page 28: ...ile cpu Debugger CPU awareness file Starting the Debugger This section explains how you can start the debugger from within the CodeWarrior IDE or from a DOS command line Starting from within the IDE There are two ways to start the debugger from within the IDE from a Project window icon or from the IDE Main Window menu bar Starting Debug from the Project Window To start the debugger from the Projec...

Page 29: ...Warrior IDE To start the debugger from the main menu bar select Debug from the Project menu Project Debug Figure 2 2 Main Window Project Menu Debugger Command Line Start You can start the debugger from a DOS command line The command syntax is as follows HIWAVE EXE AbsFileName options where AbsFileName is the name of the application to load in the debugger Precede each option with a dash ...

Page 30: ...ollers V6 1 demo hc12 sim fibo abs w Target sim The command in the above example starts the debugger and loads fibo abs file W Wait mode Debugger waits even when a exeName is specified Instance currentTargetName This option defines a build instance name Once you define a build instance the debugger uses same build instance the next time you start the debugger For example c Program Files Freescale ...

Page 31: ...e txt ENVpath Env Environment Variable Variable Setting This option sets an environment variable This environment variable may be used to overwrite system environment variables For example c Program Files Freescale CodeWarrior for Microcontrollers V6 1 prog hiwave exe EnvOBJPATH c sources obj NOTE Options are not case sensitive Order of Commands Commands specified by options are executed in the fo...

Page 32: ...without an ini extension as a command file and not a project file Example C Program Files Freescale CodeWarrior for Microcontrollers V6 1 PROG DEMO TEST ABS w d Debugger Main Window Once you start the debugger the True Time Simulator Real Time Debugger window opens in the right side of the IDE Main Window Figure 2 3 Debugger Main Window ...

Page 33: ...on specific information e g number of CPU cycles for the Simulator connection and execution status Figure 2 5 The Debugger Status Bar Main Window Menu Bar The Debugger Main Window Menu Bar shown in Figure 2 6 is associated with the main function of the debugger application connection and selected windows Figure 2 6 Debugger Window Menu Bar NOTE You can select menu commands by pressing the ALT key ...

Page 34: ...e debugger configuration files View Contains entries to configure the toolbar Run Contains entries to monitor a simulation or debug session Connection Contains entries to select the debugger connection Once a connection has been selected the name of this heading changes Component Contains entries to select and configure extra component window Data Contains entries to select Data component function...

Page 35: ...ject window You can load a project file PJT or INI Additionally you can load an existing HWC file corresponding to a debugger configuration file You can load a project INI file containing component names associated window positions and parameters window parameters fonts background colors etc connection name e g Simulator and the ABS application file to load Save Configuration Saves the project fil...

Page 36: ...tion is only enabled if a project file is loaded Figure 2 8 Configuration Window Environment Tab The Configuration Window Environment tab contains the following controls A list box containing all available environment variables You can select a variable with the mouse or Up Down buttons Command Line Arguments are displayed in the text box You can add delete or modify options and specify a director...

Page 37: ...n Window Load tab contains the following controls Automatically erase and program into FLASH and EEPROM checkbox A Verify memory image after loading code checkbox with two radio buttons that let you define the memory image Run after successful load checkbox A Stop at Function checkbox with a textbox that lets you define the function Command Buttons OK Changes are confirmed and saved in current pro...

Page 38: ...er adding and removing component shortcuts and action shortcuts in this dialog box You can also insert separators to separate icons Almost all functions in View Run and Window menus are available as shortcut buttons as shown in Figure 2 11 Table 2 3 View Menu Description Menu Entry Description Toolbar Check uncheck Toolbar if you want to display or hide it Status Bar Check uncheck Status Bar if yo...

Page 39: ...lick Add to install it in the toolbar Select a button in the Toolbar buttons list box and click Remove to remove it from the toolbar Demo Version Limitations The default toolbar cannot be configured Examples of View Menu Options Figure 2 12 shows a typical component window display Figure 2 12 Typical Component Window Display Figure 2 13 shows a component window without a title and headline ...

Page 40: ... 13 Component Window without Title and Headline Figure 2 14 shows a component window without a title and headline and with a small border Figure 2 14 Component Window without Title and Headline and with Small Border Figure 2 15 shows a component window without headline and small border ...

Page 41: ...igure 2 15 Component Window without Headline and Small Border Run Menu The Main Window Run menu shown in Figure 2 16 is associated with the debug session You can monitor a simulation or debug session from this menu Run menu entries are described in Table 2 4 Figure 2 16 Run Menu ...

Page 42: ...xt source reference is reached If the current statement is a procedure call the debugger steps into that procedure The Single Step command does not treat a function call as one statement therefore it steps into the function Shortcut F11 key Step Over Similar to the Single Step command but does not step into called functions A function call is treated as one statement Shortcut F10 key Step Out If t...

Page 43: ...et the number of menu entries is expanded depending on the connection To set the connection select Component Set Connection Refer to the Component Menu section for details Figure 2 17 Connection Menu Table 2 5 describes the Connection Menu entries Assembly Step Over Similar to the Step Over command but steps over subroutine call instructions Shortcut CRTL F10 keys Assembly Step Out If the applicat...

Page 44: ... Figure 2 18 appears Load Executable File Window From the Load Executable File window set the load options and choose a Simulation Execution Framework an ABS application file Figure 2 18 Load Executable File Window Open Button Pressing this button loads the application code and symbols Table 2 5 Connection Menu Common Option Description Menu Entry Description Load Loads a connection Reset Resets t...

Page 45: ...nto FLASH and EEPROM A Verify memory image after loading code checkbox with two radio buttons that let you define the memory image Run after successful load checkbox A Stop at Function checkbox with a textbox that lets you define the function Command Buttons OK Changes are confirmed and saved in current project file Cancel Closes dialog box without saving changes Help Opens the help file Connectio...

Page 46: ... performed in this dialog box are stored for subsequent debugging sessions in the Simulator section of the PROJECT file using the variable CMDFILE0 NOTE When a CPU is set the settings performed in this dialog box are stored for subsequent debugging sessions in the Simulator XXX where XXX is the processor section of the PROJECT file using variables CMDFILE0 CMDFILE1 CMDFILEn Startup Command File Th...

Page 47: ...er system command file The Preload command file executes before an application loads to the target system through the connection or by selecting Connection Name Load Specify the Preload command file full name and status enable disable either with the CMDFILE PRELOAD Command Line command or using the Preload property tab of the Connection Command File Window The default settings enable the PRELOAD ...

Page 48: ...ect Component Set Connection and the Set Connection dialog box shown in Figure 2 21 is opened Table 2 6 Component Menu Description Menu entry Description Open Loads an extra component window that has not been loaded by the Debugger at startup The context sensitive dialog box presents a set of different components that are introduced in the Typical Component Window Display section Set Connection Se...

Page 49: ... list menu to select the desired connection A text panel displays information about the selected connection NOTE When a connection cannot be loaded the combo box displays the correct path for you to install the missing DLL 8 Click OK to load connection in debugger NOTE For more information about which connection to load and how to set reset a connection refer to the other sections of this manual ...

Page 50: ...n Figure 2 22 you can set the component windows general arrangement The Submenu Window Options is shown in Figure 2 23 and the Submenu Window Layout in Figure 2 24 Figure 2 22 Window Menu Figure 2 23 Window Menu Options SubMenu Figure 2 24 Window Menu Layout SubMenu Table 2 7 specifies the Window Menu entries ...

Page 51: ...s at the bottom of windows Options Autosize Component windows always fit into the debugger window whenever you modify the debugger window size Options Component Menu When a component window is selected the associated menu is displayed in the main menu For example if you select the Source window the Source menu is displayed in the main menu Layout Load Store Option to Load Store your arrangements f...

Page 52: ...nternet home page Click on OK to close this dialog box Component Associated Menus Various Debugger Component windows are shown in Figure 2 3 Each component window loaded by default or that you have loaded has two menus One menu is in the main menu and the other one is a context menu also called Associated Context Menu that you can open by right clicking in a window component Note that before right...

Page 53: ...object Figure 2 27 Object Info Bar of Debugger Component Windows Component Context Menu The context menu is a dynamic context sensitive menu It contains entries for additional facilities available in the current component Depending on the position of the mouse in the window and what is being pointed to context menu entries differ Figure 2 28 Example of Component Context Menu For example if you cli...

Page 54: ... 29 Drag and Drop Example When the dragged item is not allowed in the destination to which you are dragging the item the following cursor symbol is displayed Example You can activate the display of coverage information on assembler and C statements by dragging the chosen procedure name from the Coverage component to the Source and Assembly components Figure 2 30 Figure 2 30 Dragging Procedure Name...

Page 55: ...ent description section See below the possible combinations of drag and drop between components and associated actions When additional components are available new combinations might be possible and described in the component s information manual Dragging from Assembly Component Window Table 2 9 summarizes dragging from the Assembly Component Table 2 9 Dragging from the Assembly Component Window D...

Page 56: ...d in the Command Line Window Dragging the value appends the variable value to the current command in the Command Line Window Memory Dumps memory starting at the address where the selected variable is located The memory area where the variable is located is selected in the memory component Register Dragging the name loads the destination register with the address of the selected variable Dragging t...

Page 57: ... instructions corresponding to the selected high level language instructions are highlighted in the Assembly component Register Loads the destination register with the PC of the first instruction selected Memory Displays the memory area corresponding with the high level language source code selected The memory area corresponding to the selected instructions are grayed in the memory component Data ...

Page 58: ...memory area are highlighted in the Assembly component Command Line Appends the selected memory range to the Command Line window Register Loads the destination register with the start address of the selected memory block Source Displays high level language source code starting at the first address selected Instructions corresponding to the selected memory area are grayed in the source component Tab...

Page 59: ... Open Module Individual component window Table 2 14 Dragging from the Register Component Window Destination Component Window Action Assembly Assembly component receives an address range scrolls to the corresponding instruction and highlights it Memory Dumps memory starting at the address stored in the selected register The corresponding address is selected in the memory component Table 2 15 Draggi...

Page 60: ...Debugger Interface Highlights of the User Interface 60 Microcontrollers Debugger Manual ...

Page 61: ... this section However the Register component Memory component and all other Connection dependent components reflect this system component The appropriate CPU component loads automatically when loading an application or executable file ABS file therefore it is possible to mix applications for different MCUs The Debugger automatically detects the MCU type and loads the appropriate CPU component if a...

Page 62: ... a ROM monitor a BDM pod cable or any other supported device NOTE Connection components are introduced in their respective manuals Loading Component Windows In the Debugger Main Window Menu Bar shown in Figure 3 1 you can use the Component menu to load all framework components Each Debugger component you select appears as a window in the Debugger main window Figure 3 1 Debugger Window Menu Bar To ...

Page 63: ...utton to open the selected component There are three tabs in the Open Window Component window The Icon tab shows components with large icons The List tab shows components with small icons The Details tab shows components with their description Demo Version Limitations The demo version limits the number of components you can open at a time If you use the demo version you can open a maximum of eight...

Page 64: ... the loaded application Each displayed disassembled line in the window can show the following information the address machine code instruction and absolute address in case of a branch instruction By default the user can see the instruction and absolute address If breakpoints have been set in the application they are marked in the Assembly component with a special symbol depending on the kind of br...

Page 65: ... front of each disassembled instruction Symbolic Displays symbolic names of objects Address Displays the location address at the beginning of each disassembled instruction Absolute Address In a branch instruction displays the absolute address at the end of the disassembled instruction Format Select formatting choose Auto Hexadecimal Octal Binary Decimal or Unsigned Decimal Freeze Both the Assembly...

Page 66: ...dress is entered in the Show PC dialog box shown in Figure 3 5 memory contents are interpreted and displayed as assembler instructions starting at the specified address Figure 3 5 Show PC Dialog Box Associated Context Menu To open the context menu right click in the text area of the Assembly component window The context menu contains default menu entries for the Assembly component It also contains...

Page 67: ... instruction and continues execution of the program Disabling a permanent breakpoint at this position disables the temporary breakpoint as well and does not halt the program Temporary breakpoints are automatically removed when they are reached Show Breakpoints Opens the Controlpoints Configuration Window Breakpoints Tab and displays list of breakpoints defined in the application refer to Control P...

Page 68: ...ponent window where the operation is performed This line or code range is also highlighted Drag Out Table 3 3 shows the drag actions possible from the Assembly component Drop Into Table 3 4 shows the drop actions possible in the Assembly component Table 3 3 Assembly Component Drag Actions Destination Component Window Action Command Line The Command Line component appends the address of the pointed...

Page 69: ...y Component Source Component Window Action Source Displays disassembled instructions starting at the first high level language instruction selected The assembler instructions corresponding to the selected high level language instructions are highlighted in the Assembly component Memory Displays disassembled instructions starting at the first address selected Instructions corresponding to the selec...

Page 70: ...l up or the down arrow key to scroll down Commands are displayed in blue Prompts and command responses are displayed in black Error messages are displayed in red When a command is executed and running from the Command Line component the component cannot be closed In this case if the Command Line component is closed with the window close button X or with the Close entry of the system menu the follo...

Page 71: ...omplete Command Menu Figure 3 8 shows the Command menu which is identical to the Command Context menu Figure 3 8 Command Menu Clicking Execute File opens a dialog box where you can select a file containing Debugger commands to be executed These files generally have a cmd extension by default Selected text in the Command Line window can be copied to the clipboard by Selecting the menu entry Command...

Page 72: ... Command Line Component window as described in Table 3 5 The command line component appends corresponding items of the current command Table 3 5 Drop Into Command Component Source Component Window Action Assembly The Command Line component appends the address of the pointed to instruction to the current command Data Dragging the name appends the address range of the variable to the current command...

Page 73: ...rocedure names as well as percentage values representing the proportion of executed code in a given source module or procedure NOTE In cases of advanced code optimizations like linker overlapping ROM code areas the coverage output data is affected In such a case it is recommended to switch linker optimizations Figure 3 10 Coverage Window The Coverage window contains percentage numbers and graphic ...

Page 74: ...ge Menu The Coverage menu and submenus are shown in Figure 3 12 Figure 3 12 Coverage Menu Table 3 6 Coverage Menu Description Menu Entry Description Reset Resets all simulator statistic information Details Opens a split view in the chosen component Source or Assembly Graphics Toggles the graphic bars Timer Update Switches the periodic update on off If activated statistics are updated each second O...

Page 75: ...ou want to display i e modules only modules and functions or modules functions and code lines You can also specify a range of coverage to be logged in your file Figure 3 13 Output File Filter Dialog Box Output File Save The Save As entry opens a Save As dialog box where you can specify the output file name and location an example is shown in Listing 3 1 Listing 3 1 Example Output File with Modules...

Page 76: ...y component Destination component displays marks in front of the executed source or assembler instruction Drop Into Nothing can be dropped into the Coverage Component window Demo Version Limitations Only modules are displayed and the Save function is disabled Associated Commands DETAILS FILTER GRAPHICS OUTPUT RESET TUPDATE DA C Link Component The DA C Link window shown in Figure 3 15 is an interfa...

Page 77: ...formation The Setup entry of the DA C Link main menu allows you to define the connection parameters NOTE For related information refer to the Chapter Synchronized Debugging Through DA C IDE DA C Link Menu Selecting Setup from the DA C Link menu opens the Connection Specification dialog box Figure 3 16 DA C Link Menu Table 3 7 DA C Link Menu Description Menu Entry Description Setup Opens the Connec...

Page 78: ... the Show Protocol checkbox to display the communication protocol in the Command component of the Debugger To validate the settings click the OK button A new connection is established and the Connection Specification is saved in the current Project ini file The HELP button opens the help topic for this dialog box NOTE If problems exist refer to the Troubleshooting section in the DA C documentation...

Page 79: ...ng on variable types and hexadecimal octal binary signed and unsigned formats may be selected Structures can be expanded to display their member fields and pointers can be traversed to display data they are pointing to Watchpoints can be set in this component Refer to Control Points chapter Data Operations Double click a variable line to edit the value Click the folded unfolded icons to unfold fol...

Page 80: ...omponents Select a variable on which a watchpoint was previously defined in the Data component and left mouse button D key to delete the watchpoint on the selected variable The vertical bar previously displayed for the variables is removed Select a variable in the Data component and left mouse button S key to set a watchpoint on the selected variable The Watchpoints Setting dialog box opens A gray...

Page 81: ...the Debugger User defined expressions are stored in this command file The name of the expression command file is the name of the application with a xpr extension XPR file When loading a new user application the debugger executes the matching expression command file to load the user defined expression into the data component Example When loading fibo abs the debugger executes Fibo xpr Data Menu Fig...

Page 82: ... structure The member field of the structure replaces the variable list Scope Opens a variable display submenu Format Symb Hex hexadecimal Oct octal Bin binary Dec signed decimal UDec unsigned decimal display format Mode Switches between Automatic Periodical Locked and Frozen update mode Options Opens an options menu for data for example Pointer as Array facility Table 3 9 Scope Submenu Entries Me...

Page 83: ...ghlighting the format entry on the Data menu Figure 3 22 Format Submenu Table 3 10 describes the Format submenu entries Format Selected and All Sub Menu The Format Selected and All submenu is activated by highlighting this entry on the Data Component menu Figure 3 23 Format Selected and All Submenus Table 3 11 describes the Format Selected Mode and Format All Mode Submenu entries Table 3 10 Format...

Page 84: ...ay format Oct Select the octal data display format Dec Select the signed decimal data display format UDec Select the unsigned decimal data display format Bit Reverse Select the bit reverse data display format each bit is reversed Table 3 12 Mode Submenu Menu Entry Description Automatic Switches to Automatic mode default variables are updated when the connection is stopped Variables from the curren...

Page 85: ... modify the default update rate using steps of 100 ms Figure 3 25 Update Rate Dialog Box Options Submenu The Options submenu is activated by highlighting the Options entry on the Data menu Figure 3 26 Options Submenu Locked Switches to Locked mode value from variables displayed in the data component are updated when the connection is stopped Frozen Switches to Frozen mode value from variables disp...

Page 86: ...alid for all pointers displayed in the Data window Check the Display Pointer as Array checkbox and set the number of items that you want to be displayed as array items Name Width Option In the Data Menu s Options submenu choose Options Name Width to open the dialog box shown in Figure 3 28 Figure 3 28 Edit Name Width Dialog Box This dialog box allows you to adjust the width of the variable name di...

Page 87: ... selected sets a read write watchpoint on this variable A yellow vertical bar is displayed for the variables on which a read write watchpoint has been defined If the variable is accessed during execution the program is halted and the current program state is displayed in all window components Delete Watchpoint Appears only in the context menu if a watchpoint is set or disabled on the pointed to va...

Page 88: ...hpoints defined in the application Refer to Control Points Show location Forces all open components to display information about the pointed to variable e g the Memory component selects the memory range where the variable is located Table 3 14 Dragging Data Possibilities Destination Component Window Action Command Line Dragging the name appends the address of the variable to the current command in...

Page 89: ... of a structure are visible when unfolded Only one expression can be defined Source Dragging the name of a global variable in the source Window displays the module where the variable is defined and highlights the first occurrence of the variable Register Dragging the name loads the destination register with the address of the selected variable Dragging the value loads the destination register with...

Page 90: ...hpoints Memory areas can be initialized with a fill pattern using the Fill Memory box An ASCII dump can be added removed on the right side of the numerical dump when checking unchecking ASCII in the Display menu entry The location address may also be added removed on the left side of the numerical dump when checking unchecking Address in the Display menu entry To specify the start address for the ...

Page 91: ...Address Space menu entry When several address spaces are available address numbers on the left side of the window are extended with the sign and the space letter to avoid confusion TIP HCS08 devices with Memory Management Unit MMU have two address spaces The Paged address space covers regular that is physical local and logical displays see Banked Window Paged Memory Physical Local vs Logical displ...

Page 92: ...ed with the physical local address we obtain a 24 bit address that does not represent anything for the CPU but that is directly readable by the user in the Memory window By default for 8 16 bit devices the debugger displays memory addresses above address 0xFFFF as logical These addresses do not represent actual addresses anymore but are still required by the debugger to synchronize the program flo...

Page 93: ... is detected during execution the program is halted and the current program state is displayed in all window components Select a memory range and hold down the left mouse button B key to set a Read Write watchpoint on the selected memory area Memory ranges where a read write watchpoint has been defined are underlined in black If the memory area is exceeded during execution the program is halted an...

Page 94: ... to display items Mode Opens a submenu to choose the update mode Display Opens a submenu to toggle the display of addresses and ASCII dump Fill Opens the Fill Memory to fill a memory range with a bit pattern Address Opens the memory dialog box and prompts for an address CopyMem Opens the CopyMem dialog box that allows you to copy memory range values to a specific location Search Pattern Opens the ...

Page 95: ...gure 3 37 you can set the memory mode format Table 3 19 describes the menu entries Figure 3 37 Mode Submenu Table 3 18 Format Submenu Description Menu Entry Description Hex Selects the hexadecimal memory display format Bin Selects the binary memory display format Oct Selects the octal memory display format Dec Selects the signed decimal memory display format UDec Selects the unsigned decimal memor...

Page 96: ...dated when the connection is stopped Periodical Selects the Periodical mode memory dump is updated at regular time intervals when the connection is running The default update rate is 1 second but it can be modified by steps of up to 100 ms using the associated dialog box see below Frozen Selects the Frozen mode memory dump displayed in the memory component is not updated when the connection is sto...

Page 97: ...TE If Hex Format is checked numbers and letters are interpreted as hexadecimal numbers Otherwise type expressions and prefix Hex numbers with 0x or Display Address With the Display Address dialog box shown in Figure 3 40 the memory component dumps memory starting at the specified address Figure 3 40 Display Address Dialog Box NOTE The Show PC dialog box is the same as the Display Address dialog bo...

Page 98: ...cified memory range Press the Cancel button to close the dialog box without changes Press the Help button to open the help file associated with this dialog box If Hex Format is checked all given values are in Hexadecimal Format You don t need to add 0x For instance type 1000 instead of 0x1000 NOTE If you try to read or write to an unauthorized memory address an error dialog box appears Search Patt...

Page 99: ...he Refresh memory when halting option for wanted ranges in the DMM dialog or type enter the DMM RELEASECACHES command in the Command window You can disable caching for the debug session when typing entering the DMM CACHINGOFF command in the Command window Update Rate This dialog box shown in Figure 3 43 allows you to modify the update rate in steps of 100ms Figure 3 43 Update Rate Dialog Box NOTE ...

Page 100: ...mory Context Menu Description Menu Entry Description Set Watchpoint Appears in the context menu only if no watchpoint is set or disabled on the selected memory range When selected sets a Read Write watchpoint at this memory area Memory ranges where a read write watchpoint has been defined are underlined in yellow If the memory area is accessed during execution of the application the program is hal...

Page 101: ... controlled See Control Points chapter Show Location Forces all opened windows to display information about the selected memory area Word Size etc The submenus are explained in Table 3 16 Table 3 22 Memory Component Drag Possibilities Destination Component Window Action Assembly Displays disassembled instructions starting at the first address selected The instructions corresponding to the selected...

Page 102: ...rop Possibilities Source Component Window Action Assembly Dumps memory starting at the selected PC instruction The PC location is selected in the memory component Data Dumps memory starting at the address where the selected variable is located The memory area where the variable is located is selected in the memory component Register Dumps memory starting at the address stored in the selected regis...

Page 103: ...odule s global variables Module Menu The Module Component window has no menu Drag Out Table 3 24 shows the drag actions possible from the Module component Drop Into Nothing can be dropped into the Module Component window Demo Version Limitations Only two modules are displayed Table 3 24 Module Component Drag Possibilities Destination Component Window Action Data Global Displays the global variable...

Page 104: ...t window contains the source module and address of the selected procedure Procedure Operations Double clicking on a procedure name forces all open windows to display information about that procedure The Source Component window shows the procedure s source The local Data Component window displays the local variables and parameters of the selected procedure The current assembly statement inside this...

Page 105: ...on Show Values Switches to the display of function parameter values in the procedure component Show Types Toggles to the display of function parameter types in the procedure component Table 3 26 Procedure Component Drag Possibilities Destination Component Window Action Data Local Displays the local variables from the selected procedure in the data component Source Displays source code of the selec...

Page 106: ...rcentages and also graphic bars The Profiler window can set a split view in the Source and Assembly windows as shown in Figure 3 49 To obtain a split view in either the Source or Assembly windows select Details Source or Details Assembly or both from the Profiler menu and submenu The split windows collapse when the Profiler window is closed Figure 3 49 Split View in the Source and Assembly Windows...

Page 107: ... in Table 3 27 Figure 3 50 Profiler Menu and Submenus Figure 3 51 Profiler Output File Submenu Table 3 27 Profiler Menu Entries Description Menu Entry Description Reset Resets all statistics Details Sets a split view in the chosen component Source or Assembly Base Sets the base of percentage total code or module code Graphics Toggles the display from graphics bar Timer Update Switches on off the p...

Page 108: ...file by choosing Output File Save As in the menu or context menu Output File Filter By choosing Output Filter the dialog box shown in Figure 3 53 lets you select what you want to display i e modules only modules and functions or modules and functions and code lines You can also specify a range of coverage to be logged in your file Figure 3 53 Output File Filter Dialog Box Table 3 28 Profiler Split...

Page 109: ...rop Into Nothing can be dropped into the Profiler Component window Demo Version Limitations Only modules are displayed and the Save function is disabled Associated Commands GRAPHICS TUPDATE DETAILS RESET BASE Recorder Component The Recorder window shown in Figure 3 54 provides record and replay facilities for debug sessions Figure 3 54 Recorder Window The Recorder window enables the user to record...

Page 110: ...tons are enabled When the pause button is clicked file execution stops and the play and stop buttons are enabled When the play button is clicked file execution continues from the point it has been stopped When the stop button is clicked the replay session stops Terminal and TestTerm Record Data typed in the Terminal component and TestTerm component is recorded during a record session The resulting...

Page 111: ...Freescale DEMO fibo abs at 9424 bs 0x1040 P at 11917 Assembly attributes code on at 14481 Assembly attributes adr on at 20540 Data 1 attributes scope local at 24425 g wait s Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations Only 20 commands are recorded and replayed Register Component The Register window shown in Figure 3 56 displays the content of re...

Page 112: ...y to ignore changes and retain previous content of the register If the Enter key is pressed outside the edited register the new value is validated and the register content is changed If the Tab key is pressed the new value is validated and the register content is changed The next register value is selected and may be modified Double clicking a status register bit toggles it Holding down the left m...

Page 113: ... format Float Selects the float register display format all 32 64 bit registers are displayed as floats all others as hex Auto Selects the auto register display format all floating point 32 64 bit registers are displayed as floats all others as hex Bit Reverse Selects the bit reverse data display format Each bit is reversed Table 3 31 Register Component Drag Possibilities Destination Component Win...

Page 114: ...Assembler Loads the destination register with the PC of the selected instruction Data Dragging the name loads the destination register with the start address of the selected variable Dragging the value loads the destination register with the value of the variable Source Loads the destination register with the PC of the first instruction selected Memory Loads the destination register with the start...

Page 115: ...clicking it A section of code can be selected by holding down the left mouse button and dragging the mouse The object info bar displays the line number in the source file of the first visible line that is at the top of the source Source code can be folded and unfolded Marks places where breakpoints may be set can be displayed When the source statement matching the current PC is selected in this wi...

Page 116: ...e and address of the selected procedure A parameter or procedure can be selected by double clicking it Figure 3 59 ToolTips Features Select ToolTips Enable from the source menu entry to enable or disable the tool tips feature Select ToolTips Mode from the source menu entry to select normal or details mode which provides more information on a selected procedure Select ToolTips Format from the sourc...

Page 117: ...g Setting Temporary Breakpoints For information on setting breakpoints refer to the Control Points chapter Point to an instruction in the Source component Window and click the right mouse button The Source window context menu is displayed Select Run To Cursor from the context menu The application continues execution and stops at this location Hold down the left mouse button and press the T key Thi...

Page 118: ...ed in front of the source statement pointed to Folding and Unfolding Use this feature to show or hide a section of source code e g source code of a function For example if a section is free of bugs you can hide it All text is unfolded at loading Sections of code that can be folded are enclosed between and Sections of code that can be unfolded are hidden under Double click a folding mark or to fold...

Page 119: ...ion reaches this statement the program is halted and the current program state is displayed in all window components Delete Breakpoint Appears only in the Context Menu if a breakpoint is set or disabled at the nearest code position visible with marks When selected deletes this breakpoint Enable Breakpoint Appears only in the Context Menu if a breakpoint is disabled at the nearest code position vis...

Page 120: ...code position visible with marks When selected disables this markpoint Show Markpoints Opens the Controlpoints Configuration Window s Markpoints Tab and allows you to view the list of markpoints defined in the application and modify their properties see Control Points Set Program Counter The Program Counter is set to the address of the selected source code Open Source File Opens the Source File di...

Page 121: ...hat has been used to build the currently loaded absolute file Assembly file dbg is searched in the directory given by the OBJPATH and GENPATH variables C C files c cpp h are searched in the directories given by the GENPATH variable Figure 3 64 Open Source File Dialog Box Find Procedure CTRL I Opens a dialog box for searching a procedure Foldings Opens the folding window Marks Toggles the display o...

Page 122: ...Operations The Find dialog box shown in Figure 3 66 is used to perform find operations for text in the Source component Enter the string you want to search for in the Find what edit box To start searching click Find Next the search starts at the current selection or first line visible in the source component when nothing is selected Use the Up Down buttons to search backward or forward If the stri...

Page 123: ...x To start searching click OK the search starts at the current selection or at the first line visible in the source component when nothing is selected Figure 3 67 Find Procedure Dialog Box If a valid procedure name is given as a parameter the source file where the procedure is defined is opened in the Source Component The procedure s definition is displayed and the procedure s title is highlighted...

Page 124: ...s all source code at load time Table 3 35 Source Drag Possibilities Destination Component Window Action Assembly Displays disassembled instructions starting at the first high level language instruction selected The assembler instructions corresponding to the selected high level language instructions are highlighted in the Assembly component Register Loads the destination register with the PC of th...

Page 125: ...in Figure 3 69 can be used to simulate input and output It can receive characters from several input devices and send them to other devices Figure 3 69 Terminal Window Table 3 36 Source Drop Possibilities Source Component Window Action Assembly Source component scrolls to the source statements corresponding with the pointed to assembly instruction and highlights it Memory Displays high level langu...

Page 126: ...rminal component use the Terminal menu of the terminal shown in Figure 3 70 Figure 3 70 Terminal Menu and Context Menu To open the context menu right click in the terminal window Configure Terminal Connections The terminal window is very flexible and can redirect characters received from any available input device to any available output device You can specify these connections by choosing Configu...

Page 127: ...eam make sure that there exists at least one connection from the input file to any output device Then you can open an input file by simply choosing Input File from the context menu As soon as you press the OK button in the File Open dialog input from the file starts The file closes as soon as the end of file is reached or you choose Close Input File from the context menu When the input file has re...

Page 128: ... what TERM_TO_WINDOW what TERM_APPEND_FILE return TERM_Write ESC TERM_Write h TERM_Write char what 0 if what TERM_TO_WINDOW what TERM_FROM_KEYS TERM_WriteString fileName TERM_Write CR In the example the parameter what is one of the following constants TERM_TO_WINDOW send output to terminal window TERM_TO_BOTH send output to file and window TERM_TO_FILE send output to file fileName TERM_FROM_KEYS r...

Page 129: ...virtual SCI port does not work unless a user defined Sci0 object with the specified register name is loaded Write access to the target application is done with the Object Pool function OP_SetValue at the address Sci0 SerialInput Input from the target application is handled with a subscription to an Object Pool register with the name Sci0 SerialOutput When this register changes sends a notification...

Page 130: ...ws to show the corresponding code or location Time and cycles of all other frames are evaluated relative to this base Holding down the left mouse button and pressing the Z key sets the zero base frame to the pointed frame Holding down the left mouse button and pressing the D key forces all open component windows to show the code matching the pointed to frame Trace Menu The Trace Menu shown in Figu...

Page 131: ...le 3 38 Trace Menu Description Menu Entry Description Textual Displays window contents in text format Graphical Displays window contents in graphical format Instructions Displays instructions in window Items Use to specify the window display items Dump Select a file to dump or a range of frames to dump Go to Frame Search for a specific frame Disable Trace Enable Trace Disable or enable tracing fun...

Page 132: ...race Associated Context Menu Description Menu Entry Description Search Trace Setup Select this menu entry to activate the Trace Search Setup dialog box see Figure 3 76 Specify either the frame or a condition for which to search Not available with all connections Next Steps to the next occurrence of the condition Pressing the N key has the same effect Previous Steps back to the previous occurrence ...

Page 133: ...omponents there are visualization utilities that graphically display values registers memory cells etc or provide an advanced graphical user interface to simulated I O devices program variables and so forth The following components of the continuously growing set of visualization utilities belong to the standard Debugger installation Inspector Component The Inspector window shown in Figure 3 77 di...

Page 134: ...icon is selected in the Inspect window as shown in Figure 3 78 the right side displays various information about all loaded components A Component is the unit of dynamic loading therefore all windows the CPU the connection and perhaps the connection simulator are listed Figure 3 78 Inspect Window Components Icon Stack Icon The Stack icon shown in Figure 3 79 displays the current stack trace Every ...

Page 135: ...con shown in Figure 3 81 shows all currently installed events Events are handled by peripheral devices and notified at a given time The Event display shows the name of the event and remaining time until the event occurs Figure 3 81 Inspector Window Events Icon Events are only used in the HC S 08 Freescale Full Chip Simulator This information is used for simulation I O device development When simul...

Page 136: ...ol shown in Figure 3 83 is a pool of objects It can contain any number of Objects which can communicate together and also with other parts of the Debugger Figure 3 83 Inspector Window Object Pool The most common use of Objects is to simulate special hardware with the I O development package however other connections also use the Object Pool For example the Terminal Component exchanges its input an...

Page 137: ... column an access result diagnostic is given in the AccessResult column the register size is given in bits in the size column the kind of access read read write write is given in the Access column and finally the Type column indicates if the register is memory mapped or is a special purpose register core Inspector Operations Click the folded unfolded icons to unfold fold the tree and display hide ...

Page 138: ...he Inspector If the Inspector is already loaded select Update from the context menu in the Inspector Then click on the Components icon to see the Component list which now includes the IO_Led component Figure 3 85 How to See the IO_Led in the Inspector Window Expand Object Pool to see the Leds icon Click on the Leds icon On the right side the Port_Register and Data_Direction_Register are displayed ...

Page 139: ...s updated Items that no longer exist are removed and new items are added Table 3 41 Inspector Context Menu Entries Description Menu Entry Context Description Update All items All displayed information is updated Items that no longer exist are removed and new items are added Max Elements All items To display large arrays element by element the maximum number can be configured It is also possible to...

Page 140: ...nspector Component Drag Possibilities Dragging Item Description Components The components cannot be dragged Stack The Stack Icon itself cannot be dragged All subitems can be dragged the same way as the Symbol Table subitems described below Symbol Table The Symbol Table icon cannot be dragged out Subitems can be dragged depending on their type Modules Modules can be dragged to the source and global...

Page 141: ... be equipped with many different instruments Figure 3 88 VisualizationTool Window Edit Mode and Display Mode The VisualizationTool may operate in two modes Display mode or Edit mode The Edit mode is for designing the workspace to suit your needs In the Display mode you can then use what you have done in the Edit mode that is to view values interact with your application and instruments press butto...

Page 142: ... along the edges of the selection rectangle You can resize an object by dragging its sizing handles or by using the cursor keys while holding down the shift key The resize process performed with the mouse can be broken off by pressing the escape key Only one instrument can be resized at a time Furthermore each instruments has its own size minimum VisualizationTool Menu Once the Visualization Tool ...

Page 143: ...hecked Setup Always Shows Setup dialog box of the VisualizationTool Load Layout Edit mode Loads a VisualizationTool Layout vtl Save Layout Always Saves current layout to a file vtl Add New Instrument Edit mode Shows a new context menu with all available instruments Properties Only one instrument selected Shows property dialog box for the currently selected instrument Shortcut Ctrl P Remove At leas...

Page 144: ... selections Gives access to a new menu for alignment Top Align Aligns instruments to the top line of the last selected instrument Bottom Align Aligns instruments to the bottom line of the last selected instrument Left Align Aligns instruments to the left line of the last selected instrument Right Align Aligns instruments to the right line of the last selected instrument Size Align Makes size of al...

Page 145: ... Edit mode Switches from Edit mode to Display mode Display Scrollbars Switches the scrollbars on off or sets it to automatic mode Display Headline Switches the headline on or off Background color Specifies the background color of the VisualizationTool Grid Mode Specifies the grid mode There are four possibilities Off Show grid but no snap Snap to grid without showing the grid or Show the grid and ...

Page 146: ...nts height Width Specifies the instruments width Bounding Box Specifies the look of the bounding box Available displays are No Box Flat outline only Raised Sunken Etched and Shadowed Background color Defines the color of the instrument s background The checkbox enables to set a color or let the instrument be transparent Kind of Port Specifies the kind of port to be used to get the value to display...

Page 147: ...e 3 90 may be used as a position state of a water tank Figure 3 90 Bar Instrument Bar instrument attributes are shown in Table 3 48 Table 3 47 Analog Instrument Attributes Attribute Description Low Display Value Defines zero point of the indicator Values below this definition are not displayed High Display Value Defines highest position of the indicator Defines the value at which the indicator rea...

Page 148: ...emory cell in your application and each bit in this cell describes whether a lamp is on e g bit 0 says that the Table 3 48 Bar Instrument Attributes Attribute Description Low Display Value Defines zero point of the indicator Values below this definition are not displayed High Display Value Defines highest position of the indicator Defines the value on which the indicator reads 100 Bardirection Set...

Page 149: ...al in Line Switch Figure 3 91 It is mainly used for configuration purposes You can use it for viewing or setting bits of one to four bytes Figure 3 91 DILSwitch Instrument DILSwitch instrument attributes are listed in Table 3 50 Knob Instrument The Knob instrument is normally known as an adjustment instrument For example it can simulate the volume control of a radio Figure 3 92 Figure 3 92 Knob In...

Page 150: ...re 3 94 7 Segment Display Instrument Table 3 51 Knob Instrument Attributes Attribute Description Low Display Value Defines the zero point of the indicator The values below this definition are not displayed High Display Value Defines the highest position of the indicator It defines the value on which the indicator reads 100 Indicator Color Defines the color and the width of the pen used to draw the...

Page 151: ...Attribute Description Decimalmode Displays the first four or the second four bits of one byte in hexadecimal mode When it is switched off each segment represents one bit of one byte Sloping Switches the sloping on or off Display Version Selects the appearance of the instrument Two versions are available Color if Bit 1 Defines the color of an activated segment You may also set the color to transpar...

Page 152: ...others since it returns to its initial state as soon as it has been released Switch Color Specifies the color of the switch Bounces If enabled gives access to the following other attributes to configure the way the switch bounces Nb Bounces Specifies the number of bounces before stabilization Bounces on Edge Specifies whether the switch bounces on falling rising or both edges Type of Unit Synchron...

Page 153: ...lative Value and Command Displayfont Defines the desired font All installed Windows fonts are available Horiz Text Alignment Specifies the desired horizontal alignment of the text in the given bounding box Vert Text Alignment Specifies the desired vertical alignment of the text in the given bounding box Textcolor Defines the color of the given text Table 3 56 Static Text Attributes Attribute Descr...

Page 154: ... front of the value Add a colon and or space if desired The default setting is Value Low Display Value Fixes the minimal value that represents 0 Values below this definition appear as an error ERROR High Display Value Fixes the maximal value that represent 100 Values above this definition appear as an error ERROR Relative Mode Switches between percent and permill Table 3 59 Command Attributes Attr...

Page 155: ...y set on Memory and the Port to Display field contains the address of the variable Now repeat the drag and drop on a bare portion of the VisualizationTool window a new text instrument is created with correct port configuration Some other components allow this operation The memory window select bytes and drag and drop them onto the instrument The Inspector component pick an object from the object p...

Page 156: ...Debugger Components Visualization Utilities 156 Microcontrollers Debugger Manual ...

Page 157: ... a memory range They start from an address have a range and a read and or write state Markpoints Are marked points of observation that can be jumped to by the programmer They can be located in data source or memory In the context menu of the Source Memory or Assembly window you can set or disable a control point set a condition and an optional command and set the current count and counting interva...

Page 158: ...checking unchecking the matching checkbox Enable disable halting on multiple temporary breakpoints by checking unchecking the matching checkbox With watchpoints the following operations are also available Enable disable halting on a single read and or write access by checking unchecking the corresponding checkboxes Enable disable halting on multiple read and or write accesses by checking uncheckin...

Page 159: ...his window can be opened through the Source Window Context menu as described below Figure 4 1 Source Window Context Menu 1 Point at a C statement in the Source window and click the right mouse button 2 Select Show Breakpoints from this menu The Controlpoints Configuration Window Breakpoints Tab is opened The Breakpoints tab of this window is shown in Figure 4 2 ...

Page 160: ...mporary or permanent Condition group box that displays the condition string to evaluate and the state of the condition disabled or not Command group box that displays the command string to execute and the state of the command disable or continue after command execution Counter group box that displays the current value of the counter and interval value of the counter NOTE Current and Interval value...

Page 161: ...another breakpoint When multiple breakpoints are selected in the list box the name of the group box Breakpoint is changed to Selected Breakpoints When selecting multiple breakpoints the Address hex Name Condition Disable for condition Command Current and Interval controls are disabled When multiple breakpoints are selected the Disable and Temporary controls in the Selected breakpoints group box ar...

Page 162: ...tate cur current inter interval cdSz codeSize srSz sourceSize In the code above The address value is the address where the breakpoint is to be set This address is specified in ANSI C format The address value can also be replaced by an expression as shown in the example below P specifies the breakpoint as a permanent breakpoint T specifies the breakpoint as a temporary breakpoint A temporary breakp...

Page 163: ... in Listing 4 2 Listing 4 2 Breakpoint File with Save Restore on load Checked savebp on BS fibo c Fibonacci 19 P E cond fibo 10 E cdSz 47 srSz 0 BS fibo c Fibonacci 31 P E cdSz 47 srSz 0 BS fibo c main 12 P E cdSz 42 srSz 0 BS fibo c main 21 P E cond fiboCount 5 E cmd Assembly spc 0x800 E cdSz 42 srSz 0 Case 2 If FIBO ABS is loaded and Save Restore on load was unchecked in a previous session of th...

Page 164: ...tions When using a high level language some compound statements can be generated as shown in the following example Figure 4 3 Source and Assembly Windows The debugger helps you detect all positions where you can set a breakpoint 1 Right click in the Source component The Source Context Menu is displayed on the screen 2 Choose Marks from the Context Menu All statements where a breakpoint can be set ...

Page 165: ...ndow hold down the left mouse button and press the T key 2 A temporary breakpoint is defined 3 Choose Run To Cursor from the Context Menu The application continues execution and stops before executing the statement Temporary breakpoints are automatically deleted once they have been activated If you continue program execution it no longer stops on the statement that contained the temporary breakpoi...

Page 166: ... to set a counting breakpoint Holding down the left mouse button and pressing the S key 1 Point at a C statement in the Source window hold down the left mouse button and press the S key 2 The Controlpoints Configuration window with the Breakpoints tab is opened 3 A new breakpoint is inserted in the list of breakpoints defined in the application 4 Select the breakpoint you want to modify by clickin...

Page 167: ...ndition is TRUE A conditional breakpoint is recognized by the following icon Setting Conditional Breakpoints Conditional breakpoints can only be set from the Controlpoint Configuration window s Breakpoints tab There are two ways to set a conditional breakpoint Holding down the left mouse button and pressing the S key 1 Point at a C statement in the Source Component window hold down the left mouse ...

Page 168: ...ox The condition must be specified using the ANSI C syntax Example counter 7 You can use register values in the breakpoint condition field with the following syntax RegisterName Example RX 0x10 7 Close the window by clicking OK If you continue program execution the condition is evaluated each time the instruction containing the conditional breakpoint is reached When the condition is TRUE the appli...

Page 169: ...ted with a debugger command This command can be specified in the Breakpoints tab of the Controlpoints Configuration window To open this window choose Show Breakpoints from the Source Window context menu In the Breakpoints tab of the Controlpoints Configuration window 1 Select the breakpoint to modify by clicking on the corresponding entry in the list of defined breakpoints 2 Enter the command in t...

Page 170: ...pecified memory range Counting Watchpoints activated after a specified number of accesses occur inside the memory range Conditional Watchpoints activated when an access occurs inside the memory range and a given condition is TRUE Watchpoints are controlled through the Controlpoints Configuration Window Watchpoints Tab This window can be opened through the Memory or Data component window context me...

Page 171: ...Control Points Watchpoints 171 Microcontrollers Debugger Manual Figure 4 4 Memory Context Menu Figure 4 5 Data Context Menu ...

Page 172: ...te access of the watchpoint enabled or not Condition group box that displays the condition string to evaluate and the state of the condition disabled or not Update button to Update all modifications in the dialog box Command group box that displays the command string to execute and state of the command disabled or continue after command execution Delete button to remove currently selected watchpoi...

Page 173: ...int is changed to Selected Watchpoints When multiple watchpoints are selected the Address hex Size Name Condition Disable for condition Command Current and Interval controls are disabled When multiple watchpoints are selected in the list box the Disable Read and Write controls in the Selected watchpoints group box are enabled When multiple watchpoints are selected Disable in the Command group box ...

Page 174: ...point is defined 3 Point in the Data window and right click The Data Context Menu is displayed 4 Choose Show WatchPoints from the Context Menu The Controlpoints Configuration window Watchpoints tab is displayed 5 Select the watchpoint you want to define as read access from the list 6 Select the Read type in the list menu 7 A read access watchpoint is defined for the selected variable Using the Lef...

Page 175: ...Select the Write type in the list menu 7 A write access watchpoint is defined for the selected variable Using the Left Mouse Button and Pressing the W Key 1 Point at a variable in the Data window hold down the left mouse button and press the W key 2 A write access watchpoint is defined for the selected variable Once a write access watchpoint has been defined you can continue program execution The ...

Page 176: ...lick The Source Context Menu is displayed 4 Choose Show WatchPoints from the Context Menu The Controlpoints Configuration window Watchpoints tab is displayed 5 Select the watchpoint you want to define as a counting watchpoint 6 From the list menu select the type of access you want to track 7 In the interval field specify the interval count for the watchpoint 8 Close the window by clicking OK A cou...

Page 177: ... Specify the condition for the watchpoint in the Condition field The condition must be specified using the ANSI C syntax Example counter 7 8 Close the window by clicking OK A conditional watchpoint is defined for the selected variable Using the Left Mouse Button and Pressing the S Key 1 Point at a variable in the Data window hold down the left mouse button and press the S key The Watchpoints tab o...

Page 178: ...lick The Data context menu is displayed 2 Choose Show Watchpoints from the context menu The Watchpoints tab of the Controlpoints Configuration window is displayed 3 Select the watchpoint you want to delete 4 Click Delete The selected watchpoint is removed from the list of defined watchpoints 5 Click OK to close the window The watchpoint is deleted and the vertical bar in front of the variable is r...

Page 179: ...control points associated with a source line memory or data range They provide the programmer with accessible program markers Program execution does NOT stop when the Source line data or memory range defined by the markpoint has been accessed Markpoints are controlled through the Markpoint tab of the Controlpoints Configuration Window Markpoints Tab This window can be opened through the Source Mem...

Page 180: ...Control Points Markpoints 180 Microcontrollers Debugger Manual Figure 4 7 Source Window Context Menu Figure 4 8 Memory Context Menu ...

Page 181: ...ugger Manual Figure 4 9 Data Context Menu Figure 4 10 Controlpoints Configuration Window Markpoints Tab Markpoints Tab The Markpoints tab of the Controlpoints Configuration window contains List box that displays the list of currently defined markpoints ...

Page 182: ... validate all modifications Cancel button to ignore all modifications Help button to display help file and related help information Setting Markpoints Markpoints may be set in a Source Data or Memory window Setting a Source Markpoint A blue letter L is displayed in front of a code line associated with a markpoint To define a markpoint in source code Use the Source Context Menu 1 Point at a code li...

Page 183: ...ow Markpoints Tab is displayed 5 Make any modifications to the markpoint you have installed or any other markpoints listed 6 Click OK to close the window Setting a Memory Markpoint A blue letter L is displayed in front of a memory range associated with a markpoint To define a Memory markpoint Use the Memory Context Menu 1 Point at a line in the Memory window and right click The Memory Context Menu...

Page 184: ...emoved from the list of defined watchpoints 5 Click OK to close the window The markpoint is deleted and the blue letter L in front of the variable memory range or code line is removed Halting on a Control Point Code execution is halted when the program reaches either a breakpoint or a watchpoint if the conditions specified in the definition of the breakpoint or watchpoint have been reached Code ex...

Page 185: ...cting Kernel Data Structures OSEK Kernel Awareness Introduction Often operating systems Real Time Kernels are used to coordinate the different tasks in more complex systems This chapter describes how applications built of several tasks can be handled with the Debugger There are two main topics to be considered Debugging of any task in the system e g viewing the state of any task in the system When...

Page 186: ...e task to be inspected The result is the CPU context CPU registers and status of the task which allows the debugger to display the procedure activation stack in a symbolic way RTK Interface When the application is halted the debugger displays the state of the current task To identify the task to be inspected the user has to follow these steps Make the task descriptor or a pointer to it visible in ...

Page 187: ... gets value of memory WORD at given address MD gets value of DOUBLE WORD at given address MA gets value at given address interpreted as DOUBLE WORD PC is the program counter to be set SP is the stack pointer to be set SR is the status register value to be set DL is the dynamic link data base to be set if not available same as SP STATUS is the error number to be set refer to manual Rnn processor re...

Page 188: ...tatus register STATUS 1000 Initialized with 1000 IF MW B 18 1 THEN IF registers are saved in task Control Block THEN R0 MD B 22 R1 MD B 26 R2 MD B 30 R3 MD B 34 R4 MD B 38 R5 MD B 42 R6 MD B 46 R7 MD B 50 R8 MD B 54 R9 MD B 58 R10 MD B 62 R11 MD B 66 R12 MD B 70 END R13 B R14 DL R15 SP i MB B 112 i contains the current state of the selected task IF i 0 THEN MSG ReadyInCQSc ELSIF i 1 THEN MSG Block...

Page 189: ... Structure Description typedef struct PD int status struct PD next long regs 6 PD This is an example of the definition of a simple task descriptor Variables can be collected in a structure and must be assigned to a segment for example OS_DATA shown in Listing 5 3 Listing 5 3 OS_DATA Structure pragma DATA_SEG OS_DATA struct PD readyList list of tasks ready to be executed char filler 6 unimportant v...

Page 190: ...en the terminal window during testing Errors detected during reading of a PRM file are written to this window OSEK Kernel Awareness OSEK Kernel provides a framework for building real time applications OSEK Kernel awareness within the debugger allows you to debug your application from the operating system perspective The CodeWarrior Debugger supports OSEK ORTI compliant real time operating systems ...

Page 191: ... abs the ORTI file name is winLift_demo ort Otherwise the debugger cannot use the correct ORTI file The ORTI file contains dynamic information as a set of attributes that are represented by formulas to access corresponding dynamic values Formulas for dynamic data access are comprised of constants operations and symbolic names within the target file The given formula can then be evaluated by the de...

Page 192: ...on as the executable file but its extension is ort ORTI File Structure The ORTI file structure builds on top of the structure of the OSEK OIL file It consists of the following parts Version Section This section describes the version of the ORTI standard used for the current ORTI file Implementation Definition Section This section describes the method to use to interpret the data obtained for the v...

Page 193: ...Open menu entry and then by clicking on Inspect icon in the Open Window Component window When the RTK components icon is selected in the hierarchical content of the items the right side displays various information about OSEK Awareness Figure 5 2 CodeWarrior RTK Inspect Window The OSEK RTK Inspect Window provides access to all this information As defined in the ORTI file objects of the same type a...

Page 194: ...ame displays the name of the task Task Priority displays the priority of the task Task State describes the current state of the task Possible values are READY SUPENDED WAITING RUNNING or INVALID_TASK The ORTI file defines the different states Events State the event is represented by its mask The event mask is the number whose range is from 1 to 0xFFFFFFFF When the event mask value is set to 1 the ...

Page 195: ...ck Stack Size displays the size of the stack Inspector SystemTimer The SystemTimer shown in Figure 5 5 displays the current state of OSEK SystemTimer trace Figure 5 5 Inspector SystemTimer Select SystemTimer in the hierarchical tree on the left side to display additional information concerning the timer on the right side of the window under the following headings Name displays name of the system t...

Page 196: ...d Counter based on counters the OSEK OS offers an alarm mechanism for the application software Assigned Counter is the name of the counter used by the alarm Notified Task alarm management allows the user to link task activation to a certain counter value assign an alarm to a counter and define the action to be performed when an alarm expires Notified Task defines the task to be notified by activat...

Page 197: ...spector Message Select Message in the hierarchical tree on the left side to display additional information concerning task on the right side Name displays the name of the message Message Type displays message type Possible values are UNQUEUED QUEUED Notified Task displays the task that shall be activated when the message is sent Event to be set displays the event to be set when the message is sent...

Page 198: ...Real Time Kernel Awareness OSEK Kernel Awareness 198 Microcontrollers Debugger Manual ...

Page 199: ...Content of Memory Address How to Consult Assembler Instructions Generated by a Source Statement How to View Code How to Communicate with the Application How To Configure the Debugger If you have installed the Debugger under Windows 2000 or higher the Debugger can be started from the CodeWarrior IDE from the desktop from the Start menu or from an external editor In order to work efficiently the Deb...

Page 200: ...king directory including the path is defined in the environment variable DefaultDir in the Options group or WorkDir WorkingDirectory Starting Debugger from CodeWarrior IDE The Debugger can be started by selecting Project Debug or clicking the Debugger icon bug in project window The Window looks similar to Figure 6 1 but varies depending on your project Figure 6 1 Debugger After Startup READY displ...

Page 201: ...utility Example Freescale CodeWarrior for Microcontrollers V6 1 PROG HIWAVE EXE c init cmd When you start the Debugger with this command line it executes the command specified in the file init cmd after loading the layout or project file Calling the command file from the project file Listing 6 2 The project file in which you save the layout and connection component File Save is a normal text file ...

Page 202: ...ry point The Assembly component contains the corresponding disassembled code The highlighted statement is the entry point The Data 1 component contains the list of global variables defined in the module containing the application entry point The Data 2 component lists local variables if any are available The PC in the Register component is initialized with the PC value from the application entry p...

Page 203: ...embler statement at which the program was stopped next assembler instruction to be executed Data window with attribute Global displays the name and values of the global variables defined in the module where the currently executed procedure is implemented The name of the module is specified in the Data info bar Data window with attribute Local displays the name and values of the local variables def...

Page 204: ...ng execution of the source statement Step Over a Function Call Flat Step The Debugger provides two ways of stepping over a function call Choose Run Step Over Click the Step Over icon from the Debugger tool bar STEPPED OVER STEPOVER or STOPPED STOP in the status line indicates that the application is stopped by a step over function If the application was previously stopped on a function invocation ...

Page 205: ...xt assembler instruction Choose Run Assembly Step Click the Assembly Step icon from the debugger tool bar TRACED in the status line indicates that the application is stopped by an assembly step function The application stops at the next assembler instruction The display in the Source component is always synchronized with the display in the Assembly component The highlighted instruction in the Sour...

Page 206: ...e components is displayed on the screen 2 Double click the entry Module A module component is opened which contains the list of all modules building the application 3 Drag a module name from the Module component to a Data component with attribute Global Using Context Menu 1 Right click in a Data component with attribute Global 2 Choose Open Module in Context Menu A dialog box is opened which conta...

Page 207: ...being signed or not Format menu is activated as follows 1 Right click in the Data component The Data Context Menu is displayed on the screen 2 Choose Format from Context Menu The list of formats is displayed on the screen The format selected is valid for the whole Data component Values from all variables in the data component are displayed according to the selected format Table 6 1 Debugger Displa...

Page 208: ...e variable is initialized with 16 2 To validate the input value you can either press the Enter or Tab key 3 If an input value has been validated by the Tab key the value of the next variable in the component is automatically highlighted this value can also be edited 4 To restore the previous variable value press the Esc key or select another variable A local variable can be modified when the appli...

Page 209: ...ss Register with the Address of a Variable The Debugger allows you to load a register with the address where a variable is allocated Drag a variable name from the Data Component to Register component The destination register is updated with the start address of the selected variable How to Work on the Register This section describes how to work with the Register component Change Format of Register...

Page 210: ...lue If the input value is 10 the variable is set to 0x10 16 2 To validate the input value either press the Enter or Tab key or select another register 3 Validating an input value using the Tab key automatically highlights the content of the next register in the component You can edit this register also 4 To restore the previous register content press the Esc key Modify Bit Register Content In a bi...

Page 211: ...dress 1 Right click in the Memory component to display the Memory context menu 2 Choose Address from the context menu to open the Memory dialog box shown in Figure 6 5 3 Enter the register content in the Edit Box and choose OK to close the dialog box The memory component scrolls until it reaches the address stored in the register This feature allows you to display a memory dump from the applicatio...

Page 212: ...idate the last input value you can either press the Enter or Tab key or select another variable 4 To stop editing and restore the previous memory value press the Esc key How to Consult Assembler Instructions Generated by a Source Statement The Debugger provides an on line disassembly facility which allows you to disassemble the hexadecimal code directly from the Debugger code area Online disassemb...

Page 213: ...embly can be performed in one of the following ways Using Context Menu 1 Point in the Assembly component and right click The Assembly context menu is displayed 2 Choose Display Code Figure 6 6 Using Assembly Menu 1 Click the title bar of the Assembly component The Assembly menu appears in the debugger menu bar 2 Choose Assembly Display Code The Assembly component displays the corresponding code on...

Page 214: ... defined in the TERMINAL H file and used in the calculator demo file 1 Start the Debugger and choose Open from the Component menu 2 Open the TestTerm or Terminal Component 3 Choose Load from the Simulator menu 4 Load the program CALC ABS The target application uses the Read function to fetch data entered in the TestTerm or Terminal component window through the keyboard The target application uses ...

Page 215: ...adversely Under normal circumstances make all configuration changes in the CodeWarrior IDE To change the configuration the Real Time Debugger and True Time Simulator follow these steps 1 Start the IDE 2 From the CodeWarrior IDE open the Target Settings Panel by clicking on the Targets panel of the IDE main window 3 Double click on the name of your target in the list displayed in this panel 4 Selec...

Page 216: ...CodeWarrior IDE Integration Debugger Configuration 216 Microcontrollers Debugger Manual Figure 7 1 IDE Target Window Build Extras Panel ...

Page 217: ...ou to execute almost any command from the Command line that is available within the debugger There are also special DDE items for more commonly performed tasks This section describes topics and DDE items available to CodeWright clients In addition to the required System topic CurrentBuffer and the names of all CodeWright non system buffers documents are available as topics Driving Debugger through...

Page 218: ...for example open recorder and click the Exec button The command is executed by way of DDE and a new recorder component appears in the Debugger NOTE You can disconnect the DDE in the Debugger The Debugger can be started without DDE this is saved in the project file To view the current state open a command line component and type the following command DDEPROTOCOL STATUS The state must be DDEPROTOCOL...

Page 219: ...r Interface Synchronized Debugging Troubleshooting Configuring DA C IDE for Freescale Tool Kit Install the DA C software The Freescale CD contains a demo version located in Addons DA C Run Setup to install the Typical installation A few configurations are required in order to make efficient use of Freescale Tools within DA C IDE Create a new project Configure the working directories Configure the ...

Page 220: ...pecific project file is created with dcp extension for example myproject dcp Configure Working Directories Choose Options Project from the main menu of DA C The window shown in Figure 9 1 contains options which establish directories for the project Figure 9 1 DA C Project Options Window Directories Tab Project Root Directory This text box determines the project root directory The full path is expe...

Page 221: ...in which to save the symbols and software metrics database This directory can be absolute or relative to the Project Root Directory Leave this field empty User Help File This text box determines the user help file for example compiler help file The hot key for User Help File can be defined in the Keyboard definition file default Ctrl Shift F1 Browse in the prog directory of your Freescale installa...

Page 222: ...symbol analysis This can be done by choosing Options Analysis for Symbols C Source in the main menu of DA C The window shown in Figure 9 3 contains options that determine parameters of the C source code analysis Figure 9 3 Analysis for Symbols Options Window C Source Tab Source The supported C dialects of the C language used in the current project can be selected in this text field In our example ...

Page 223: ...d contains the file name absolute or relative in relation to the project root with prefix Directories are separated with a semi colon or new line Define the library path matching your CPU assuming Freescale tools are installed on C Program Files Freescale C Program Files Freescale lib processor c include Preprocessor Preinclude File This text box determines the name of the file included automatica...

Page 224: ...d choose Add to Project The file is now added in the current project and a green mark appears in front of it Figure 9 4 Figure 9 4 Adding Files to Project Using Explorer Tab In the same way select fibo prm file and add it to this project You can also add a directory to the project in the following way Select Explorer View Tab in Project Window In the left section select the directory with files to...

Page 225: ...g Start Build database and Start Update database commands Start Update database optionally checks to ensure that the include files used in program modules are changed as well To build the database in our example use Start Build database command which makes the unconditional analysis of all project files and creates a database containing information about analyzed source code Errors and Warnings de...

Page 226: ...Tool Kit 226 Microcontrollers Debugger Manual Figure 9 6 Logical View Tab Double click on Fibo c file to open it Configuring The Tools We will now configure the compiler and maker in the DA C IDE Procedures are defined in Project User Defined Actions from the main menu of DA C ...

Page 227: ...ation and choose Compiler bmp This is a default bitmap delivered with the DA C IDE Here you are able to add your own bitmap Figure 9 7 DA C Compiler Settings Now fill in the Action Script field in order to associate related compiler actions Copy the following lines shown in Listing 9 1 in the Action Script field and change the directory to where the compiler is located Listing 9 1 Script for Compi...

Page 228: ...figuration In the same way you can now configure the linker as illustrated in Figure 9 8 In the Menu Start Actions click on new and fill in the created New Action box with Link then validate with ENTER After setting the corresponding bitmap copy the following lines shown in Listing 9 2 in the Action Script field and change the directory to where the linker is located Listing 9 2 Script for Linker ...

Page 229: ...u Start Actions click on new and fill in the created New Action box with Make then press ENTER After setting the corresponding bitmap copy the lines from Listing 9 3 in the Action Script field and change the directory to where the maker is located Listing 9 3 Script for Maker Action Association c Freescale prog maker exe fibo mak if Exist edout Message No Messages found Cancel ErrClr ErrGet edout ...

Page 230: ...and on the same line as the debugger Thus usability of both the DA C and Debugger is increased Some configurations are required in order to make efficient use of this Debugger Interface Installation of communication DLL Configuration of Debugger properties Configuration of the Debugger project file DA C IDE and Debugger Communication DA C and the Debugger are both Microsoft Windows applications an...

Page 231: ...cally installed during the Freescale Tool Kit installation However if you install a new release of DA C you have to follow this procedure In the Program directory of your DA C installation copy the Ndapi32 dll Ndapi32 dll version 1 1 or later and paste it in your current Freescale CodeWarrior for Microcontrollers V6 1 PROG directory where Debugger is located Then rename it to Ndapi dll Debugger Pr...

Page 232: ...bugger Setup Dialog Box Specify the path to the hiwave exe file or use the Browse button then click on OK Debugger Project File Configuration Before configuring the project file close DA C Open Debugger for example from a shell and select File Open Project from the main menu bar Select the Project ini file from the currently defined working directory in our case C Program Files Freescale WORK proc...

Page 233: ...now test the synchronization between the DA C IDE and Debugger Run DA C exe and open the project previously created Open Fibo c if it s not already open Right click mouse button on Fibo c source window and select main in the context menu The cursor points to the void main void statement In the main menu from DA C select Debug Set Breakpoint or click on the corresponding button on the debug toolbar...

Page 234: ...to connect the Debugger with the DA C IDE When loading the DAC component into the Debugger if the message box shown in Figure 9 16 is displayed ensure that Ndapi dll is in the prog directory of your current Freescale installation If not copy the specified DLL into this directory Figure 9 16 DA C Component Loading Error Message If the message box shown in Figure 9 17 is displayed in the DA C IDE th...

Page 235: ...g Box Compare the Debugger Name from this dialog box with the selected Debugger in the DA C IDE Options Debugger as shown in Figure 9 19 Both must be the same Figure 9 19 DA C Debugger Options Dialog Box If the names are not the same change the name in the Debugger Connection Specification and click OK This establishes a new connection and saves the Connection Specification in the current Project ...

Page 236: ...Synchronized Debugging Through DA C IDE Troubleshooting 236 Microcontrollers Debugger Manual ...

Page 237: ... how to use the environment This book the HC08 Debug Connections defines the connections available for debugging code written for HC08 CPUs This book consists of the following sections Microcontroller Debugging First Steps HC08 Full Chip Simulation MON08 Interface Connection ICS MON08 Interface Connection HC08 P E Multilink Cyclone Pro Connection HC08 ICS P E Multilink Cyclone Pro Connections SofT...

Page 238: ...Book II Contents 238 Microcontrollers Debugger Manual ...

Page 239: ...Serial Monitor Connection ICS MON08 Interface Connection HCS08 P E Multilink Cyclone Pro Connection HC08 ICS P E Multilink Cyclone Pro Connections SofTec HCS08 Connection HCS08 Open Source BDM Connection RS08 Open Source BDM Connection NOTE The initial project creation steps for RS08 Connections mentioned in Book IV RS08 Debug Connections are similar to the first steps mentioned in Debugging First...

Page 240: ... Debugging and Full Chip simulation In Circuit Simulation or ICS mode simulates the CPU core instructions on the user s PC P E Multilink Cyclone Pro Considerations To use the P E BDN Multilink the drivers from P E must be installed on the host computer Use a parallel cable for communication between the BDM Multilink and the host computer The communication protocol between the BDM Multilink and the...

Page 241: ...he Wizard To take the first steps toward debugging with the CodeWarrior IDE using the stationery Wizard 1 Run the CodeWarrior IDE with the shortcut created in the program group 2 Choose the menu File New Project to create a new project from stationery The Microcontrollers New Project Wizard first screen appears Figure 10 1 New Window Device and Connection Screen 3 Expand the list and select the CP...

Page 242: ...Microcontroller Debugging First Steps Debugging First Steps Using the Wizard 242 Microcontrollers Debugger Manual Figure 10 2 Project Parameters Screen ...

Page 243: ...or relocatable assembly C This sets up your application with an ANSI C compliant startup code doing initialization of global variables C This sets up your application with an ANSI C startup code doing global class object initialization 7 Enter a project name and folder location to store project 8 Click the Next button to proceed Figure 10 3 Add Files to Project Screen 9 If needed browse to and add...

Page 244: ...Wizard 244 Microcontrollers Debugger Manual Figure 10 4 Processor Expert Screen 11 Select a Rapid Application Development option 12 Depending on selected CPU derivative this may be last the screen Click on the Finish button and the IDE opens Figure 10 5 C C Options Screen ...

Page 245: ...s an ANSI compliant startup code that initializes global variables objects and calls the application main routine Small The Small memory model is best used if both the code and the data fit into the 64kB address space By default all variables and functions are accessed with 16 bit addresses the compiler does support banked functions or paged variables in this memory model but all accesses have to ...

Page 246: ...switch connections select Set Connection from the Component menu The following information provides three examples of switching a connection CAUTION Normally use the New Project or Change wizard to change the connections This information is provided for advanced users only Loading the Full Chip Simulation Connection Because there is no actual hardware involved in switching from another project suc...

Page 247: ...Debugger Manual 1 From the Debugger main menu select Component Set Connection as shown below Figure 10 8 Component Menu The Set Connection dialog box now appears Figure 10 9 Set Connection Dialog Box 2 Select the Processor for example HC08 and the Connection as Full Chip Simulation ...

Page 248: ...have successfully switched connections to the FCS connection The values and use of each HC08FCS menu entry is explained in the Full Chip Simulation chapter of this manual Loading the P E Multilink Cyclone Pro Connection To load the Multilink Cyclone Pro connection from within an existing project take the following steps 1 From the Debugger main menu select Component Set Connection as shown below F...

Page 249: ...tion menu selection P E Multilink Cyclone Pro loads the proper drivers etc for the connection 4 In the Debugger Main window the Connection heading has been renamed MultilinkCyclonePro Click on this heading to display its menu and list of selections Figure 10 13 MultilinkCyclone Pro Menu The menu selection MultilinkCyclonePro Load loads an executable abs file into connection memory The file s progr...

Page 250: ...r Manual The menu selection MultilinkCyclonePro Connect takes you to the P E ICD connection manager dialog box Figure 10 14 P E ICD Connection Manager Dialog Box The menu selection MultilinkCyclonePro Command Files takes you to the Command Files dialog box Figure 10 15 Command Files Window ...

Page 251: ...8 Open Source BDM Connection follow these steps 1 From the Debugger main menu select Component Set Connection as shown below Figure 10 16 Component Menu The Set Connection dialog box appears Figure 10 17 Set Connection Dialog Box 2 Select the Processor and Connection for example RS08 and RS08 Open Source BDM NOTE Select HC08 as the Processor to select HC08 Open Source BDM as the Connection ...

Page 252: ...hing Connections 252 Microcontrollers Debugger Manual 3 Press the OK button The Debugger main menu entry bar for the connection now changes to RS08 Open Source BDM Figure 10 18 RS08 Open Source BDM Menu You have successfully switched connections ...

Page 253: ...ly different simulation engine to accurately simulate the memory ranges I O and peripherals for a given derivative for more information on selecting a specific derivative see the Select Device Option section below Configuration Procedure Choose the Full Chip Simulation option from the Set Connection dialog box See Figure 11 1 Figure 11 1 Set Connection Dialog Box Full Chip Simulation Option When y...

Page 254: ...HC08 Full Chip Simulation Configuration Procedure 254 Microcontrollers Debugger Manual Figure 11 2 Connection HCS08FCS List Menu ...

Page 255: ...Extended Menus Full Chip Simulation Module Commands The HCS08FCS Menu contains the Full Chip Simulation commands for the modules that have specialty commands associated with them for a chosen device For more information about specific module commands refer to the Full Chip Simulation section describing the particular module Run Till Cycle Option The Run Till Cycle command lets you begin execution ...

Page 256: ...r Files option in the HCS08FCS Menu also gives you the option of running the register file viewer editor If register files are available for the device that you have chosen the Choose a Register Block dialog box see Figure 11 4 is opened You may also open it by entering the R command in the Command Window command line Figure 11 4 Choose A Register Block Dialog Box If register files have been insta...

Page 257: ...es Options If you have selected a device see Select Device Option the HCS08FCS Connection Menu displays a list of peripherals Modules for the device you have chosen The Module s associated commands appear as extended menus Figure 11 7 HCS08FCS Menu ADC Module Extended Menu Options Placing your mouse over a peripheral opens an extended menu which lists its associated commands Click on a command to ...

Page 258: ...displayed with the input buffer values Input values can be entered while the window is open An arrow points to the next value to be as input to the ADC The conversion takes place after a proper value is written to the ADC Status and Control register Once the conversion occurs the arrow moves to the next value in the ADC Buffer Figure 11 8 ADC IN Buffer Display At any point the ADCLR command can be...

Page 259: ...the input buffer values Input values can be entered while the window is open An arrow points to the next value to be sent to the ADC The maximum number of input values is 256 bytes Syntax ADDI n Where n The value to be entered into the next location in the input buffer Example ADDI 55 Set the next input value to the ADDI to 55 ADDI Pull up the data window with all the input values ADCLR Command Us...

Page 260: ...ration Automatic lock detection Interrupt Acquisition Tracking Flag polling Full Chip Simulation mode uses simulated External Oscillator Frequency change command XTAL to allow the user to input the desired XTAL value To check the current value of the External Oscillator Bus Frequency and CGMXCLK Frequency open the HCS08FCS menu then select Clocks Module Show MCU Clocks Figure 11 10 Show MCU Clocks...

Page 261: ...location of the CGM Status and Control register Figure 11 12 Memory Window For more information on how to properly configure Clock Generation refer to the reference manual corresponding to the microprocessor that you are using CGM Commands The following Clock Generation commands are available on the HC08 processor XTAL Command Use the XTAL command to change the value of the simulated external osci...

Page 262: ...d to a hexadecimal format by adding the suffix h High Resolution PWM Module In Full Chip Simulation Mode this option lets you simulate all functionality of the High Resolution PWM HRP module including pulse width modulation flag polling interrupt enabled mode of operation variable period and dead time insertion shutdown input for fast disabling of outputs To ensure that the HRP firmware is functio...

Page 263: ...ber of CPU cycles that it takes for the event to occur The cycle counter is only incremented as the user steps through the code To determine the exact amount of cycles over which the event occurs one can either observe the cycle display in the Register Window or use the built in simulation commands To display the current number of cycles in the Command window use the CYCLES command To change the n...

Page 264: ...for the cycles counter Examples CYCLES 0 Reset cycles counter CYCLES 1000 Set cycle counter to 1000 GOTOCYCLE Command The GOTOCYCLE command executes the program in the simulator beginning at the address in the program counter PC Execution continues until the cycle counter is equal to or greater than the specified value until a key or the Stop button on the toolbar is pressed until it reaches a bre...

Page 265: ...g the state of the SHTDWN pin on the next simulated clock cycle Example SHTDWN 0 Change the state of the SHTDWN pin to 0 Input Output I O Ports Module In Full Chip Simulation Mode FCS this option lets you simulate all input and output functionality of the Input Output I O Ports module FCS mode uses a set of designated commands to simulate the input and output activity on corresponding I O port pin...

Page 266: ...evant I O port The manipulation of I O port pins can be observed in the Memory Window Figure 11 16 Memory Component Window Note that if the regular I O pins are multiplexed to be used by a different MCU Module they might not be available for general I O functionality For more information on how to properly configure I O pins refer to the Freescale user manual corresponding to the microprocessor th...

Page 267: ...n Eight bit simulated value for port x Example INPUTA AA Simulate the input AA on port A INPUTS Command In Full Chip Simulation and CPU Only Simulation mode the INPUTS command opens the Simulated Port Inputs dialog box shown in Figure 11 17 below The user may then use this box to specify the input states of port pins and IRQ Figure 11 17 Simulated Port Inputs Dialog Box When using In Circuit Simul...

Page 268: ...line prompt the Simulated Port Inputs window appears In addition the user can directly modify the state of the IRQ pin using the IRQ n command documented below The occurrence of the IRQ event sets the appropriate flag in the corresponding IRQ register The user can poll the IRQ flag if the Polling Mode is simulated In the Interrupt Mode the simulator branches to an appropriate interrupt subroutine ...

Page 269: ...t input values NOTE The IRQ pin state can be directly manipulated with the IRQ command For example IRQ 1 simulates a high state on the IRQ pin likewise IRQ 0 simulates a logic low state on the IRQ pin Keyboard Interrupt Module In FCS Mode this module simulates all functionality of the Keyboard Interrupt KBI module including the edge only edge and level interrupt and flag polling modes of operation...

Page 270: ... port in the appropriate manner depending on whether the KBI is configured for edge only or edge and level Once the KBI event takes place the KEYF Flag bit which is a part of the Keyboard Status and Control register can be observed in the Memory Window Figure 11 21 Memory Component Window The user is able to poll the KBI Interrupt Pending flag if the polling Mode is simulated In Interrupt Mode the...

Page 271: ...port n Eight bit simulated value for port x Example INPUTA AA Simulate the input AA on port A INPUTS Command In Full Chip Simulation and CPU Only Simulation mode the INPUTS command opens the Simulated Port Inputs dialog box shown in Figure 11 22 You may then use this box to specify the input states of port pins and IRQ Figure 11 22 Simulated Port Inputs Dialog Box When using In Circuit Simulation ...

Page 272: ...put buffer of the USB module can also hold 256 output bytes To queue the MMIIC Input Packets use the IICDI command in the command prompt If the MMIIC packet parameters are properly defined the packet is placed into the next slot in the input buffer Otherwise if no parameters are provided an MMIIC Input Buffer window is displayed Different MMIIC packet parameters can be entered while the window is ...

Page 273: ...ved the first queued in data byte is passed from the data buffer into the corresponding MMIIC module registers It can be observed in the Memory Window by displaying the appropriate register location there Figure 11 25 Memory Component Window The user can also observe different MMIIC flags in the Memory Window If the module is run in Flag Polling mode poll the flag corresponding to the expected MMI...

Page 274: ...n external master Note that when the microprocessor attempts to read an acknowledge from an external device and the next value in the buffer is neither ACK nor NACK the microprocessor automatically receives an ACK signal i e assumes ACK unless NACK is specified Syntax IICDI n START STOP ACK NACK Where n The value to be entered into the next location in the input buffer START indicates the incoming...

Page 275: ...ng the first ACK the first data result being the second ACK and the second data byte being the NACK MMIIC in MASTER mode is not acknowledged by any Slave IICDI NACK If the NACK signal is entered before our master device transmits a START signal then the master device receives a NACK signal when it tries to read an acknowledge after the address is output The master device then generates a STOP sign...

Page 276: ...ut log buffer for IIC simulation IICCLR Use the IICCLR command to flush the input and output buffers for MMIIC simulation This resets the buffers and clears all values Notice that if the MMIIC is currently shifting a value this command allows the MMIIC to finish the transfer Syntax IICCLR Example IICCLR Clear input and output buffers for IIC simulation FCSMSCAN Controller Module The MSCAN Controll...

Page 277: ... Freescale project It initializes the CAN peripheral on the microcontroller for operation and uses interrupts from the CAN peripheral to service requests from other controllers Once the code is compiled and loaded into the microprocessor that you are using simulator commands can be used to emulate the CAN messages that come from the host Let us first break down what is being done in the example pr...

Page 278: ... PacketDataEnd org RomStart Transmission Message Descriptors All messages are extended data types Format is Address Priority Length Data Msg1_Desc dw 0001 Message 1 Address dw 2345 Message 1 Address db 03 Message 1 Priority db 08 Message 1 Length db 11 Data Byte 1 db 22 Data Byte 2 db 33 Data Byte 3 db 44 Data Byte 4 db 55 Data Byte 5 db 66 Data Byte 6 db 77 Data Byte 7 db 88 Data Byte 8 M1Desc_En...

Page 279: ...reset state lda 01 sta CMCR1 CAN clock source CGMOUT 2 lda 01 sta CBTR0 set SJW 0 baud rate prescalar div by 2 lda 27 sta CBTR1 set TSEG1 7 8Tq TSEG2 2 3Tq one sample per bit lda CANAddress 21t FF set identifier acceptance register to CAN address sta CIDAR0 lda CANAddress 38000 15t ora CANAddress 1C0000 13t ora 18 sta CIDAR1 lda CANAddress 7F80 7t sta CIDAR2 lda CANAddress 7F 1t sta CIDAR3 lda 00 ...

Page 280: ...in message address and 03 lsla ora CT0IDR1 sta CT0IDR1 lda 2 x get next byte in message address and 80 rola rola ora CT0IDR1 sta CT0IDR1 lda 2 x get next byte in message address and 7F lsla sta CT0IDR2 lda 3 x get next byte in message address and 80 rola rola ora CT0IDR2 sta CT0IDR2 lda 3 x get next byte in message address and 7F lsla sta CT0IDR3 lda 4 x get the message priority sta CT0TBPR lda 5 ...

Page 281: ... CT0DSR6 lda 0d x get the message data sta CT0DSR7 ldhx Msg2_Desc set up transmission message 2 lda 0 x get message address lsla lsla lsla sta CT1IDR0 lda 1 x get next byte in message address and E0 lsra lsra lsra lsra lsra ora CT1IDR0 sta CT1IDR0 lda 1 x get next byte in message address and 1C lsla lsla lsla ora 18 sta CT1IDR1 lda 1 x get next byte in message address and 03 lsla ora CT1IDR1 sta C...

Page 282: ...PR lda 5 x get the message length sta CT1DLR sta datacount lda 6 x get the message data sta CT1DSR0 lda 7 x get the message data sta CT1DSR1 lda 8 x get the message data sta CT1DSR2 lda 9 x get the message data sta CT1DSR3 ldhx Msg3_Desc set up transmission message 3 lda 0 x get message address lsla lsla lsla sta CT2IDR0 lda 1 x get next byte in message address and E0 lsra lsra lsra lsra lsra ora ...

Page 283: ...d 80 rola rola ora CT2IDR2 sta CT2IDR2 lda 3 x get next byte in message address and 7F lsla sta CT2IDR3 lda 4 x get the message priority sta CT2TBPR lda 5 x get the message length sta CT2DLR sta datacount lda 6 x get the message data sta CT2DSR0 lda 7 x get the message data sta CT2DSR1 SYNCHCAN lda 00 sta CMCR0 allow MSCAN08 to synchronize to the bus lda FF sta CRFLG Reset all CAN receiver flags l...

Page 284: ... module CAN_ISR lda CRDLR get length of data in message cbeqa 0 DATADONE if no data in message then done sta datacount ldhx CRDSR0 initialize data pointer to first data segment sthx dataptr STOREDATA ldhx dataptr get data pointer to data in received message lda 0 x load data from data segment aix 1 index pointer to next segment sthx dataptr save data pointer ldhx buffptr get pointer to local circu...

Page 285: ...r dw dummy_isr SPI Transmit Vector dw dummy_isr SPI Receive Vector dw dummy_isr TIMB Overflow Vector dw dummy_isr TIMB Channel 1 Vector dw dummy_isr TIMB Channel 0 Vector dw dummy_isr TIMA Overflow Vector dw dummy_isr TIMA Channel 3 Vector dw dummy_isr TIMA Channel 2 Vector dw dummy_isr TIMA Channel 1 Vector dw dummy_isr TIMA Channel 0 Vector dw dummy_isr TIM Vector dw dummy_isr PLL Vector dw dumm...

Page 286: ...the code shows the interrupt vectors for the microcontroller where the CAN interrupts and the RESET vector are included All other vectors are pointed to a dummy interrupt service routine that simply returns from the interrupt Once the above mentioned assembly code is compiled as a part of the Freescale project one can step through it in the Full Chip Simulation mode The execution starts automatica...

Page 287: ...s edit box The address format can be set to be standard 11 bits or extended 29 bits Note that if you select an ERROR or OVERLOAD packet then the DATA field and CAN Address fields are unused and are grayed out For DATA and REMOTE packets the DATA field must be filled with the appropriate data Let s demonstrate how to fill these fields for a data packet coming in to the device from the network Figur...

Page 288: ...gle stepping through the code the user exits the ISR and return to the main loop The user can then see the resulting data in the memory window pointed to by the buffptr variable which is the 0 1 2 3 4 5 6 7 placed in the data packet Figure 11 30 shows the memory window Figure 11 29 CAN IN Display After Data Packet Figure 11 30 Memory Window Showing Received Data Now for the output packets that wer...

Page 289: ...n now select the other packets in the CAN OUT window to open them up and see which data packet they were in Figure 11 31 CAN OUT Display Figure 11 32 CAN Example Output Packet It is possible that a user does not want to enter all of these simulator commands manually In this case use macro files for automated code testing A macro file permits a user to set up a sequence of simulator commands to run...

Page 290: ... the transfer See CANIN command and CANOUT command for accessing the input and output buffers of the CAN interface Syntax CANCLR Example CANCLR Clear input and output buffers for CAN simulation CANIN Command The CANIN command allows the user to input data into the CAN If a data parameter is given the value is placed into the next slot in the input buffer Otherwise if no parameter is given a window...

Page 291: ...ted The maximum number of output packets that the buffer holds is 256 bytes Syntax CANOUT Example CANOUT View data from the output buffer for CAN simulation FCS Programmable Timer Interrupt Module In FCS Mode this module simulates all functionality of the Programmable Timer Interrupt PIT module including Programmable PIT clock input Free running or modulo up count operation Flag polling Interrupt ...

Page 292: ...I inputs The user can queue up to 256 data values into the input buffer The output buffer of the SCI module can also hold 256 output values To queue the SCI Input Data use the SCDI n command in the command prompt If n the data parameter is given the value is placed into the next slot in the input buffer Otherwise if no parameter is provided a window is displayed with the input buffer values Input ...

Page 293: ...le To bring up the SCI OUT buffer dialog box use the SCDO command Figure 11 36 SCI OUT Buffer Display At any point the SCCLR command can flush the input and output SCI buffers After the SCI simulated input is received the first queued value is passed from the data buffer into the SCI data register It can be observed in the memory window by displaying the memory location corresponding to the SCI da...

Page 294: ...r SCCLR Command Use the SCCLR command to flush the input and output buffers for SCI simulation This resets the buffers and clears out all values Notice that if the SCI is in the process of shifting a value this command allows the SCI to finish the transfer See SCDI command and SCDO command for accessing the input and output buffers of the SCI interface Syntax SCCLR Example SCCLR Clear input and ou...

Page 295: ...Pull up the data window with all the input values Figure 11 38 SCI IN Buffer Display SCDO Command The SCDO command displays the output buffer from the SCI A window is opened that shows all the data that the SCI has shifted out An arrow is used to point to the last output value transmitted The maximum number of output values that the buffer holds is 256 bytes Syntax SCDO Example SCDO View data from...

Page 296: ... queue up to 256 data bytes into the input buffer The output buffer of the SLIC module can also hold 256 output bytes To queue the SLIC Input bytes use the SLCIN command in the command prompt The SLIC command brings up a window which displays a list of queued in input data Different SLIC packets can be entered while the window is open An arrow points to the next byte to be used as input to the SLI...

Page 297: ...ut Data Configuration Dialog Box The SLIC data output buffer simulation allows the user to gain access to the past 256 SLIC data bytes transmitted out of the module To bring up the SLIC OUT buffer dialog box use the SLCOUT command Figure 11 42 SLIC OUT Buffer Display At any point use the SLCCLR command to flush the input and output SLIC buffers ...

Page 298: ...ned Note that the SLIC State Vector Register reflects the specific SLIC interrupt that was triggered CPU overhead for servicing different LIN interrupts can be significantly decreased by monitoring the state of this register from within the interrupt subroutine For more information on how to configure SLIC module for desired operation refer to the Freescale manual for your microprocessor FCSSLIC C...

Page 299: ...a or identifier After the SLIC Data IN buffer is filled with some data the SLIC simulation module begins reception of the data packet as soon as it is properly configured and turned on within the user s firmware In Byte Transfer Mode the designation of a byte as either data or identifier has no effect The SLIC data input buffer can store up to 256 bytes Syntax SLCDI Example SLCDI Bring up the SLIC...

Page 300: ...put clock Transmission and reception of external data FCS mode uses the buffered input output structure to simulate SPI inputs The user can queue up to 256 data values into the input buffer The output buffer of the SPI module can also hold 256 output values To queue the SPI Input Data use the SPDI n command at the command prompt If n the data parameter is given the value is placed into the next sl...

Page 301: ...er Display At any point SPCLR command can flush the input as well as output SPI buffers After the SPI simulated input is received the first queued value is passed from the data buffer into the SPI data register It can be observed in the Memory Window by displaying the memory location corresponding to the SPI data register Figure 11 48 Memory Component Window The user can also observe different SPI...

Page 302: ...re available for use with the M68HC08 processor SPCLR Command Use the SPCLR command can be used to flush the input and output buffers for SPI simulation This resets the buffers and clear out all values Notice that if the SPI is currently shifting a value this command allows the SPI to finish the transfer See SPDI command and SPDO command for accessing the input and output buffers of the SPI interf...

Page 303: ...Pull up the data window with all the input values Figure 11 49 SPI IN Buffer Display SPDO Command The SPDO command displays the output buffer from the SPI A window is opened that shows all the data that the SPI has shifted out An arrow is used to point to the last output value transmitted The maximum number of output values that the buffer holds is 256 bytes Syntax SPDO Example SPDO View data from...

Page 304: ...dow appears and the user is prompted for a value If this command is not used then the clocking is assumed to be set by the SPI control register Syntax SPFREQ n Where n The number of cycles for the period of the input clock Example SPFREQ 8 Set the period of the input slave clock to 8 cycles total shift 8 8 cycles per bit 64 cycles FCSTimer Interface Module In FCS Mode this module simulates all fun...

Page 305: ... Inputs for all general I O ports It displays the current simulated values for all applicable input ports See the documentation for the command INPUT x INPUTS for more information about the various forms of this command Figure 11 51 Simulated Port Inputs Dialog Box Use the Simulated Port Inputs dialog box to reconfigure the input value to any I O port Depending on whether the input capture is set ...

Page 306: ...le wave Once a PWM event takes place pin toggle clear set behavior corresponding to the Timer configuration can be observed in the Memory window displaying the IO port associated with a given timer channel To observe the accuracy of the Timer module operation the user can observe the number of CPU cycles that it takes for the event to occur The cycle counter is only incremented as the user steps t...

Page 307: ... useful for timing procedures Syntax CYCLES n Where n Integer value for the cycles counter Examples CYCLES 0 Reset cycles counter CYCLES 1000 Set cycle counter to 1000 GOTOCYCLE Command The GOTOCYCLE command executes the program in the simulator beginning at the address in the program counter PC Execution continues until the cycle counter is equal to or greater than the specified value until a key...

Page 308: ...corresponding port n Eight bit simulated value for port x Example INPUTA AA Simulate the input AA on port A INPUTS Command In Full Chip Simulation and CPU Only Simulation mode the INPUTS command opens the Simulated Port Inputs dialog box shown in Figure 11 54 Use this box to specify the input states of port pins and IRQ Figure 11 54 Simulated Port Inputs Dialog Box When using In Circuit Simulation...

Page 309: ... Interrupt enabled mode Transmission and reception of external data Endpoint 0 1 2 modes of operation USB reset functionality STALL NAK and ACK handshakes This section goes through an example of assembly code showing how the simulator can be used to test out code for driving the USB peripheral Listing 11 2 shows an assembly program that exercises the USB full speed peripheral on the 68HC908JW32 Th...

Page 310: ... JW32 VectorStart equ FFEE start of Vectors for JW32 EP1BuffStart equ 1000 start of buffer for endpoint 1 of the USB EP2BuffStart equ 1010 start of buffer for endpoint 2 of the USB Include JW32regs inc org RamStart Setup_Packet ds 8 array for SETUP packet bmReqType equ Setup_packet Characteristic of Request bRequest equ Setup_packet 1 Request Code wValueL equ Setup_packet 2 Low byte Value Field wV...

Page 311: ...0 8 bytes db 00 00 Vendor ID none db 00 00 Product ID none db 01 00 Device Release Number 1 00 db 01 Index to Manufacturer String Descriptor db 02 Index to Product String Descriptor db 00 Index to Device Serial Number String Descriptor db 01 Number of possible configurations 1 DDesc_End Configuration Descriptor Con_Desc db CDesc_End Con_Desc Descriptor Length db 02 Descriptor Type Configuration db...

Page 312: ...nd Endp1_Desc Descriptor Length db 05 Descriptor Type Endpoint db 81 Endpoint Number and Direction 1 IN db 03 Endpoint Attribute Interrupt db 01 00 Maximum Packet Size for EP1 1 byte db FF Polling Interval 255 ms E1Desc_End Endpoint 2 Descriptor Endp2_Desc db E2Desc_End Endp2_Desc Descriptor Length db 05 Descriptor Type Endpoint db 02 Endpoint Number and Direction 2 OUT db 02 Endpoint Attribute Bu...

Page 313: ...t and suspend events mov d0 UEP1CSR enable EP1 as interrupt IN direction buffer size of 8 mov 80 UEP2CSR enable EP2 as bulk OUT direction buffer size of 8 mov 20 UEP12BPR set base address pointer for EP1 to 1000 EP2 to 1010 mov 00 UINTFCR set interface number for EP1 EP2 to 0 mov 4e USBCR turn on USB clocking enable interrupts for endpoint 0 1 2 transfers mov ce USBCR enable USB module rts FORCE_S...

Page 314: ...ptr ldhx Dev_Desc store pointer to next byte in descriptor bra GETDESC_END GETCONDESC lda Con_Desc x take configuration descriptor information sta UE0D0 x store in USB endpoint 0 data buffer incx cpx 8 all descriptors more than 8 bytes bne GETCONDESC ldhx E2Desc_End store end location of the descriptor sthx descendptr ldhx Con_Desc store pointer to next byte in descriptor bra GETDESC_END GETHIDDES...

Page 315: ...iptor bge GETDESC_END2 else end_pointer calculated pointer sthx descendptr GETDESC_END2 ldhx descptr get pointer to start of descriptor aix 8 eight bytes sent already sthx descptr store current pointer mov 88 UEP0CSR SIZE 8 bytes IN packet data ready mov GET_DESC control set flag for control transfer type bra GETDESC_EXIT GETDESC_STALL jsr FORCE_STALL GETDESC_EXIT rts SETUP_PROC This procedure han...

Page 316: ...l GET_DESCR jsr GETDESC_PROC packet received was GET_DESCRIPTOR bra SETUP_EXIT go exit SETUP_STALL jsr FORCE_STALL error force stall on endpoint 0 SETUP_EXIT lda UEP0CSR setup endpoint 0 for more packets and fc sta UEP0CSR bclr 5 USBSR clear setup flags rts IN_PROC This procedure handles the IN packets that come into the USB peripheral through endpoint 0 IN_PROC lda control is this IN packet for d...

Page 317: ... asla asla ora 08 set DVALID_IN bit that data is ready sta UEP0CSR rts IN_PROC2 bclr 2 UEP0CSR clear the TFRC_IN bit for further packets rts OUT_PROC This procedure handles the OUT packets that are sent by the USB peripheral through endpoint 0 OUT_PROC lda UEP0CSR setup endpoint 0 for more packets and fc all OUT packets received for endpoint 0 sta UEP0CSR should be for status stage of requests rts...

Page 318: ...r IN_PROC handle IN packet for endpoint 0 rti exit interrupt USB_ENDP_ISR3 brclr 0 UEP1CSR USB_ENDP_ISR4 Is packet sent from IN packet for endpoint 1 lda ptb get Port B value sta EP1BuffStart place in endpoint 1 data buffer mov 01 UEP1DSR set data size for endpoint 1 to 1 bclr 0 UEP1CSR clear the TFRC flag bset 1 UEP1CSR set the DVALID flag USB_ENDP_ISR4 brclr 0 UEP2CSR USB_ENDP_EXIT is it a packe...

Page 319: ...t Port B value sta EP1BuffStart place in endpoint 1 data buffer mov 01 UEP1DSR set data size for endpoint 1 to 1 bclr 0 UEP1CSR clear the TFRC flag bset 1 UEP1CSR set the DVALID flag bclr 3 USBSR clear the CONFIG_CHG flag rti exit interrupt USB_CONFIG_CLR bclr 3 USBSR clear CONFIG_CHG bit rti exit interrupt USB_SYS_ISR3 brclr 5 USBSR USB_SYS_ISR4 is it SETUP packet jsr SETUP_PROC handle SETUP pack...

Page 320: ...quest with a valid address the device is placed into the ADDRESSED state Finally when a SET_CONFIGURATION standard device request is sent the device is placed into the CONFIGURED state After the device is configured endpoint 1 is enabled for interrupt transfers from the host Endpoint 1 is only capable of sending information out from it Therefore only IN packets are accepted at the endpoint The rep...

Page 321: ...luded All other vectors are pointed to a dummy interrupt service routine that simply just returns from the interrupt Once the mentioned above assembly code is compiled as a part of the Freescale project one can step through in the Full Chip Simulation mode The execution starts automatically at the reset location within the code We are now ready to start debugging the code First we need to step thr...

Page 322: ... that if you select a SETUP IN or OUT packet then the DATA field is not utilized If you select the DATA0 or DATA1 packet then the USB Address and Endpoint edit fields are not used For SETUP IN and OUT packets the USB Address and Endpoint fields must be filled with the appropriate data Here is an explanation of how to fill these fields for a GET DEVICE DESCRIPTOR request from the host which typical...

Page 323: ...g t in the simulator At this point use the USBOUT command to see that the ACK packet was sent out by the device as shown in Figure 11 60 This completes the setup stage We can utilize the same commands for the data stage using the USBIN command to create IN and ACK packets Once the code receives the IN packet it sends out the descriptor information with data packets through endpoint 0 The ACK packe...

Page 324: ...HC08 Full Chip Simulation Configuration Procedure 324 Microcontrollers Debugger Manual Figure 11 57 USB Packet Exchange Diagram ...

Page 325: ...8 Full Chip Simulation Configuration Procedure 325 Microcontrollers Debugger Manual Figure 11 58 USB Packet Setup Full Figure 11 59 USB IN Data Buffer Figure 11 60 USB Out Buffer Figure 11 61 USB IN Buffer ...

Page 326: ... found in the device descriptor table in the code This shows exactly what USB packet information was sent out from the device Figure 11 63 USB Packets IN Setup Once we get through the status stage which requires an OUT packet along with an empty DATA0 packet from the host to be received we get the USB IN window to look like that shown in Figure 11 64 and the USB out window to look like that shown ...

Page 327: ...uffer Now that we have gone through this device descriptor exchange the host has an idea of what type of USB slave device it is and next needs to give it an address We can go through the same process for the SET ADDRESS request from the host Once the device is addressed you must use this address in the SETUP packets sent to the device ...

Page 328: ...USBCLR Command Use the USBCLR command to flush the input and output buffers for USB simulation This resets the buffers and clears out all packets If the USB is currently shifting a value this command allows the USB to finish the transfer See USBIN command and USBOUT command for accessing the input and output buffers of the USB interface Syntax USBCLR Example USBCLR Clear input and output buffer fo...

Page 329: ... Syntax USBIN SETUP IN OUT address endpoint USBIN DATA0 DATA1 n1 n2 n3 USBIN ACK NAK STALL Where n1 n2 n3 are the values for the data packet address is the USB address for the packet endpoint is the endpoint number for the packet Example USB SETUP 5A 0 Set the next input packet as a SETUP packet for address 5A at the endpoint 0 USBIN DATA1 10 A4 52 Set the next packet as a DATA1 packet with 3 data...

Page 330: ...ays the output buffer from the USB A window is opened that shows all the data that the USB has shifted out An arrow is used to point to the last output packet transmitted The maximum number of output packets that the buffer holds is 256 bytes Syntax USBOUT Example USBOUT View packets from the output buffer for USB simulation Figure 11 68 USB OUT Buffer Display ...

Page 331: ...et from the USB connection If the URSTD bit is clear in the CONFIG register then a reset of the MCU occurs just as with a RESET command If the URSTD bit is set then a USB interrupt occurs See the technical description of the USB peripheral in the Freescale Manual for more information Syntax USBRESET Example USBRESET Simulate USB reset of the MCU ...

Page 332: ...HC08 Full Chip Simulation Configuration Procedure 332 Microcontrollers Debugger Manual ...

Page 333: ... debug code as the firmware is fully resident in the FLASH of the microprocessor The operation of all modules fully reflects the actual operation of the on board resources Connection Procedure To make the MON08 Interface debugger connection 1 Choose the MON08 Interface option from the Set Connection dialog box Figure 12 1 Set MON08 Interface Connection 2 Click the OK button The P E Connection Mana...

Page 334: ...nection Manager Window Connect to Target Tab 3 Access the Interface Selection dialog box by clicking the Add A Connection button in the Connection Manager window s Connect Target Tab Choose a device class corresponding to the type of interface that you are using Figure 12 3 Interface Selection Dialog Box ...

Page 335: ... The following is an explanation of each part of the Advanced Settings tab Figure 12 4 P E Connection Manager Window Advanced Settings Tab Tpd and Tpu Timing Listboxes Tpd and Tpu Timing Listboxes set the power up and power down delay respectively that are observed when power cycling a target for entry into Monitor Mode These settings are only valid for devices with automatically controlled power ...

Page 336: ... of the target system is desired If the option is unchecked the software asks the user to power cycle the target system to achieve a reset For a detailed description of the board or device classes see Device Class Description MON08 Cable Connection Communications Type This selection box is valid only for Class II hardware configurations using the MON08 cable For a detailed description of the board...

Page 337: ...he user go through two dialog box stages and requires more time than simply cycling the power 1 Software automatically powers down the ICS 2 Software asks the user to power down the board as follows Figure 12 5 Power Down Dialog Box 3 Software automatically powers up the ICS which configures the processor s MON08 configuration pins 4 Software asks the user to power up the board as follows Figure 1...

Page 338: ...cessor s MON08 configuration pins Serial Port Stop Bits Serial Port Stop Bits allow users of Class 1 4 devices that are experiencing unreliable communication to increase the number of stop bits to 2 Pulse IRQ on Stop The IRQ on Stop allows the users to execute a mechanism to stop a running HC08 microprocessor For more information refer to the Stop a Running HC908 Target pdf application note that i...

Page 339: ... S19 button IGNORE Security Failure and Enter Monitor Mode This MON08 16 Pin Header Signals tab checkbox can be used to cause the software to ignore a failure to properly pass the 68HC08 security check If the checkbox is set the software attempts to establish monitor mode communications regardless of the security status As long as the Baud and Port are correct and the device is properly powered th...

Page 340: ...e ICS Target is not connected No Power to the ICS If this status bit is N you must correct this before analyzing the rest of the status bits 1 Device echoed some security bytes The monitor resident in a 68HC08 device automatically echoes every incoming character when it is in monitor mode A valid character transmitted from the PC is echoed once by the loopback circuitry on the board and once by th...

Page 341: ...rom the processor it attempts to communicate with the monitor running on the M68HC08 processor It tries to read the monitor version number by issuing a monitor mode read If the processor fails to respond properly to this command this flag reads N 5 Reset was Power On Reset If the device properly entered monitor mode 4 the software reads the reset status register RSR This read does not affect the s...

Page 342: ... device is secure and the flag value is an N If all flags 0 5 register a value of Y and flag 6 registers a value of N then the reset process has occurred correctly except that the security code used to pass security was incorrect Specify the correct security code and try again or IGNORE the security failure and erase the device Once you erase a secured device you must exit the software and restart...

Page 343: ...alog Box Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking lets the software transparently program the microprocessor Trim Options The Calculate Trim and Program the Non Volatile Trim Register checkbox enables automatic calculation and programming of the trim value in a designated Non Volatile memory location Sync to PLL Change Checkbox Sync to PLL Change is r...

Page 344: ...d for all M68HC08 devices Start Expert Mode Programmer Option Start Expert Mode Programmer grants the user access to P E s graphical Flash programming utility PROG08SZ PROG08SZ lets an advanced user control the step by step execution of the Flash erase programming procedure See Figure 12 11 More information on how to use PROG08SZ can be found on P E Microcomputer Systems website at www pemicro com...

Page 345: ...Register Block Window If register files are installed on the host computer selecting a block brings up the Register Block register listing see Figure 12 13 which shows a list of the associated registers their addresses and their descriptions This begins interactive setup of system registers such as I O timer and COP watchdog Figure 12 13 Timer Interface Module Register Listing Selecting a file bri...

Page 346: ...le In this configuration there is no processor resident in any of the sockets of the ICS board itself The processor is mounted down in the user s MCU system The connection from the ICS board to the user s MCU system is accomplished via the 16 pin MON08 connector In this configuration since the ICS does not control power to the processor the user is prompted to turn the processor s power supply on ...

Page 347: ...nd all hardware configuration necessary to force the processor into MON08 mode upon reset In addition the user must include an extra circuit which allows the reset line of the processor to be driven low from the DTR line of the serial port connector Pin 4 on a DB9 The following diagram shows the additional connection needed to reset from a DB9 serial connector Figure 12 15 Reset Connection In this...

Page 348: ...MON08 Interface Connection Device Class Description 348 Microcontrollers Debugger Manual ...

Page 349: ...points and speed to name just a few while allowing the obvious benefit of garnering relevant signals from actual hardware In Circuit simulation requires a user to have a connected MCU Device be it a development board prototype hardware or simply a device placed in a simple circuit on a breadboard Once connection is established the P E Interface loads a MON file to the microcontroller itself This M...

Page 350: ...elect the ICS MON08 Interface connection 1 Choose the ICS MON08 Interface option from the set connection dialog box as shown in Figure 13 1 2 Click the OK button to open the P E Connection Manager Window Figure 13 1 ICS MON08 Set Connection Dialog Box Figure 13 2 P E Connection Manager Window Connect to Target Tab ...

Page 351: ... Window Figure 13 2 Choose a device class that corresponds to the Interface that you are using Figure 13 3 Interface Selection Dialog Box 4 Define the proper communication port and baud rate setting in the Connection Manager See Figure 13 3 5 To remove a pre configured ICS MON08 Interface go to the Remove section of the connection manager Select the interface to be removed and click on Remove Sele...

Page 352: ...wer Whenever power is automatically switched off or is manually requested to be switched off the software waits for an amount of time equal to the Tpd delay time before proceeding to the connection protocol This is because a board or power supply may have capacitance which holds the power up for a short time after the supply has been switched off but the supply voltage must reach less than 0 1v be...

Page 353: ...equence that the software uses to power up the ICS system When the software tries to create a power on reset condition two events must occur 1 Power of the target MCU must go below 0 1v This means that the processor cannot be receiving power from its power pins nor can it have a significant voltage being driven on port pins or the IRQ line as these drive the MCU power back through these pins It is...

Page 354: ... the user to power cycle their board Power UP ICS button does the opposite This option works for many ICS boards as well but relies on the fact that while the ICS is powered off it holds the target in reset until it is powered up itself and has configured the MON08 configuration pins The sequence of events in this mode is 1 Software automatically powers down the ICS 2 Software asks the user to pow...

Page 355: ...the checkbox is set the software attempts to establish monitor mode communications regardless of the security status As long as the Baud and Port are correct and the device has been properly powered this allows monitor mode entry By ignoring the security check failure you may still use monitor mode but the ROM Flash is not accessible NOTE If a connection is not established for any reason other tha...

Page 356: ...he character was not received or not received properly it is most likely due to one of the following reasons The baud rate specified was incorrect The part did not start the monitor mode security check on reset Signals to force monitor mode may be incorrect No Power to the ICS If this status bit returns an N you must correct this before analyzing the reset of the status bits 2 Device echoed all se...

Page 357: ... RSR to determine if the last reset was indeed caused by power on The result of the RSR read is indicated in parentheses after the flag value If the highest bit is not set then the reset was not a power on reset and the flag indicates an N Reasons for this include The processor did not power all the way down because power was being supplied to the processor through either the port pins IRQ line RE...

Page 358: ...ted more Connection menu entries become available to the user Figure 13 8 Additional Connection Menu Options Advanced Programming Debug Options The Advanced Programming Debug Options menu entry take you to the Advanced Options dialog box where you can configure the software settings for the Flash programming procedure Figure 13 9 Advanced Options Dialog Box ...

Page 359: ...s required for the software hardware connection to synchronize with the microprocessor during the Flash erasing programming procedure NOTE The Non Volatile Memory Preservation and Custom Trim functionality are only available for the M68HCS08 devices and as such these options are disabled for all M68HC08 devices Start Expert Mode Programmer Option Start Expert Mode Programmer grants the user access...

Page 360: ... that you have chosen the Choose a Register Block window see Figure 13 11 opens You may also open it by entering the R command in the Command Window command line Figure 13 11 Choose A Register Block Dialog Box If register files are installed on the host computer selecting a block brings up the Register Block register listing see Figure 13 12 which shows a list of the associated registers their add...

Page 361: ... the standard and most common configuration of the ICS08 boards In this configuration the processor is resident in one of the sockets on the ICS board itself The processor can be debugged and programmed in this configuration and an emulation cable containing all the processor I O signals can be connected to the user s MCU development board In this configuration the ICS board hardware can automatic...

Page 362: ...MON08 mode upon reset This includes resets both internal and external to the processor In this configuration because the software does not directly control power to the processor the user is prompted to turn the processor s power supply on and off The user is also prompted to turn power on and off to reset the microprocessor as the PC has no control of the microprocessor reset Turning off the powe...

Page 363: ...ed to turn the processor s power supply on and off Turning off the power supply is necessary to pass the initial security mode check and access the Flash on the processor A simple reset is not enough to pass the security check you must first force the processor to encounter a POR power on reset which requires the processor s voltage to dip below 0 1v Once security is passed resetting the device is...

Page 364: ...ICS MON08 Interface Connection Device Class Description 364 Microcontrollers Debugger Manual ...

Page 365: ...resident in the FLASH of the microprocessor The operation of all modules fully reflects the actual operation of the on board resources Connection Procedure To select the P E Multilink Cyclone Pro connection 1 Select the Component Set Connection menu command 2 Choose the P E Multilink Cyclone Pro option from the Set Connection dialog box as shown in Figure 14 1 Figure 14 1 Set Connections Dialog Bo...

Page 366: ...get and under user control If it is under user control the software uses dialog boxes to ask the user to power the target up and down when necessary similar to Class II IV See Figure 14 3 Figure 14 3 Device Power Selection List Figure 14 4 HC08 Device Clock Selection Box 5 The device clock menu allows two options as shown in Figure 14 4 P E provides clock to target The device has its own clock 6 C...

Page 367: ...on button on this tab of the Connection Manager window See Figure 14 5 For more information about configuring Cyclone Pro for ethernet operation refer to the Cyclone Pro User s Manual Figure 14 5 Interface Selection Dialog Box 8 To remove a manually configured interface click on the Remove Connection button on this tab of the Connection Manager window and choose the interface to be deleted See Fig...

Page 368: ...er power is automatically switched off or is manually requested to be switched off the software waits for an amount of time equal to the Tpd delay time before proceeding to the connection protocol This is because a board or power supply may have capacitance which holds the power up for a short time after the supply has been switched off but the supply voltage must reach less than 0 1v before it is...

Page 369: ...oftware uses to power up the ICS system When the software tries to create a power on reset condition two events must occur 1 Power of the target MCU must go below 0 1v This means that the processor cannot be receiving power from its power pins nor can it have a significant voltage being driven on port pins or the IRQ line as these drive the MCU power back through these pins It is crucial therefore...

Page 370: ...s well but relies on the fact that while the ICS is powered off it holds the target in reset until it is powered up itself and has configured the MON08 configuration pins The sequence of events in this mode is 1 Software automatically powers down the ICS 2 Software asks the user to power cycle their board as follows Figure 14 10 Power Cycle Dialog Box 3 Software automatically powers up the ICS whi...

Page 371: ...that is programmed into the part This holds true even when the part is blank The security code consists of the 8 values which are currently stored in Flash locations FFF6 FFFD of the processor Figure 14 11 P E Connection Manager Window P E Multilink on LPT1 Interface This window can be used to manually enter the proper security bytes via the USER setting or to load the security bytes from the same...

Page 372: ...he monitor of the target processor itself This status indicates whether the first echoed character from the hardware loopback was received when one of the security bytes was transmitted If the status is N which indicates that the character was not received it is most likely due to one of the following reasons Wrong Com Port specified The baud rate specified was incorrect probably too low The ICS T...

Page 373: ...k was not received from the processor this flag returns an N Reasons for this include The baud rate specified was incorrect The processor was not reset properly Check the Target Hardware Type If you are connecting to a class II board check the MON08 cable communication connections type in the Advanced Settings dialog box 4 Device entered monitor mode Once the software has received or failed to rec...

Page 374: ...invalid or protected read back from the device as AD If all bytes from FFF6 FFFF read a value of AD it is assumed the device is secure and the flag value is an N If all flags 0 5 register a value of Y and flag 6 registers a value of N then the reset process has occurred correctly except that the security code used to pass security was incorrect Specify the correct security code and try again or IG...

Page 375: ... HC08 Device Extended Menus Connect Option The Connect option initiates an attempt to communicate with the device chosen under the device section of the menu Active Mode Menu Options When the microprocessor is connected more Connection menu entries become available to the user Figure 14 14 Additional Menu Options ...

Page 376: ...Dialog Box Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking lets the software transparently program the microprocessor Trim Options The Calculate Trim and Program the Non Volatile Trim Register checkbox enables automatic calculation and programming of the trim value in a designated Non Volatile memory location Sync to PLL Change Checkbox Sync to PLL Change is...

Page 377: ...disabled for all M68HC08 devices Start Expert Mode Programmer Option Start Expert Mode Programmer grants the user access to P E s graphical Flash programming utility PROG08SZ PROG08SZ lets an advanced user control the step by step execution of the Flash erase programming procedure See Figure 14 16 More information on how to use PROG08SZ can be found on P E Microcomputer Systems website at www pemi...

Page 378: ... Choose A Register Block Window If register files have been installed on the host computer selecting a block brings up the Register Block register listing see Figure 14 18 which shows a list of the associated registers their addresses and their descriptions This begins interactive setup of system registers such as I O timer and COP watchdog Figure 14 18 Register Block Register Listing Selecting a ...

Page 379: ...nterrupt 7 Do not set hardware breakpoints within the monitor ROM area itself Hardware breakpoints set in this area do not function properly Debugging Tips The following tips may prove useful 1 Single stepping is allowed in both RAM or ROM 2 The first breakpoint set is always a hardware breakpoint and any additional breakpoints set are software breakpoints To make sure that a hardware breakpoint i...

Page 380: ... system via a standard 16 pin MON08 ribbon cable MON08 Multilink and USB MON08 Multilink allow one to auto detect the baud rate as well as auto cycle the power through the microprocessor system Class 8 Device P E s Cyclone Pro communicates with the PC through a Serial Ethernet or USB port The Cyclone Pro can be used to debug and program the firmware inside of Freescale HC08 microprocessors via a s...

Page 381: ...reakpoints and speed to name just a few while allowing the obvious benefit of garnering relevant signals from actual hardware In Circuit simulation requires a user to have a connected MCU Device be it a development board prototype hardware or simply a device placed in a simple circuit on a breadboard Once connection is established the P E Interface loads a MON file to the microcontroller itself Th...

Page 382: ...ual Connection Procedure 1 Choose the ICS P E Multilink Cyclone Pro option from the set connection dialog box as shown in Figure 15 1 Figure 15 1 Set Connection Dialog Box 2 Click the OK button to bring up the P E Connection Manager Window Figure 15 2 P E Connection Manager Window Connect to Target Tab ...

Page 383: ...4 M68HC08 Device Clock Selection Box 4 The device clock menu allows two options See Figure 15 4 P E provides clock to target The device has its own clock 5 Click on Refresh which detects all P E devices that are automatically detected such as Cyclone Pro USB Cyclone Pro Ethernet and USB ML MON08 Multilink See Figure 15 2 6 To add a serial parallel port P E device such as Cyclone Pro Serial MON08 M...

Page 384: ...emove A Manually Configured Multilink Cyclone Pro Interface Advanced Settings Tab The Advanced Settings tab of the P E Connection Manager window allows the user to set specific protocol settings The following is an explanation of the Advanced Settings tab Figure 15 6 P E Connection Manager Window Advanced Settings Tab ...

Page 385: ...ich are Class III boards with the monitor mode circuitry built in including RS 232 driver there is no means to reset the target to gain control If the board has a reset button the software can use this to gain control of the target system If this option is checked the software prompts the user to push the target reset button when a reset of the target system is desired If the option is unchecked t...

Page 386: ...p the board This is the default option and works for most if not all ICS08 Target Board solutions 1 Software automatically powers down the ICS 2 Software asks the user to power down the board as follows Figure 15 7 Power Down Dialog Box 3 Software automatically powers up the ICS which configures the processor s MON08 configuration pins 4 Software prompts the user to power up the board as follows F...

Page 387: ...ode is simulated on the PC and not run from the Non Volatile memory of the device Therefore there is no need to pass security in this mode of operation STATUS Area The status area of the P E Connection Manager window consists of one status string following the Status label and seven items which list the state of the last attempt to connect to a target and pass security The description for these it...

Page 388: ...one of the following reasons The baud rate specified was incorrect The part did not start the monitor mode security check on reset Signals to force monitor mode may be incorrect No Power to the ICS If this status bit returns an N you must correct this before analyzing the rest of the status bits 2 Device echoed all security bytes In order to pass security the software must send eight security byte...

Page 389: ...s the RSR to determine if the last reset was indeed caused by power on The result of the RSR read is indicated in parentheses after the flag value If the highest bit is not set then the reset was not a power on reset and the flag indicates an N Reasons for this include The processor did not power all the way down because power was being supplied to the processor through either the port pins IRQ li...

Page 390: ...cted more Connection menu options become available to the user Figure 15 10 Additional Connection Menu Options Advanced Programming Debug Options The Advanced Programming Debug Options menu entry takes you to the Advanced Options dialog box where you can configure the software settings for the Flash programming procedure Figure 15 11 Advanced Options Dialog Box ...

Page 391: ...nc to PLL Change is required for the software hardware connection to synchronize with the microprocessor during the Flash erasing programming procedure NOTE The Non Volatile Memory Preservation and Custom Trim functionality are only available for the M68HCS08 devices and as such these options are disabled for all M68HC08 devices Start Expert Mode Programmer Option Start Expert Mode Programmer gran...

Page 392: ...e device that you have chosen the Choose a Register Block window see Figure 15 13 opens You may also open it by entering the R command in the Command Window command line Figure 15 13 Choose A Register Block Window If register files have been installed on the host computer selecting a block brings up the Register Block register listing see Figure 15 14 which shows a list of the associated registers...

Page 393: ...ce information summarizes the different classes of boards available to the user Detailed information about specific devices is available from Freescale Class 5 Device P E MON08 Cyclone Device connects to PC via a serial port The Cyclone to target connection takes place via a standard 16 pin MON08 ribbon cable MON08 Cyclone Device allows one to auto detect the baud rate as well as auto cycle the po...

Page 394: ...icroprocessors via a standard 16 pin MON08 ribbon cable The Cyclone Pro can provide its own power and clock signals to the target as long as proper signals are connected to the corresponding pins of the 16 pin MON08 header In addition the Cyclone Pro can be used for programming and debugging the M68HC12 M68HCS12 M68HCS08 Freescale microprocessors via a standard 6 pin ribbon cable To take advantage...

Page 395: ...onnected through the SofTec in circuit debugger programmer units such as the SofTec Microsystems HC08 ISP Debuggers Programmers inDART Series and Starter Kits AK SK PK ZK and newer Series Refer to the inDART HC08 In Circuit Debugger Programmer for Motorola HC08 Family FLASH Devices User s Manual from SofTec for communication hardware requirements and SofTec product installation CodeWarrior IDE and...

Page 396: ...ted in the program group 2 Choose the menu File New to create a new project from a stationery the HC08 New Project Wizard first screen appears 3 In the list box on the left of the screen select the HC08 MCU you are targeting 4 In the Connections list box select SofTec HC08 as the connection Figure 16 1 Wizard Connection Selection 5 Finish the Wizard steps the IDE opens 6 In the IDE main window too...

Page 397: ...thin an existing debugging project 1 Run the CodeWarrior IDE 2 Open the project 3 Choose Project Debug to start the debugger 4 In the Debugger choose Component Set Connection to select another target interface in the Set Connection dialog box 5 Select HC08 as Processor 6 Select SofTec HC08 as connection Figure 16 2 Set Connection Dialog Box SofTec HC08 Selection 7 In the MCU Configuration dialog b...

Page 398: ...nection is set the connection menu entry in the debugger main toolbar is inDART HC08 Figure 16 4 inDART HC08 Menu Options MCU Configuration Option Select the inDART HC08 MCU Configuration option to display the MCU Configuration Dialog Box User s Manual Option Select the inDART HC08 User s Manual option to open the inDART HC08 In Circuit Debugger Programmer for Freescale HC08 Family FLASH Devices U...

Page 399: ...ttings button opens the Communication Settings Dialog Box Communication Settings Dialog Box Pressing the Communication Settings button in the MCU Configuration dialog box opens the Communication Settings dialog box which allows you to fine tune critical parameters needed for proper operation with the chosen target microcontroller The dialog box is divided into three sections Communication Paramete...

Page 400: ...nning an additional interrupt service routine is required for the IRQ vector See Stop Command Handling section in inDART HC08 In Circuit Debugger Programmer for Motorola HC08 Family FLASH Devices User s Manual from SofTec for further details About Dialog Box This dialog box belongs to the SofTec GDI DLL and provides information about the inDART_HC08 dll release and version Figure 16 7 About Dialog...

Page 401: ...em called the MMDS0508 a Modular Development System MMDS If you have worked with the MMDS0508 many of the features of the FSICEBASE will be familiar to you FSICEBASE Overview This overview section contains the following topics System Requirements System Features System Components The CodeWarrior IDE software provides an integrated development environment that includes an editor assembler and a use...

Page 402: ...patibility standards Allows you to set four complex data or instruction breakpoints a breakpoint can be qualified by an address an address range data or externally connected logic clips Up to 128k real time variables any ROM or RAM memory area Up to 128 Kilobytes of emulation memory to accommodate the largest available ROM size of current HC08 MCU Unlimited hardware instruction breakpoints over th...

Page 403: ...cuit Emulator Base includes the following components Base station The connectors on the top of the box let you connect an emulation module EM Cables connectors and adapters crossover ethernet cable connects directly to an Ethernet Network Interface Card NIC on a PC straight through ethernet cable connects to a hub or switch Universal Serial Bus USB cable MON08 debug port built into base station ex...

Page 404: ...he FSICEBASE for a particular MCU or MCU family The FSICEBASE works with a variety of EMs You can purchase EMs separately from the FSICEBASE The two DIN connectors on the bottom of the EM fit into connectors on the top of the FSICEBASE box The target provides power and signal targets Connection to your target system is then made through a separately purchased target cable and target head adapter t...

Page 405: ...rt Connect the FSICEBASE to a host computer in one of the three ways described in the following paragraphs 1 If you are using an ethernet connection to connect your host computer to the FSICEBASE through a Local Area Network LAN a Connect host computer to LAN b Connect FSICEBASE to LAN c Make sure power supply is not connected to board d Connect one end of ethernet cable to ethernet port of FSICEB...

Page 406: ...o the FSCIBASE connect Power supply to FSICEBASE 1 Connect round end of 5 volt power cord to barrel connector on FSICEBASE 2 Plug power supply into surge protected strip 3 Connect surge protected strip to AC outlet 4 Switch FSICEBASE Power switch to ON LED lights after the base station finishes boot sequence There are three status LEDs on the box busy ready and error The FSICEBASE base station tak...

Page 407: ...CEBASE Specify IP address in the debugger The following procedures explains how to do these things step by step To establish communication through a LAN 1 Set up hardware as explained in Setting Up the Hardware 2 Obtain the IP address that your network administrator assigned to the FSICEBASE 3 Start the debugger as explained in Starting the Debugger 4 Make sure connection is FSICEBASE a From debug...

Page 408: ...e a USB connection to establish communication between your host computer and the FSICEBASE 1 Set up hardware as explained in Setting Up the Hardware 2 Start the debugger as explained in Starting the Debugger NOTE If you have started the debugger from your project previously when you select Debug in the IDE the Debugger attempts to connect to the FSICE with the last known settings If the Debugger c...

Page 409: ...you need to make sure that the system is configured properly Configuring the FSICE system includes Specifying A Connection Specifying Communication Information Assigning an IP Address to FSICEBASE Specifying a Memory Map Specifying the Clock Speed Specifying A Connection To specify the connection including the specific derivative 1 Start the debugger the True time Simulator Real time Debugger wind...

Page 410: ...ontains a menu item labeled FSICEBASE HC08 as shown in Figure 17 3 The FSICEBASE HC08 list menu is also shown Figure 17 3 FSICEBASE Menu Specifying Communication Information When you start the debugger from the CodeWarrior IDE the debugger automatically prompts you to specify communication information However if necessary you can change the communication information directly from the debugger To s...

Page 411: ...SE b If you use an ethernet connection to connect your host computer directly to the FSICEBASE not through a LAN In the Communication dialog box select TCP IP and In the text box of the Communication dialog box type the IP address of the FSICEBASE NOTE Make sure that the cable between the host computer and the FSICEBASE is a cross over ethernet cable NOTE Make sure that the host computer uses a st...

Page 412: ... FSICEBASE The CodeWarrior IDE software includes a utility that allows you to assign a different IP address to the FSICEBASE To assign an IP address to the FSICEBASE 1 Use a USB cable to connect the host computer to the FSICEBASE 2 Start the FSICEBASE Configuration Utility a From Windows desktop click Start menu b Select Run c Browse to the following executable file installation_directory prog GDI...

Page 413: ...SE Configuration Utility 7 In Address text box type the IP address that you want to assign to the FSICEBASE NOTE All hosts on a network must have a unique IP address If you are connecting the FSICEBASE to a Local Area Network LAN consult with your network administrator to obtain a valid IP address 8 From Mask combo box select the subnet mask that you want to assign to the FSICEBASE NOTE All the ho...

Page 414: ...on 11 Click Change button The FSICEBASE Configuration Utility displays the IP Address Change Confirmation dialog box Figure 17 5 with the information that you specified If information is wrong click No to return to the Network tab and correct the information Figure 17 5 IP Address Change Confirmation Dialog Box 12 Click Yes The FSICEBASE Configuration Utility assigns the new IP information to the ...

Page 415: ...an view the memory map and modify it To use the Command line to view the current memory map 1 From debugger main menu select Window Command to view the Command window If you do not see the Command window a From the debugger main menu select Component Open b Select Command c Click OK the debugger opens a new Command window 2 Click on command line place insertion point on command line 3 Type MEM Com...

Page 416: ...ormation on specifying a connection see Specifying A Connection 3 Select Memory Map Memory Map dialog box opens Figure 17 7 Figure 17 7 Memory Map Dialog Box 4 Specify memory map information a From Memory list box select portion of map to change b In Start text box type new start address of range desired c In End text box type new end address of range desired d Select Type of memory represented by...

Page 417: ...lock source can be used Refer to the specific EM user s manual for EM clock source information The FSICEBASE has seven clock frequencies available six internally generated clock frequencies 32 MHz 16 MHz 8 MHz 4 MHz 2 MHz and 1 MHz and an external clock source You can also define a custom internal clock speed If you use an external clock source you need to use a logic clip to connect the clock to ...

Page 418: ...ou specify a custom clock speed be aware that the FSICEBASE can provide clock speeds from 4100Hz to 40MHz in steps of 5kHz The FSICEBASE uses a clock synthesis chip to generate the clock speed This method is not as accurate as a crystal only within about 0 75 absolute frequency with about 5 jitter If you choose a clock value either from one of the radio buttons or by typing it in that is an intege...

Page 419: ...umpers as necessary to use the Reset IN option For more information refer to your EM s documentation d To allow a reset signal to be sent to the target system through the target cable check the Reset Out checkbox NOTE If you check both Reset IN and Reset Out the internal resets of the emulator system are not sent to the target system e Click OK 2 From debugger main menu select FSCICEBASE HC08 3 Se...

Page 420: ...d clock connection to the white probe tip and use the TIMETAG command to select an external time tag source for the analyzer Table 17 1 Pod and Logic Cable Pin Assignments Pod Pin Pod A Signal Pod B Signal Probe Color 1 LC0 LC8 Brown BRN 2 GND GND 3 LC1 LC9 Red RED 4 GND GND 5 LC2 LC10 Orange ORG 6 GND GND 7 LC3 LC11 Yellow YEL 8 GND GND 9 LC4 LC12 Green GRN 10 GND GND 11 LC5 LC13 Blue BLU 12 GND ...

Page 421: ...es the analyzer stores Data collection cycle storage begins when you arm the analyzer and start program execution Data collection continues until execution stops through a specified number of events or through a defined sequence of events Using BSA To use the bus state analyzer BSA to produce useful data that you can view and analyze you must 1 Define events terms 2 Arm the BSA Defining Events You...

Page 422: ...menu select File Load Application Specify the location of the executable program file abs or s19 file Click Open debugger loads the application you specified 3 From debugger main menu select FSCICEBASE HC08 The FSICEBASE HC08 menu is between the Run menu and the Component menu If you do not see the FSICEBASE HC08 menu you need to specify the connection For more information on specifying a connecti...

Page 423: ...d the signals of Pods B and C cannot be used to define an event The Bus Analyzer Configuration dialog box shows the five clips that you can use to trigger an event The choice of these five signals is hard set in the FSICEBASE you cannot choose other signals to be used as event criteria However the BSA does capture data from all 24 lines of Pods A B and C 11 If you want the term to also act as a br...

Page 424: ...execution Counted Events Only After execution begins the trace buffer begins storing data that matches an event definition for the specified number of cycles A breakpoint can stop storage before the analyzer stores the specified number of cycles as can halting execution A B C D After execution begins the trace buffer begins storing data from the first cycle run This continues through the occurrenc...

Page 425: ... events A B C or D whichever are enabled Then the bus state analyzer captures the next 4096 cycles By selecting the terminal post trigger count the user can control the number of cycles that is stored This can be used to speed uploading of the BSA data if only a small portion of data is needed NOTE The terminal count or post trigger cycles are valid only for counted or sequential modes For a count...

Page 426: ...ut 5 jitter If you choose a clock value either from one of the radio buttons or by typing it in that is an integer divisor of 32MHz you get an accurate crystal sourced clock Collecting Bus Data To instruct the Bus State Analyzer BSA to start collecting data 1 From debugger main menu select FSCICEBASE HC08 2 Select Arm Trace the BSA begins to collect data when the debugger starts execution of the l...

Page 427: ... the way that data is displayed a Place mouse cursor over Trace window b Right click mouse Menu appears allowing you to change various aspects of the Trace window The Trace window can display trace buffer contents as raw bus cycles as disassembled instructions as mixed instructions and raw bus cycles or as source code ...

Page 428: ...HC08 FSICEBASE Emulator Bus State Analyzer BSA 428 Microcontrollers Debugger Manual ...

Page 429: ...tions and help you understand how to use the environment This book the HCS08 Debug Connections defines the connections available for debugging code written for HCS08 CPUs This book consists of the following sections HCS08 Full Chip Simulation HCS08 P E Multilink Cyclone Pro Connection HCS08 Open Source BDM Connection HCS08 Serial Monitor Connection SofTec HCS08 Connection HCS08 On Chip DBG Module ...

Page 430: ...Book III Contents 430 Microcontrollers Debugger Manual ...

Page 431: ...f code on the user s MCU system including the function of any peripherals associated with the device that you select For more detailed information refer to the Full Chip Simulation description for the module that you are using Configuration Procedure To select Full Chip Simulation as the debugger connection 1 Choose the Full Chip Simulation option from the set connection dialog box See Figure 18 1...

Page 432: ... Procedure 432 Microcontrollers Debugger Manual Connection HCS08FCS Menu Once you have chosen Full Chip Simulation as your debugger connection the name of the Connection menu is updated and addition options are added Figure 18 2 HC08FCS Menu ...

Page 433: ... chosen device For more information about specific module commands refer to the Full Chip Simulation section describing the module Run Till Cycle Command The Run Till Cycle command begins code execution and stops execution when the specified cycle count is reached Note that the parameter given is not the number of cycles to execute but the total cycle count of the simulator displayed in the Regist...

Page 434: ...18 4 opens You may also open it by entering the R command in the Command Window command line Figure 18 4 Choose A Register Block Dialog Box If register files have been installed on the host computer selecting a block brings up the Register Block register listing see Figure 18 5 which shows a list of the files their addresses and their descriptions This begins interactive setup of system registers ...

Page 435: ... you select a device see Device Option the HCS08FCS Menu displays a list of peripheral modules and the associated commands for the device you have chosen Figure 18 7 HCS08FCS Menu Peripherals Commands Extended Menus Placing your mouse over a peripheral opens a box which lists its associated commands Click on a command in order to execute that command ...

Page 436: ...xt slot in the input buffer Otherwise if no parameter is provided a window is displayed with the input buffer values Input values can be entered while the window is open An arrow points to the next value to be used as input to the ADC The conversion takes place after a proper value is written to the ADC Status and Control register Once the conversion occurs the arrow moves to the next value in the...

Page 437: ...he next slot in the input buffer Otherwise if no parameter is given a window is displayed with the input buffer values Input values can be entered while the window is open An arrow points to the next value to be used by the ADC The maximum number of input values is 256 bytes Syntax ADDI n Where n The value to be entered into the next location in the input buffer Example ADDI 55 Set the next input ...

Page 438: ... Automatic lock detection Interrupt Acquisition Tracking Flag polling FCS mode uses simulated External Oscillator Frequency change command XTAL to allow the user to input the desired XTAL value To check the current value of the External Oscillator Bus Frequency and CGMXCLK Frequency open the HCS08FCS menu then select Clocks Module Show MCU Clocks Figure 18 10 Clocks Module Extended Menu Once you s...

Page 439: ...vent situate your Memory Window on the memory location of the ICG Status and Control register Figure 18 12 Memory Window For more information on how to properly configure Clock Generation refer to the Freescale reference manual for your microprocessor Clock Generation Module Commands The following commands are available for the M68HCS08 Clock Generation Module XTAL Command Use the XTAL command to ...

Page 440: ... of operation START and STOP signal generation detection Acknowledge bit generation detection FCS mode uses the buffered input output structure to simulate IIC inputs The user can queue up to 256 data bytes into the input buffer The output buffer of the USB module can also hold 256 output bytes To queue the IIC Input Packets use the IICDI command in the command prompt For a more detailed descripti...

Page 441: ...IIC IN OUT LOG Buffer Display At any point use the IICCLR command to flush the input as well as input output log IIC buffers After the IIC simulated input is received the first queued in data byte is passed from the data buffer into the corresponding IIC module registers It can be observed in the Memory Window by displaying the appropriate register location there Figure 18 15 Memory Component Wind...

Page 442: ... given a window is displayed with the input buffer values Input values can be entered while the window is open The maximum number of input values is 256 This command is useful for either inputting response data from a slave target or for inputting data packets from an external master Note that when the microprocessor attempts to read an acknowledge from an external device and the next value in the...

Page 443: ... ACK ACK If however the slave receiver is designed to generate a NACK signal after the second received data byte the proper response packet is IICDI ACK ACK NACK The address result being the first ACK the first data result being the second ACK and the second data byte being the NACK IIC in MASTER mode is not acknowledged by any Slave IICDI NACK If the NACK signal is entered before our master devic...

Page 444: ... to flush the input and output buffers for IIC simulation This resets the buffers and clears all values Notice that if the IIC is currently shifting a value this command does not prevent the IIC from finishing the transfer Syntax IICCLR Example IICCLR Clear input and output buffers for IIC simulation Input Output I O Ports Module In FCS this module simulates all input and output functionality of t...

Page 445: ...Box Use the Simulated Port Inputs dialog box to reconfigure the input value to any I O port Use the INPUTS command to reconfigure the output values on any relevant I O port You can observe the manipulation of I O port pins in the Memory Window Figure 18 17 Memory Component Window Note that if the regular I O pins are multiplexed to be used by a different MCU Module they might not be available for ...

Page 446: ...PUT x Command The INPUT x command sets the simulated inputs to port x The CPU reads this input value when port x is set as an input port Syntax INPUT x n Where x is the letter representing corresponding port n Eight bit simulated value for port x Example INPUTA AA Simulate the input AA on port A ...

Page 447: ...alues to any applicable port Syntax INPUTS Example INPUTS Show I O port input values External Interrupt IRQ Module In FCS this module simulates the input flag polling and interrupt functionality of the External Interrupt IRQ module FCS mode uses the INPUTS command to let the user monitor and change the simulated value of the IRQ input pin state Once the user enters the INPUTS command into the comm...

Page 448: ...n poll the IRQ flag if the Polling Mode is simulated In the Interrupt Mode the simulator branches to an appropriate interrupt subroutine as long as the IRQ interrupt vector is properly configured For more information on IRQ configuration refer to the Freescale user manual for your microprocessor Following the IRQ event you can observe the IRQ Flag being set in the IRQ Status and Control register F...

Page 449: ... Figure 18 21 The user may then use this box to specify the input states of port pins and IRQ Figure 18 21 Simulated Port Inputs Dialog Box When using In Circuit Simulation mode the INPUTS command shows the simulated input values to any applicable port Syntax INPUTS Example INPUTS Show I O port input values NOTE The IRQ pin state can be directly manipulated with the IRQ command For example IRQ 1 s...

Page 450: ...is port At the same time you can use the INPUTS command to bring up the Simulated Port Inputs for all general I O ports It displays the current simulated values to all applicable input ports See the documentation for Timer Module Commands for more information about the various forms of this command Figure 18 22 Simulated Port Inputs Dialog Box Use the Simulated Port Inputs dialog box to reconfigur...

Page 451: ...rupt Commands The following Keyboard interrupt commands are available during full chip simulation on the HCS08 INPUT x Command The INPUT x command sets the simulated inputs to port x The CPU reads this input value when port x is set as an input port Syntax INPUT x n Where x is the letter representing corresponding port n is an eight bit simulated value for port x Example INPUTA AA Simulate the inp...

Page 452: ...lo Timer Interrupt Module In FCS this module simulates all functionality of the Modulo Timer Interrupt MTIM Module including programmable MTIM clock input free running or modulo up count operation flag polling interrupt enabled mode of operation Once the MTIM Status and Control register properly configures the operation of the module the MTIM Counter starts incrementing If modulo up count operatio...

Page 453: ...I inputs The user can queue up to 256 data values into the input buffer The output buffer of the SCI module can also hold 256 output values To queue the SCI Input Data use the SCDI n command in the command prompt If n the data parameter is given the value is placed into the next slot in the input buffer Otherwise if no parameter is provided a window is displayed with the input buffer values You ca...

Page 454: ...ule To bring up the SCI OUT buffer dialog box use the SCDO command Figure 18 27 SCI OUT Buffer Display At any point use the SCCLR command to flush the input and output SCI buffers After the SCI simulated input is received the first queued value is passed from the data buffer into the SCI data register It can be observed in the memory window by displaying the memory location corresponding to the SC...

Page 455: ...ut and output buffers for SCI simulation This resets the buffers and clear out all values Notice that if the SCI is in the process of shifting a value this command does not prevent the SCI from finishing the transfer See SCDI command and SCDO command for accessing the input and output buffers of the SCI interface Syntax SCCLR Example SCCLR Clear input and output buffer for SCI simulation SCDI Comm...

Page 456: ...29 SCI IN buffer display SCDO Command The SCDO command displays the output buffer from the SCI A window is opened that shows all the data that the SCI has shifted out An arrow is used to point to the last output value transmitted The maximum number of output values that the buffer holds is 256 bytes Syntax SCDO Example SCDO View data from the output buffer for the SCI simulation Figure 18 30 SCI O...

Page 457: ...command at the command prompt If n the data parameter is given the value is placed into the next slot in the input buffer Otherwise a window is displayed with the input buffer values You can enter input values while the window is open An arrow points to the next input value to the SPI The data from the SPI input buffer is written to the SPI data register once the SPI module is turned on and is pro...

Page 458: ...module is run in the Flag Polling mode poll the flag corresponding to the expected SPI event If the SPI interrupts are enabled the FCS jumps to an appropriate subroutine as long as the SPI channel interrupt vectors are properly defined To simulate the frequency of the SPI slave input clock use the SPFREQ n command If the SPI is configured for slave mode this command allows the user to enter the nu...

Page 459: ...Example SPCLR Clear input and output buffer for SPI simulation SPDI Command The SPDI command allows the user to input data into the SPI If a data parameter is given the value is placed into the next slot in the SPI input buffer Otherwise if no parameter is given a window is displayed with the input buffer values Input values can be entered while the window is open An arrow points to the next input...

Page 460: ...splays the output buffer from the SPI A window is opened that shows all the data that the SPI has shifted out An arrow is used to point to the last output value transmitted The maximum number of output values that the buffer holds is 256 bytes Syntax SPDO Example SPDO View data from the output buffer for the SPI simulation Figure 18 35 SPI OUT Buffer Display ...

Page 461: ...cles Timer Interface Module In FCS this module simulates all functionality of the Timer Interface module including Input capture output compare Pulse width modulation Internal or external clock input Free running or modulo up count operation Flag polling Interrupt enabled mode of operation FCS mode uses the simulated port inputs to trigger the input capture on a given timer channel To define an in...

Page 462: ... channel interrupt is enabled the FCS jumps to an appropriate subroutine as long as the Timer channel interrupt vector is properly defined To observe the Timer Overflow Flag TOF flag being set as a result of the corresponding CPU event situate your Memory window on the memory location of the Timer Status and Control register To observe the Pulse Width Modulation PWM operation properly configure th...

Page 463: ...a pre calculated number of cycles use CYCLE 00 to reset the number of cycles and GOTOCYCLE n to run through the code until you reach the expected event Figure 18 38 Register Window With Cycles Display Timer Module Commands The following timer module commands are available for use with the HCS08 CYCLES Command The CYCLES command changes the value of the cycles counter The cycles counter counts the ...

Page 464: ...utton on the toolbar is pressed until it reaches a break point or until an error occurs Syntax GOTOCYCLE n Where n Cycle counter value at which the execution stops Example GOTOCYCLE 100 Execute the program until the cycle counter equals 100 INPUT x Command The INPUT x command sets the simulated inputs to port x The CPU reads this input value when port x is set as an input port Syntax INPUT x n Whe...

Page 465: ...d opens the Simulated Port Inputs dialog box shown in Figure 18 39 The user may then use this box to specify the input states of port pins and IRQ Figure 18 39 Simulated Port Inputs Dialog Box When using In Circuit Simulation mode the INPUTS command shows the simulated input values to any applicable port Syntax INPUTS Example INPUTS Show I O port input values ...

Page 466: ...HCS08 Full Chip Simulation Peripheral Modules Commands 466 Microcontrollers Debugger Manual ...

Page 467: ...the Flash of the microprocessor The operation of all modules fully reflects the actual operation of the on board resources Connection Procedure To select the P E Multilink Cyclone Pro as your debugger connection 1 Choose the P E Multilink Cyclone Pro option from the set connection dialog box as shown in Figure 19 1 2 Click the OK button Figure 19 1 Set Connections Dialog Box 3 Choose the P E devic...

Page 468: ...HCS08 P E Multilink Cyclone Pro Connection Connection Procedure 468 Microcontrollers Debugger Manual Figure 19 2 HCS08 Connection Assistant Interface Selection ...

Page 469: ...able trim value is only limited by the device itself the user can input any value within the valid internal clock frequency range Note that the valid internal clock frequency range and the default trim value for the currently selected device algorithm are displayed as well For more information about the specific functionality of the internal clock source see the Freescale Data Sheet for your speci...

Page 470: ...o Menu Device Option The Device option in the MultilinkCyclonePro menu allows the user to select the particular Freescale processor that they wish to use When choosing Device from the MultilinkCyclonePro menu extended menus open which allow you to select the family e g GB Family and device type e g 9S0GB60 of the MCU that you are using Figure 19 5 HCS08 Device Extended Menu Connect Option The Conn...

Page 471: ...errupts while stepping Option Select MultilinkCyclonePro Disable interrupts while stepping to debug without diving into the pending program ISRs Setting this option masks the interrupts before stepping as if you changed the interrupt level in the SR core register directly When the step occurs the interrupt level reverts to the previous state and if necessary adjusts according to the last executed ...

Page 472: ...nges of non volatile memory on devices with EEPROM the entire EEPROM array may optionally be preserved as well Ranges that are designated as preserved are read before an erase and re programmed immediately afterwards thereby preserving the data in these ranges Any attempts to program data into a preserved range is ignored When entering an address into the preserved range field hexadecimal input is...

Page 473: ...erase programming procedure See Figure 19 8 More information on how to use the PROGHCS08 can be found on the P E Microcomputer Systems website at www pemicro com Figure 19 8 PROGHCS08 Programmer Window View Register Files Option The View Register Files Connection menu selection also gives the user the option of running the register file viewer editor If register files are available for the device ...

Page 474: ...heir descriptions This begins interactive setup of system registers such as I O timer and COP watchdog Figure 19 10 Register Block Register Listing Selecting a file brings up the Register Window see Figure 19 11 which displays the values and significance for each bit in the register The registers can be viewed and their values modified and the values can be stored back into debugger memory Figure ...

Page 475: ...n allows you to gather pertinent bus data by operating the bus analyzer in different modes The various trace modes let you choose appropriate actions to take when a certain pattern event or sequence of patterns appears on the bus To trigger the Bus analyzer define specific bus states as terms and select a sequence of terms as a trigger event ...

Page 476: ...HCS08 P E Multilink Cyclone Pro Connection Connection Procedure 476 Microcontrollers Debugger Manual ...

Page 477: ...S08 OSBDM Open Source BDM cable When the debugger runs the HCS08 Open Source BDM connection it can communicate and debug HCS08 core based hardware connected through the Open Source BDM Interface as described at the Freescale Semiconductor web site http www freescale com keyword OSBDM08 CodeWarrior IDE and HCS08 Open Source BDM Connection There are two separate paths that may be followed to take th...

Page 478: ... project and name the project 3 Click the Next button to open the New Project window 4 In the Microcontrollers New Project window select the HCS08 Family chip that you are working with from the list in the Derivative list box Figure 20 1 Microcontrollers New Project Wizard Window 5 From the Default Connection list box choose the connection HCS08 Open Source BDM to create a new project from this st...

Page 479: ...CS08 Open Source BDM connection from within an existing debugging project 1 Run the CodeWarrior IDE 2 Open the project 3 Choose Project Debug to start the debugger 4 In the debugger main window choose Component Set Connection to select another connection 5 Select HCS08 as the processor then HCS08 Open Source BDM as the connection Figure 20 2 Set Connection Dialog Box HCS08 Open Source BDM Selectio...

Page 480: ...Click the OK button to start debugging HCS08 Open Source BDM Menu Options Once the HCS08 Open Source BDM connection is set the connection menu entry in the debugger main toolbar changes to HCS08 Open Source BDM Figure 20 4 HCS08 Open Source BDM Menu Options Setup Option Select HCS08 Open Source BDM Setup to display the HCS08 Open Source BDM Setup Dialog Box ...

Page 481: ...r Module Settings Select HCS08 Open Source BDM Trigger Module Settings to open the Trigger Module Settings dialog For more information see HCS08 On Chip DBG Module Bus Trace Select HCS08 Open Source BDM Bus Trace to open the Trace component window within the debugger main window For more information see HCS08 On Chip DBG Module Flash Option Select HCS08 Open Source BDM Flash to open the Non Volati...

Page 482: ... menu shows which OSBDM cables are plugged into the computer Figure 20 5 HCS08 Open Source BDM Setup Dialog Box Select the desired cable as your communication device then click the OK button to start debugging The Show Protocol checkbox option is only for support usage Select this checkbox when you want the debugger s internal information reported in the Command window TIP Cables are numbered 1 2 ...

Page 483: ...ect Derivative Dialog Box This dialog box is used to set up a derivative The list menu gives a list of derivatives that match the target silicon System Device Identification Registers SDIDH SDIDL Figure 20 6 Select Derivative Dialog Box Select your target hardware derivative then click the OK button to start debugging ...

Page 484: ...ss erase the device and program the security byte The Information required to unsecure the device dialog box provides an FCDIV value to the Unsecure Command File script To access this dialog box select the menu option HCS08 Open Source BDM Command Files and click on the Unsecure tab Figure 20 7 Information Required to Unsecure the Device Dialog Box When FCDIV is correctly set select the OK button ...

Page 485: ...t 485 Microcontrollers Debugger Manual Show Status Dialog Box This dialog box provides both a revision summary of the HCS08 Open Source BDM software and hardware plus technical support information Figure 20 8 Show Status Dialog Box Press the OK button to close this dialog box ...

Page 486: ...HCS08 Open Source BDM Connection First Steps From Within an Existing Project 486 Microcontrollers Debugger Manual ...

Page 487: ...ial Monitor for MC9S08GB GT Application Note AN2140 D from Freescale When the debugger runs the HCS08 Serial Monitor connection it can communicate and debug hardware running the HCS08 Serial Monitor in full compliance with the Freescale Serial Monitor for MC9S08GB GT Application Note AN2140 D specifications Refer to this Application Note for communication hardware requirements CodeWarrior IDE and ...

Page 488: ...e path to create a new project naming the project 3 Click the Next button to open the New Project window 4 In the Microcontrollers New Project window select the HCS08 Family chip you are working with from the list in the Derivative list box Figure 21 1 Microcontrollers New Project Wizard Window 5 From the Default Connection list box choose the connection HCS08 Serial Monitor to create a new projec...

Page 489: ... the program group 2 Open the existing project 3 Choose the menu Project Debug to start the debugger debugger main window opens 4 In the debugger main window from the Component menu choose Component Set Connection to select another connection Figure 21 2 Set Connection Dialog Box HCS08 Serial Monitor Selection 5 Select HCS08 as the Processor then HCS08 Serial Monitor as the connection in the Set C...

Page 490: ...erivative matching your hardware in the Derivative Selection dialog box Figure 21 4 Derivative Selection Dialog Box 10 Press the OK button The Monitor Setup window is opened again to propose to use the mirrored vector table feature See Vector Redirection in the Serial Monitor for MC9S08GB GT Application Note AN2140 D for all details We recommend that you use the Vector Table Mirroring feature Othe...

Page 491: ...Mirroring Tab 11 To enable this feature check the Enable Vector Table Mirroring checkbox Figure 21 6 Monitor Setup Window Vector Table Mirroring Tab 12 Press the Auto Detect button to make the debugger search for the vector table address and vectors reserved by the HCS08 Serial Monitor 13 Once the auto detection succeeds press the OK button to start debugging ...

Page 492: ...unications option to display the Monitor Setup Window Monitor Communication Tab Vector Mirroring Setup Select the MONITOR HCS08 Vector Mirroring Setup option to display the Monitor Setup Window Vector Table Mirroring Tab Erase Flash Select the MONITOR HCS08 Erase Flash option to immediately erase the target processor Flash Trigger Module Settings Select the MONITOR HCS08 Trigger Module Settings op...

Page 493: ... the Derivative Selection Dialog Box Monitor Setup Window The Monitor Setup window has two tabs as shown in Monitor Setup Window Monitor Communication Tab and Monitor Setup Window Vector Table Mirroring Tab Figure 21 8 Monitor Setup Window Monitor Communication Tab Monitor Communication Tab In the Monitor Communication tab you can set or modify the current serial communication port in the HOST Ser...

Page 494: ...ectors reserved by Monitor edit box NOTE In the Vectors reserved by Monitor list box above the number 1 matches the RESET vector 2 is the SWI vector 5 is the ICG vector etc Vector table mirroring allows you to access chip vectors transparently Indeed the HCS08 Serial Monitor also uses some vectors and the vector area is protected from erasing and overwriting We recommend that you use this feature ...

Page 495: ...le to select a specific derivative according to the System Device Identification Register SDIDH SDIDL sometimes called PARTID returned by the silicon device Figure 21 10 Derivative Selection Dialog Box As several silicon devices might return the same value a selection list is available to select the debugged derivative according to reference text written on the top of the silicon ...

Page 496: ...HCS08 Serial Monitor Connection First Steps from Within an Existing Project 496 Microcontrollers Debugger Manual ...

Page 497: ...ardware connected through the SofTec in circuit debugger programmer units that is SofTec Microsystems HCS08 ISP Debuggers Programmers inDART Series and Starter Kits PK and newer Series Refer to the inDART HCS08 In Circuit Debugger Programmer for Motorola HCS08 Family FLASH Devices User s Manual from SofTec for communication hardware requirements and SofTec product installation CodeWarrior IDE and ...

Page 498: ...zard follow the path to create a new project naming the project 3 Click the Next button to open the New Project window 4 In the Microcontrollers New Project window choose HCS08 Family chip you are working with from the list in the Derivative list box Figure 22 1 Wizard Connection Selection 5 From the Default Connection list box choose the connection SofTec HCS08 to create a new project from this s...

Page 499: ...e CodeWarrior IDE with the shortcut created in the program group 2 Open the project 3 Choose Project Debug to start the debugger 4 In the debugger choose Component Set Connection to select another target interface in the Set Connection dialog box 5 Select HCS08 as the Processor then SofTec HCS08 as the connection Figure 22 2 Set Connection Dialog Box SofTec HCS08 Selection 6 Press the OK button MC...

Page 500: ...art debugging SofTec HCS08 Menu Options Once the SofTec HCS08 connection is set the connection menu entry in the debugger main toolbar changes to SofTec HCS08 Figure 22 4 SofTec HCS08 Menu Options MCU Configuration Option Select SofTec HCS08 MCU Configuration to display the MCU Configuration Dialog Box About Option Select SofTec HCS08 About to display the About Dialog Box ...

Page 501: ...wn list can be expanded to select another type of BDC debug interface than the SofTec inDART HCS08 The HW Code drop down list can be expanded to select another HCS08 derivative Figure 22 5 MCU Configuration Dialog Box Press the Communication Settings button in this window to open the Communication Settings Dialog Box Communication Settings Dialog Box The BDC Clock CLKSW group is intended to setup ...

Page 502: ...nal clock Other derivatives may use the external crystal frequency Refer to the inDART HCS08 In Circuit Debugger Programmer for Motorola HCS08 Family FLASH Devices User s Manual from SofTec for further details Figure 22 6 Communication Settings Dialog Box About Dialog Box This dialog box belongs to the SofTec GDI DLL and provides information about the SofTec_BDC08 dll release and version Figure 22...

Page 503: ...ule support is automatically enabled or disabled according to derivative selected by user or automatically through the device Part Id Reference Document The HCS08 on chip DBG module described in this chapter is also described in the HCS08RMv1 D Rev 1 6 2003 Freescale document DBG Features The debugger covers all features available within the on chip DBG module Regular hardware breakpoints and watc...

Page 504: ...cific Connection Menu Options Specific DBG support menu options are added to the Connection menu as soon as the debugger target processor is acknowledged by the DBG module Two additional context menu entries are displayed Trigger Module Settings and Bus Trace Shown below is an example with the P E PEDebug connection Figure 23 1 Connection Menu Added DBG Options Choose Trigger Module Settings to op...

Page 505: ...ers A and or B a Trigger Settings to set the DBG module Triggers Settings and the Trigger Module Usage to set the DBG module functionality globally Setting a trigger which can be assimilated as a complex breakpoint or watchpoint is as simple as setting a breakpoint Figure 23 2 Source Context Menu Added Options Instead of setting a breakpoint a trigger can be set Note that only 2 triggers can be se...

Page 506: ...elect a Set Trigger Address entry at the selected source location address Figure 23 3 Set Trigger Address A Option The trigger is displayed in the Source window and at the corresponding address in the Assembly window just like a breakpoint icon To distinguish from breakpoints trigger A is marked with a red A icon and trigger B with a red B icon ...

Page 507: ...ce Data Assembly and Memory Windows 507 Microcontrollers Debugger Manual Figure 23 4 Triggers Set in Source and Assembly Windows Once a trigger is set it can be deleted by opening any context sensitive menu that contains the Delete Trigger Address option ...

Page 508: ...by choosing Show Markpoints in the menu Triggers are stored as Trigger A and Trigger B markpoints These markpoint names are therefore reserved by the debugger The markpoint type INSTRUCTION is automatically selected when the trigger is set from the Source or Assembly window Figure 23 5 Show Markpoints Option Selecting the Show Markpoints option from the Source window causes the Controlpoints Confi...

Page 509: ...reakpoints and watchpoints can be very useful to automatically save the application with the DBG module setup and trigger positions saved as they are set in the current application Data and Memory Windows Data and Memory windows have context menu options to set delete Memory Access Triggers A and or B a Trigger Settings option to set the DBG module triggers settings and the Trigger Module Usage op...

Page 510: ... a trigger can be set Note that only 2 triggers can be set Trigger A and trigger B In a general way the on chip DBG module provides combinations of trigger A and trigger B conditions and according to the number of triggers defined one or two a different trigger DBG Module Mode Setup can be chosen To set a trigger choose a Set Trigger Address entry and the kind of access Read Write Read Write This ...

Page 511: ... Manual Figure 23 8 Triggers Set in Data and Memory Windows The trigger is displayed in the Data window and at the corresponding address in the Memory window like a watchpoint icon To be distinguished from watchpoints the trigger A is marked with a red dotted vertical line and trigger B with a blue dotted vertical line ...

Page 512: ...replacing the Set Trigger Address A entry by a Set DBGCA entry and the Set Trigger Address B entry by a Set DBGCB entry The renaming is due to a more physical DBG registers approach in Expert mode and in the Expert Mode Tab Figure 23 9 Source Window Context Menu Expert Trigger Options As shown in the next picture Expert triggers are displayed in Source and Assembly windows with a small additional ...

Page 513: ...lly selected when the trigger was set from the Source or the Assembly window As for regular triggers the markpoint types READACCESS WRITEACCESS or READWRITEACCESS are automatically selected when the trigger was set from the Data or the Memory window Just as with regular triggers editing expert triggers through the Markpoints tab in the Controlpoints Configuration window is not user friendly Howeve...

Page 514: ...ng the Trigger Module Settings Window However the amount of trigger types is dynamic depending if no triggers are defined if only Trigger A is defined if only trigger B is defined if both triggers are defined and also depending on the trigger type Instruction Read Access Read Write Access Write Access Only possible combinations are displayed Also DBG Module Options can be directly edited Figure 23...

Page 515: ...ing the Trigger Module Settings Window to do the DBG Module Mode Setup Figure 23 12 Source Window Extended Menu DBG Support Status Bar Item A specific DBG support debugger status bar item is present as soon as the debugger target processor features the DBG module Clicking on this item opens immediately the Trigger Module Settings Window future debugger revision only Figure 23 13 Status Bar Item ...

Page 516: ...ture Triggers used or the current DBG Module Mode Setup Figure 23 14 Status Bar Item Trigger Module Settings Window This window can be opened from context sensitive context menus in the Source Data Memory and Assembly component windows from the Connection menu and also when clicking on a Status Bar item The on chip DBG module can be fully controlled from within this window Figure 23 15 Trigger Mod...

Page 517: ...int or to set up triggers selected by the user from the list or from a context sensitive context menu This mode is simply the default selection when no triggers have been set yet The trigger condition and trigger addresses can be set from the debugger Source Assembly Memory and Data component using Set Trigger A or Set Trigger B context sensitive menu entry or within this dialog box The DBG module...

Page 518: ...Assembly Memory and Data windows using Set DBGCA or Set DBGCB The DBG module is set by the debugger DBG module enabling and arming depend on the selected flags set within the DBG register control registers through the Expert triggers tab property page The settings are written to the hardware right before the application is run The DBG module is reset when the application stops Figure 23 17 Trigger...

Page 519: ...his mode the DBG module is set up to source code execution profiling and source code execution coverage Open the Profiler and or Coverage components to display results Neither triggers nor DBG based controlpoints can be set in this mode and the debugger must be stopped on user request software breakpoints can still be used Profiling and Coverage features are based on a periodical debugger program ...

Page 520: ...ng to use this mode There is no dedicated graphical user interface to access the DBG module register The triggers comparator addresses and DBG control registers are handled by the user through the debugger Memory component or using command line commands The DBG module is NOT set by the debugger DBG module enabling and arming depend on the selected flags set within the DBG register control register...

Page 521: ...s B memory location The code program flow rebuild is displayed in the Trace Component Window automatically and switched to Instructions Display mode Memory Access Inside Address A Address B Range This mode is used to trigger on a program instruction read and or write inside the Address A Address B memory range locations The code program flow rebuild is displayed in the Trace Component Window and a...

Page 522: ...h value rather than an address Also when setting this trigger via a context sensitive context menu the following message is displayed if the match value was never set Figure 23 20 Memory Access at Address A and Value on Data Bus Match Dialog Box The Trigger Editing dialog box is not available for trigger B Special Match value edit boxes are displayed instead of Address B edit box Figure 23 21 Trig...

Page 523: ... 22 Memory Access at Address A and Value on Data Bus Mismatch Dialog Box The Trigger Editing dialog box is not available for the trigger B Special Match value edit boxes are displayed instead of Address B edit box Figure 23 23 Trigger Address Settings Dialog Box The code program flow rebuild is displayed in the Trace Component Window automatically switched to Instructions Display mode Instruction ...

Page 524: ...ructions Display mode Instruction Execution Outside Address A Address B Range This mode is used to trigger on a program instruction execution program counter outside the Address A Address B range NOTE IMPORTANT With the HCS08 Serial Monitor via GDI connection this trigger type might be interfered with by the monitor code itself and therefore the debugger might break for executed code not belonging...

Page 525: ...ata Bus Match Dialog Box The Trigger Editing dialog box is not available for the trigger B Special Match value edit boxes are displayed instead of Address B edit box Figure 23 25 Trigger Address Settings Dialog Box The code program flow rebuild is displayed in the Trace Component Window automatically switched to Instructions Display mode Instruction at Address A and Value on Data Bus Mismatch This...

Page 526: ...de is used to capture the data involved in a read and or write access to the address specified by the trigger B such as the address of a particular control register or program variable Captured byte data are displayed in the Trace Component Window automatically switched to Recorded Data Display mode The trigger address is typically not a program code address program counter but rather a data memor...

Page 527: ... controlled through the Trigger Settings tab list box of the Trigger Module Settings window Figure 23 28 Change of Flow Recording Control Record continuously and halt on trigger hit The DBG module starts recording program flow information immediately after run The DBG module halts the processor debugger on trigger condition match Record continuously and DO NOT halt on trigger hit The DBG module st...

Page 528: ...match Data Recording The data recording options are available for Capture Triggers only and are selected from the list box in the Trigger Settings tab of the Trigger Module Settings window Figure 23 29 Data Recording Control Halt when the fifo is full The DBG module records data accesses continuously and halts the processor debugger when the capture buffer is full Do not halt when the fifo is full...

Page 529: ...irectly set by typing in the edit box Use the Type list menu to select change the type of trigger Use Instruction type for Instruction Triggers and Read Write and R W Access for Memory Access Triggers and Capture Triggers Pressing Modify Trigger in this sub dialog box modifies and records the trigger in the trigger database Trigger Stored as Markpoints NOTE Pressing the OK button does NOT update t...

Page 530: ...n and copied in the Address edit box from the markpoint list Figure 23 31 Finding Trigger Address in Editor Dialog Box Trigger Module Settings Window Display Information A large grayed edit box dynamically provides information about the current triggers and selected options As context sensitive menus only display triggers matching the amount and the kind of triggers which are currently set the Tri...

Page 531: ...b Information General Settings Tab Most of the time there is no reason to change any of these settings which are default settings of the DBG user interface However in some debug special cases it is possible to disable some automated debugger background processes Figure 23 33 Trigger Module Settings Window General Settings Tab ...

Page 532: ...cation Several reads are performed to retrieve the entire shifting buffer However when the debugger is halted while refreshing Data and Assembly windows it might read also the debugger target processor memory at the same location reading the first DBG Fifo data shifting the buffer and therefore corrupt the DBG user interface DBG Fifo data retrieving This option hides to the debugger and also user ...

Page 533: ...ster as code program flow rebuild is discarded this last disassembling back the assembly data from the connection CPU s memory Instructions Display This display mode is automatically set when Instruction Triggers and Memory Access Triggers are used It is also the default display in Automatic Mode Default Displayed columns Frame A number representing an information item stored in the Trace componen...

Page 534: ...y mode when selecting Graphical in the Trace window context sensitive menu It provides a graphical representation of the same information Figure 23 36 Trace Window Graphical Display Textual Display This display mode can be select when selecting Textual in the Trace window context sensitive context menu when using Instruction Triggers and Memory Access Triggers are used This display mode is rather ...

Page 535: ...he Trace window Figure 23 37 Trace Window Textual Display Column Display and Moving Selecting Items in the Trace window context sensitive menu opens a small dialog box to setup the columns to hide display in each display mode The Displaying mode list menu can be opened to make column display modification in Textual Instructions or Graphical mode Figure 23 38 Items Configuration Dialog Box ...

Page 536: ...sensitive context menu opens a small dialog box to go to a frame in the Trace window Figure 23 40 Search Frames Dialog Box Clearing Frames Selecting Clear in the Trace window context sensitive menu flushes the frames in the Trace window flushing in background the database DBG Module FIFO Buffer Display Selecting Display DBG FIFO data in the Trace window context sensitive menu displays data informa...

Page 537: ...o buffer from DBGFH and DBGFL DBG on chip module registers Figure 23 41 Trace Window FIFO Display Recorded Data Display This display mode is automatically set when Capture Triggers are used Displayed columns FIFO Depth A number representing the depth in the DBG Fifo of the byte data value The first frame Depth 1 is the oldest value in the time Data value the byte value retrieved from the DBG Fifo ...

Page 538: ...d also program flow recording and rebuild of applications running over PPAGE paging windows banked memory model LOOP1 mode The on chip DBG V3 module available for example on MC9S08QE128 devices provides some new features like an additional comparator that is typically used as a third hardware breakpoint that is not involved in the trigger logic except in a new recording mode call LOOP1 In LOOP1 mo...

Page 539: ...trace what happened right before a reset occurred at the condition that the module was initially armed to record continuously At next debugger stop the debugger displays in the Trace window the last recorded instructions and in red color the last instructions that could have been executed and generated a reset Also the debugger displays in the status bar the source of the reset decoded from the Sy...

Page 540: ...HCS08 On Chip DBG Module HCS08 DBG V3 New Features 540 Microcontrollers Debugger Manual Figure 23 44 Recording a PIN reset ...

Page 541: ... illegal opcode reset Recording from Reset In other cases including Power On Reset POR the DBG module starts recording immediately out of reset The Trigger Module Settings dialog provides a new setup to capture this recording from the reset vector entry point when selecting Start recording from asynchronous reset ...

Page 542: ...rding out of reset mode selection Figure 23 47 Start recording from Reset trace CAUTION After interpreting the Trace window recorded information reset the debugger and hardware pressing the debugger Reset button to clear the SRS register This ensures a correct debugger analysis from the next reset capture ...

Page 543: ...ule HCS08 DBG V3 New Features 543 Microcontrollers Debugger Manual Expert Triggers tab extended The Expert Triggers tab has been redesigned and extended with the newest comparator C controls Figure 23 48 Expert Triggers tab ...

Page 544: ...HCS08 On Chip DBG Module HCS08 DBG V3 New Features 544 Microcontrollers Debugger Manual ...

Page 545: ...with the Debugger to use all its functions and help you understand how to use the environment This book the RS08 Debugger Connections defines the connections available for debugging code written for RS08 CPUs This book consists of the following sections RS08 Full Chip Simulation RS08 P E Multilink Cyclone Pro Connection RS08 Open Source BDM Connection SofTec RS08 Connection ...

Page 546: ...Book IV Contents 546 Microcontrollers Debugger Manual ...

Page 547: ...on on the user s MCU system including the function of any peripherals associated with the device that you select For more detailed information refer to the Full Chip Simulation description for the module that you are using Configuration Procedure To select Full Chip Simulation as the debugger connection 1 Choose the Full Chip Simulation option from the set connection dialog box See Figure 24 1 2 C...

Page 548: ... and additional options are added Figure 24 2 RS08FCS Menu Device Option The Device selection of the RS08FCS menu allows the user to select the particular Freescale processor that they wish to use When choosing the Device option from the RS08FCS menu extended menus open which allow you to select the family e g KA Family and device type e g MC9RS08KA2 of the MCU that you are using Figure 24 3 RS08F...

Page 549: ...menu contains the option to show the input pin levels dialog box this corresponds to the INPUTS command The dialog box graphically displays the current value of the inputs buffers for all available I O ports on the device note that this may not reflect the value shown in the memory window depending on the current state of a given port s data direction register The input buffer can be directly modi...

Page 550: ...pins Vdd and GND has a corresponding arrow If the arrow points towards the processor this indicates that the pin is configured as an input Conversely if the arrow points away from the processor this indicates that the pin is configured as an output Figure 24 6 Processor Pins Window Below the graphical processor representation are several buttons each corresponding to a processor peripheral Pressin...

Page 551: ...ction in the RS08FCS menu also gives the user the option of running the register file viewer editor If register files are available for the device that you have chosen the Choose a Register Block window see Figure 24 8 opens You may also open it by entering the R command in the Command Window command line Figure 24 8 Choose A Register Block Dialog Box If register files have been installed on the h...

Page 552: ...e 24 10 which displays the value and significance of each bit in the register The registers can be viewed and their values modified and the values can be stored back into debugger memory Figure 24 10 Register Window Peripheral Modules Commands When you select a device see Device Option the RS08FCS Menu displays a list of peripheral modules and the associated commands for the device you have chosen...

Page 553: ...the FLASH of the microprocessor The operation of all modules fully reflects the actual operation of the on board resources Connection Procedure To select the P E Multilink Cyclone Pro as your debugger connection 1 Choose the P E Multilink Cyclone Pro option from the Set Connection dialog box as shown in Figure 25 1 2 Click the OK button Figure 25 1 Set Connection Dialog Box 3 Choose the P E device...

Page 554: ...ontrollers Debugger Manual Figure 25 2 RS08 Connection Assistant Interface Selection Figure 25 3 RS08 Connection Assistant Interface Selected Hotsync Button The Hotsync button in the Connection Assistant see Figure 25 3 allows the user to connect to an already running target ...

Page 555: ...d and other options are added Figure 25 4 Connection MultilinkCyclonePro Menu Device Option The Device option in the MultilinkCyclonePro menu allows the user to select the particular Freescale processor that they wish to use Select Device from the MultilinkCyclonePro menu to display a submenu that allows you to select the family e g KA Family and device type e g MC9RS08KA2 of the MCU that you are ...

Page 556: ... menu Active Mode Menu Options When the microprocessor is connected more Connection Menu options become available to the user Figure 25 6 Additional Connection Menu Options Advanced Programming Debug Options The Advanced Programming Debug Options menu option takes you to the Advanced Options dialog box where you can configure the software settings for the FLASH programming procedure Figure 25 7 Ad...

Page 557: ...nc to PLL Change Checkbox Sync to PLL Change is required for the software hardware connection to synchronize with the microprocessor during the Flash erasing programming procedure Start Expert Mode Programmer Option The Start Expert Mode Programmer option in the Connection Menu grants the user access to P E s graphical Flash programming utility PROGRS08 PROGRS08 lets an advanced user control the s...

Page 558: ... Conversely if the arrow is pointing away from the processor this indicates that the pin is configured as an output Figure 25 9 Processor Pins Window Below the graphical processor representation are several buttons each corresponding to a processor peripheral Pressing the button of a given peripheral brings up the appropriate register files see below allowing for easy and informative manipulation ...

Page 559: ...h shows a list of the associated registers their addresses and their descriptions This begins the interactive setup of system registers such as I O timer and COP watchdog Figure 25 11 Register Block Register Listing Selecting a file brings up the Register Window see Figure 25 12 which displays the values and significance for each bit in the register The registers can be viewed and their values mod...

Page 560: ...RS08 P E Multilink Cyclone Pro Connection Connection Procedure 560 Microcontrollers Debugger Manual ...

Page 561: ...S08 OSBDM Open Source BDM cable When the debugger runs the RS08 Open Source BDM connection it can communicate and debug RS08 core based hardware connected through the Open Source BDM Interface as described on the Freescale Semiconductor web site http www freescale com keyword OSBDM08 CodeWarrior IDE and RS08 Open Source BDM Connection There are two separate paths that may be followed to take the f...

Page 562: ...new project and name the project 3 Click the Next button to open the New Project window 4 In the Microcontrollers New Project window select the RS08 Family chip you are working with from the list in the Derivative list box Figure 26 1 Microcontrollers New Project Wizard Window 5 From the Default Connection list box choose the connection RS08 Open Source BDM to create a new project from this statio...

Page 563: ...g project 1 Run the CodeWarrior IDE 2 Open the project 3 Choose Project Debug to start the debugger 4 In the debugger main window choose Component Set Connection to select another connection 5 Select RS08 as the Processor then RS08 Open Source BDM as the connection Figure 26 2 Set Connection Dialog Box RS08 Open Source BDM Selection 6 Click the OK button Set Derivative dialog box typically opens i...

Page 564: ...connection is set the connection menu entry in the debugger main toolbar changes to RS08 Open Source BDM Figure 26 4 RS08 Open Source BDM Menu Options Setup Option Select RS08 Open Source BDM Setup to display the RS08 Open Source BDM Setup Dialog Box Select Derivative Option Select RS08 Open Source BDM Select Derivative to display the Select Derivative Dialog Box NOTE If there is only one derivati...

Page 565: ...en Source BDM Setup Dialog Box This dialog box is used to set up your communication device The communication device list menu shows the current OSBDM cables plugged into the computer Figure 26 5 RS08 Open Source BDM Setup Dialog Box Select the OSBDM cable then click the OK button to start debugging The Show Protocol checkbox and option is for Support usage only When enabled debugger internal infor...

Page 566: ...ch the target silicon System Device Identification Registers SDIDH SDIDL Figure 26 6 Select Derivative Dialog Box Select the correct target hardware derivative then select the OK button to start debugging Show Status Dialog Box This dialog box provides both a revision summary of the RS08 Open Source BDM software and hardware plus technical support information Figure 26 7 Show Status Dialog Box Sel...

Page 567: ...rogrammer units such as SofTec Microsystems HCS08 ISP Debuggers Programmers inDART Series and Starter Kits PK and newer Series Refer to the inDART HCS08 In Circuit Debugger Programmer for Motorola HCS08 Family FLASH Devices User s Manual from SofTec for communication hardware requirements and SofTec product installation CodeWarrior IDE and SofTec RS08 Connection There are two separate paths that m...

Page 568: ...e Microcontrollers New Project Wizard follow the path to create a new project naming the project 3 Click the Next button to open the New Project window 4 In the Microcontrollers New Project window select the RS08 Family chip you are working with from the list in the Derivative list box in the left of the window Figure 27 1 Wizard Connection Selection 5 From the Default Connection list box choose t...

Page 569: ... Steps Using the Stationery Wizard 569 Microcontrollers Debugger Manual Figure 27 2 IDE Main Window Project Menu 7 Choose the menu option Project Make 8 Choose the menu option Project Debug to start the debugger 9 Start debugging ...

Page 570: ...Warrior IDE with the shortcut created in the program group 2 Open the project 3 Choose the menu Project Debug to start the debugger 4 Choose in the debugger menu Component Set Connection to select another target interface in the Set Connection dialog box 5 Select RS08 as the Processor then SofTec RS08 as the connection Figure 27 3 Set Connection Dialog Box SofTec RS08 Selection 6 Press the OK butt...

Page 571: ...ollers Debugger Manual Figure 27 4 MCU Configuration Dialog Box 8 Press the OK button to start debugging SofTec RS08 Menu Options Once the SofTec RS08 connection is set the connection menu entry in the debugger main toolbar is set to SofTec RS08 Figure 27 5 SofTec RS08 Menu Options ...

Page 572: ...RS08 derivative Figure 27 6 MCU Configuration Dialog Box Pressing the Communication Settings button in this window opens the Communication Settings dialog box Communication Settings Dialog Box The communication dialog box provides chip trimming The Enable Trimming checkbox can be checked to enable the trimming data calculation according to the requested DCO value that can be specified in the DCO O...

Page 573: ...ng Project 573 Microcontrollers Debugger Manual Figure 27 7 Communication Settings Dialog Box About Dialog Box This dialog box belongs to the SofTec GDI DLL and provides information about the SofTec_BDC08 dll release and version Figure 27 8 About Dialog Box ...

Page 574: ...SofTec RS08 Connection First Steps From Within an Existing Project 574 Microcontrollers Debugger Manual ...

Page 575: ...udes information to help you become more familiar with the Debugger to use all its functions and help you understand how to use the environment Book 5 is divided into the following chapters ColdFire V1 Full Chip Simulation Connection ColdFire P E Multilink Cyclone Pro Connection SofTec ColdFire Connection ColdFire On Chip DBG Module ...

Page 576: ...Book V Contents 576 Microcontrollers Debugger Manual ...

Page 577: ...ry ranges I O and peripherals for a given derivative for more information on selecting a specific derivative see the FCS and Silicon On Chip Peripheral Simulation sections This section presents the first steps to debugging using the CodeWarrior debugger and the ColdFire V1 Full Chip Simulation connection Full Chip Simulation Menu Figure 28 1 shows the menu associated with the Full Chip Simulation ...

Page 578: ... Time Table 28 1 Simulator Menu Entry Description Menu Entry Description Load Opens the Load Executable Window menu Reset Resets the Full Chip Simulation Set Derivative Selects the current simulated derivative Configure Opens the Memory Configuration Window Reset RAM Resets the RAM to undefined Reset Mem Resets all configured memory to undefined Reset Statistic Resets the statistical data Load I O...

Page 579: ...ore SAMPLE opens the Set Derivative dialog box Open I O Component Dialog Box From the Simulator menu choose Load I Os to open the Open I O Component dialog box This dialog box shown in Figure 28 4 allows you to open an I O device peripheral simulation The Browse button allows you to specify a location for the I O Figure 28 4 Open IO Component Dialog Box NOTE I O simulation components are either de...

Page 580: ...les dialog The default Setcpu command file is SETCPU CMD By default the SETCPU CMD file located in the current project directory is enabled as the current Setcpu command file Memory Configuration The memory configuration interface is an FCS advanced configuration feature The FCS divides the emulated memory into blocks A memory manager handles the list of memory blocks The memory configuration faci...

Page 581: ...how the Full Chip Simulation verifies the memory Set the type of the memory RAM ROM Flash EEPROM or I O Define start and end addresses Define the wait state the time for each read or write access Set the width of the bus that accesses the memory Set access details such as auto configure automatically computing read and write access misaligned access allowing misaligned access on words and longs Op...

Page 582: ...ARF Object file format the Memory Configuration dialog box lists separate RAM and ROM blocks for each data and code segment in the absolute file once an application has been loaded The segment addresses and lengths determine the starting and ending addresses of each block you cannot modify these addresses Initial attributes of each code and data block come from the corresponding initial RAM and RO...

Page 583: ...me Type Start End Wait state Bus width and Access Details Save Memory Block Click the Save button to store the current memory blocks configuration The Save Memory blocks standard dialog box appears Enter a file name then click the OK button The dialog box closes and the system stores the memory block configuration into the file Memory Check Options The Memory Check group box consists of three chec...

Page 584: ...ry block Wait state Time used for reading or writing a specific number of bytes Bus width Width of the bus that accesses the memory Read access Table that defines read access details on Byte Word Word misaligned Long and Long misaligned Write access Table that defines write access details on Byte Word Word misaligned Long and Long misaligned Auto configure Flag that directs automatic computation o...

Page 585: ...ding to the current data of the Name Type Start End Bus width and Access Details controls Delete Removes the currently selected memory block from the list box The list box contents adjust to reflect this deletion OK Closes the dialog box and validates the list of modified memory blocks The parent class can access this list updating its own list Cancel Closes the dialog box canceling your modificat...

Page 586: ... into the file you defined at the outset Clock Frequency Setup The Full Chip Simulation provides a true time information It is possible to provide an oscillator clock frequency to the debugger The debugger CPU awareness and IO modules provide the clock factor to apply to this input frequency to derive the CPU cycle frequency Figure 28 8 Clock Frequency Setup Dialog Box Derivative specific IO simul...

Page 587: ...nds The OSCFREQUENCY variable displays or sets the oscillator frequency Bus Trace The FCS can record all executed instructions and memory accesses in the Trace component up to one million frames Enable recording in the Trace menu or context sensitive menu after opening the Trace component NOTE Refer to the ColdFire On Chip DBG Module manual for the Trace Component Window common functionality and c...

Page 588: ...ariable name and module name for each global variable data access Figure 28 10 Bus Trace Data Access Symbolic Information Full Chip Simulation Warnings By default the FCS generates warning messages when the application accesses on chip registers that are not implemented for the selected derivative These warnings appear in the Command window For example the following messages can be indefinitely re...

Page 589: ...re from the Flash CONTROL registers block Therefore any access to an unimplemented Flash CONTROL register generates the same kind of message The debugger provides a set of commands to hide specific ID messages to stop the FCS automatically or to display a warning message box You can executes these commands from a POSTLOAD command file These commands are volatile and not saved in current project WA...

Page 590: ... status WARNING_SETUP STATUS CLMSG WARNING_SETUP MSGBOX A message box appears on warning Pressing Cancel stops the FCS Pressing OK resumes the FCS Figure 28 11 FCS Warning Message Box Example in warning_setup none in warning_setup msgbox in warning_setup status WARNING_SETUP STATUS MSGBOX WARNING_SETUP NONE clears all kinds of warning messages in warning_setup none in warning_setup status WARNING_...

Page 591: ...D message number ID Example in MESSAGE_HIDE_ID 1 in warning_setup status WARNING_SETUP STATUS CLMSG Hidden message ID 1 MESSAGE_SHOW_ID Command The MESSAGE_SHOW_ID shows back the hidden message of a specific ID Components Debugger engine Usage MESSAGE_SHOW_ID message number ID Example in MESSAGE_SHOW_ID 1 MESSAGE_HIDE_RESET Command The MESSAGE_HIDE_RESET commands resets all hidden messages to disp...

Page 592: ...CodeWarrior installation named FCS_Notes_ derivative name pdf These documents contain details on the implementation of each peripheral module within the derivative Generating a new project with the New Project Wizard and the connection Full Chip Simulation sets everything up to run the project with FCS support Use Simulator Set Derivative to change the derivative to simulate In addition to the der...

Page 593: ...ly includes utility components that extend to the production phase of applications such as the host application builder components and process visualization components These components contain visualization utilities that graphically display such things as values registers and memory cells or provide an advanced graphical user interface to the simulated I O devices and program variables This secti...

Page 594: ...Figure 28 13 Analog Meter Template Window The Analog Meter contains four controls an analog gauge in the middle a vertical level bar to the left a horizontal level bar on top and a turning knob in the top left corner Click in any of these controls to adjust the value of the meter The Analog Meter is assigned to address 0x210 Analog Meter Operations In the vertical bar the value can be tracked vert...

Page 595: ...f at the DDR address symbolic values Figure 28 14 IO_LED Component Window When you change the state of LEDs in this window the value of the corresponding bit at the DDR address changes in the Memory component window IO_LED Operations Clicking and changing the state of one LED changes the value of the byte at the DDR address To change the color of the LEDs you must change the value of the byte at t...

Page 596: ...u contains a single item Setup that opens the IO_LED Setup dialog box shown in Figure 28 15 Use this dialog box to specify the PORT and DDR addresses Figure 28 15 LED Setup Dialog Box Associated Context Menu Identical to menu Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations No limitations ...

Page 597: ...n LED to toggle its state The underlying value changes accordingly LED Operations If you click an LED its state toggles between green 0 and red 1 The corresponding bit in the underlying value changes as well When you right click within the component window a context menu appears with the same menu entries as listed in the LED menu in the main menu bar LED Menu The LED menu contains a single item S...

Page 598: ...in Demo Version Limitations No limitations Phone Component The Phone window shown in Figure 28 18 is an input utility that provides a graphical keyboard pad that allows you to interactively modify the value of a memory cell Figure 28 18 Phone Window The phone component displays the front panel of a cellular phone with a numeric keypad and LCD display Click the keys on the keypad to store the corre...

Page 599: ...dress command which opens the Phone Address dialog shown in Figure 28 19 In the text field of this dialog box the user can specify the address of the memory cell where keypad characters will be stored Specify the location with a hexadecimal number Figure 28 19 Phone Address Dialog Box Click OK to accept the specified address Click Cancel to discard changes and retain the previous address Example S...

Page 600: ... ADC_DAC window shown in Figure 28 20 consists of an Analog to Digital ADC and a Digital to Analog DAC converter Figure 28 20 ADC DAC Window Description The ADC DAC component consists of four units as shown in Figure 28 21 A signal generator An analog to digital converter ADC A digital to analog converter DAC A visualization unit ...

Page 601: ...al Generator The signal generator only generates a sinus signal The generator output connects to the ADC visualization screen Visualization Screen The visualization screen is a 200 point horizontal resolution screen The sinus signal period deploys in red by default shown in the upper part of the screen in Figure 28 20 and the signal generated by the DAC appears in blue in the lower part ADC The AD...

Page 602: ...nu The ADC DAC menu shown in Figure 28 22 contains all functions associated with the ADC DAC component Table 28 4 describes these entries Figure 28 22 ADC DAC Menu Table 28 4 ADC DAC Menu Description Menu Entry Description Setup Opens the ADC DAC Setup dialog box allowing you to set the port addresses Reset Erases the visualization screen and re initializes the display properties Conversion Parame...

Page 603: ...onent functions with the Programmable IO_Ports Component Figure 28 23 ADC DAC Setup Dialog Box Conversion Parameters Dialog Box The dialog box shown in Figure 28 24 allows you to choose the analog signal frequency generated by the sinus generator and the sampling frequency The choice of these two frequencies internally initializes the timer which gives the conversion orders Figure 28 24 Conversion...

Page 604: ...fine the vertical position of the input and output curves Two control buttons allow you to change the axes scales Figure 28 25 Display Properties Dialog Box ADC DAC Operations To convert a signal from an example application 1 Load the application and the ADC DAC component 2 Choose the ports address 3 Define the input signal frequency 4 Define the sampling frequency 5 Start the application 6 Choose...

Page 605: ... four columns Y0 to Y3 The resistor R connected to the positive supply gives a logical level 1 when there is no connection key not pressed The activation of a line or column gives a logical level 0 and a key pressed on this line or column places the column or the line corresponding on the low level For example if you activate line X2 column Y3 decreases from logical level 1 to logical level 0 when...

Page 606: ... Y0 Continue till the last column of the last line and restart at the beginning All keyboard keys are scanned until we find one that is activated During the scanning process it is easy to update a counter representing the number of the key pressed Raising an interruption when a key is pressed allows you to scan only when a key is activated rather than constantly IT_Keyboard Menu Figure 28 28 shows...

Page 607: ...e Port address section for each two ports you can insert an address in hexadecimal in the Lines field or select one of the five ports listed in the Columns field These are used when the component works with the Programmable IO_Ports Component The Vector number filed allows you to specify an interruption vector number in hexadecimal The Keys label buttons permit you to change the symbols displayed ...

Page 608: ...Display Module Ports The bits d7 d0 represent an ASCII code to display characters or an instruction code The RS bit defines the status of bits d7 d0 LCD Operation The LCD Display device can display one or two lines of 16 characters and show or hide the position cursor To manage the display this device contains a controller the DDRAM Display Data RAM The DDRAM stores the ASCII codes of characters w...

Page 609: ...ut 40h For example if we send a 48 character string after initialization the AC stores the bytes at addresses 00h to 1Fh and 40h to 4Fh NOTE Only characters having their ASCII codes in the visible interval of the 16 characters positions 1 to 16 of RAM appear Sending Information to the Display Two steps are necessary to display a character 1 Set the E and RS bits at 1 and the R W bit at 0 control w...

Page 610: ...ss 00h into AC address counter Re initializes the display if shifts occurred Puts the cursor in position 1 on the display first line Return Home Sets AC 00h and re initializes the display Puts the cursor in position 1 on the display first line Leaves the DDRAM unchanged Entry Mode Set Increases AC if I D 1 or decreases AC if I D 0 after you write an ASCII code into RAM Moves the cursor to the righ...

Page 611: ... During a screen shift the two lines only move horizontally the first line never passes to the second one Figure 28 34 describes how to choose the moving direction Figure 28 34 Left Right Choice Set DDRAM Address Puts the address indicated by a6a5a4a3a2a1a0 into AC When the number of lines is 2 the address goes from 00h to 1Fh for the first line and from 40h to 5Fh for the second line The a6 bit i...

Page 612: ...ssively to fix the exchange data width and a fourth time to fix the number of lines used The example shown in Figure 28 35 configures the display module in 8 bit mode two lines with the cursor visible and an increase of AC the cursor moves to the right Figure 28 35 The LCD Display Initialization LCD Menus Figure 28 36 shows the LCD menu which is identical to the context menu Table 28 6 describes t...

Page 613: ...Ports address section for each two ports you can insert an address in hexadecimal in the Lines field or select one of the five ports listed in the Columns field These are used when the component works with Programmable IO_Ports Component Drag Out Nothing can be dragged out Drop Into Nothing can be dropped into the LCD display Component Demo Version Limitations No limitations Table 28 6 LCD Display...

Page 614: ...mat similar to an oscilloscope The monitor component can save the list of state modifications and associated time in a file Monitor Menu Figure 28 39 shows the Monitor menu and Table 28 7 describes its entries Figure 28 39 Monitor Menu Table 28 7 Monitor Menu Description Menu Entry Description Add Channel Opens the dialog box to create a new Channel in the Monitor Delete Channel Deletes the Select...

Page 615: ...text area Object to monitor enter the object name and bit e g TIM12 PORTT bit 0 and click OK to validate or Cancel to exit Monitor Settings The Monitor Settings dialog box shown in Figure 28 41 allows you to change the time base Select the object name in the list enter a CPU timer proportional value in the Ticks field and a number of pixels in the Pixels field to define the horizontal scale Click ...

Page 616: ...e 28 42 allows you to change the colors from the selected Channel Figure 28 42 Change Colors Dialog Box Select the intended element in the categories field and click Change to open the standard color selection dialog Click OK to validate or Cancel to exit Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations No limitations ...

Page 617: ...e Push Buttons window shown in Figure 28 43 is a basic input device Figure 28 43 Push Buttons Window Push Buttons Menu Figure 28 44 shows the Push Buttons menu and Table 28 8 describes its entry Figure 28 44 Push Buttons Menu Table 28 8 Push Buttons Menu Description Menu Entry Description Setup Opens the Push Buttons Setup dialog box ...

Page 618: ...ort for the LEDs component Use with IO_Ports The component uses the address defined in the Push Buttons Setup dialog box when working with the Programmable IO_Ports Component Use with LEDs Component Figure 28 46 shows the bytes that the Push Button component sends to the LEDs component Figure 28 46 Push Buttons Input Port Sending a value of 1 for a bit lights on the corresponding LED on the LEDs d...

Page 619: ...r and peripherals The peripherals are connected to the data bus in parallel The appropriate output circuit catches information on the data bus and saves it in a latch until the next data reception The processor perceives the input output couplers as memory cases with a wired fixed address The capability exists to do input output actions at a known address In C access is accomplished using forced p...

Page 620: ... to set the port address and control port address Figure 28 49 Port Address Dialog Box Setup You can enter the address for the five ports A B C D and E and the address for the Control port Click OK to validate The Control register coupler allows you to configure the port type for each port set a bit to 1 to configure the port as output and clear to 0 to configure the port as input as shown in Figu...

Page 621: ... segment display systems Figure 28 51 7 Segments Display Window Operation of the 7 segments display component is based on the display scanning principle Only one display can be activated at a time for the purpose of limiting consumption of the set Common segment connection is the strength of the component The other connections serve as code input so the same code applies to all seven as shown in F...

Page 622: ...Segments Display Component Constitution 7 Segments Display Menu Figure 28 53 shows the 7 segments display component menu and Table 28 10 describes its entry Figure 28 53 7 Segments Display Menu Table 28 10 7 Segments Display Menu Description Menu Entry Description Setup Opens the Seven segments display component setup dialog ...

Page 623: ...y In the Segment Activation field you can set the value of this display The predefined port is the one used when this component works with the Programmable IO_Ports Component Control Bits Configuration The two bytes sent to the 7 segments display must be composed as shown in Figure 28 55 Figure 28 55 Seven Segments Display Control Bits NOTE The 7 segments display component in FCS is much slower th...

Page 624: ...he True Time I O Stimulation section describes using this feature in detail with accompanying examples The Stimulation window component shown in Figure 28 56 provides the basic functionality of the Full Chip Simulation It serves to execute timed action and raise exception events The Stimulation component displays and executes I O stimulation described in a text file Figure 28 56 Stimulation Window...

Page 625: ...n 10 and 1 000 000 By default the number of lines is 1000 Figure 28 58 Size of the Cache Dialog Box NOTE Increasing the cache size slows new line logging Example of a Stimulation File Using an editor open the file named IO_VAR TXT located in the project directory Listing 28 1 is an example file Listing 28 1 Stimulation File Example def a TargetObject 210 B PERIODICAL 200000 50 50000 a 128 150000 a...

Page 626: ...timulation section describes using this component in detail with examples Drag Out Nothing can be dragged out Drop Into Nothing can be dragged in Demo Version Limitations Only 15 interrupts and memory accesses are generated TestTerm Component The TestTerm window shown in Figure 28 59 is a user friendly terminal input output It provides a simple SCI Serial Communication Interface interface which is...

Page 627: ...ASCII code of the typed key into the SCDR register Conceptually writing a new value in the SCDR register by the target application clears the TDRE flag in SCSR Transmission completion sets the TDRE flag again As TestTerm is only an I O emulation no delay is simulated and writing into SCDR sets the TDRE flag in the SCSR register Output Redirection Output can be redirected to a TestTerm window a fil...

Page 628: ...debugger uses the Term_Direct function declared in terminal h to redirect an output Listing 28 2 gives the source code in terminal c Listing 28 2 Term_Direct Source Code void Term_Direct int what char fileName if what 1 what FROM_FILE return Write ESC Write h Write what 0 if what TO_WINDOW what FROM_KEYS PutString fileName Write CR In this case what is one of the following items Table 28 14 Redire...

Page 629: ...rm Listing 28 3 shows the functions defined in termport h that can be called to access the TestTerm component Listing 28 3 Functions to Access the TestTerm Component char GetChar void void PutChar char ch void PutString char str void InitTermIO void Listing 28 4 gives the source code for the functions in termport c Listing 28 4 Functions to Access the TestTerm Component in termport c typedef struc...

Page 630: ...tr void InitTermIO void SCI BAUD 0x30 baud rate 9600 at 8 MHz SCI SCCR2 0x0C 8 bit TE and RE set TestTerm Menu The TestTerm component menu shown in Figure 28 60 lets you set the Cache Size in lines Selecting this menu entry accesses the dialog box shown in Figure 28 61 Figure 28 60 TestTerm Menu Figure 28 61 TestTerm Cache Size Dialog Box Drag Out Nothing can be dragged out ...

Page 631: ...t devices and send them to other devices Figure 28 62 Terminal Window You can use a virtual SCI Serial Communication Interface port provided by the framework for communication with the target but it is also possible to use the keyboard the display some files or even the serial port of your computer as I O devices To control and configure a terminal component use the Terminal menu of the terminal s...

Page 632: ...se one of the default configurations in the Default Configuration combo box The Connections section lists all active connections in a list box There you can customize which input devices to redirect to which output devices by adding and removing connections To add a connection specify the source and target devices using the From and To combo boxes and then press the Add button The new connection a...

Page 633: ...to all output devices receiving characters from the input file to notify them that the file transfer is complete Redirecting input devices to an output file is a similar process Choose your connections from input devices to the output file Then open or create your output file by choosing Output File from the context menu If the file does not exist the debugger creates it Otherwise you can choose t...

Page 634: ...ets direction of the terminal if what TERM_TO_WINDOW what TERM_APPEND_FILE return TERM_Write ESC TERM_Write h TERM_Write char what 0 if what TERM_TO_WINDOW what TERM_FROM_KEYS TERM_WriteString fileName TERM_Write CR In the example the parameter what is one of the following constants TERM_TO_WINDOW send output to terminal window TERM_TO_BOTH send output to file and window TERM_TO_FILE send output t...

Page 635: ...bject with the specified register name Write access to the target application is done with the Object Pool function OP_SetValue at the address Sci0 SerialInput A subscription to an Object Pool register with the name Sci0 SerialOutput handles input from the target application When this register changes sends a notification a new value is received For implementations of this register with help of th...

Page 636: ...er position When you click the RUN button the wagon goes to the right side Upon arriving at the right border the wagon returns to the left side The RESET button positions the wagon at the left border The STOP button stops the wagon at the current position Wagon Menu Figure 28 67 shows the Wagon menu Table 28 16 describes its entry Figure 28 67 Wagon Menu Table 28 16 Wagon Menu Description Menu Ent...

Page 637: ...an insert an address in hexadecimal to select the Wagon position Predefined ports are fixed when the component operates with the Programmable IO_Ports Component Control Bits Configuration The 2 bytes sent to the wagon component must be composed as shown in Figure 28 69 Figure 28 69 Wagon Control Bits Description To move the wagon to the right set bit r To move the wagon to the left set bit l The s...

Page 638: ...ister modifications invoked by the hardware This tutorial introduces and explains examples of stimulation files This section contains the following subsections Stimulation Program Examples Stimulation Input File Syntax Stimulation Program Examples The following examples illustrate common stimulation programs Running an Example Program Without Stimulation 1 Run the debugger with the FCS connection ...

Page 639: ...ts in startup click the Start Continue command again 8 Choose Run Halt to stop execution after a few seconds The Template component is a view linked to a specific memory location in TargetObject In the source code of the test program you can find a variable associated with it define PORT_DATA volatile unsigned char 0x0210 Value with range 0 255 The Template component polls this value and displays ...

Page 640: ...A 255 dir 1 do Delay PORT_DATA while dir 1 PORT_DATA 0 Example Program with Periodic Variable Stimulation 1 Choose Simulator Reset 2 Choose Simulator Load Io_demo abs 3 Choose Component Open Stimulation Figure 28 73 shows the Stimulation component Figure 28 73 Stimulation Component Window 4 Activate the Stimulation Window by clicking on it 5 Choose Stimulation Open File io_var txt 6 Choose Stimula...

Page 641: ...specified between the keywords PERIODICAl and END PERIODICAL 200000 50 50000 a 128 After 50 000 cycles write 128 at address 0x210 150000 a 4 After 150 000 cycles write 4 at address 0x210 END 10000000 a 0 After 10 000 000 cycles write 0 at address 0x210 First the simulated object is defined This object is located at address 0x210 and is 1 byte wide Once 200 000 cycles have been executed the memory ...

Page 642: ...o run The stimulation is finished The interrupts have been invoked by the Stimulation component source io_int txt Listing 28 8 gives the Stimulation file listing Listing 28 8 io_int txt def a TargetObject 210 B PERIODICAL 200000 10 100000 RAISE 7 3 test_interrupt END 10000000 RAISE 7 3 test_interrupt In the first line the stimulated object is defined The interrupt is raised periodically ten times ...

Page 643: ... interrupt is generated when the number of CPU cycles reaches 10 000 000 Example of a Larger Stimulation File Listing 28 9 contains this example and is commented below This example file may not work as expected if the variables defined here do not refer to a port in TargetObject In our example we only defined the objects TargetObject 210 and 212 over the Io_led component Definitions of b c and pbi...

Page 644: ... byte B register named Port_Register in LEDs You can specify names of target objects when using FCS In our example it is the name of the port register defined by the IO LED component 10000 pbits 3 This line of code sets the three bits of LEDs Port_Register accessed with pbits to binary 011 Other bits are unaffected The new value of Port_Register is 0x75 if the initial value was 0x55 Values outside...

Page 645: ...pt with priority 3 with vector number 7 40000 cycles after each start of the periodic event The time specification in the PERIODICAL loop is always relative so 30000 means 30000 The raised interrupt has the name test_interrupt This name is not important for the interrupt functionality END This line of code is the end of the periodic block The block loops again after finishing so the loop restarts ...

Page 646: ...e exception vector number Priority the exception priority number ArbPrio the arbitration priority of the exception Start the number of cycle when the periodical event must be called for the first time after the initial time NbTimes the number of times the periodical event must be called 0 infinity Remarks Omitting bitRange affects all bits of the object register Specifying bitRange applies the mas...

Page 647: ... timed event In the PerTimedEvent declaration the is optional If specified or not the following time is interpreted exactly the same way The periodical events are not displayed in the stimulation screen Electrical Signal Generators and Signals Application to Device Pins Signal IO Component This Signal IO is the first implementation of a Signal Generator reading in real debugger time a file describ...

Page 648: ...ble value GAIN double value DCOFFSET double value OPTION NORMAL ONLYPOSITIVE ONLYNEGATIVE ABSOLUTE Signal Data Description level double value time double value duration in seconds or cycles File Example 1 FILELOOP INF LOOP 4 TIMEUNIT SECONDS TIMEFACTOR 0 5 GAIN 1 DCOFFSET 0 OPTION NORMAL 0 000000e 000 3 051758e 005 3 051758e 005 3 051758e 005 6 103516e 005 3 051758e 005 9 155273e 005 3 051758e 005...

Page 649: ...NORMAL 2 136230e 004 3 051758e 005 2 441406e 004 3 051758e 005 2 746582e 004 3 051758e 005 3 051758e 004 3 051758e 005 3 356934e 004 3 051758e 005 3 662109e 004 3 051758e 005 EOF File Example 2 FILELOOP INF LOOP INF TIMEUNIT NONE TIMEFACTOR 0 5 GAIN 1 DCOFFSET 0 OPTION NORMAL 5 5 2 8 0 4e 3 300 123 EOF File Parameters The following parameters apply to the previous code examples LOOP FILELOOP ...

Page 650: ...ing multiplies the number of cycles or time duration by this factor GAIN At Pin level setup multiply the level by this gain DCOFFSET At Pin level setup level offset applied after gain is applied OPTION NORMAL do nothing ONLYPOSITIVE at Pin level setup after gain and offset cleared to 0 if signal level 0 ONLYNEGATIVE at Pin level setup after gain and offset cleared to 0 if signal level 0 ABSOLUTE a...

Page 651: ... the debugger installation path Syntax SETSIGNALFILE value 0 15 file name Example To create three generators setsignalfile 0 sinus_11bit_0_5v_1Hz txt setsignalfile 1 saw_11bit_0_5v_1Hz txt setsignalfile 2 square_1_5v_1Hz txt Then perform virtual pin connections with the Pinconn IO CONNECT command connect SignalGenerator0 SignalPin Atd0 PAD0 connect SignalGenerator1 SignalPin Atd0 PAD1 connect Sign...

Page 652: ...olts voltage range saw_8bit_0_5v_1kHz txt a sawtooth signal with an 8 bit sampling definition scaled on a 1000 Hz frequency in a 0 to 5 Volts voltage range sinus_11bit_0_5v_1Hz txt a sinus signal with an 11 bit sampling definition scaled on a 1 Hz frequency in a 0 to 5 Volts voltage range sinus_8bit_0_5v_1kHz txt a sinus signal with an 8 bit sampling definition scaled on a 1000 Hz frequency in a 0...

Page 653: ... Pinconn Commands CONNECT Connects output pin to input Syntax CONNECT OutputPin InputPin Example CONNECT Pim PORTHPin0 Pim PORTPPin3 DISCONNECT Removes connection between pins Syntax DISCONNECT OutputPin InputPin Example DISCONNECT Pim PORTHPin0 Pim PORTPPin3 CONNECT_STATE Displays the list of active connections NOTE There is no limitation of connections NOTE The Inspect component provides this li...

Page 654: ...mple This section contains the following subsections Guess the Number PWM Sample Guess the Number This tutorial uses the SCI and a terminal window from the debugger At the end the user can guess a number between 0 and 9 This guessing is done via terminal window The final application runs on real hardware as well Step 1 Environment Setup The tutorial uses Processor Expert You can get a free Process...

Page 655: ...o add additional files 9 Choose Processor Expert and click Next 10 Click Finish to stay with the default options The CodeWarrior software creates a new project using the wizard and Processor Expert is available During this process several windows may appear allowing you to select additional options Close these windows to keep the default settings Several Processor Expert windows are visible Figure...

Page 656: ...ith an icon attached to them are modules used by the application The pins that are used to connect external functions are indicated by a line and an icon symbol of the function attached CPU and Port A Figure 28 76 Target CPU Window Optional Place the cursor of the mouse on the pins to see a description of their functions Enlarge the Target CPU window to see different on chip modules Step 4 Bean Se...

Page 657: ... Current Project to add an instance of the AsynchroSerial bean to the project Figure 28 77 Bean Selector Window Selection of AsynchroSerial Bean Step 5 Project Panel Window The Project Panel window shows and keeps track of the beans created for this application This Panel is a tab of the Project Manager window A click on the next to a bean shows a list of methods and or events related to the bean ...

Page 658: ...chroSerial Step 6 Bean Inspector AS1 AsynchroSerial Window In this window you can modify the behavior of the bean to suit your needs General settings are in the Properties tab Software drivers are located under the tab Methods and Events Select Properties tab Enter a proper baud rate If you want to run it on real hardware check your board manual for the right value If you want to run it in FCS onl...

Page 659: ...ssage shows the progress with the information processed and the code generated A window shows compiling and linking progress Step 8 Verification of Files Created Select the Files tab to display all the Project files We can verify the folders and files created by Processor Expert User Modules A file MyGuessTheNumber C is the placeholder for the main procedure and any other procedure desired by the ...

Page 660: ...tr while str 0 0 PutChar str 0 str void GuessTheNumber void int ran rand RAND_MAX 9 AS1_Init PutString Guess a Number between 0 and 9 n PutString Number for unsigned char c if AS1_RecvChar c ERR_OK PutChar c PutChar if c 0 c 9 PutString not a number try again n else if c ran 0 PutString nCongratulation You have found the number PutString nGuess a new number n ran rand RAND_MAX 9 else if c ran 0 Pu...

Page 661: ...main routine DO NOT MODIFY THIS TEXT Step 10 Run The application is now complete and we can launch it Make sure you have chosen the Full Chip Simulation connection 1 Select the Debug icon in the Project Manager window or the menu bar Project Debug or F5 If there are compilation errors correct your source code and try again 2 In the Debugger select Component Open in the debugger and open the Termin...

Page 662: ...al Figure 28 80 Terminal Configuration Dialog 4 Select the Save icon in the debugger or the menu bar File Save Configuration to save the window layout 5 Select the Run icon in the debugger or the menu bar Run Start Continue or F5 6 Enter numbers in the terminal window to guess the right number ...

Page 663: ...ange the period and duty time of the PWM and see the changes displayed in a chart Step 1 Environment Setup The tutorial uses Processor Expert You can get a free Processor Expert license Special Edition from www codewarrior com Step 2 Creating Project 1 Launch the CodeWarrior IDE 2 In the CodeWarrior menu Select File New Project 3 Select a derivative like ColdFire V1 MCF51QE Family MCF51QE128 4 Sel...

Page 664: ...and the ADC Modules with an icon attached to them are modules used by the application The pins that are used to connect external functions are indicated by a line and an icon symbol of the function attached CPU and Port A Optional Place the cursor of the mouse on the pins to see a description of their functions Enlarge the Target CPU window to see different on chip modules Step 4 Creating PWM Bean...

Page 665: ...tes that we have started the code generation The second message shows the progress with the information processed and the code generated A window shows compiling and linking progress Step 8 Verification of Files Created Select the Files tab to display all the Project files We can verify the folders and files created by Processor Expert User Modules A file PMW_Sample C is the placeholder for the ma...

Page 666: ...con in the Project Manager window or the menu bar Project Debug or F5 2 Select Component Open in the debugger and open the VisualizationTool component VisualizationTool Properties In this tutorial we will create a visualization using the VisualizationTool window Make sure that you are in the Edit mode Right mouse click Edit Mode or Ctrl E 1 Select Right mouse click Properties 2 For Refresh Mode se...

Page 667: ... on the Bar to see the Bar Properties 3 Select Variable for Kind of Port 4 Select pwmRatio for Port to Display 5 Select 65535 for High Display Value 6 Leave all others on default You might add labels with Right mouse click Add New Instrument Static Text Now leave the Edit mode and run the final application First save the window layout 1 Right mouse click Edit Mode or Ctrl E 2 Select the Save icon ...

Page 668: ...ColdFire V1 Full Chip Simulation Connection FCS Tutorials 668 Microcontrollers Debugger Manual Figure 28 82 Debugger Main WIndow Final Application ...

Page 669: ...yclone Pro connection When the debugger runs the P E Multilink Cyclone Pro connection it can communicate and debug ColdFire V1 core based hardware connected through the P E BDM Multilink interface or through the P E Cyclone Pro interface NOTE The BDM Multilink parallel port and USB ML 12 Rev A are no longer supported in ColdFire V1 CodeWarrior IDE and P E Multilink Cyclone Pro Connection There are...

Page 670: ...t Wizard follow the path to create a new project naming the project 3 Click the Next button to open the New Project window 4 In the Microcontrollers New Project window choose the ColdFire Family chip you are working with from the list in the Derivative list box Figure 29 1 Wizard Connection Selection 5 From the Default Connection list box choose the connection P E Multilink Cyclone Pro to create a...

Page 671: ...Run the CodeWarrior IDE with the shortcut created in the program group 2 Open the project 3 Choose Project Debug to start the debugger 4 In the debugger choose Component Set Connection to select another target interface in the Set Connection dialog box 5 Select ColdFire as the Processor then P E Multilink Cyclone Pro as the connection Figure 29 2 Set Connection Dialog Box P E Multilink Cyclone Pro...

Page 672: ...Existing Project 672 Microcontrollers Debugger Manual Figure 29 3 Set Derivative Dialog Box 8 Press the OK button The Connection Manager dialog box opens 9 Select the P E interface and port Press the Connect button to start debugging Figure 29 4 Connection Manager Dialog Box ...

Page 673: ...ro Menu Options Setup Select MultilinkCyclonePro Setup to display the P E Multilink Cyclone Pro Setup Dialog Box Connect Communication Select MultilinkCyclonePro Connect or Communication to display the Connection Manager Dialog Box Select Derivative Select MultilinkCyclonePro Select Derivative to display the Set Derivative Dialog Box Debugging Memory Map Select MultilinkCyclonePro Debugging Memory...

Page 674: ...x For more information see Flash Programming P E Multilink Cyclone Pro Setup Dialog Box In the communication tab the communication protocol between the debugger and P E driver display can be activated The protocol is displayed in the Command window Use this option only when requested by the Support team Figure 29 6 P E Multilink Cyclone Pro Setup Dialog Box Communication Tab In the communication t...

Page 675: ... and reports an unknown hardware break status To emulate a Terminal communications use the special libraries delivered with the CodeWarrior IDE Figure 29 7 P E Multilink Cyclone Pro Setup Dialog Box Debug Options Tab Connection Manager Dialog Box The Connection Port and Interface Type field gives the user the way to select the debugging cable and also the communication port or specific cable when ...

Page 676: ...Existing Project 676 Microcontrollers Debugger Manual Figure 29 8 Connection Manager Dialog Box Set Derivative Dialog Box This dialog box is used to set up a derivative The list menu can be expanded to select another ColdFire derivative Figure 29 9 Set Derivative Dialog Box ...

Page 677: ...based hardware connected through the SofTec in circuit debugger programmer units that is SofTec Microsystems ColdFire ISP Debuggers Programmers inDART Series and Starter Kits PK and newer Series Refer to the inDART ColdFire In Circuit Debugger Programmer for Freescale ColdFire Family FLASH Devices User s Manual from SofTec for communication hardware requirements and SofTec product installation Cod...

Page 678: ...rd follow the path to create a new project naming the project 3 Click the Next button to open the New Project window 4 In the Microcontrollers New Project window choose the ColdFire Family chip you are working with from the list in the Derivative list box Figure 30 1 Wizard Connection Selection 5 From the Default Connection list box choose the connection SofTec ColdFire to create a new project fro...

Page 679: ...the CodeWarrior IDE with the shortcut created in the program group 2 Open the project 3 Choose Project Debug to start the debugger 4 In the debugger choose Component Set Connection to select another target interface in the Set Connection dialog box 5 Select ColdFire as the Processor then SofTec ColdFire as the connection Figure 30 2 Set Connection Dialog Box SofTec ColdFire Selection 6 Press the O...

Page 680: ...ng Project 680 Microcontrollers Debugger Manual Figure 30 3 Set Derivative Dialog Box 8 Press the OK button Target Connection dialog box opens 9 Select the hardware cable model Press the Connect button to start debugging Figure 30 4 Target Connection Dialog Box ...

Page 681: ...on Select SofTec MCF51 Communication to display the Target Connection Dialog Box Select Derivative Select SofTec MCF51 Select Derivative to display the Set Derivative Dialog Box Debugging Memory Map Select SofTec MCF51 Debugging Memory Map to display the Debugging Memory Map dialog For more information about the Debugging Memory Map menu option see Debugging Memory Map window Trigger Module Settin...

Page 682: ...fTec driver display can be activated The protocol is displayed in the Command window Use this option only on Support team request Figure 30 6 SofTec ColdFire Setup Dialog Box Communication Tab In the Debug Options tab checking Disable maskable ISR s when stepping option provides a way to debug without diving in pending program ISR s When this option is set interrupts are masked before stepping as ...

Page 683: ...To emulate a Terminal communications use the special libraries delivered with CodeWarrior IDE Figure 30 7 SofTec ColdFire Setup Dialog Box Debug Options Tab Target Connection Dialog Box The SofTec debug cable or target board can be selected in the Hardware Model Code list menu When an inDART One model is selected a Port list menu appears to select the exact inDART One cable by its serial number A ...

Page 684: ...unication Settings Dialog Box The BDC Clock CLKSW group is intended to setup the best BDC synchronization between the SofTec inDART ColdFire interface and the target processor When Use system bus frequency is selected the BDC communication clock source is the microcontroller s bus frequency when Use alternate frequency is selected the BDC communication clock source is a constant clock source which...

Page 685: ...ons set up within this dialog refer to the inDART ColdFire In Circuit Debugger Programmer for Freescale ColdFire Family FLASH Devices User s Manual from SofTec Figure 30 9 Communication Settings Dialog Box Set Derivative Dialog Box This dialog box is used to set up a derivative The list menu can be expanded to select another ColdFire derivative Figure 30 10 Set Derivative Dialog Box ...

Page 686: ...eps From Within an Existing Project 686 Microcontrollers Debugger Manual About Dialog Box This dialog box belongs to the SofTec GDI DLL and provides information about the inDART_CFV1 dll release and version Figure 30 11 About Dialog Box ...

Page 687: ...DBG Module for general information This section gives details of specific setup for the ColdFire debug module DBG Features The debugger covers all features available within the on chip DBG module Regular hardware breakpoints and watchpoints Predefined preset Instruction Triggers or Memory Access Triggers a wide set of complex hardware breakpoints triggers on program code instructions and watchpoin...

Page 688: ...u Trigger A and B can be selected to set breakpoints Specific DBG support menu options are added to the Connection menu as soon as the debugger target processor is acknowledged by the DBG module The DBG module Sequencer setup can be set directly via the context sensitive context menu Sequencer Setup menu entry The recording mode can also be set when selecting the Trace Setup menu entry The Trigger...

Page 689: ...Window Trigger Settings Tab Trigger Module Usage DBG Module Setup In the Trigger Settings main tab three modes can be selected to take advantage of the on chip DBG module An Automatic mode which does not provide trigger functionalities therefore does not provide complex breakpoints or complex watchpoints but typically four hardware breakpoints and one watchpoints that can be set as usually via win...

Page 690: ...not real time The debugger can only access the DBG on chip trace buffer FIFO when the device is halted Therefore in background the debugger regularly halts the device retrieves debug information then restarts the device to build a statistic program counter database Refer to Profiling and Coverage Mode Figure 31 3 General Usage Listbox Automatic Mode Automatic provides only two behaviors for the Tr...

Page 691: ...tion the DBG module does not record any data and the debugger cannot rebuild any program flow in the Trace window To force the DBG module to capture program flow information regardless of the executed instructions engage the Sync PC feature using the list menu The more cycles in the loop you are debugging the higher you can set the Sync PC cycle Figure 31 5 Sync PC List Menu NOTE Engaging the Sync...

Page 692: ...e breakpoints can be set using the Set Trigger button Refer to HCS08 On Chip DBG Module for information about the Browse for Trigger interface TIP Trigger A only can be adjusted with a mask on the address that can be set in the Mask field when the Enable Mask checkbox is set The Trace Settings list menu gives a set of options to choose the way the module is going to start and to stop recording Fig...

Page 693: ...s specific data access options When setting the Enable Data Compare edit box additional fields are accessible to specify the data to compare the mask and the bus information to check for compare in the Compare Mode list menu The watchpoint size can be edited within the Set Trigger Browse for Trigger interface Figure 31 8 Trigger C advanced data access watchpoint ...

Page 694: ...BG module The debugger still provides the Trace rebuild window and support to display when available the results of the captured data Enhanced setup The ABxR hex edit box setup combines ABHR and ABLR registers setup Set the CSR2 register using the Mode and Start Stop list menu or by using the Select button Figure 31 9 Expert Trigger Settings CSR2 interactive translation of recording mode Setting C...

Page 695: ...sis except trigger flags reported in the status bar Clearing this check box restricts result analysis even with the Trace window open When starting automatically step if a trigger is set at PC address otherwise warn To run the application again the debugger usually needs to exit the trigger current match condition and avoid being stuck halted locked by the trigger This usually requires a single st...

Page 696: ...ColdFire On Chip DBG Module Trigger Module Settings Window 696 Microcontrollers Debugger Manual Figure 31 12 General Settings tab ...

Page 697: ...I Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger to use all its functions and help you understand how to use the environment Book 6 is divided into the following chapters Flash Programming Debugging Memory Map ...

Page 698: ...Book VI Contents 698 Microcontrollers Debugger Manual ...

Page 699: ...ser interface then loads an MCU specific module The module provides the appropriate information such as structure access algorithms and location for that MCU The NVMC utility lists all non volatile memory devices indicating their structure state and location You can change the state enabled disabled blank programmed protected unprotected and program data into the modules Automated Application Prog...

Page 700: ... The setting is saved in the project under the project variable AEFWarningdialog box FALSE Setup Choose the Load menu entry in the connection debugger menu for example HCS08 Open Source BDM to open the Load Executable File dialog box Figure 32 2 Load Executable File Dialog Box option Check the above option to automatically mass erase the device and program the application into non volatile memory ...

Page 701: ...e application without erasing any non volatile memory on the device CAUTION The debugger ignores pre programmed modules and the user is responsible for reprogramming limitations risks and impossibilities However the debugger displays a warning message when a programmed i e not blank not automatically erased module is going to be written You can disable the displayed warning message TIP When availa...

Page 702: ...initions correspond with the CPU derivative technical summary and special technical considerations If an on chip module consists of several independent blocks the NVMC dialog box might list all of these blocks However typically groups the entire non volatile on chip blocks under one single listed module and separates relevant and important non volatile memory blocks such as mirrored non banked mem...

Page 703: ...g a module is setting clearing a flag in a special register Note that a few modules always must be unprotected you may not protect such modules Unprotected An unprotected module can be erased and programmed To select a module or other list item left click the module To deselect a module press the Ctrl key and left click For multiple selections or deselections use the Shift key NVMC Dialog Box The ...

Page 704: ...cted Possible state combinations are Bad Device the interface was unable to detect a correct device Disabled one or all modules are disabled Enabled Blank Programmed Unprotected Protected The NVMC dialog box displays only meaningful states For example it displays Enabled only if it is possible to disable a module It displays Unprotected only if it is possible to protect a module The Configuration ...

Page 705: ...lects all modules in the list box After the button is pressed the button changes to Unselect All and can be pressed to remove all current selections Enable Disable The Enable button enables all selected modules currently disabled The Disable button disables all selected modules currently enabled The possibility of enabling or disabling a Flash module depends on the MCU features and context Protect...

Page 706: ...ction Configuration FPP File Loading When the dialog box is open the NVMC utility loads the FPP configuration file according to this algorithm 1 The utility reads the NV_PARAMETER_FILE entry from the connection specific section of the project ini file HCS08 Open Source BDM is a connection specific section Example HCS08 Open Source BDM NV_PARAMETER_FILE C MYINSTALL PROG FPP mcu1027 fpp 2 If the uti...

Page 707: ...ror during loading the utility displays an appropriate message Figure 32 7 Open Dialog Box If you check the Auto select according to MCUID checkbox the NVMC utility searches for and loads the corresponding FPP parameter file Click the OK button to close the NVMC dialog box If the Auto select according to MCUID checkbox is clear the NVMC utility saves the name of the selected configuration file und...

Page 708: ...loaded The Load Executable File dialog box lists the executable files that relate to blocks selected in the NVMC dialog box Figure 32 8 Load Executable File Dialog Box If a problem occurs during application loading into Flash the NVMC utility displays an error message Figure 32 9 FLASH Writing Error Message Box This means that you tried to load a program into an unselected section The NVMC utility...

Page 709: ...block of FLASH above the High Page Registers range HCS08 CPU devices with banked paged EEPROM As devices described in previous section FLASH and SMALL_FLASH might be available EEPROM_P0 and EEPROM_P1 are provided to program directly paged EEPROM ranges Note that when programming banked paged EEPROM ranges programming addresses must be considered logical Erasing one module also erases the other mod...

Page 710: ...ENABLE DISABLE PROTECT UNPROTECT AEFSKIPERASING blockNo ARM DISARM SAVECONTEXT LOADCONTEXT MEMMAP MEMUNMAP RELEASE OVLBACKUP OVLRESTORE PROTOCOLON PROTOCOLOFF SKIPSTATUS ON SKIPSTATUSOFF NOUNSECURE UNSECURE NVMFREQUENCY frequency in Hz NVMIF2RELOCATE address NVMIF2WORKSPACE address address INIT fileName AUTOID Description The FLASH command displays names locations and states of all available modul...

Page 711: ...fies non volatile memory blocks to protect from mass erasing during application automated programming Place the command in a Startup command file If no modules are specified no blocks are erased NOTE This command is compatible and replicated in the NVM Programming Selection dialog box FLASH UNPROTECT unprotects the specified modules If no modules are specified all available blocks are unprotected ...

Page 712: ...ency in Hertz typically the device bus speed after reset When used the Flash programmer does not try to evaluate this speed and the debugger gains 2 3 seconds at application loading time A value of 0 enables the speed detection FLASH NVMIF2RELOCATE Command not relevant for HCS08 devices FLASH NVMIF2WORKSPACE Command not relevant for HCS08 devices FLASH UNSECURE After device mass erasing the Flash ...

Page 713: ...ses all available memory blocks While Flash modules are armed execution of user code is not possible If you enter a command such as run step or so forth a message box prompts you to disarm the modules or cancel the command If you click the OK button the system disarms all Flash modules then executes your command If you click the CANCEL button the system cancels the command and leaves the Flash mod...

Page 714: ...Flash Programming NVMC Commands 714 Microcontrollers Debugger Manual ...

Page 715: ...drivers of BDM pods Monitors etc For each CPU core the debugger provides the DMM with core specific read write access methods that are called Types within the DMM Graphical User Interface GUI and core specific priority rules that are called Priority within the DMM GUI Indeed the DMM has a GUI therefore providing to the user a way to change memory access methods at any time The DMM GUI The graphica...

Page 716: ...he debugger displays some in the Memory window in that case and the DMM NEVER attempts to read or write unimplemented memory The Comment column contains a text information comment about the defined memory address range The Information scrollable window gives a general diagnostic of the DMM This diagnostic has less information than the edition mode diagnostic Pressing the New button opens the editi...

Page 717: ...sparent for the DMM and the debugger The Start edit box contains the first address of a memory range and the End edit box contains the last address of a memory range Range boundaries are always limited to an overlapped range with a bigger priority For example if 2 bytes are defined in a range which overlaps another range accessing these 2 bytes is performed using the type and rules of this 2 byte ...

Page 718: ...ust start with an even address and finish on an odd address A module defined with access size 4 must start with an address with the least significant byte in 0 4 8 C and finish with an address with the least significant byte in 3 7 B F NOTE A memory range overlapping in priority another memory range can only have the same or a higher access size Types The Type list menu provides all kinds of memor...

Page 719: ... can have a bigger priority highest debugger to set an upper address range that can overlap an on chip address range This makes a debugger display filter for a Memory window e g when creating a No read access while running memory address range A Flat memory architecture i e without memory blocks moving feature provides the following Priority list menu e g HCS08 and ColdFire cores Figure 33 4 HCS08...

Page 720: ...the caching feature Access while Running Use the No memory access while running option to discard debugger access to a memory range typically accessed while running This feature is useful to protect on chip I O Register flags from being triggered by debugger memory reads due to display refreshes Remarks It is possible to create as many memory ranges as wanted down to a single byte Deleting Default...

Page 721: ...not need to use this type linear This mode is only available for HCS08 devices with an on chip MMU This sets the memory as linear address space also called Extended Address range typically addressed by the on chip linear address pointer physical this sets the memory range as physical i e with local 16 bit address bus access as performed by the CPU when reading and writing the on chip memory banked...

Page 722: ...be moved to overlap another memory range lowest debugger a low debugger priority that can be used by the user or defined for the debugger typically to protect a memory area from being read This priority is of poor usage but can still be used for display purposes on chip unimplemented memory range Types physical this sets the memory range as physical i e with linear 32 bit address bus access as per...

Page 723: ...2MERHANDLINGOFF DMM OPENGUI mcuid DMM SETAHEADREADSIZE front size when halted back size when halted front size when running back size when running DMM command Syntax DMM Purpose Displays in the Command window the current DMM Memory Types Overlap Priorities and memory ranges DMM ADD command Syntax DMM ADD comment address size handle type cache locking priority mapping access while running access ki...

Page 724: ... range to be refreshed after each debugger halting priority a value corresponding to an overlap priority handle value as given listed with the DMM command mapping a 0 or 1 value 1 enabling the memory range mapping access while running a 0 or 1 value 1 enabling the memory range access while running access kind 0 for R W 1 for write only 2 for read only 3 for none Purpose Insert a new memory range i...

Page 725: ...current project ini file under DMM_MCUIDxxxx_MODULEn keys DMM DELETEALLMODULES command Syntax DMM DELETEALLMODULES Purpose Removes all current DMM memory range modules Useful to start a scripted DMM setup DMM RELEASECACHES command Syntax DMM RELEASECACHES Purpose Flushes once all currently cached data for each memory range module even if the cache locking is active i e no refresh on halting is act...

Page 726: ...ve for memory range modules defined with this option DMM CACHINGOFF command Syntax DMM CACHINGOFF Purpose Data caching is disabled The debugger flushes all caches even for memory range modules defined without this option Each time the debugger halts the memory data are retrieve from the target hardware for all memory range modules DMM WRITEREADBACKON command Syntax DMM WRITEREADBACKON Purpose ...

Page 727: ...for HCS12 devices i e INITRM INITRG and INITEE The DMM remaps automatically memory range module addresses according to the real value of these registers when halting NOTE The debugger does not poll the MER registers while running Also the remapping is performed only on factory defined memory range modules not user defined memory range modules DMM HCS12MERHANDLINGOFF command Syntax DMM HCS12MERHAND...

Page 728: ...ning back size when running with front size when halted amount of bytes to read ahead of exact start of read block address when the hardware is halted back size when halted amount of bytes to read after the exact block of read addresses when the hardware is halted front size when running amount of bytes to read ahead of exact start of read block address when the hardware is running back size when ...

Page 729: ...anual includes information to help you become more familiar with the Debugger to use all its functions and help you understand how to use the environment This book the Debugger Commands defines the HC S 08 and RS08 commands This book contains the following chapter Book 7 Commands Debugger Engine Commands ...

Page 730: ...Book VII Contents 730 Microcontrollers Debugger Manual ...

Page 731: ...mponent component number command where component is the name of the window component For example Data Register Source Assembly etc Component number is the number of the component This number does not exist in the component window title if only one component of this type is open For example if you open a second Memory component window the initial Memory component window is renamed Memory 1 and the ...

Page 732: ...ld command programs They can only be used in a debugger command file since the Command Line component can only accept one command at a time It is possible to build powerful programs by combining Kernel commands with Base commands Common commands and Component specific commands Table 34 1 contains all available Kernel commands Table 34 1 List of Kernel Commands Command Syntax Short Description A Af...

Page 733: ...F condition Label Conditional branch to a label in a command file IF condition Conditional execution PAUSETEST Displays a modal message box PRINTF Text value PRINT instruction REPEAT REPEAT loop instruction RETURN Returns from a CALL command TESTBOX Displays a message box with a string UNDEF symbol Undefines a user defined symbol UNTIL condition Condition of a REPEAT loop WAIT time s Command file ...

Page 734: ...s a breakpoint breakpoint set CD path Changes the current working directory CR fileName A Opens a record file command records DASM address range OBJ Disassembles DB address range Displays memory bytes DL address range Displays memory bytes as longwords DW address range Displays memory bytes as words G address Starts execution of the application currently loaded GO address Starts execution of the a...

Page 735: ...lication STEPOUT Executes program out of a function call STEPOVER Steps over the next source instruction of the loaded application STOP Stops execution of the loaded application SAVEBP on off Saves breakpoints T address count Traces program instructions at the specified address WB range list Writes bytes WL range lis Writes longwords WW range list Writes words Table 34 2 List of Base Commands cont...

Page 736: ...ndow AUTOSIZE on off Autosizes windows in the main window layout BCKCOLOR color Sets the background color CLOSE component Closes a component DDEPROTOCOL ON OFF SHOW HIDE STATUS Configures the Debugger Simulator DDE protocol FONT fontName size color Sets text font LOAD applicationName Loads a framework application code and debug information LOADCODE applicationName Loads the code of a framework app...

Page 737: ...omponent Commands Command Syntax Short Description CMDFILE Specify a command file state and full name EXIT Terminates the application HELP Displays a list of available commands RESET Resets statistics SMEM range Shows a memory range SMOD module Shows module information in the destination component SPC address Shows the specified address in a component window SPROC level Shows information associate...

Page 738: ... a command file CLOCK frequency Sets the clock speed COPYMEM Source addr range dest addr Copies memory CYCLE on off Switches cycles and milliseconds in SofTrace component DETAILS assembly source Sets split view DUMP Displays data component content E expression O D X C B Evaluates a given expression EXECUTE fileName Executes a stimulation file FILL range value Fills a memory range with a value FILT...

Page 739: ...der SLINE linenumber Shows the desired line number SAVE range fileName offset A Saves a memory block in S Record format SETCOLORS Name Background Cursor Grid Line Text Changes the colors attributes of the Name channel from the Monitor component SREC fileName offset Loads a memory block in S Record format TUPDATE on off Switches on off time update for statistics UNFOLD Unfolds a source block UPDATE...

Page 740: ...composition of two addresses to define a range of memory addresses Syntax is shown below address address or address size where size is an ANSI format numerical constant Example 0x2F00 0x2FFF Refers to the memory range starting at 0x2F00 and ending at 0x2FFF 256 bytes Example 0x2F00 256 Refers to the memory range starting at 0x2F00 which is 256 bytes wide Both previous examples are equivalent fileN...

Page 741: ...xample Memory Example SoUrCe Module Names Correct module names are displayed in the Module component window Make sure that the module name of a command that you implement is correct If the abs is in HIWARE format some debug information is in the object file o and module names have a o extension e g fibo o In ELF format module name extensions are c cpp or dbg dbg for program sources in assembler e ...

Page 742: ...A variable value Components Debugger engine Example in a counter 8 The variable counter is now equal to 8 in A day1 monday_8U Monday_8U is defined in an Enum The variable day1 is now equal to monday_8U in A value 3 3 The variable value is now equal to 3 3 ACTIVATE ACTIVATE activates a component window as if you clicked on its title bar The window is displayed in the foreground and its title bar is...

Page 743: ...and is effective for various components as described in the next sections In the Command Component The ATTRIBUTES command allows you to set the display and state options of the Command component window The CACHESIZE command sets the cache size in lines for the Command Line window The cache size value is between 10 and 1000000 NOTE Usually this command is not specified interactively by the user How...

Page 744: ... or hides the address of a disassembled instruction ON OFF is used to switch the address on or off SMEM show memory range and SPC show PC address scroll the Assembly component to the corresponding address or range code location and select highlight the corresponding assembler lines or range of code The CODE command displays or hides the machine code of the disassembled instruction ON OFF is used t...

Page 745: ...mbly component window ATTRIBUTES CODE Select menu Assembly Display Code ATTRIBUTES SYMB Select menu Assembly Display Symbolic Example Assembly ATTRIBUTES ADR ON SYMB ON CODE ON SMEM 0x800 16 Addresses hexadecimal codes and symbolic names are displayed in the Assembly component window and assembly instructions at addresses 0x800 16 are highlighted In the Register Component The ATTRIBUTES command al...

Page 746: ...ayed if the parameter is a negative value the scroll box is not visible If the given scroll position is bigger than the maximum scroll position the current absolute position of the scroll box is set to the maximum scroll position Equivalent Operations ATTRIBUTES FORMAT Select menu Register Options ATTRIBUTES VSCROLLPOS Scroll vertically in the Register component window ATTRIBUTES HSCROLLPOS Scroll...

Page 747: ...and state options of the Source component window The SMEM show memory range command and SPC show PC address command loads the corresponding module s source text scrolls to the corresponding text range location or text address location and highlights the corresponding statements The SMOD show module command loads the corresponding module s source text If the module is not found a message is display...

Page 748: ...ON OFF Example in Source ATTRIBUTES MARKS ON Marks are visible in the Source component window In the Data Component The ATTRIBUTES command allows you to set the display and state options of the Data component window The FORMAT command selects the format for the list of variables The format is one of the following binary octal hexadecimal signed decimal unsigned decimal or symbolic Usage ATTRIBUTES...

Page 749: ... rate is 1 second but it can be modified by steps of up to 100 ms using the associated dialog box or the UPDATERATE command The UPDATERATE command sets the variables update rate see also UPDATERATE command The SPROC show procedure and SMOD show module commands display local or global variables of the corresponding procedure or module The SCOPE command selects and displays global local or user defi...

Page 750: ... 2 for word format 2 bytes or 4 for long format 4 bytes The ADR command ON or OFF displays or hides the address in front of the memory dump lines The ASC command ON or OFF displays or hides the ASCII dump at the end of the memory dump lines The ADDRESS command scrolls the corresponding memory dump window and displays the corresponding memory address lines memory WORD is not selected SPC show pc SM...

Page 751: ...dated at regular time intervals when the target is running The default update rate is 1 second but it can be modified by steps of up to 100 ms using the associated dialog box or UPDATERATE command The UPDATERATE command sets the variables update rate see also UPDATERATE command NOTE Also refer to SMEM SPC and SMOD command descriptions for more detail about these commands Equivalent Operations ATTR...

Page 752: ...n UPDATERATE rate COMPLEMENT NONE ONE Example Memory ATTRIBUTES ASC OFF ADR OFF ASCII dump and addresses are removed from the Memory component window In the Inspector Component The ATTRIBUTES command allows you to set the display and state of the Inspector component window Usage ATTRIBUTES list where list command command command COLUMNWIDTH columnname columnfield columnsize EXPAND name subname dee...

Page 753: ...ayed in the Inspector Window The following commands set the width of the function names to 100 inspect ATTRIBUTES COLUMNWIDTH SymbolTableModules Name 100 NOTE Due to the inspect redirection only the Inspector handles this command The EXPAND command computes and displays all subitems of a specified item up to a given depth An item is specified by specifying the complete path starting at one of the ...

Page 754: ...sets the position of the split line between the left and right pane The value must be between 0 and 100 A value of 0 only shows the right pane a value of 100 shows the left pane Any value between 0 and 100 makes a relative split The following command makes both panes the same size inspect ATTRIBUTES SPLIT 50 The MAXELEM command sets the number of subitems to display After the following command the...

Page 755: ...T command temporarily suspends a command file from executing until after a specified delay in milliseconds The delay is measured from the time the command file is started In the event that command files are chained one calling another the delay is measured from the time the first command file is started NOTE This command can only be executed from a command file The time specified is relative to th...

Page 756: ...e automatically adapted to the Simulator Debugger main window when it is resized Usage AUTOSIZE on off Components Debugger engine Example in AUTOSIZE off Windows autosizing is disabled BASE In the Profiler component the BASE command sets the profiler base to code total code or module each module code Usage BASE code module Components Profiler component Example in BASE code ...

Page 757: ...ions are c cpp or dbg dbg for program sources in assembler e g fibo c since all debugging information is contained in the abs file and object files are not used Adapt the following examples with your abs application file format Usage BC address address is the address of the breakpoint to be deleted This address is specified in ANSI C or standard Assembler format address can also be replaced by an ...

Page 758: ...ay asynchronous events NOTE When WHITE is given as a parameter the default background color for all component windows is set for example the register component is lightgray Usage BCKCOLOR color Where color can be one of the following BLACK GREY LIGHTGREY WHITE RED YELLOW BLUE CYAN GREEN PURPLE LIGHTRED LIGHTYELLOW LIGHTBLUE LIGHTCYAN LIGHTGREEN LIGHTPURPLE Components Debugger engine Example in BCK...

Page 759: ...ation You can point at a statement in the Assembly or Source component window right click and choose Set Breakpoint in the context menu or open the Controlpoints Configuration Window and choose Show Breakpoint then select the breakpoint and set its properties NOTE Correct module names are displayed in the Module component window Make sure that the module name of your command is correct If the abs ...

Page 760: ...specified and D is for disabled condition is an expression It matches the Condition field in the Controlpoints Configuration window for a conditional breakpoint command is any Debugger command at this level the commands G GO and STOP are not allowed It matches the Command field in the Controlpoints Configuration window for associated commands For the Command function the states are E enabled or C ...

Page 761: ...main procedure 22 where the code size of the main procedure is 66 bytes and its source size is 134 characters in BS Fibo c main 3 Sets a breakpoint at the third mark of the procedure main where main is a function of the FIBO C module in BS counter 5 cond fib1 fib2 cmd bckcolor red Sets a breakpoint at the address of the variable counter 5 where the condition is fib1 fib2 and the command is bckcolo...

Page 762: ...id directory that exists and is accessible from the PC When specifying a relative path in the CD command make sure the path is relative to the project directory NOTE When no path is specified the default directory is the project directory Using the CD command may affect any commands which refer to a file with no path specified Usage CD path path The pathname of a directory that becomes the current...

Page 763: ...is the current project directory Usage CF fileName C NL Where fileName is a file and path containing Simulator Debugger commands C specifies chaining the command file This option is meaningful in a nested command file only When the C option is given in the calling file the command interpreter quits the calling file and executes the called file i e in the calling file commands following the CF C co...

Page 764: ...cf command2 txt bckcolor white If a command2 txt file contains bckcolor red Execution in cf command1 txt executing command1 txt bckcolor green cf command2 txt executing command2 txt 1 bckcolor red 1 1 done command2 txt bckcolor white done command1 txt Example With C Option If a command1 txt file contains bckcolor green cf command2 txt C bckcolor white ...

Page 765: ...t executing command1 txt bckcolor green cf command2 txt C executing command2 txt 1 bckcolor red 1 1 done command2 txt done command1 txt CLOCK In the SoftTrace component the CLOCK command sets the clock speed Usage CLOCK frequency Where number is a decimal number which is the CPU frequency in Hertz Components SoftTrace component Example in CLOCK 4000000 ...

Page 766: ... Example in CLOSE Memory The Memory component window is closed unloaded COPYMEM The COPYMEM command is used to copy a memory range to a destination range defined by the beginning address This command works on defined memory only The source range and destination range are tested to ensure they are not overlayed Usage COPYMEM Source address range dest address Components Memory Example in copymem 0x3...

Page 767: ... CR The CR command initiates writing records of commands to an external file Writing records continues until a close record file NOCR command is executed NOTE Drag drop actions are also translated into commands in the record file NOTE If no path is specified the destination directory is the current project directory Usage CR fileName A If fileName is not specified a standard Open File dialog box i...

Page 768: ... lines of an application starting at the address given in the parameter If there is no parameter the assembler code following the last address of the previous display is displayed This command can be stopped by pressing the Esc key Equivalent Operation Right click in the Assembly component window select Address and enter the address to start disassembly in the Show PC dialog box Usage DASM address...

Page 769: ...lays assembler code in hexadecimal Components Debugger engine Example in dasm 0xf04b 00F04B LDHX 0x0450 00F04E TXS 00F04F CLRH 00F050 CLRX 00F051 STX 0x80 00F053 INC 0x80 00F055 LDX 0x80 00F057 JSR 0xF000 00F05A STX 0x82 00F05C STA 0x81 00F05E LDA 0x17 00F060 CMP 0x80 00F062 BEQ 20 abs F050 00F064 BRA 19 abs F053 00F066 DECX 00F067 DECX NOTE Depending on the target the above code may vary Disassem...

Page 770: ...acter is represented by a period This command can be stopped by pressing the Esc key Usage DB address range When address and range are omitted the first longword displayed is taken from the address following the last longword displayed by the most recent DB DW or DL command or from address 0x0000 for the first DB DW DL command of a session Components Debugger engine Examples in DB 0x8000 0x800F 80...

Page 771: ... communication protocol SHOW displays DDE protocol information in the command line component HIDE hides DDE protocol information in the command line component STATUS provides information if the DDE protocol is active on or off and if display is active Show or Hide Components Debugger engine Example in DDEPROTOCOL ON in DDEPROTOCOL SHOW in DDEPROTOCOL STATUS DDEPROTOCOL ON DISPLAYING ON The DDE pro...

Page 772: ...SKIP and if CPHX xxxx is decoded as SKIP2 Components HC08 CPU HCS08 CPU also affected Assembly and Trace components Example in DECODE_SKIP ALL in DECODE_SKIP INFO ALL decode BRN as SKIP and CPHX xxxx as SKIP2 instructions Decoding BRN as SKIP and CPHX xxxx as SKIP2 is set and information about it is displayed in the command line component DEFINE The DEFINE command creates a symbol and associates t...

Page 773: ...gn meaningful names to expressions which can be used in other commands This increases the readability of command files and avoids re evaluation of complex expressions Usage DEFINE symbol expression Components Debugger engine Example in DEFINE addr 1000 in DEFINE limit addr 15 First addr is defined as a constant equivalent to 1000 Then limit is defined and affected with the value 1000 15 A symbol d...

Page 774: ...define symbol testCase DEFINE testCase 800 Display value stored at address 800 DB testCase Redefine symbol testCase UNDEF testCase Display value of testCase DB testCase NOTE Also refer to examples given for the command UNDEF DETAILS In the Profiler component the DETAILS command opens a profiler split view in the Source or Assembly component Usage DETAILS assembly source Components Profiler compone...

Page 775: ... by pressing the Esc key NOTE Open the Command Line component before executing this command to see the dumped code Usage DL address range When range is omitted the first longword displayed is taken from the address following the last longword displayed by the most recent DB DW or DL command or from address 0x0000 for the first DB DW DL command of a session Components Debugger engine Example in DL ...

Page 776: ...d in the line followed by the number of specified hexadecimal word values When a size is specified in the range this size represents the number of words that display in the command line window This command can be stopped by pressing the Esc key NOTE Open the Command Line component before executing this command to see the dumped code Usage DW address range When address is an address constant expres...

Page 777: ...e expression is displayed in the default number base The result is displayed as a signed number in decimal format and as unsigned number in all other formats Usage E expression O D X C B where O displays the value of expression as an octal base 8 number D displays the value of expression as a decimal base 10 number X displays the value of expression as an hexadecimal base 16 number C displays the ...

Page 778: ...the Command Line window The output can be redirected to a file by using the LF command refer to LF and LOG command descriptions ELSE The ELSE keyword is associated with the LF command Usage ELSE Components Debugger engine Example if CUR_TARGET 1000 Condition set sim else set bdi Other Condition ELSEIF The ELSEIF keyword is associated with the IF command Usage ELSEIF condition where condition is sa...

Page 779: ...ommand is only valid in a command file Usage ENDFOCUS Components Debugger engine Example FOCUS Assembly ATTRIBUTES code on ENDFOCUS FOCUS Source ATTRIBUTES marks on ENDFOCUS The ATTRIBUTES command is first redirected to the Assembly component by the FOCUS Assembly command The code is displayed next to assembly instructions Then the Assembly component is released by the ENDFOCUS command and the sec...

Page 780: ...associated with the FOR command Usage ENDFOR Components Debugger engine Example for i 1 5 define multi5 5 i endfor After the ENDFOR instruction i is equal to 5 ENDIF The ENDIF keyword is associated with the IF command Usage ENDIF Components Debugger engine Example if CUR_CPU 12 DW counter else DB counter endif ...

Page 781: ...E Components Debugger engine Example while i 5 define multi5 5 i define i i 1 endwhile After the ENDWHILE instruction i is equal to 5 EXECUTE In the Stimulation component the EXECUTE command executes a file containing stimulation commands Refer to the I O Stimulation document Usage EXECUTE fileName Components Stimulation component Example in EXECUTE stimu txt ...

Page 782: ...t the FILL command fills a corresponding range of Memory component with the defined value The value must be a single byte pattern higher bytes ignored Usage FILL range value The syntax for range is LowAddress HighAddress Components Memory component Equivalent Operation The Fill Memory dialog box is available from the Memory context menu and by selecting Fill or Memory Fill menu entry Example in FI...

Page 783: ...ch a specified pattern in the source file currently loaded If the pattern has been found it is highlighted The search is forward default backward B match case sensitive MC or match whole word sensitive WW The operation starts form the currently highlighted statement or from the beginning of the file if nothing is highlighted If the item is found the Source window is scrolled to the position of the...

Page 784: ...ocedure name is given as parameter the source file where the procedure is defined is opened in the Source Component The procedure s definition is displayed and the procedure s title is highlighted Equivalent Operation You can select Source Find Procedure or open the Source context menu and select Find Procedure to open the Find Procedure dialog box Usage FINDPROC procedureName Components Source co...

Page 785: ... is not possible to visually notice that a component is FOCUSed However you can use the ACTIVATE command to activate a component window Usage FOCUS component Components Debugger engine Example FOCUS Assembly ATTRIBUTES code on ENDFOCUS FOCUS Source ATTRIBUTES marks on ENDFOCUS The ATTRIBUTES command is first redirected to the Assembly component by the FOCUS Assembly command The code is displayed n...

Page 786: ...idden program text reappears All text is folded once or completely until there are no more folded parts Usage FOLD Where means fold completely otherwise fold only one level Components Source component Example in FOLD FONT FONT sets the font type size and color Equivalent Operation The Font dialog box is available by selecting the Component Fonts menu entry Usage FONT FontName size color Components...

Page 787: ...re executing the FOR command with a DEFINE command Assignment happens immediately before comparing the iteration value with the upper bound The variable is only a copy of the internal iteration value therefore modifications on the variable don t have an impact on the number of iterations This command can be stopped by pressing the Esc key Usage FOR variable range step Where variable is the name of...

Page 788: ... Debugger engine Example fprintf test txt s 2d The value of the counter is counter The content of the file test txt is The value of the counter is 25 FRAMES In the SoftTrace component the FRAMES command sets the maximum number of frame records Usage FRAMES number Where number is a decimal number which is the maximum number of recorded frames This number must not exceed 1000000 Components SoftTrace...

Page 789: ...he address in the program counter Alias GO Components Debugger engine Example G 0x8000 Program execution is started at 0x8000 RUNNING is displayed in the status bar The application runs until a breakpoint is reached or you stop the execution GO The GO command starts code execution in the emulated system at the current address in the program counter or at the specified address You can therefore spe...

Page 790: ...ution GOTO The GOTO command diverts execution of the command file to the command line that follows the Label The Label must be defined in the current command file The GOTO command fails if the Label is not found A label can only be followed on the same line by a comment Usage GOTO Label Components Debugger engine Example GOTO MyLabel MyLabel comments When the instruction GOTO MyLabel is reached th...

Page 791: ...true and the label is not found Usage GOTOIF condition Label where condition is same as defined in C language Components Debugger engine Example DEFINE jump 0 DEFINE jump jump 1 GOTOIF jump 10 MyLabel T MyLabel comments The program pointer jumps to MyLabel only if jump equals 10 Otherwise the next instruction T Trace command is executed GRAPHICS In the Profiler component GRAPHICS switches the perc...

Page 792: ...I WAVE Engine VER LF NOLF CR NOCR IF The conditional commands IF ELSEIF ELSE and ENDIF allow you to execute different sections depending on the result of the corresponding condition The conditional command may be nested Conditions of the IF and ELSEIF commands respectively guard all commands up to the next ELSEIF ELSE or ENDIF command on the same nesting level The ELSE command guards all commands ...

Page 793: ...luated and depending on the test result the T Trace instruction is executed or the ELSEIF jump 100 test is evaluated INSPECTOROUTPUT The Inspector dumps the content of the specified item and all computed subitems to the command window Uncomputed subitems are not printed To compute all information the ATTRIBUTES EXPAND command is used Usage INSPECTOROUTPUT name subname The name specifies any of the...

Page 794: ... Swap Swap Name Value Address Init IO_Reg_1 0x0 0x1000 0x0 IO_Reg_2 0x0 0x1001 0x0 INSPECTORUPDATE The Inspector displays various information Some types of information are automatically updated To make sure that displayed values correspond to the current situation the INSPECTORUPDATE command updates all information Usage INSPECTORUPDATE Components Inspector component Example in INSPECTORUPDATE ...

Page 795: ... path is specified in the file name this path must be a valid path When a relative path is specified ensure that the path is relative to the project directory Usage LF fileName A fileName is a DOS filename that identifies the file or device where the log is written The command interpreter does not assume a filename extension A opens the file in append mode Logged lines are appended at the end of a...

Page 796: ...CODEONLY and SYMBOLSONLY loads only the code or symbols NOPROGRESSBAR loads the application without progress bar NOBPT loads the application without loading breakpoints file with BPT extension NOXPR loads the application without playing Expression file with XPR extension NOPRELOADCMD loads the application without playing PRELOAD file NOPOSTLOADCMD loads the application without playing POSTLOAD fil...

Page 797: ...application is loaded NOTE If no path is specified the destination directory is the current project directory LOADCODE This command loads code into the target system This command can be used if no debugging is needed If no target is installed the following error message is displayed Error no target is installed If no target is connected the following error message is displayed Error no target is c...

Page 798: ...le LOADSYMBOLS FIBO ABS Debugging information of the FIBO ABS application is loaded If no path is specified the destination directory is the current project directory LOG The LOG command enables or disables logging of information in the Command Line component window and to logfile when it as been opened with an LF command If LOG is not used all types are ON by default i e all information is logged...

Page 799: ...r engine Example LOG ERRORS OFF CMDLINE on Error messages are not recorded in the Log File Commands entered in the Command Line component window are recorded More About Logging of IF FOR WHILE and REPEAT When commands executed from a command file are logged all executed commands that are in a IF block are logged That is a command file executed with the CF or CALL command without the NL option and ...

Page 800: ...DIF When commands executed from a command file are logged all executed commands that are in the FOR loop are logged the number of times they have been executed That is a command file executed with the CF or CALL command without the NL option and with the CMDFILE flag of the LOG command set to TRUE Example 2 When executing the following file define i 1 FOR i 1 3 ls ENDFOR The following log file is ...

Page 801: ...DFILE flag of the LOG command set to TRUE Example 3 When executing the following file define i 1 WHILE i 3 define i i 1 ls ENDWHILE The following log file is generated define i 1 WHILE i 3 define i i 1 ls i 0x2 2 ENDWHILE define i i 1 ls i 0x3 3 ENDWHILE When commands executed from a command file are logged all executed commands that are in the REPEAT loop are logged the number of times they have ...

Page 802: ... Manual Example 4 When executing the following file define i 1 REPEAT define i i 1 ls UNTIL i 4 The following log file is generated repeat until condition define i 1 REPEAT define i i 1 ls i 0x2 2 UNTIL i 4 define i i 1 ls i 0x3 3 UNTIL i 4 define i i 1 ls i 0x4 4 UNTIL i 4 ...

Page 803: ...the LS command are split in two parts Applications Symbols and User Symbols Usage LS symbol C S Where symbol is a restricted regular expression that specifies the symbol whose values are to be listed specifies to list all symbols C specifies to list symbols in canonical format which consists of a DEFINE command for each symbol S specifies to list symbol table statistics following the list of symbo...

Page 804: ...EM The MEM command displays a representation of the current system memory map and lower and upper boundaries of the internal module that contains the MCU registers Usage MEM Components Debugger engine Example in mem Type Addresses Comment IO 0 3F PRU or TOP TOP board resource or the PRU NONE 40 4F NONE RAM 50 64F RAM NONE 650 7FF NONE EEPROM 800 A7F EEPROM NONE A80 3DFF NONE ROM 3E00 FDFF ROM IO F...

Page 805: ... the bytes in the list list is a list of byte values to be stored in the block of memory Components Debugger engine Example in MS 0x1000 0x100F 0xFF The memory range between addresses 0x1000 and 0x100F is filled with the 0xFF value NB Description The NB command changes or displays the default number base for the constant values in expressions The initial default number base is 10 decimal and can b...

Page 806: ...al octal or binary constants using the Assembler prefixes shown in Table 34 7 Table Example 2F00 Hexadecimal Constant 43 Octal Constant 10011 Binary Constant When the default number base is 16 constants starting with a letter A B C D E or F must be prefixed either by 0x or by as shown in Table 34 8 Otherwise the command line interpreter cannot detect if you are specifying a number or a symbol Tabl...

Page 807: ...le The record file is opened with the CR command Usage NOCR Components Debugger engine Example in NOCR The current record file is closed NOLF The NOLF command closes the current Log File The log file is opened with the LF command Usage NOLF Table 34 8 Base is 16 Constants Starting with Letter A B C D E or F Notation Meaning 5AFD Hexadecimal constant 5AFD AFD Hexadecimal constant AFD ...

Page 808: ... is the Y axis of the upper left corner of the window component width is the width of the window component height the height of the window component When I is specified the component window displays icons when MAX is specified the component window is maximized Component names are Assembly Command Coverage Data Inspect IO_Led Led Memory Module Phone Procedure Profiler Recorder Register SoftTrace So...

Page 809: ... to by the program counter This command traces through subroutine calls software interrupts and operations involving the following instructions two are target specific Branch to SubRoutine BSR Long Branch to Subroutine LBSR Jump to Subroutine JSR Software Interrupt SWI Repeat Multiply and Accumulate RMAC For example if the current instruction is a BSR instruction the subroutine is executed and exe...

Page 810: ...struction pointed to by the current value of the program counter Components Debugger engine Example in p A 0x0 HX 0x450 SR 0x70 PC 0xF04E SP 0xFF 00F04E 94 TXS STEPPED Contents of registers are displayed and the current instruction is disassembled PAUSETEST Displays a modal message box shown in Figure 34 1 for testing purposes Figure 34 1 Test Pause Message Box Usage PAUSETEST Components Debugger ...

Page 811: ...F The value of the counter is d counter The output is The value of the counter is 2 PTRARRAY The PTRARRAY command allows the user to specify a pointer to display as an array Usage PTRARRY on off nb Where on displays pointers as arrays off displays pointers as usual pointer nb is the number of elements to display in the array when unfolding a pointer displayed as array Components Data component Exa...

Page 812: ... to be displayed Registers to be displayed are separated by a space When RD CPU is specified all CPU registers are displayed If no CPU is loaded No CPU loaded is displayed as an error message When is specified the RD command lists the content of the register file that is currently loaded If no register file is loaded following error message is displayed No register file loaded When there is no par...

Page 813: ... component Example in RECORD on REPEAT The REPEAT command allows you to execute a sequence of commands until a specified condition is true The REPEAT command may be nested Press the Esc key to stop this command Usage REPEAT Components Debugger engine Example DEFINE var 0 REPEAT DEFINE var var 1 UNTIL var 2 The REPEAT UNTIL loop is identical to the ANSI C loop The operation DEFINE var var 1 is done...

Page 814: ... sure that the RESET command is redirected to the correct component Targets also have their own RESET command and if RESET is not redirected the target is reset Usage RESET Components Profiler and Coverage Example in Profiler RESET RESTART Resets execution to the first line of the current application and executes the application from this point Usage RESTART Components Engine component Example in ...

Page 815: ...t calls a second command file cmd2 txt It is so necessary to insert the RETURN instruction to return to the caller file Then the T Trace instruction is executed RS The RS command assigns new values to specified registers The RS mnemonic is followed by register name and new value s An equal sign may be used to separate the register name from the value to be assigned to the register otherwise they m...

Page 816: ...a register in the register file value is an integer constant expression in ANSI format representation Components Debugger engine Example in rs a 0xff hx 0x7fff S The S command stops execution of the emulation processor Use the Go G command to start the emulator NOTE The S command ends as soon as the PC is changed Usage S Alias STOP Components Debugger engine Example in s STOPPING HALTED Current ap...

Page 817: ...gine Example in SAVE 0x1000 0x2000 DUMP SX A The memory range 0x1000 0x2000 is appended to the DUMP SX file SAVEBP The SAVEBP command saves all breakpoints of the currently loaded ABS file into the matching breakpoints file Also the matching file has the name of the loaded ABS file but its extension is BPT For example the Fibo ABS file has a breakpoint file called FIBO BPT This file is generated i...

Page 818: ...xample Content of the FIBO BPT file savebp on BS fibo c Fibonacci 19 P E cond fibo 10 E cdSz 47 srSz 0 BS fibo c Fibonacci 31 P E cdSz 47 srSz 0 BS fibo c main 12 P E cdSz 42 srSz 0 BS fibo c main 21 P E cond fiboCount 5 E cmd Assembly spc 0x800 E cdSz 42 srSz 0 SET Sets a new current target for the debugger by loading the targetName component Usage SET targetName where targetName is name without ...

Page 819: ...e format is 0x00bbggrr Line is the new color for the channel lines the format is 0x00bbggrr Text is the new color for the channel text the format is 0x00bbggrr Components Monitor component Example in SETCOLORS Leds Port_Register bit 0 0x00123456 0x00234567 0x00345678 0x00456789 0x00567891 This changes the color attributes from the channel Leds Port_Register bit 0 to the new values SLAY The SLAY co...

Page 820: ...o directory SLINE With the SLINE command a line of the source file is made visible If the line is not currently visible the source scrolls so that it appears on the first line If the line is currently in a folded part it is unfolded so that it becomes visible NOTE The given line number must be between 1 and number of lines in source file or else an error message is displayed Usage SLINE line numbe...

Page 821: ...nts Source Assembly and Memory components Example in Memory SMEM 0x8000 8 The Memory component window is scrolled and specified memory addresses are highlighted SMOD In the Source component the SMOD command loads displays the corresponding module s source text If the module is not found a message is displayed in Command Line window In the Data component the SMOD command loads the corresponding mod...

Page 822: ...d does not take part of the current application loaded If no application is loaded Components Data Memory and source components Example in Data 1 SMOD fibo c Global variables found in the fibo c module are displayed in the Data 1 component window SPC In the Source component the SPC command loads the corresponding module s source text scrolls to the corresponding text location the code address and ...

Page 823: ...responding module s source text scrolls to the corresponding procedure and highlights the statement of this procedure that is in the procedure chain level 0 is the current procedure level level 1 is the caller stack level and so on NOTE This command is relevant when C source debugging NOTE When a procedure of a level greater than 0 is given as parameter to the SPROC command the statement correspon...

Page 824: ... is a signed value added to the load addresses in the file when loading the file contents Components Debugger engine Example in SREC DUMP SX The DUMP SX file is loaded into memory STEPINTO The STEPINTO command single steps through instructions in the program and enters each function call that is encountered NOTE This command works while the application is paused in break mode program is waiting fo...

Page 825: ...ement following the procedure call All of the code is executed between the current and final execution points Using this command you can quickly finish executing the current function after determining that a bug is not present in the function NOTE This command works while the application is paused in break mode program is waiting for user input after completing a debugging command Usage STEPOUT Co...

Page 826: ... statement in the current procedure regardless of whether the current statement is a call to another procedure NOTE This command works while the application is paused in break mode program is waiting for user input after completing a debugging command Usage STEPOVER Components Debugger engine Example in STEPOVER STEP OVER STARTED RUNNING STOPPED STEPPED OVER or STOPPED in the status line indicates...

Page 827: ...re instructions at a specified address or at the current address the address in the program counter The T command traces into subroutine calls and software interrupts For example if the current instruction is a Branch to Subroutine instruction BSR the BSR is traced and execution stops at the first instruction of the subroutine After executing the last or only instruction the T command displays the...

Page 828: ...ount is an integer constant expression in the decimal integral interval 1 65535 that specifies the number of instructions to be traced If count is omitted one instruction is traced Components Debugger engine Example in T 0xF030 TRACED A 0x0 HX 0x7F02 SR 0x62 PC 0xF032 SP 0x44D 00F032 B787 STA 0x87 Contents of registers are displayed and current instruction is disassembled TESTBOX Displays a modal ...

Page 829: ... Profiler and Coverage components Example in TUPDATE on UNDEF The UNDEF command removes a symbol definition from the symbol table This command does not undefine the symbols defined in the loaded application Program variables whose names were redefined using the UNDEF command are visible again Undefining an undefined symbol is not considered an error Usage UNDEF symbol If is specified all symbols d...

Page 830: ...ommand again In this case the previous value is replaced and lost It is not put on a stack Then when UNDEF is applied to the symbol it no longer exists even if the value of the symbol has been replaced several times in DEFINE apple 0 in LS apple 0x0 0 apple is equal to 0 in DEFINE apple apple 1 in LS apple 0x1 1 apple is equal to 1 in DEFINE apple apple 1 in LS apple 0x2 2 apple is equal to 2 in U...

Page 831: ...one user symbol counter counter 0x1 1 Application Symbols symbols of the loaded application fiboCount 0x800 2048 counter 0x802 2050 _startupData 0x84D 2125 Fibonacci 0x867 2151 main 0x896 2198 Init 0x810 2064 _Startup 0x83D 2109 in undef counter in LS User Symbols there is no user symbol Application Symbols symbols of the loaded application fiboCount 0x800 2048 counter 0x802 2050 _startupData 0x84...

Page 832: ...vel All text is unfolded once or completely until no more folded parts are found Usage UNFOLD Where means unfolding completely otherwise unfolding only one level Components Source component Example in UNFOLD UNTIL The UNTIL keyword is associated with the REPEAT command Usage UNTIL condition Where condition is defined as in C language definition Components Debugger engine Example repeat open assemb...

Page 833: ...RATE rate where rate is a constant number matching a quantity of time in tenths of a second between 1 and 600 tenth of second 0 1 to 60 seconds Components Data and Memory component Example in Memory updaterate 30 This commands sets the Memory component updaterate to 3 seconds VER The VER command displays the version number of the Debugger engine and components currently loaded in the Command line ...

Page 834: ...specified execution of the command file is halted for the specified time When only s is specified execution of the command file is halted until the target is halted If the target is already halted command file execution is not halted When time and s are specified If the target is running command file execution is halted for the specified time only if the target is not halted If the target is halte...

Page 835: ...ssary to fill the memory block When the range is not an integer a multiple of the length of the list and the last copy of the list is truncated accordingly This command is identical to the memory set MS command Usage WB range list range is an address range constant that defines the block of memory to be set to the values of the bytes in the list list is a list of byte values to be stored in the bl...

Page 836: ...ump jump 1 ENDWHILE T While jump 100 the jump variable is incremented by the instruction DEFINE jump jump 1 Then the loop ends and the T Trace instruction is executed WL The WL command sets a specified block of memory to a specified list of longword values When the range is wider than the list of longword values the list of longword values is repeated as many times as necessary to fill the memory ...

Page 837: ...rea 0x2000 to 0x2007 with the longword value 0x0FFFFF0F WW The WW command sets a specified block of memory to a specified list of word values When the range is wider than the list of word values the list of word values is repeated as many time as necessary to fill the memory block When the range is not an integer or a multiple of length of the list the last copy of the list is truncated accordingl...

Page 838: ...t command is used to return to the nesting level indicated by the given identifier NOTE Addresses are not needed to zoom out Simply type ZOOM out NOTE This command is relevant when C source debugging Usage ZOOM address in out Where address is the address of the structure or pointer variable to zoom in or zoom out respectively Components Data component Example in ZOOM 0x1FE0 in The variable structu...

Page 839: ...l its functions and help you understand how to use the environment This book the Debugger Environment Variables defines the HC08 and HC S 08 environment variables both those environment variables used by the debugger engine and those specific to individual debugger connections This book is divided into the following chapters Debugger Engine Environment Variables Connection Specific Environment Var...

Page 840: ...Book VIII Contents 840 Microcontrollers Debugger Manual ...

Page 841: ...information about other tools see their respective manuals Topics include Debugger Environment Local Configuration File usually project ini ABSPATH Absolute Path DEFAULTDIR Default Current Directory ENVIRONMENT Environment File Specification GENPATH include File Path LIBRARYPATH include File Path OBJPATH Object File Path TMP Temporary directory USELIBPATH Using LIBPATH Environment Variable Search ...

Page 842: ...y the value of the system environment variable ENVIRONMENT NOTE The default directory mentioned above can be set by using the system environment variable DEFAULTDIR Default Current Directory When looking for an environment variable all programs first search the system environment then the DEFAULT ENV file and finally the global environment file given by ENVIRONMENT If no definition can be found a ...

Page 843: ...ject file also changes the current directory if the other project file is in a different directory Note that browsing for a C file does not change the current directory To overwrite this behavior the environment variable DEFAULTDIR Default Current Directory may be used Global Initialization File MCUTOOLS INI PC Only All tools may store global data in MCUTOOLS INI The tool first searches for this f...

Page 844: ...directory changes the default env file is reloaded Always when a configuration file is loaded or stored options in the environment variable COMPOPTIONS are reloaded and added to the project options Beware of this behavior when a different default env file exists in different directories which contain incompatible options in COMPOPTIONS When a project is loaded using the first default env its COMPO...

Page 845: ...get Bdi Window n Specifies coordinates of the windows that must be open when the Debugger is started The syntax for a window is Window n component XPos YPos width height where n is the index of the window This index increments for each window and determines the sequence in which windows open In the case of overlapping windows this index determines which windows appear on top of other windows Value...

Page 846: ...r overwrites any Window n definition describing the default windows layout It is possible to load a previously saved project from a file by inserting the following line in your PROJECT INI file Project ProjectName where ProjectName is the name of the file describing the project to be loaded for example Project Proj1 hwc NOTE The project path can be specified if the project is not in the project di...

Page 847: ...lowing syntax Hideheadlines 0 1 If 1 is specified the heading lines are hidden otherwise they are shown The border can be reduced with the following syntax Smallborder 0 1 If 1 is specified borders are thin otherwise they are normal The environment variable BPTFILE authorizes the creation of breakpoint files they may be enabled or disabled All breakpoints of the currently loaded abs file are saved...

Page 848: ...Paths Most environment variables contain path lists indicating where to search for files A path list is a list of directory names separated by semicolons following the syntax below PathList DirSpec DirSpec DirSpec DirectoryName Example GENPATH C INSTALL LIB D PROJECTS TESTS usr local hiwave lib home me my_project If a directory name is preceded by an asterisk the programs recursively search the di...

Page 849: ...es might not be put where you expect them Line Continuation It is possible to specify an environment variable in an environment file default env hidefaults over multiple lines by using the line continuation character Example OPTIONS W2 Wpd This is the same as OPTIONS W2 Wpd Be careful when using the line continuation character with paths For example GENPATH TEXTFILE txt Results in GENPATH TEXTFILE...

Page 850: ... of other tools that are using this variable Synonym Fore some environment variables a synonym also exists The synonyms may be used for older releases of the Debugger and will be removed in the future A synonym has lower precedence than the environment variable Syntax Specifies the syntax of the option in EBNF format Arguments Describes and lists optional and required arguments for the variable De...

Page 851: ...bin DEFAULTDIR Default Current Directory Tools Compiler Assembler Linker Decoder Librarian Maker Burner Debugger Synonym None Syntax DEFAULTDIR directory Arguments directory Directory specified as default current directory Default None Description With this environment variable the default directory for all tools may be specified All tools indicated above take the specified directory as their curr...

Page 852: ...T file Arguments file file name with path specification without spaces Default None Description This variable has to be specified at the system level Normally the application looks in the The Current Directory for an environment file named default env Using ENVIRONMENT for example set in the autoexec bat for DOS a different file name may be specified NOTE This is an environment variable at the sys...

Page 853: ... included with double quotes the Debugger searches in the current directory then in the directories given by GENPATH and finally in the directories given by LIBRARYPATH include File Path NOTE If a directory specification in this environment variable starts with an asterisk the whole directory tree is searched recursively All subdirectories and their subdirectories are searched Within one level in ...

Page 854: ...hes in the current directory then in the directories given by GENPATH include File Path and finally in directories given by LIBRARYPATH include File Path NOTE If a directory specification in the environment variables starts with an asterisk the whole directory tree is searched recursively All subdirectories and their subdirectories are searched Within one level in the tree search order is random E...

Page 855: ...Default Current directory Arguments path Path without spaces Description If a tool looks for an object file for example the Linker then it first checks for an object file specified by this environment variable then in GENPATH include File Path and finally in HIPATH Example OBJPATH sources obj TMP Temporary directory Tools Compiler Assembler Linker Librarian Debugger Synonym None Syntax TMP directo...

Page 856: ...riable is empty or does not exist the current directory is used Check this variable if you get an error message Cannot create temporary file NOTE This is an environment variable at the system level global environment variable It cannot be specified in a default environment file DEFAULT ENV hidefaults Example TMP C TEMP See also The Current Directory USELIBPATH Using LIBPATH Environment Variable To...

Page 857: ... See also Environment variable LIBRARYPATH include File Path Search Order for Source Files This section describes the search order from first to last used by the debugger In the Debugger for C Source Files c cpp 1 Path coded in the absolute file abs 2 Project file directory where the pjt or ini file is located 3 Paths defined in the GENPATH environment variable from left to right 4 Abs File direct...

Page 858: ...tion files and examples These files and file extensions are listed in the following table Table 35 2 Debugger File Extensions File Extension Description ABS Absolute framework application file e g fibo abs ASM Assembler specific file e g macrodem asm BBL Burner Batch Language file e g fibo bbl BPT Debugger Breakpoint file e g fibo bpt C CPP C and C source files CHM Compiled HTML help file CMD Comm...

Page 859: ...ogram for example LINKER EXE FPP Flash Programming Parameters files CPU specific for example mcu0e36 fpp HLP Application Help file for example Hiwave hlp IO I O simulation file for example sample11 io ISU Uninstall Application File PJT Debugger configuration Settings File for example Project pjt INI Debugger configuration Settings File for example Project ini LST Assembler Listing File for example...

Page 860: ... for example mcu081e reg SIM CPU Awareness file for example st7 sim SX S Record file for example fibo sx TXT General Text Information file TGT Target File for the Debugger for example xtend g3 tgt WND Debugger Window Component File for example recorder wnd XPR Debugger User Expression file for example Fibo xpr Table 35 2 Debugger File Extensions continued File Extension Description ...

Page 861: ...s Some of the environment variables that can be used in the debugging process are imported with the connection software and are specific to that connection Connection Specific Environment Variables There are currently no connection environment variables that can be manually edited ...

Page 862: ...Connection Specific Environment Variables Connection Specific Environment Variables 862 Microcontrollers Debugger Manual ...

Page 863: ...mation to help you become more familiar with the Debugger to use all its functions and help you understand how to use the environment This book is divided into the following chapters Book 9 Debugger Legacy Legacy PEDebug Target Interface Legacy Target Interfaces Removed HC S 08 Full Chip Simulator Components No Longer Supported ...

Page 864: ...Book IX Contents 864 Microcontrollers Debugger Manual ...

Page 865: ...08 Interface Connection P E Multilink Cyclone Pro Connection ICS P E Multilink Cyclone Pro Connection For the HCS08 CPU the P E following connections have been created Full Chip Simulation Connection P E Multilink Cyclone Pro Connection Refer to specific manual chapter to get further details about each connection Revert to Full Chip Simulator Feature Removed These new connections NO LONGER revert ...

Page 866: ...atured a new menu option in the Project menu The Change MCU Connection option opens the Device and Connection dialog box where you can change the currently selected project connection Automatic Upgrade Path for Projects Previously Created The debugger automatically upgrades the previous connection to the current latest connection set in a previous project Find further details in the Technical Note...

Page 867: ...ollowing hardware Target Interfaces have been discontinued For HC08 CPU Hitex Emulator Target Interface MON08 Target Interface originally HIWARE MON08 Target Interface Trace32 Target Interface Lauterbach Emulator MMDS support MMEVS support For HCS08 CPU BDM_HCS08 Target Interface ...

Page 868: ...Legacy Target Interfaces Removed 868 Microcontrollers Debugger Manual ...

Page 869: ...OPEN command in the Command window However these components are only operational with the Legacy Freescale HC S 08 Instruction Set Simulator formerly Sim tgt target interface Therefore HC08 and HCS08 Full Chip Simulators do not support the following debugger components which remain selectable and available for backward compatibility Adc_dac Io_led Io_ports IT_keyboard Lcd Led MicroC Monitor Phone ...

Page 870: ...HC S 08 Full Chip Simulator Components No Longer Supported List of HC S 08 FCS Components No Longer Supported 870 Microcontrollers Debugger Manual Testterm Timer Wagon Winlift ...

Page 871: ...7 Assembly Menu entries 65 Assembly Step menu entry 42 Assembly Step Out menu entry 43 Assembly Step Over menu entry 43 AT command 755 Attributes 147 ATTRIBUTES command 743 Auto configure 581 Auto menu entry 113 Auto on Access 582 Auto on Load 582 Auto select according to MCUID 707 Automatic menu entry 84 96 Automatic mode 82 Automatically analyze FIFO content 532 AUTOSIZE command 756 B B icon 506...

Page 872: ...nd 762 CF command 763 Clear 536 Clear menu entry 131 CLOCK command 765 Clock Frequency menu entry 578 Clock speed Time tag 425 Clone Attributes menu entry 144 CLOSE command 766 Close I Os menu entry 578 cmd files 71 Cmd Option 31 CMDFILE command 767 Code coverage 519 Code profiling 519 CodeWarrior IDE and RS08 Open Source BDM Connection 561 CodeWarrior IDE Integration 215 Collecting data 426 Color...

Page 873: ... Component Files 53 Component menu 47 48 Components 403 COMPOPTIONS variable 844 Configuration menu entry 35 Configure menu entry 578 Connection HC08FCS List Menu 254 Connection Components 62 Connection menu 43 44 Control Point Definition 157 Dialogs 157 Control Points menu entry 43 Controlpoints Configuration window 508 509 513 Copy menu entry 120 143 COPYMEM command 766 CopyMem menu entry 94 Cop...

Page 874: ...20 DASM command 768 Data Component 79 202 203 205 Value 537 Viewing trace 426 Window 509 Data menu entries 82 DB command 770 DBG 533 DBG FIFO Data 537 DBGCA 512 513 518 DBGCB 512 513 518 DBGFH 532 537 DBGFL 532 537 DBGT 519 DDE HI WAVE server 217 DDEPROTOCOL command 771 Debugger DDE Capability deprecated 217 MON08 Limitations 379 Starting 28 Tips 379 Debugger Commands A 742 ACTIVATE 742 ADDXPR 743...

Page 875: ...T 813 RESET 814 RESTART 814 RETURN 815 RS 815 S 816 SAVE 817 SAVEBP 817 SET 818 SETCOLORS 819 SLAY 819 SLINE 820 SMEM 821 SMOD 821 SPC 822 SPROC 823 SREC 824 STEPINTO 824 STEPOUT 825 STEPOVER 826 STOP 827 T 827 TESTBOX 828 TUPDATE 829 UNDEF 829 UNFOLD 832 UNTIL 832 UPDATERATE 833 VER 833 WAIT 834 WB 835 WHILE 836 WL 836 WW 837 ZOOM 838 Debugger Start Option C 31 Cmd 31 ENVpath 31 Instance currentT...

Page 876: ...menu entries 96 Display Symbolic menu entry 65 Display Version 151 Displayfont 153 DL command 775 Do not halt when fifo is full 528 Drag Out 607 Dragging 54 Driving True Time Simulator and Real Time Debugger through DDE 217 Drop Into 607 Dump 536 DUMP command 776 Dump menu entry 131 DW command 776 Dynamic trigger type 514 E e Character trigger display 512 E command 777 EBNF command syntax 731 Edit...

Page 877: ... Device Option 255 External Interrupt Module 268 High Resolution PWM Module 262 Input Output I O Ports Module 265 Keyboard Interrupt Module 269 Modules Peripherals Options 257 Multi Master Inter Integrated Circuit Module Option 272 Programmable Timer Interrupt Module 291 Select Device Option 255 Serial Communications Interface Module 292 Serial Peripheral Interface Module Option 300 Slave LIN Inte...

Page 878: ... changing 207 209 FPP directory 706 FPP file loading 706 FPRINTF command 788 Frame 533 Frames 130 FRAMES command 788 Frozen menu entry 85 96 Frozen mode 82 FSICEBASE Assigning an IP address 412 Bus Analyzer Configuration dialog box 422 Bus State Analyzer BSA 421 Communication dialog box 408 Communication through Ethernet Port 407 Communication through USB Port 408 Components 403 Emulation system r...

Page 879: ...tput Ports user commands 445 Inter Integrated Circuit module 440 Inter Integrated Circuit module commands 442 IRQ commands 449 Keyboard Interrupt commands 451 Keyboard Interrupt module 450 Modulo Timer Interrupt module 452 Peripheral Modules commands 435 SCI commands 455 Serial Communications Interface module 453 Serial Peripheral Interface module 457 Set Connection Dialog Box 431 SPI commands 458...

Page 880: ... Hexadecimal format 207 Hide Headline menu entry 38 Hide Tile menu entry 38 hidefaults 842 851 852 856 HIENVIRONMENT 852 High Display Value 147 148 150 154 HIPATH 853 855 Horiz Text Alignment 153 Horizontal Size menu entry 144 How To information 199 HWC file 35 hwl 846 hwp 846 I ICS MON08 Added Connection Menu Options 358 Advanced Options Dialog Box 358 Advanced Programming Debug Options 358 Cable...

Page 881: ...RT HCS08 503 Indicator color 147 150 Indicatorlength 147 INI 35 init cmd 201 INPUT command 267 271 INPUTS Command 267 269 308 INPUTS command 271 Inspector Component 133 INSPECTOROUTPUTcommand 793 INSPECTORUPDATE command 794 Instance currentTargetName Option 30 Instruction at Address A and value on data bus match 525 Instruction at Address A and value on data bus mismatch 525 Instruction at Address...

Page 882: ...13 Markpoints 508 Definition 157 Deleting 67 Showing 67 Markpoints tab 509 513 Markpoints setting 67 Marks 147 Marks menu entry 121 Match value 522 525 MCU Communication 398 MCU Configuration option 572 MCU configuration option 500 MCUID 706 MCUTOOLS INI 843 MCUTOOLS INI file 199 MEM command 804 Memory Dump 90 Word 90 Memory access at Address A 521 at Address A and value on data bus match 522 at A...

Page 883: ...Manager Window Advanced Settings Tab 368 Connect to Target Tab 366 Connection Manager Window Interface Details Area 371 Connection Manager Window STATUS Area 372 Connection Menu Added Options 375 Connection Menu Advanced Programming Debug Option 376 Connection Menu View Register Files Option 378 Connection Procedure 365 Cycle Power Button 370 Debugging Limitations 379 Device Class Description 380 ...

Page 884: ...using Stationery Wizard 670 Flash 674 MCU Configuration 673 MCU Configuration dialog box 676 Set Connection dialog box 671 Set Derivative dialog box 672 Setup 673 Target Connection dialog box 672 675 Technical considerations 669 Trigger Module Settings 674 Wizard connection selection 670 Paste menu entry 142 144 PATH 848 Pause button 110 PAUSETEST command 810 PEDebug 503 Percentage of executed cod...

Page 885: ...ce connection 335 REPEAT command 799 813 Replay menu entry 110 Requirements 402 RESET command 814 Reset command file 47 Reset Connection 44 Reset Mem menu entry 578 Reset menu entry 44 74 107 578 Reset RAM menu entry 578 Reset Statistic menu entry 578 Reset to Normal Mode option 481 reset cmd file 47 RESTART command 814 Restart menu entry 42 RETURN command 815 Right menu entry 144 ROM 379 RS comma...

Page 886: ...Memory map 416 Select All menu entry 142 Select Core menu entry 578 Select Derivative 673 681 Select derivative 493 Selected menu entry 83 Send to Back menu entry 144 Send to Front menu entry 144 Serial Monitor 524 Set Breakpoint menu entry 67 119 SET command 818 Set Connection Dialog Box Full Chip Simulation Option 253 Set Connection menu entry 48 Set DBGCA 512 Set DBGCB 512 Set Derivative menu e...

Page 887: ...5 SofTec HCS08 About 500 Bus Trace 501 CodeWarrior IDE and SofTec HCS08 connection 497 Communication Settings dialog box 501 Connection menu options 500 First Steps from within existing project 499 First Steps using Stationery Wizard 498 MCU Configuration 500 MCU Configuration dialog box 500 501 Set Connection dialog box 499 Technical considerations 497 Trigger Module Settings 501 Wizard connectio...

Page 888: ...d adapter as additional component 404 Target Option 30 Tasks Viewing state of 185 Term 421 Terminal Component 214 TESTBOX command 828 Text Mode 153 Textcolor 153 Textual 534 Textual display 534 Textual menu entry 131 Tile menu entry 51 Time tag 425 Timer Update menu entry 74 107 TMP 855 Toolbar Customizing 38 Main window 33 Toolbar menu entry 38 ToolTips Activation 116 ToolTips format 116 ToolTips...

Page 889: ...try 82 User s Manual 398 V Variable Address 208 Displaying Format 79 Displaying Global Variables 206 Displaying Local Variables 205 Editing Value 208 Local and Global 79 Mode 82 Scope 79 Showing Location 209 Type 79 Value 207 Variable modification 208 Vector mirroring setup 492 VER command 833 Version number finding 51 Vertical Size menu entry 144 Vertical Text Alignment 153 View menu 38 View Regi...

Page 890: ...indow menu 50 51 Window Menu entries 51 Windows 842 Command File 45 WinEdit 842 843 WL command 836 WND files 61 wnd files 53 Word menu entry 94 Word size menu entry 94 Word Size submenu entries 94 WorkDir 200 WorkingDirectory 200 Write 529 Write access 510 Write Access trigger type 514 WRITEACCESS markpoint type 513 WW command 837 X X Position 146 xpr file 81 XTAL Command 261 Y Y Position 146 Z ZO...

Page 891: ...891 Microcontrollers Debugger Manual ...

Page 892: ...892 Microcontrollers Debugger Manual ...

Reviews: