Freescale Semiconductor Microcontrollers Manual

Freescale semiconductor microcontrollers debugger manual
Table of Contents

Advertisement

Quick Links

Microcontrollers
Debugger Manual
Revised: 22 October 2007

Advertisement

Table of Contents
loading

Summary of Contents for Freescale Semiconductor Microcontrollers

  • Page 1 Microcontrollers Debugger Manual Revised: 22 October 2007...
  • Page 2: How To Contact Us

    Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any partic- ular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental dam- ages.
  • Page 3: Table Of Contents

    Component Main Menu ........52 Microcontrollers Debugger Manual...
  • Page 4 Breakpoints ........... .158 Microcontrollers Debugger Manual...
  • Page 5 Introduction........... . 185 Microcontrollers Debugger Manual...
  • Page 6 Modify Content of Memory Address ....... .212 How to Consult Assembler Instructions Generated by a Source Statement . . .212 Microcontrollers Debugger Manual...
  • Page 7 Switching Connections ......... . . 246 Microcontrollers Debugger Manual...
  • Page 8 Advanced Settings Tab ........352 Microcontrollers Debugger Manual...
  • Page 9 Using the Stationery Wizard ........396 Microcontrollers Debugger Manual...
  • Page 10 Configuration Procedure ......... .431 Microcontrollers Debugger Manual...
  • Page 11 MONITOR-HCS08 Menu Options ....... 492 Microcontrollers Debugger Manual Table of Contents...
  • Page 12 Capture Triggers ..........526 Microcontrollers Debugger Manual...
  • Page 13 Active Mode Menu Options ........556 Microcontrollers Debugger Manual...
  • Page 14 Full Chip Simulation Warnings ........588 FCS and Silicon On-Chip Peripherals Simulation ..... .592 Microcontrollers Debugger Manual...
  • Page 15 First Steps From Within an Existing Project ......671 P&E Multilink/Cyclone Pro Menu Options ......673 Microcontrollers Debugger Manual Table of Contents...
  • Page 16 Setup ............700 Microcontrollers Debugger Manual...
  • Page 17 Debugger Commands ..........742 Microcontrollers Debugger Manual...
  • Page 18 Connection Selection or Change Always Available within IDE... .866 Automatic Upgrade Path for Projects Previously Created ....866 Microcontrollers Debugger Manual...
  • Page 19 39 HC(S)08 Full-Chip Simulator Components No Longer Supported List of HC(S)08 FCS Components No Longer Supported ....869 Index Microcontrollers Debugger Manual Table of Contents...
  • Page 20 Table of Contents Microcontrollers Debugger Manual...
  • Page 21: Introduction

    Introduction Manual Contents The Microcontrollers Debugger Manual consists of the following books: Book 1: Debugger engine - defines the HC08 and HC(S)08 common and base features, their functionality, and a description of the components that are available in the debugger.
  • Page 22 The Flexis series of devices is the 8- to 32-bit connection point on the Freescale Controller Continuum, where complementary families of HCS08 and ColdFire V1 microcontrollers share a common set of peripherals and development tools to deliver migration flexibility. These devices include the MC9S08QE128, MC9S08QE64, MC9S08QE96, MCF51QE128, MCF51QE64, and MCF51QE96, which are covered in Book 3 and Book 5 respectively.
  • Page 23: Book I - Debugger Engine

    Debugger DDE Capabilities • The Synchronized Debugging Through DA-C IDE with the DA-C IDE from RistanCase Microcontrollers Debugger Manual Chapter introduces the Debugger concept. Chapter provides all details about the Debugger user Chapter contains descriptions of each basic component Chapter is dedicated to the control points and associated...
  • Page 24 Book I Contents Microcontrollers Debugger Manual...
  • Page 25: Introduction

    Debugger Components is very easy. You can add additional Debugger Components (for example, for simulation of a specific I/O peripheral chip) and integrate them with your Debugger Application. You can also open several components of the same type. Microcontrollers Debugger Manual...
  • Page 26: Debugger Features

    When the Debugger is started in demo mode or with an invalid engine license, then all components that are protected with FLEXlm are in demo mode. The limitations of all components are described in their respective chapter. Microcontrollers Debugger Manual...
  • Page 27: Debugger Interface

    The CodeWarrior IDE installer places executable programs in the prog subdirectory of the CodeWarrior IDE installation directory. For example, installing the CodeWarrior IDE software in C:\Program Files\Freescale, locates all program files in the folder C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\prog. Microcontrollers Debugger Manual...
  • Page 28: Starting The Debugger

    To start the debugger from the Project window, click the Debug icon top of the Project window. Figure 2.1 Project Window Make and Debug Icons Debugger executable file Debugger main function dll Debugger loader dll Debugger component Debugger target file Debugger CPU awareness file Microcontrollers Debugger Manual (Figure 2.1), at the...
  • Page 29: 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. Microcontrollers Debugger Manual Debugger Interface Starting the Debugger...
  • Page 30: Command Line Options

    -Target=<targetname> This option sets the specified connection. For example: C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\prog\hiwave.exe c:\Program Files\Freescale\CodeWarrior for Microcontrollers 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.
  • Page 31 -Nodefaults This prevents the debugger from loading the default layout. For example: c:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\prog\hiwave.exe -nodefaults -Cmd = <Command> This option specifies a command to be executed at start-up: -cmd = {command}. For example: c:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\prog\hiwave.exe -cmd="open recorder"...
  • Page 32: Debugger Main Window

    The function Open in the File menu interprets any file 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.
  • Page 33: Debugger Main Window Toolbar

    You can select menu commands by pressing the ALT key to select the menu bar then press the key corresponding to the underlined letter in the menu command. Table 2.1 describes menu entries available in the menu bar. Microcontrollers Debugger Manual Debugger Interface Debugger Main Window Figure 2.4 identifies each Figure 2.5...
  • Page 34: File Menu

    Contains entries to select and configure extra component window. Contains entries to select Data component functions. Contains entries to set the component windows. A standard Windows Help menu. Figure 2.7 is dedicated to the debugger project. Microcontrollers Debugger Manual...
  • Page 35 2.Test.ini 3... Exit You can shortcut some of these functions by clicking toolbar icons (refer to the Main Window Toolbar Microcontrollers Debugger Manual Description Creates a new project. Loads an executable file (or debugger connection if nothing is selected). Recent applications list Opens the debugger project window.
  • Page 36 • A second list box contains the arguments for all of the environment variables defined in the corresponding Environment section. Select a variable with the mouse or Up/ Down buttons. 2.8) it is possible to set up environment variables for the current Microcontrollers Debugger Manual...
  • Page 37 • 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. Microcontrollers Debugger Manual Debugger Interface Debugger Main Window...
  • Page 38: View Menu

    Check / uncheck Hide Headline if you want to hide or display the headline. Check / uncheck Small Border if you want to display or hide small window borders. Opens the debugger Customize Toolbar window. Figure 2.11. Microcontrollers Debugger Manual Component Windows Object Table 2.3...
  • Page 39 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. Microcontrollers Debugger Manual Debugger Interface Debugger Main Window...
  • Page 40 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 Microcontrollers Debugger Manual...
  • Page 41 The Main Window Run menu, shown in You can monitor a simulation or debug session from this menu. Run menu entries are described in Table Figure 2.16 Run Menu Microcontrollers Debugger Manual Figure 2.16 2.4. Debugger Interface Debugger Main Window...
  • Page 42 Execution continues for one CPU instruction from the point it was halted. This command is similar to the Single Step command, but executes one machine instruction rather than a high level language statement. Shortcut: CTRL + F11 keys Microcontrollers Debugger Manual...
  • Page 43 To set the connection, select Component > Set Connection. Refer to the Component Menu Figure 2.17 Connection Menu Table 2.5 describes the Connection Menu entries. Microcontrollers Debugger Manual Description Similar to the Step Over command, but steps over subroutine call instructions. Shortcut: CRTL + F10 keys...
  • Page 44 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. Description Loads a connection. Resets the current connection. Figure 2.18 Microcontrollers Debugger Manual appears.
  • Page 45 Debugger recognizes these command files and executes them. Depending on the connection used, other command files can be recognized by the Debugger. Refer to the appropriate connection chapter for command file information and properties. Microcontrollers Debugger Manual Figure 2.19 File,...
  • Page 46 Component > Set Connection). You can specify the Startup command file full name and status (enable/disable) either with the CMDFILE STARTUP Command Line command or using the Startup property tab of the Connection Command File Window. Microcontrollers Debugger Manual...
  • Page 47: Component Menu

    Connection Command File The default settings enable the POSTLOAD.CMD file located in the current project director as the current Postload command file. Component Menu The Component menu is shown in Microcontrollers Debugger Manual Window. Window. Window. Figure 2.20.
  • Page 48 Opens a standard Font Selection dialog box, where you can set the font used by Debugger components. Opens a standard Color Selection dialog box, where you can set the background color used by the Debugger component windows. Debugger Components. Microcontrollers Debugger Manual section. Figure...
  • Page 49 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. Microcontrollers Debugger Manual Debugger Interface Debugger Main Window...
  • Page 50: Window Menu

    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. Figure 2.22, you can set the component windows general Figure 2.24. Microcontrollers Debugger Manual Figure 2.23 and the Submenu...
  • Page 51: Help Menu

    Figure 2.25 Help Menu Table 2.8 Help Menu Description Menu entry Help Topics About Microcontrollers Debugger Manual Description Option to arrange all open windows in cascade (so they overlap). Option to display all open windows in tile format (non overlapping).
  • Page 52: Component Associated Menus

    You can hide this menu by unchecking Window > Options > Component Menu. Figure 2.26 Example of Component Main Menu Figure 2.26 is always between the Component entry and the Window Microcontrollers Debugger Manual Figure 2.3. Each component...
  • Page 53: Component Windows Object Info Bar

    Figure 2.28 Example of Component Context Menu For example, if you click the mouse on a breakpoint, menu options allow you to delete, enable, or disable the breakpoint. Microcontrollers Debugger Manual Debugger Interface Component Associated Menus Figure...
  • Page 54: Highlights Of The User Interface

    Figure 2.30 Dragging Procedure Name from Coverage to Source Component Window You can display the memory layout corresponding to the address held in a register by dragging the address from the Register Component to the Memory Component. (Figure 2.30). Microcontrollers Debugger Manual Figure 2.29.
  • Page 55: To Drag And Drop An Object

    Component Window Command Line Memory Register Source Microcontrollers Debugger Manual Highlights of the User Interface Action The Command Line component appends the address of the “pointed to” instruction to the current command. Dumps memory starting at the selected instruction PC.
  • Page 56 Dragging the name of a global variable in the source window displays the module where the variable is defined and the source text is searched for the first occurrence of the variable and highlighted. Microcontrollers Debugger Manual...
  • Page 57 Destination Component Window Assembly Register Memory Data Microcontrollers Debugger Manual Highlights of the User Interface Action 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...
  • Page 58 Displays local variables from the selected procedure in the data component. Displays source code of the selected procedure. Current instruction inside the procedure is highlighted in the Source component. The current assembly statement inside the procedure is highlighted in the Assembly component. Microcontrollers Debugger Manual...
  • Page 59 • Set Connection • Open IO component • Open Source File • Open Module • Individual component window Microcontrollers Debugger Manual Highlights of the User Interface Action Assembly component receives an address range, scrolls to the corresponding instruction and highlights it.
  • Page 60 Debugger Interface Highlights of the User Interface Microcontrollers Debugger Manual...
  • Page 61: Debugger Components

    Window components can access all global facilities of the debugger engine, such as the connection (to communicate with different connections), and the symbol table. The Debugger window components are implemented as dynamic link libraries (DLLs) with extension .WND. These components are introduced in this section. Microcontrollers Debugger Manual...
  • Page 62: Connection Components

    To open the window that lets you choose one or more components: 1. Choose Component > Open 2. In the Open Window Component window shown in component. NOTE To open more than one component, select multiple components. Figure 3.1, you can use the Figure 3.2, select the desired Microcontrollers Debugger Manual...
  • Page 63 • 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 components. Microcontrollers Debugger Manual Debugger Components Component Introduction...
  • Page 64: General Debugger Components

    The Object Info Bar of the component window contains the procedure name, which contains the currently selected instruction. When a procedure is double clicked in the Procedure component, the current assembly statement inside this procedure is highlighted in the Assembly component. Figure 3.3, displays program code in disassembled Microcontrollers Debugger Manual...
  • Page 65 Code Symbolic Address Absolute Address Format Freeze Microcontrollers Debugger Manual Figure 3.4 contains all functions associated with the Table 3.1 describes these menu entries. Description Opens a dialog box prompting for an address: Show PC. Displays machine code in front of each disassembled instruction.
  • Page 66 Menu contents vary when the DBG module is available. Figure 3.6 Assembly Context Menu Control Points chapter. Figure 3.5, Table 3.2; depending on the Microcontrollers Debugger Manual...
  • Page 67 Show Location Set Markpoint Delete Markpoint Show Markpoints Address Microcontrollers Debugger Manual General Debugger Components Description Appears only in the context menu if no breakpoint is set or disabled on the pointed to instruction. When selected, sets a permanent breakpoint on this instruction. When program execution reaches this instruction, the program is halted and the current program state is displayed in all window components.
  • Page 68 Dumps memory starting at the selected instruction PC. The PC location is selected in the memory component. Loads the destination register with the PC of the selected instruction. Source component scrolls to the source statements and highlights it. Microcontrollers Debugger Manual...
  • Page 69: Command Line Component

    The command entry always occurs in the last line of the Command component. Characters can be input or pasted on the edit line. Figure 3.7 Command Line Window Microcontrollers Debugger Manual Debugger Components General Debugger Components Action Displays disassembled instructions starting at the first high level language instruction selected.
  • Page 70 If not found, it is checked as a global variable in the application. If not found, it is checked as a function in the current module. If not found, it is checked as a function in the application, finally if not found an error is generated. Microcontrollers Debugger Manual...
  • Page 71 (end of current line) by: • Selecting the menu entry Command > Paste • Pressing CTRL + V simultaneously. • Clicking the Microcontrollers Debugger Manual General Debugger Components button in the toolbar. button are only enabled if something is icon in the toolbar.
  • Page 72 Window. Dragging the value appends the variable value to the current command in the Command Line Window. Appends the selected memory range to the Command Line window. The address stored in the pointed to register is appended to the current command. Microcontrollers Debugger Manual Figure 3.9.
  • Page 73: Coverage Component

    3.11. A red check mark is displayed in front of each source or assembler instruction that has been executed. Split views are removed when the Coverage window is closed or by selecting Delete in the split view context menu. Microcontrollers Debugger Manual Debugger Components General Debugger Components Debugger Engine Figure 3.10...
  • Page 74 Resets all simulator statistic information. Opens a split view in the chosen component (Source or Assembly). Toggles the graphic bars. Switches the periodic update on/off. If activated, statistics are updated each second. Opens the Output File options. 3.12. Microcontrollers Debugger Manual...
  • Page 75: Output File

    Listing 3.1 Example Output File with Modules and Functions: ------------------------------------------------------------ Coverage: Item: ------------------------------------------------------------ 94.4 % Application FULL fibo.c FULL Fibonacci() FULL main() 86.0 % startup.c 80.5 % Init() FULL _Startup() Microcontrollers Debugger Manual Debugger Components General Debugger Components Figure 3.13. Select what you want Listing 3.1.
  • Page 76: Da-C Link Component

    (Development Assistant for C - from RistanCASE GmbH) and the IDE, allowing synchronized debugging features. Figure 3.15 DA-C Link Window (Figure 3.14) contains the Delete entry, which is used TUPDATE Figure 3.15 is an interface module between the DA-C Microcontrollers Debugger Manual...
  • Page 77 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 Setup Microcontrollers Debugger Manual IDE. Description Opens the Connection Specification dialog box. Debugger Components General Debugger Components...
  • Page 78 Project.ini file. The HELP button opens the help topic for this dialog box. NOTE If problems exist, refer to the documentation. Drag Out Nothing can be dragged out. Drop Into Nothing can be dropped into the DAC Component window. Demo Version Limitations None. Troubleshooting section in the DA-C Microcontrollers Debugger Manual...
  • Page 79: Data Component

    If a read access on the variable is detected during execution, the program is halted and the current program state is displayed in all window components. Microcontrollers Debugger Manual General Debugger Components Figure 3.18...
  • Page 80: Expression Editor

    You may enter a logical or numerical expression in the edit box, using the Ansi-C syntax. In general, this expression is a function of one or several variables from the current Data component window. Figure 3.19 Edit Expression Dialog Box Figure 3.19, or Microcontrollers Debugger Manual...
  • Page 81: Expression Command File

    Data component menu, the Zoom submenu is shown in the Scope submenu is shown in submenu in Figure submenus in Figure Figure 3.20 Data Menu Microcontrollers Debugger Manual Figure 3.21, the Format submenu in 3.24, the Options submenu in Figure 3.26 3.29. Table 3.8 describes the Data Menu entries.
  • Page 82 Opens an options menu for data, for example, Pointer as Array facility. Description Switches to Global variable display in the Data component. Switches to Local variable display in the Data component. Switches to User variable display in the Data component. Displays user defined expression (variables are erased). Microcontrollers Debugger Manual...
  • Page 83 Component menu: Figure 3.23 Format Selected and All Submenus Table 3.11 describes the Format Selected Mode and Format All Mode Submenu entries. Microcontrollers Debugger Manual General Debugger Components Description Applies changes to the selection only Applies changes to all items...
  • Page 84 Switches to Periodical mode; variables are updated at regular time intervals when the connection is running. The default update rate is 1 second, but can be modified by steps of up to 100 ms using the associated dialog box (see below). Microcontrollers Debugger Manual...
  • Page 85 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 Microcontrollers Debugger Manual General Debugger Components Description Switches to Locked mode; value from variables displayed in the data component are updated when the connection is stopped.
  • Page 86 This string is cut off if longer than 16 characters. Thus, by enlarging the value you can adapt the window to longer names. Zoom and Sort Submenus Figure 3.29 Zoom and Sort Submenus Figure 3.27. 3.28. Microcontrollers Debugger Manual...
  • Page 87 Watchpoint Enable Watchpoint Disable Breakpoint Microcontrollers Debugger Manual Description Opens the Open Module dialog box. Appears only in the context menu if no watchpoint is set or disabled on the pointed to variable. When selected, sets a read/write watchpoint on this variable.
  • Page 88 Dragging the value appends the variable value to the current command in the Command Line Window. 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. Control Points.) Microcontrollers Debugger Manual...
  • Page 89 Demo Version Limitations Only two variables can be displayed. Only two members of a structure are visible when unfolded. Only one expression can be defined. Microcontrollers Debugger Manual Debugger Components General Debugger Components Action 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.
  • Page 90: Memory Component

    "rr" memory value means: not accessible because the hardware is running. "--" memory values mean: not configured (no memory available) Figure 3.32 displays unstructured memory content or Control Points for more information about watchpoints. contains the procedure or variable name, Fill Memory box. Microcontrollers Debugger Manual...
  • Page 91 The Flash address space covers the Extended Address range (covering the Flash memory as one single linear range), as accessed by the Linear Address Space Pointer of the chip MMU. Figure 3.33 HCS08 device with MMU Address Space selection Microcontrollers Debugger Manual Debugger Components General Debugger Components...
  • Page 92 Memory Operations • Double-click a memory position to edit it. If the memory is not initialized, this operation is not possible. • Drag the mouse in the memory dump to select a memory range. Debugging Memory Map Microcontrollers Debugger Manual...
  • Page 93 Memory ranges where a watchpoint has been defined are underlined in black. Memory Menu The Memory Menu shown in 3.16 describes the menu entries. Figure 3.34 Memory Menu Microcontrollers Debugger Manual Debugger Components General Debugger Components Figure 3.34 provides access to memory commands. Table...
  • Page 94 Opens the Search Pattern dialog box. Figure 3.35, you can set the memory display unit. Description Sets display unit to byte size. Sets display unit to word size (=2 bytes). Sets display unit to Lword size (=4 bytes). Microcontrollers Debugger Manual...
  • Page 95 Mode Submenu With the Mode submenu shown in Table 3.19 describes the menu entries. Figure 3.37 Mode Submenu Microcontrollers Debugger Manual Figure 3.36, you can set the memory display format. Description Selects the hexadecimal memory display format Selects the binary memory display format...
  • Page 96 Figure 3.38, you can set the memory display Table 3.20 describes the menu entries. Description Allows you to toggle the display of address dump. Allows you to toggle the display of ASCII dump. Microcontrollers Debugger Manual...
  • Page 97 NOTE The Show PC dialog box is the same as the Display Address dialog box. In this dialog box, the Assembly component dumps assembly code starting at the specified address. Microcontrollers Debugger Manual Debugger Components General Debugger Components Figure 3.39...
  • Page 98 The Search Pattern dialog box shown in memory range for a specific expression. Figure 3.42 Search Pattern Dialog Box Figure 3.41 allows you to copy a memory range to a Figure 3.42 allows you to search memory or a Microcontrollers Debugger Manual...
  • Page 99: Update Rate

    When you check the Refresh memory periodically when halted checkbox, the debugger keeps on refreshing caches even when it is not running. This allows you to see I/O Register changes even if the CPU is not running. Microcontrollers Debugger Manual General Debugger Components Figure 3.43, allows you to modify the update rate in steps of...
  • Page 100 Appears in the context menu only if a watchpoint is set or disabled on the selected memory range. When selected, deletes this watchpoint. Microcontrollers Debugger Manual Figure describes the menu entries. Menu...
  • Page 101 Destination Component Window Assembly Command Line Register Source Microcontrollers Debugger Manual Description When selected, brings up the Controlpoints Configuration Window - Watchpoints Tab. This is the interface through which watchpoints are controlled. (See Control Points Appears in the context menu only if no watchpoint is set or disabled on the selected memory range.
  • Page 102: Module Component

    Dumps memory starting at the address of the first global variable in the module. The memory area where this variable is located is selected in the memory component. Figure 3.45 gives an overview of source modules building Microcontrollers Debugger Manual...
  • Page 103 Source Drop Into Nothing can be dropped into the Module Component window. Demo Version Limitations Only two modules are displayed Microcontrollers Debugger Manual Debugger Components General Debugger Components Action Displays the global variables from the selected module in the data component Dumps memory starting at the address of the first global variable in the module.
  • Page 104: Procedure Component

    Source Window and Assembly Window. Procedure Menu Figure 3.47 shows the Procedure menu and its entries are described in Figure 3.47 Procedure Menu Figure 3.46 displays the list of procedure or function Microcontrollers Debugger Manual Table 3.25.
  • Page 105 Nothing can be dropped into the Procedure component. Demo Version Limitations Only the last two procedures are displayed. Associated Commands ATTRIBUTES, Microcontrollers Debugger Manual Description Switches to the display of function parameter values in the procedure component. Toggles to the display of function parameter types in the procedure component.
  • Page 106: Profiler Component

    Split views are removed when the Coverage component is closed or if you open the split view Context Menu and select Delete. The value displayed may reflect percentages from total code or percentages from module code. Figure 3.48 provides information on the application profile. Microcontrollers Debugger Manual...
  • Page 107 Reset Details Base Graphics Timer Update Output File Microcontrollers Debugger Manual shows the Profiler Output File submenu. Entries are described in Description Resets all statistics. Sets a split view in the chosen component (Source or Assembly) Sets the base of percentage (total code or module code).
  • Page 108 You can also specify a range of coverage to be logged in your file. Figure 3.53 Output File Filter Dialog Box 3.28. Description Removes the split view from the host component. Toggles the graphic bars display in the split view. Figure 3.53 lets you select what you Microcontrollers Debugger Manual...
  • Page 109: Recorder Component

    The Recorder window enables the user to record and replay command files. The recorded file may also contain the time at which the command is executed. Click the buttons shown below to record, play, pause and stop. Play. Microcontrollers Debugger Manual Figure 3.54 provides record and replay facilities for Record.
  • Page 110 The Table 3.29. Description Starts recording from a debug session. Starts replaying from a debug session. If set, the evolution time is also recorded. Instant 0 corresponds to the beginning of the recording. Microcontrollers Debugger Manual...
  • Page 111: Register Component

    Figure 3.56 Register Window Register values can be displayed in binary or hexadecimal format. These values are editable. Microcontrollers Debugger Manual Debugger Components General Debugger Components Figure 3.56, displays the content of registers and status...
  • Page 112 The Memory window dumps memory starting at the address stored in the register. Register Menu (Format Submenu) The Register menu is pictured in Figure 3.57 Register Menu IO Registers field. Figure 3.57. Table 3.30 describes the menu entries. Microcontrollers Debugger Manual Inspector...
  • Page 113 Memory Command Line Drop Into Table 3.32 shows the drop actions possible into the Register component. Microcontrollers Debugger Manual Description Selects the hexadecimal register display format Selects the binary register display format Selects the octal register display format Selects the signed decimal register display format...
  • Page 114 Dragging the value loads the destination register with the value of the variable. Loads the destination register with the PC of the first instruction selected. Loads the destination register with the start address of the selected memory block. Microcontrollers Debugger Manual...
  • Page 115: Source Component

    CPU. If breakpoints have been set in the program, they are marked in the program source with a special symbol depending on the kind of breakpoint. For information on breakpoints refer Microcontrollers Debugger Manual Debugger Components General Debugger Components Figure 3.58...
  • Page 116 The corresponding range of code is highlighted in the Assembly component window, as shown in chapter. If execution stops, the current position is marked in the 3.59) or the parameter value and address of the selected procedure. A Statement. Figure 3.60. How to Consult Microcontrollers Debugger Manual...
  • Page 117 • Hold down the left mouse button and press the T key. This sets a temporary breakpoint at the nearest code position (visible with marks). The next time the program runs it breaks at this location, as shown in Figure 3.61 Setting Breakpoints Microcontrollers Debugger Manual Debugger Components General Debugger Components chapter.
  • Page 118 DBG module is available. Figure 3.62 Source Menu to fold the text located between the to unfold the text that is hidden behind the Figure 3.62 Figure 3.63 shows the functions associated Table 3.33 describes these functions. Menu content varies Microcontrollers Debugger Manual...
  • Page 119 Enable Breakpoint Disable Breakpoint Microcontrollers Debugger Manual Description Appears only in the Context Menu if no breakpoint is set or disabled at the nearest code position (visible with marks). When selected, sets a permanent breakpoint at this position. If program execution reaches this statement, the program is halted and the current program state is displayed in all window components.
  • Page 120 Opens a dialog box prompting for a string and then searches the file displayed in the source component. To start searching, click Find Next, the search is started at the current selection or at the first line visible in the source component. Control Points chapter). Points). Microcontrollers Debugger Manual...
  • Page 121 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 Microcontrollers Debugger Manual Description Opens a dialog box for searching a procedure. Opens the folding window.
  • Page 122 • Match whole word only: If this box is checked, only strings separated by special characters are recognized. • Match case: If this box is checked, the search is case sensitive. Figure 3.66 is used to perform find operations for text in Microcontrollers Debugger Manual...
  • Page 123 Recent search items are stored in the current project file. Folding Menu The Folding Menu shown in Table 3.34. Figure 3.68 Folding Menu Microcontrollers Debugger Manual Debugger Components General Debugger Components Figure 3.67 is used to find the procedure name Figure 3.68...
  • Page 124 Loads the destination register with the PC of the first instruction selected. A selection in the Source window is considered as an expression in the Data window, as if it was entered through the Expression Editor of the Data component. (See Component Expression Editor.) Microcontrollers Debugger Manual Data...
  • Page 125: Terminal Component

    The Terminal Component window shown in output. It can receive characters from several input devices and send them to other devices. Figure 3.69 Terminal Window Microcontrollers Debugger Manual General Debugger Components Action Source component scrolls to the source statements corresponding with the pointed to assembly instruction and highlights it.
  • Page 126 You can specify these connections by choosing Configure Connections in the context menu of the terminal component. This opens the dialog box shown in Figure 3.71 Configure Terminal Connections Dialog Box 3.70. Figure 3.71. Microcontrollers Debugger Manual...
  • Page 127 SCI. Table 3.37 illustrates the different possible commands and associated Escape sequences where filename is a sequence of characters terminated by a control character (e.g. CR) and is a valid filename. Microcontrollers Debugger Manual...
  • Page 128 Open output file and suppress output to terminal display. Close input file Open input file. Append to existing output file. Append to existing output file and suppress output to terminal display. Listing 3.3 shows the source code in terminal.c. Microcontrollers Debugger Manual...
  • Page 129 The item Cache Size in the context menu allows you to set the number of lines in the terminal window with the dialog shown in Figure 3.72 Size of the Cache Dialog Box Microcontrollers Debugger Manual Debugger Components General Debugger Components...
  • Page 130: Trace Component

    Trace Menu The Trace Menu shown in Trace menu entries vary depending on the connection. Figure 3.73 records and displays instruction frames and time Figure 3.74 contains the functions described in Microcontrollers Debugger Manual Table 3.38.
  • Page 131 Associated Context Menu The Trace context menu shown in conditions. Table 3.39 all connections.) Microcontrollers Debugger Manual Description Displays window contents in text format. Displays window contents in graphical format. Displays instructions in window Use to specify the window display items.
  • Page 132 (Not available with all connections.) Steps to the next occurrence of the condition. Pressing the N key has the same effect. Steps back to the previous occurrence of the condition. Pressing the P key has the same effect. Microcontrollers Debugger Manual...
  • Page 133: Visualization Utilities

    Figure 3.77 Inspector Component Window The hierarchical content of the items is displayed in a tree structure. If any item is selected on the left side, then additional information is displayed on the right side. Microcontrollers Debugger Manual Debugger Components Figure 3.77 displays information about several topics.
  • Page 134 In the stack-trace, the content of a local variable is accessible. Figure 3.79 Inspector Window Stack Icon Figure 3.79 displays the current stack trace. Every function on Microcontrollers Debugger Manual Figure 3.78, the...
  • Page 135 When simulating a watchdog/COP, an event with the remaining time is displayed in the Event View. Exceptions Icon The Inspector window Exceptions icon shown in exceptions. Exceptions are pending interrupts. Microcontrollers Debugger Manual Figure 3.80 displays all loaded symbol table information in Figure 3.81 shows all currently installed Figure 3.82...
  • Page 136 TargetObject, which represents the address space. All Objects that are loaded are displayed in the Object Pool. The TargetObject additionally shows the objects that are mapped to the address space. Figure 3.83 is a pool of objects. It can contain any number of Microcontrollers Debugger Manual...
  • Page 137 Usually, if a value is displayed, it can be changed. I/O Devices in the Object Pool do not accept all new values, depending on the I/O Device. Microcontrollers Debugger Manual Debugger Components Figure 3.84...
  • Page 138 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 with their current value. Double click on the values to change them Figure 3.86 Changing Data_Direction_Register Value Figure 3.85, open the IO_Led with the (Figure 3.86). Microcontrollers Debugger Manual...
  • Page 139 Table 3.41 Inspector Context Menu Entries Description Menu Entry Update Max. Elements Format Close Microcontrollers Debugger Manual Table Description All displayed information is updated Items that no longer exist are removed and new items are added. Table 3.41.
  • Page 140 • Functions: Functions can be dragged to display the function or code range. • Variables: Variables can be dragged to display their content in memory. • Indirections: Indirections can be dragged to display their content in memory. Figure 3.87. Microcontrollers Debugger Manual Table 3.42 gives a brief...
  • Page 141: Visualization Tool Component

    To switch between these two modes, you can use the toolbar, the context menu, or the shortcut Ctrl+E. Add New Instrument Use the context menu Microcontrollers Debugger Manual Figure 3.88, consists of a plain workspace that (VisualizationTool Menu) to add a new instrument.
  • Page 142 Pastes an instrument that has been previously copied. Shortcut: <Ctrl+V> Selects all the instruments of the view. Shortcut: <Ctrl+A> Switches between Display mode and Edit mode. In Edit mode, this entry is checked. Shortcut: <Ctrl+E> Table 3.43. Microcontrollers Debugger Manual...
  • Page 143 Edit mode Setup Load Layout Save Layout Add New Instrument Properties Remove Copy Microcontrollers Debugger Manual Description Loads a VisualizationTool-Layout (*.vtl). Does not remove the actual instruments. Shortcut: <Ctrl+L> Saves the current layout to a file (*.vtl). Shortcut: <Ctrl+S> Table 3.44.
  • Page 144 Makes size of all selected instruments the same as the last selected. Align Makes vertical size of all selected instruments the same as the last selected. Align Makes horizontal size of all selected instruments the same as the last selected. Microcontrollers Debugger Manual...
  • Page 145 Background color Grid Mode Grid Size Grid Color Refresh Mode Microcontrollers Debugger Manual Description Switches from Edit mode to Display mode. Switches the scrollbars on, off, or sets it to automatic mode. Switches the headline on or off. Specifies the background color of the VisualizationTool.
  • Page 146 Subscribe: TargetObject.#210 Subscribe: PORTB.PORTB (check exact spelling using Inspector) Variable: counter Register: SP Memory: 0x210 If you use the Memory Port, you can also specify the width of memory to display (up to 4 Bytes). Table 3.46. Microcontrollers Debugger Manual...
  • Page 147 Using the Bar instrument, values are displayed by a bar strip. This instrument (see 3.90) may be used as a position state of a water tank. Figure 3.90 Bar Instrument Bar instrument attributes are shown in Microcontrollers Debugger Manual (Figure 3.89) represents the classical pointer instrument, also Table 3.47.
  • Page 148 Performs a bitwise-AND operation with this value. AND the value of the selected port. Default value is 0. This value is compared to the result of the AND operation. The bitmap is displayed only if both values are the same. Default value is 0. Microcontrollers Debugger Manual Table...
  • Page 149 The Knob instrument is normally known as an adjustment instrument. For example, it can simulate the volume control of a radio Figure 3.92 Knob Instrument Knob instrument attributes are shown in Microcontrollers Debugger Manual Table 3.50. Description When enabled, displays the value of the bit under each plot of the DILSwitch instrument.
  • Page 150 Defines the color of the knob side. Table 3.52. Description Defines the bit of the given byte to be displayed. Defines the color if the given bit is set. Defines the color if the given bit is not set. Microcontrollers Debugger Manual (Figure 3.93). There (Figure...
  • Page 151 Table 3.54 Switch Instrument Attributes Attribute Bitnumber to Display Display 0/1 Microcontrollers Debugger Manual Description 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.
  • Page 152 “Host Periodical” in the “Type of Unit” attribute. This attribute represents the number of CPU cycles to reach before the switch changes its state. Fill in this attribute if you chose “CPU Cycles” in the “Type of Unit” attribute. 3.96). Table 3.55 Microcontrollers Debugger Manual...
  • Page 153 Format mode Relative Value is used for showing a value in a range of 0 up to 100% or 1000‰. Its attributes are shown in Microcontrollers Debugger Manual Description Specifies the mode. Choose among four modes: Static Text, Value, Relative Value, and Command Defines the desired font.
  • Page 154 Contains the command-line command to execute after pressing the button. Table 3.60 Description Warning: Executing the specified command overwrites the text in this field. Contains the command line command to execute after pressing the button. Microcontrollers Debugger Manual Commands. Table shows CMD Callback...
  • Page 155 • The memory window: select bytes and drag-and-drop them onto the instrument. • The Inspector component: pick an object from the object pool. Demo Version Limitations Loads only one VisualizationTool window. Limits the number of instruments to three. Microcontrollers Debugger Manual Debugger Components Visualization Utilities...
  • Page 156 Debugger Components Visualization Utilities Microcontrollers Debugger Manual...
  • Page 157: Control Points

    • Select a single control point from a list box and click Delete. • Select multiple control points from a list box and click Delete. Microcontrollers Debugger Manual...
  • Page 158: Breakpoints

    • Permanent breakpoints, which are activated each time the instruction is executed. • Counting breakpoints, which are activated after the instruction has been executed a certain number of times. • Conditional breakpoints, which are activated when a given condition is TRUE. Microcontrollers Debugger Manual...
  • Page 159 1. Point at a C statement in the Source window, and click the right mouse button. 2. Select Show Breakpoints from this menu. Controlpoints Configuration Window (Breakpoints Tab) tab of this window is shown in Microcontrollers Debugger Manual is opened. The Breakpoints Figure 4.2.
  • Page 160: Breakpoints Tab

    When the Interval value is changed, the Counter value is automatically set to the Interval value. • Delete button to remove the currently selected breakpoint. contains: Microcontrollers Debugger Manual...
  • Page 161: Multiple Selections In List Box

    If a syntax error has been detected, a message box is displayed: Incorrect Condition. Do you want to correct it?. If you click OK, correct the error in the condition edit box. If you click Cancel, the Condition: edit box is cleared. Microcontrollers Debugger Manual Control Points Breakpoints...
  • Page 162: Saving Breakpoints

    The interval is an expression. It matches the Interval field (Counter) in the Controlpoints Configuration Window (Breakpoints Tab)). The SAVEBP command SAVEBP command. Listing Controlpoints for conditional breakpoint. Tab), for associated commands. Tab), for counting breakpoints. Tab), for counting breakpoints. Microcontrollers Debugger Manual 4.1.
  • Page 163 (given by the symbol table). If there is a difference, the debugger sets and disables the breakpoint. If there is no difference, the debugger sets and enables the breakpoint. Microcontrollers Debugger Manual 4.2. Control Points...
  • Page 164: Setting Breakpoints

    2. Choose Marks from the Context Menu. All statements where a breakpoint can be set are identified by a special red inverted check mark: To remove the breakpoint marks, right-click in the Source component and choose Marks again. SAVEBP commands. Microcontrollers Debugger Manual...
  • Page 165: Temporary Breakpoints

    1. Point at a C statement in the Source window and right-click. The Source Context Menu is displayed. 2. Select Set BreakPoint from the Context Menu. A permanent breakpoint mark is displayed in front of the selected statement. Microcontrollers Debugger Manual Control Points Setting Breakpoints...
  • Page 166: Counting Breakpoints

    2. Choose Set BreakPoint from the Context Menu. A breakpoint is defined on the selected instruction. 3. Point in the Source window and right-click again. 4. Choose Show Breakpoints from the Context Menu. The Window (Breakpoints Tab) Controlpoints Configuration Window Controlpoints Configuration is displayed. Microcontrollers Debugger Manual...
  • Page 167: Conditional Breakpoints

    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) 5. Close the window by clicking OK. Microcontrollers Debugger Manual Control Points Setting Breakpoints is opened and a new...
  • Page 168: Deleting Breakpoints

    1. Point at a C statement in the Source Component window where a breakpoint has previously been defined, hold down the left mouse button and press the D key. 2. The breakpoint is deleted. Controlpoints Configuration is opened and a new breakpoint is inserted in the list of Microcontrollers Debugger Manual...
  • Page 169: Associate A Command With A Breakpoint

    When the breakpoint is detected, the command is executed and the application stops. The Continue check button of the Controlpoints Configuration window allows the application to continue after the command is executed. Demo Version Limitations Only two breakpoints can be set. Microcontrollers Debugger Manual Control Points Setting Breakpoints...
  • Page 170: Watchpoints

    2. Press the right mouse button. 3. Select Show Watchpoints from either menu. 4. Click the left mouse button. The ControlPoints Configuration window appears. The Watchpoints tab of this window is shown in Figure Controlpoints Configuration Window 4.6. Microcontrollers Debugger Manual...
  • Page 171 Control Points Watchpoints Figure 4.4 Memory Context Menu Figure 4.5 Data Context Menu Microcontrollers Debugger Manual...
  • Page 172: Watchpoints Tab

    • Add button to add new watchpoints. Specify the Address in hexadecimal when Hex format is checked or as an expression when Hex format is unchecked. • Counter: group box that displays the current value of the counter and interval value of the counter. Microcontrollers Debugger Manual...
  • Page 173: Multiple Selections

    If a syntax error is detected, a message box appears: Incorrect Condition. Do you want to correct it? Click OK to correct the error in the condition edit box. Click Cancel to clear the condition edit box. Microcontrollers Debugger Manual Control Points Watchpoints...
  • Page 174: Setting Watchpoints

    Once a read access watchpoint has been defined, you can continue program execution. The application stops after detecting the next read access on the variable. Read access watchpoints remain active until they are disabled or deleted. Data Context Menu Microcontrollers Debugger Manual...
  • Page 175: Setting A Write Watchpoint

    Using the Data Context Menu: 1. Point at a variable in the Data window and right-click. The Data Context Menu is displayed. 2. Choose Set Watchpoint from the Context Menu. A Read/Write Watchpoint is defined. Microcontrollers Debugger Manual Control Points Setting Watchpoints...
  • Page 176: Defining A Counting Watchpoint

    OK. A counting watchpoint is defined for the selected variable. If you continue program execution, the Current field is decremented each time an appropriate access on the variable is detected. When Current is equal to 0, the application Microcontrollers Debugger Manual...
  • Page 177: Defining A Conditional Watchpoint

    5. Close the window by clicking OK. A conditional watchpoint is defined for the selected variable. If you continue program execution, the condition is evaluated each time an appropriate access on the variable is detected. When the condition is TRUE, the application stops. Microcontrollers Debugger Manual Control Points Setting Watchpoints...
  • Page 178: Deleting A Watchpoint

    2. Select Show Watchpoints from the Context Menu. The Watchpoints tab of the Controlpoints Configuration window is displayed. 3. Click on the corresponding entry in the list of defined breakpoints to select the watchpoint you want to modify. Data Context Menu Microcontrollers Debugger Manual...
  • Page 179: Markpoints

    3. Select Show Watchpoints from the window’s context menu. 4. Click the left mouse button. The ControlPoints Configuration window appears with the Markpoints tab of this window displayed. Microcontrollers Debugger Manual Tab). This window can be opened through the Source, Memory or Control Points Markpoints STOP are not allowed.
  • Page 180 Control Points Markpoints Figure 4.7 Source Window Context Menu Figure 4.8 Memory Context Menu Microcontrollers Debugger Manual...
  • Page 181: Markpoints Tab

    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. Microcontrollers Debugger Manual Control Points Markpoints...
  • Page 182: Setting Markpoints

    4. Choose Show WatchPoints from the context menu. The Controlpoints Configuration Window 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. is displayed. Source Window Microcontrollers Debugger Manual...
  • Page 183: Setting A Data Markpoint

    Window 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. Microcontrollers Debugger Manual Control Points Setting Markpoints Data Context Menu Memory Context Menu...
  • Page 184: Deleting A Markpoint

    If a condition has been defined and enabled for a control point that halts the debugger, a command executes (if defined and enabled). Control Point with Command When the debugger halts on the control point, a specified command executes. Microcontrollers Debugger Manual...
  • Page 185: Real Time Kernel Awareness

    • Real time kernels use data structures to describe the state of the system (scheduling information, queues, timers, etc.). Some of these data structures are described in this chapter. Microcontrollers Debugger Manual...
  • Page 186: Inspecting Task State

    (the PC, SP, DL, SR and registers). The following syntax must be used to specify the algorithm (in EBNF): StatSequence = Statement] {';' Statement;}. Statement = Assignment | ErrorMsg | If. GENPATH: #include “File” Path. Microcontrollers Debugger Manual...
  • Page 187 The CPU context of the task is then expected in the variables PC, SP, SR, DL, Rnn and EN. EN describes the status of the task. If 'EN' is bigger than 1000 the status is expected in the string MSG. Microcontrollers Debugger Manual Real Time Kernel Awareness Task Description Language...
  • Page 188: Application Example

    ELSIF i = 5 THEN MSG := "BlockedByReceive" ELSIF i = 6 THEN MSG := "WaitForSemaphore" ELSIF i = 7 THEN MSG := "Dummy" ELSIF i = 8 THEN MSG := "SysBlocked" ELSE MSG := "invalid" END; Microcontrollers Debugger Manual...
  • Page 189: Inspecting Kernel Data Structures

    5.4: Listing 5.4 Linker PRM File NAMES ... rtk.o+ ... END SECTIONS RTK_SEC = NO_INIT 0x1040 TO 0x1F80; Microcontrollers Debugger Manual 5.2. Listing 5.3). /* list of tasks ready to be executed */ /* unimportant variables */ /* total number of tasks */...
  • Page 190: Osek Kernel Awareness

    With CodeWarrior OSEK kernel awareness, you can monitor kernel task information, semaphores, messages, queues, resources allocations, synchronization, communicating between tasks, etc. ORTI describes the applications in any OSEK implementation: • A set of attributes for system objects. • A method for interpreting the data obtained. Microcontrollers Debugger Manual...
  • Page 191: Osek Run Time Interface

    The second type of data is dynamic and this data is re-evaluated each time by the CodeWarrior IDE. The static information is useful for display of general information and in Microcontrollers Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness...
  • Page 192 This section also describes the method that shall be used to reference or calculate each required attribute. This information shall either be supplied as a static value or else a formula that shall be used to calculate the required value. Microcontrollers Debugger Manual...
  • Page 193: Osek Rtk Inspector Component

    The OSEK RTK Inspect Window provides access to all this information. As defined in the ORTI file, objects of the same type are grouped and can be viewed together. • Task • Stack • SystemTimer • Alarm • Message Microcontrollers Debugger Manual 5.2. Real Time Kernel Awareness OSEK Kernel Awareness...
  • Page 194 • Current Task Stack: displays the name of the current stack used by the task. • Task Properties: describes task properties. Possible value are BASIC/EXTENDED, NONPREMPT/FULLPREMPT, Priority value, AUTO. The ORTI file defines the possible values. Figure 5.3 displays the current state of the OSEK task trace. Microcontrollers Debugger Manual...
  • Page 195 • TICKSPERBASE: displays the number of ticks required to reach a counter-specific value. • MINCYCLE: displays the minimum allowed number of counter ticks for a cyclic alarm linked to the counter. Microcontrollers Debugger Manual Figure 5.4 displays the current state of OSEK stack trace. Figure 5.5...
  • Page 196 Event to set specifies the event mask to be set when the alarm expires. • Time to expire: displays time remaining before the time expires and the event is set. • Cycle period: displays period of a tick. Figure 5.6 displays the current state of OSEK alarm trace. Microcontrollers Debugger Manual...
  • Page 197 • 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. Microcontrollers Debugger Manual Real Time Kernel Awareness Figure 5.7 displays the current state of OSEK message trace.
  • Page 198 Real Time Kernel Awareness OSEK Kernel Awareness Microcontrollers Debugger Manual...
  • Page 199: How To

    In order to work efficiently, the Debugger must be associated with a working directory. For Use from Desktop When starting the Debugger, the working directory can be defined in the file MCUTOOLS.INI, located in the Windows directory. Microcontrollers Debugger Manual...
  • Page 200: 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 your project. Figure 6.1 Debugger After Startup READY displayed in the status bar indicates that the simulator is ready. Figure 6.1, but varies depending on Microcontrollers Debugger Manual...
  • Page 201: Automating Debugger Startup

    Do this in the application that starts the Debugger (for example, Editor, Explorer, or Make 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).
  • Page 202: How To Load An Application

    The application continues execution until: • you decide to stop the execution (See • it reaches a breakpoint or watchpoint. • it detects an exception (watchpoints or breakpoints). Starting Debugger from CodeWarrior 6.1). How to Stop an IDE. Application). Microcontrollers Debugger Manual...
  • Page 203: How To Stop An Application

    How to Step in the Application The Debugger provides stepping functions at the application source level and assembler level (Figure 6.2). On Source Level Figure 6.2 Stepping at Source Level Microcontrollers Debugger Manual How To... How to Stop an Application...
  • Page 204: Step Over A Function Call (Flat Step)

    Step Out from a Function Call The Debugger provides two ways of stepping out from a function call: • Choose Run > Step Out • Click the Step Out icon from the debugger tool bar Microcontrollers Debugger Manual...
  • Page 205: Step On Assembly Level

    The Debugger provides two ways to see the list of local variables defined in a function: • Drag and Drop Drag a function name from the Procedure component to a Data component with attribute local. Microcontrollers Debugger Manual How To... How to Work on Variables...
  • Page 206: Display Global Variable From A Module

    3. Double-click on a module name. The Data component for global, which is neither frozen nor locked is the destination component. The destination Data component displays the list of variables defined in the selected module with their values. Microcontrollers Debugger Manual...
  • Page 207: Change Format For Variable Value Display

    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. Microcontrollers Debugger Manual (Table 6.1).
  • Page 208: Modify A Variable Value

    The Debugger provides you with the start address and size of a variable if you do the following: 1. Point to a variable name in a Data Component 2. Click the variable name The start address and size of the selected variable is displayed in the Data info bar. Figure 6.3. Microcontrollers Debugger Manual...
  • Page 209: Inspect Memory Starting At A Variable Location Address

    3. Select either binary or hexadecimal format. The format selected is valid for the Register component. The contents from all registers are displayed according to the selected format. Microcontrollers Debugger Manual How To... How to Work on the Register...
  • Page 210: Modify A Register Content

    Mnemonic characters for bits that are set to 1 appear in black, whereas mnemonic characters for bits that are cleared to 0 appear in gray. You can toggle single bits inside the bit register by double-clicking the corresponding mnemonic character. Microcontrollers Debugger Manual...
  • Page 211: Start Memory Dump At Address Where Register Is Pointing

    NOTE If Hex Format is checked, numbers and letters are considered to be hexadecimal numbers. Otherwise, type expressions and prefix Hex numbers with 0x or $. Microcontrollers Debugger Manual How To... How to Work on the Register...
  • Page 212: Modify Content Of Memory Address

    1. In the Source component window, point to the instruction you want to disassemble. 2. Hold down the left mouse button and press the R key. The disassembled code associated with the selected source instruction is grayed in the Assembly component. Microcontrollers Debugger Manual...
  • Page 213: How To View Code

    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 the left of each assembler instruction. Microcontrollers Debugger Manual (Figure 6.6). How To... How to View Code...
  • Page 214: How To Communicate With The Application

    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 the Write function to send data to the Terminal component window of the host. Microcontrollers Debugger Manual...
  • Page 215: Codewarrior Ide Integration

    7. In the Arguments field, type the arguments, for example, %targetFilePath - Target=sim. 8. Click on Apply to validate these changes. Microcontrollers Debugger Manual Changing the configuration from within the debugger may affect your project adversely. Under normal circumstances make all configuration changes in the CodeWarrior IDE.
  • Page 216 CodeWarrior IDE Integration Debugger Configuration Figure 7.1 IDE Target Window - Build Extras Panel Microcontrollers Debugger Manual...
  • Page 217: Debugger Dde Capabilities

    The service name of the Debugger DDE Server is HI-WAVE and the Topic name for the Debugger DDE Server is Command. The following example is done with DDECLient.exe from Microsoft. 1. Run the Debugger and in the Service field in the DDEClient type: HI-WAVE 2. In the Topic field type Command Microcontrollers Debugger Manual...
  • Page 218 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 ON to ensure the DDE works properly. Microcontrollers Debugger Manual...
  • Page 219: Synchronized Debugging Through Da-C Ide

    • Adding files to project • Building the Database • Configure the tools In the following sections, we assume that the Freescale tool kit is installed in the C:\Program Files\Freescale directory. You may have to adapt the paths to your Microcontrollers Debugger Manual...
  • Page 220: Create New Project

    Project root directory, if the full path of the file is not given. In our case, keep the single dot for the project root directory. Figure Microcontrollers Debugger Manual...
  • Page 221 For an efficient use of Freescale tools, that can be defined. Figure 9.2 DA-C Project Options Window - File Types Tab Microcontrollers Debugger Manual Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Figure 9.2...
  • Page 222 The supported C dialects of the C language used in the current project can be selected in this text field. In our example we chose the Freescale M68k language (adapt it to your needs). Figure 9.3 contains options that determine parameters of the C Microcontrollers Debugger Manual...
  • Page 223 Use the preinclude file to specify predefined macros and variable and function declarations for a particular compiler, which are not set by default in DA-C analysis. We have selected the one corresponding to our example: M68k preinclude file (adapt it to your needs). Microcontrollers Debugger Manual...
  • Page 224 This operation may also be performed from Folder view, if the directory is in the left section. NOTE When adding an entire directory to the project, only files with extensions defined in Options > Project > File types (as described in the section Configure File Types) are added. Microcontrollers Debugger Manual...
  • Page 225 In the Project Manager's window of DA-C, select the Logical View Tab shown in and unfold all fields. The project overview appears. Microcontrollers Debugger Manual Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Figure 9.5...
  • Page 226: Configuring The Tools

    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. Microcontrollers Debugger Manual...
  • Page 227 .%SaveAll .c:\Freescale\prog\cm68k.exe %CurrFile .%if(%Exist(edout),,%Message(No Messages found!)%Cancel) .%ErrClr(Compiler) .%ErrGet(edout,Compiler) .%Reset(%CurrFile) Microcontrollers Debugger Manual Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit (Figure 9.7). In the Toolbar field, you can associate a bitmap with Listing 9.1 in the Action Script field and change the directory to...
  • Page 228 Listing 9.2 Script for Linker Action Association +c:\Freescale\prog\linker.exe fibo.prm .%if(%Exist(edout),,%Message(No Messages found!)%Cancel) .%ErrClr() .%ErrGet(edout) Figure 9.8 DA-C Linker Settings Listing 9.2 in the Action Script field and change the directory to Microcontrollers Debugger Manual Figure 9.8. In the...
  • Page 229 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) Figure 9.9 DA-C Maker Settings Microcontrollers Debugger Manual Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Figure 9.9. In the...
  • Page 230: Debugger Interface

    • cDAPI interface implementation DLL - which is used by DA-C (Cdgen32.dll) • nDAPI communication DLL (provided by DA-C), which is used by Debugger • Debugger specific DLL for bridging its interface to debugging environment and DA- C's nDAPI (DAC.wnd) Figure 9.10. The whole system contains: Microcontrollers Debugger Manual...
  • Page 231 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 Properties Configuration In the DA-C main menu, choose Options >...
  • Page 232 Files\Freescale\WORK\<processor>c\project.ini). We will now add in the layout of the project the Debugger DA-C component (dac.wnd). In the Debugger select Component > Open from the main menu bar and choose Dac, as shown in 9.13. Figure 9.12 is opened. Figure Microcontrollers Debugger Manual...
  • Page 233: Synchronized Debugging

    Then select Debug > Run, the Debugger is now started and after a while stops on the specified breakpoint. Up to now, you can debug from the DA-C IDE with the toolbar, as shown in Figure Microcontrollers Debugger Manual Synchronized Debugging Through DA-C IDE 9.14). 9.15, or from the Debugger.
  • Page 234: Troubleshooting

    Options > Debugger main menu of DA-C doesn't match the debugger name specified in the Debugger. Figure 9.17 DA-C Debugger Support Message Figure 9.17 is displayed in the DA-C IDE, then the current Microcontrollers Debugger Manual Figure...
  • Page 235 Specification" and click OK. This establishes a new connection and saves the "Connection Specification" in the current Project.ini file in the section shown in Listing 9.4 DA-C Section in Project File. [DA-C] DEBUGGER_NAME=HI-WAVE 6.0 SHOWPROT=1 Microcontrollers Debugger Manual Synchronized Debugging Through DA-C IDE Figure 9.19. Both must be the same. Troubleshooting Listing...
  • Page 236 Synchronized Debugging Through DA-C IDE Troubleshooting Microcontrollers Debugger Manual...
  • Page 237: Book Ii - Hc08 Debug Connections

    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 Microcontrollers Debugger Manual...
  • Page 238 Book II Contents Microcontrollers Debugger Manual...
  • Page 239: Microcontroller Debugging First Steps

    Full Chip Simulation Considerations The Full Chip Simulation (FCS) connection runs a complete simulation of all processor peripherals and I/O on the user's PC. No development board is required. Each derivative Microcontrollers Debugger Manual are similar to the first steps mentioned in Wizard.
  • Page 240: Hc08 Serial Monitor Considerations

    When the debugger runs the SofTec HC08 connection, it can communicate and debug HC08-based hardware connected through the SofTec in-circuit debugger/programmer units, that is: SofTec Microsystems HC08 ISP Debuggers/Programmers (inDART Series) and Starter Kits (AK/SK/PK/ZK and newer Series). Microcontrollers Debugger Manual...
  • Page 241: Debugging First Steps Using The 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.
  • Page 242 Microcontroller Debugging First Steps Debugging First Steps Using the Wizard Figure 10.2 Project Parameters Screen Microcontrollers Debugger Manual...
  • Page 243 8. Click the Next button to proceed. Figure 10.3 Add Files to Project Screen 9. If needed, browse to and add existing files to project. 10. Click the Next button to proceed. Microcontrollers Debugger Manual Microcontroller Debugging First Steps Debugging First Steps Using the Wizard...
  • Page 244 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 Microcontrollers Debugger Manual...
  • Page 245 14. Click Next button to proceed Figure 10.6 PC-Lint screen 15. Depending on CPU derivative selected, choose whether or not to use PC-lint. 16. Click the Finish button. Microcontrollers Debugger Manual Microcontroller Debugging First Steps Debugging First Steps Using the Wizard...
  • Page 246: Switching Connections

    SofTec in-Dart HCS08 connection, to the FCS connection, the process is simple. To load the FCS connection from within an existing project, take the following steps: Normally, use the New Project or Change wizard to change the connections. This information is provided for advanced users only. Microcontrollers Debugger Manual...
  • Page 247 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. Microcontrollers Debugger Manual Microcontroller Debugging First Steps Switching Connections...
  • Page 248: Loading The P&E Multilink/Cyclone Pro Connection

    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. Figure 10.11 Component Menu Microcontrollers Debugger Manual...
  • Page 249 The file’s program counter points to the first instruction of the startup section. The menu selection MultilinkCyclonePro > Reset triggers a reset of the connection and executes the command file reset.cmd. Microcontrollers Debugger Manual Microcontroller Debugging First Steps Switching Connections...
  • Page 250 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 Microcontrollers Debugger Manual...
  • Page 251: Loading The Hc(S)08 Or Rs08 Open Source Bdm Connection

    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. Microcontrollers Debugger Manual Microcontroller Debugging First Steps Switching Connections...
  • Page 252 Microcontroller Debugging First Steps Switching Connections 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. Microcontrollers Debugger Manual...
  • Page 253: Hc08 Full Chip Simulation

    Choose the Full Chip Simulation option from the Set Connection dialog box. See 11.1. Figure 11.1 Set Connection Dialog Box - Full Chip Simulation Option When you have selected this option, the Connection list menu becomes the HCS08FCS Menu, and appears as shown in Microcontrollers Debugger Manual section below. Figure 11.2. Figure...
  • Page 254 HC08 Full Chip Simulation Configuration Procedure Figure 11.2 Connection (HCS08FCS) List Menu Microcontrollers Debugger Manual...
  • Page 255: Select Device Option

    Note that the parameter given is not the number of cycles that executed, but rather the total cycle count of the simulator (displayed in the Register Window). Microcontrollers Debugger Manual Figure 11.3. HC08 Full Chip Simulation...
  • Page 256 Selecting a file in this dialog box brings up the Register Window (see displays the values and significance for each bit in the register. The registers can be Figure 11.4) is opened. You Figure Figure 11.6), which Microcontrollers Debugger Manual 11.5),...
  • Page 257: Peripheral Modules Options

    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 execute that command. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 258: Adc Module Option

    ADC data register. Figure 11.9 Memory Component Window Conversion completion sets the appropriate flag. If you enable interrupts, the Program Counter changes flow to the interrupt routine (as defined in the vector space of the MCU). Microcontrollers Debugger Manual...
  • Page 259: Adc User Commands

    Notice that if the ADC is currently using a value, this command does not prevent the ADC from using it. See ADDI Command for information on how to access the input buffer of the ADC interface. Syntax >ADCLR Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 260: Clock Generation Module Option

    External Oscillator, Bus Frequency and CGMXCLK Frequency, open the HCS08FCS menu, then select Clocks Module > Show MCU Clocks. Figure 11.10 Show MCU Clocks Menu Once you select the MCU Clocks Menu, the Cycles window containing all of the above- mentioned Clock Frequencies appears. Microcontrollers Debugger Manual...
  • Page 261 PLL/DCO, and therefore the bus frequency. The P&E simulator is a cycle-based simulator, so changing the XTAL value does not affect the speed of simulation; it does, however, affect the ratio in which peripherals receive cycles. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 262: High-Resolution Pwm Module

    I/O pins that are multiplexed with the HRP module. To do that, the HRP module has to be configured for the desired period with the enabled output on corresponding TOP and BOT pins. The Memory Window displays the address of the register corresponding to the appropriate I/O port. Microcontrollers Debugger Manual...
  • Page 263 Figure 11.14 Register Window With Cycles Display High-Resolution PWM Commands The following commands are available for High-Resolution Pulse-Width Modulation on the M68HC08 processor. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 264 Stop button 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. Microcontrollers Debugger Manual...
  • Page 265: Input/Output (I/O) Ports Module

    Simulated Port Inputs for all general I/O ports. It displays the current simulated values to all applicable input ports. See for more information about the various forms of this command. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 266: Input/Output Ports Commands

    I/O functionality. For more information on how to properly configure I/O pins, refer to the Freescale user manual corresponding to the microprocessor that you are using. Input/Output Ports Commands Use the following commands for general IO port manipulation. Microcontrollers Debugger Manual...
  • Page 267 Figure 11.17 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 Microcontrollers Debugger Manual <n> Figure 11.17 HC08 Full Chip Simulation Configuration Procedure below. The user may then use...
  • Page 268: External Interrupt Module

    Following the IRQ event, you can observe the IRQ Flag going up in the IRQ Status and Control register. Figure 11.18 Memory Component Window IRQ Commands The following interrupt request commands are available in FCS mode on the HC08 processor. Keyboard Interrupt Commands Microcontrollers Debugger Manual for more...
  • Page 269: Keyboard Interrupt Module

    Command line window. The <x> represents the corresponding I/O port, while <n> stands for the input value to write to this port. At the same time, you can use Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure Figure 11.19.
  • Page 270 KBI interrupt vector is properly configured. For more information on KBI configuration, refer to the Freescale user manual for your microprocessor. Keyboard Interrupt Commands Use the following Keyboard interrupt commands while in full chip simulation mode. for more information about the various forms of this Microcontrollers Debugger Manual FCS Timer...
  • Page 271 Figure 11.22 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 Microcontrollers Debugger Manual <n> Figure 11.22. You may then use this box to HC08 Full Chip Simulation...
  • Page 272: Multi-Master Inter-Integrated Circuit Module

    MMIIC module is turned on and properly configured for receiving data from an external MMIIC device. Once the simulation of the data transmission is over, the arrow moves to the next value in the MMIIC Input Buffer. Figure 11.23 IIC Input Buffer Display Microcontrollers Debugger Manual...
  • Page 273 MMIIC interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the MMIIC interrupt vectors are properly defined. For more information on how to configure the MMIIC module for desired operation, refer to the Freescale user manual corresponding to your microprocessor. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 274 This is an example of data being returned from a slave device. Once the MCU transmits a start signal and the target address, it receives an ACK from the slave device. An ACK is implied unless a NACK is specified via the IICDI command. Microcontrollers Debugger Manual...
  • Page 275 • The address $55 comes in specifying a write (slave receive). The Address Register of the current simulated device was previously set to $55. • The data byte $AA comes in. • The data byte $22 comes in. • A STOP signal comes in. Microcontrollers Debugger Manual...
  • Page 276: Fcsmscan Controller Module

    FCSMSCAN Controller Module The MSCAN Controller Module fully simulates the operation of the MSCAN08 Protocol Version 2.0 based device, including: • Flag polling • Interrupt enabled mode • 0-8 bytes data length • Transmission and reception of external data Microcontrollers Debugger Manual...
  • Page 277: Fcsdemo Can Program

    The MSCAN08 peripheral is a scalable control area network (CAN) 2.0 compliant device that allows microcontrollers to exchange data between themselves at high speeds. This is done through a high-speed serial link that is deterministic and reliable. CAN devices are often utilized in automobiles, where multiple microcontrollers need to be connected into a network.
  • Page 278 ; Data Byte 1 ; Data Byte 2 ; Data Byte 3 ; Data Byte 4 ; Message 3 Address ; Message 3 Address ; Message 3 Priority ; start of Flash1 for AZ60 ; start of Vectors for AZ60 Microcontrollers Debugger Manual...
  • Page 279 #Msg1_Desc lsla lsla lsla CT0IDR0 Microcontrollers Debugger Manual ; Message 3 Length ; Data Byte 1 ; Data Byte 2 ; place MSCAN08 into soft reset state ; CAN clock source = CGMOUT*2 ; set SJW=0, baud rate prescalar=div by 2 ;...
  • Page 280 ; get next byte in message address ; get next byte in message address ; get next byte in message address ; get next byte in message address ; get the message priority ; get the message length ; get the message data Microcontrollers Debugger Manual...
  • Page 281 CT1IDR1 CT1IDR1 #$80 rola rola CT1IDR1 CT1IDR1 Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure ; get the message data ; get the message data ; get the message data ; get the message data ; get the message data ;...
  • Page 282 ; get the message data ; get the message data ; get the message data ; set up transmission message 3 ; get message address ; get next byte in message address ; get next byte in message address Microcontrollers Debugger Manual...
  • Page 283 #$07 CTFLG **************************************************************** * MAIN_INIT - This is the point where code starts executing Microcontrollers Debugger Manual HC08 Full Chip Simulation ; get next byte in message address ; get next byte in message address ; get next byte in message address ;...
  • Page 284 ; get pointer to local circular buffer ; store data in next location ; index pointer to next location ; if end of circular buffer ; then reset pointer to start of ; circular buffer ;if no more data in message then done Microcontrollers Debugger Manual...
  • Page 285 So how is the code laid out in order to handle this? The beginning of the code shows symbol defines for addresses within memory for RAM, Flash, and interrupt vectors. The CAN address is specified here as well. Also included are the register file definitions, Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure ;...
  • Page 286 When a user types this command in the simulator, the CAN IN window appears as shown in window, so we will enter some into it. Figure 11.26. There are no CAN packets specified yet in the Microcontrollers Debugger Manual...
  • Page 287 DATA, the CAN address to $01234567, the address format to Extended, and the data field for the given 8 bytes. This is shown in through the CANIN command. Microcontrollers Debugger Manual HC08 Full Chip Simulation Figure 11.27.
  • Page 288 CANOUT command. The user can type the command GO in the simulator and let the simulation run for a while. Hit the Enter Figure 11.30 shows the memory window. Microcontrollers Debugger Manual...
  • Page 289 So, the CANIN command can include parameters that specify the type of packet, CAN address, and data. See the CANIN command in the help file for more details. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure Figure 11.31...
  • Page 290: Fcsmscan Commands

    Input values can be entered while the window is open. Figure 11.33 MSCAN_IN Buffer An arrow points to the next input value to the CAN. The maximum number of input packets is 256. Syntax >CANIN [<n>] Microcontrollers Debugger Manual...
  • Page 291: Fcs Programmable Timer Interrupt Module

    Once the PIT Status and Control register properly configures the operation of the module, the PIT Counter starts incrementing. If you enable modulo up count operation, you can observe the PIT overflow flag in the PIT Status and Control register in the Memory Window. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 292: Fcs Serial Communications Interface Module

    SCI data register once the SCI module has been turned on and is properly configured for receiving data from an external serial device. Once the simulation of the data transmission is over, the arrow moves to the next value in the SCI IN Buffer. Microcontrollers Debugger Manual...
  • Page 293 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 data register. Figure 11.37 Memory Component Window Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 294: Fcssci Commands

    You can enter input values while the window is open. An arrow points to the next input value to the SCI. The maximum number of input values is 256 bytes. Microcontrollers Debugger Manual...
  • Page 295 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. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 296: Fcs Slave Lin Interface Controller Module

    SLIC input buffer is written to the SLIC module identifier or data registers. After the simulation of the data transmission is complete, the arrow moves to the next value in the SLIC IN Buffer. Microcontrollers Debugger Manual...
  • Page 297 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. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 298: Fcsslic Commands

    This resets the buffers and clear out all packets. Notice that if the SLIC is currently shifting a value, this command allows the SLIC to finish the transfer. See SLCDI command and SLCDOUT command for accessing the input and output buffers of the SLIC interface. Syntax >SLCCLR Microcontrollers Debugger Manual...
  • Page 299 The SLIC data input buffer can store up to 256 bytes. Syntax SLCDI Example SLCDI Bring up the SLIC IN buffer. Figure 11.44 SLIC Data Input Configuration Dialog Box Figure 11.45 SLIC Input Data Buffer Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 300: Fcs Serial Peripheral Interface Module

    SPI data register once the SPI module has been turned on and is properly configured for receiving data from an external serial device. Once the simulation of the data transmission is over, the arrow moves to the next value in the SPI IN Buffer. Microcontrollers Debugger Manual...
  • Page 301 The user can also observe different SPI flags in the Memory window. If the module is run in the Flag Polling mode, poll the flag corresponding to the expected SPI event. If the SPI Microcontrollers Debugger Manual HC08 Full Chip Simulation...
  • Page 302: Fcsspi Commands

    Input values can be entered while the window is open. An arrow points to the next value to be used as input to the SPI. The maximum number of input values is 256 bytes. Microcontrollers Debugger Manual...
  • Page 303 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. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 304: Fcstimer Interface Module

    FCSTimer Interface Module In FCS Mode, 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 Microcontrollers Debugger Manual...
  • Page 305 Once the Input Capture event takes place, the CHxF can be observed in the Channel Status and Control register in the Memory window. Figure 11.52 Memory Component Window Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 306 CYCLES <n>, where <n> is the new cycle value. If an event has a pre-calculated number of cycles, use CYCLE 00 to reset the number of cycles and GOTOCYCLE <n> to run through the code until it arrives at the expected event. Figure 11.53 Register Window With Cycles Display Microcontrollers Debugger Manual...
  • Page 307 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. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 308 IRQ. Figure 11.54 Simulated Port Inputs Dialog Box When using In-Circuit Simulation mode, the INPUTS command shows the simulated input values to any applicable port. <n> Figure Microcontrollers Debugger Manual 11.54. Use this box to specify the...
  • Page 309: Fcs Universal Serial Bus (Usb) Module

    Show I/O port input values. FCS Universal Serial Bus (USB) Module Some of the microcontrollers in the MC68HC08 family contain USB compliant peripheral devices. These can be low-speed or high-speed USB slave devices. This means that all USB transfers are initiated by a host (i.e. a personal computer) and that the microcontroller needs to be setup to respond with the appropriate acknowledgement messages.
  • Page 310 ; Characteristic of Request ; Request Code ; Low byte Value Field ; High byte Value Field ; Low byte Index Field ; High byte Index Field ; Low byte Length Field ; High byte Length Field Microcontrollers Debugger Manual...
  • Page 311 {CDesc_End-Con_Desc} ; Descriptor Length {E2Desc_End-Con_Desc},$00 ; Total data length (Config- CDesc_End: * Interface Descriptor Int_Desc: {IDesc_End-Int_Desc} ; Descriptor Length Microcontrollers Debugger Manual HC08 Full Chip Simulation ; Descriptor Type (Device) ; USB specification Release (2.00) ; Class Code ; Subclass Code ;...
  • Page 312 ; Endpoint Attribute (Bulk) ; Maximum Packet Size for EP2 (8 bytes) ; Polling Interval=255[ms] ; Usage Page (vendor defined) ; Usage (vendor defined) ; Collection (Application) ; Usage (vendor defined) ; Usage (vendor defined) ; Logical Minimum ($00) Microcontrollers Debugger Manual...
  • Page 313 **************************************************************** * GETDESC_PROC - This procedure handles the standard request to get the device's descriptors. **************************************************************** GETDESC_PROC: Microcontrollers Debugger Manual HC08 Full Chip Simulation ; Logical Maximum ($FF) ; Report Size (8 bits) ; Report Count (1 field) ; Input (Data, Variable, Absolute) ;...
  • Page 314 ; store in USB endpoint 0 data buffer ; all descriptors more than 8 bytes ; store end location of the descriptor ; store pointer to next byte in descriptor ; take report descriptor information ; store in USB endpoint 0 data buffer Microcontrollers Debugger Manual...
  • Page 315 SETUP_EXIT Microcontrollers Debugger Manual ; all descriptors more than 8 bytes ; store end location of the descriptor ; store pointer to next byte in descriptor ; add length specified in setup packet and store in tptr ;...
  • Page 316 ; is this IN packet for data stage of GET_DESCRIPTOR? ; clear index into data buffer ; get pointer to descriptor ; get descriptor byte ; save pointer to descriptor ; get index to data buffer ; place byte in buffer Microcontrollers Debugger Manual...
  • Page 317 ************************************************************** MAIN_INIT: clra clrx #$01,CONFIG #$FF,PULLCR Init_USB Microcontrollers Debugger Manual HC08 Full Chip Simulation ; save index to data buffer ; is it last descriptor byte? ; is data buffer filled? go send data ; else continue ; if so then end of data transfer ;...
  • Page 318 ; set the DVALID flag ; is it a packet for endpoint 2? ; is it an OUT packet? ; get data received in endpoint buffer ; and transfer to local data buffer ; clear the TFRC/DVALID flag ; exit interrupt Microcontrollers Debugger Manual...
  • Page 319 ************************************************************** * DUMMY_ISR - Dummy Interrupt Service Routine. Just does a return from interrupt. ************************************************************** DUMMY_ISR: ************************************************************** Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure ; Is it USB reset? ; reset USB reset flag ; exit interrupt ; Is there a change in ;...
  • Page 320 ; TIM1 Overflow Vector ; TIM1 Channel 1 Vector ; TIM1 Channel 0 Vector ; PLL Vector ; IRQ Vector ; USB Endpoint Vector ; USB System Vector ; SWI Vector ; Reset Vector Microcontrollers Debugger Manual...
  • Page 321 RESET state. After the USBRESET command, step through the code with a t command to enter the system interrupt service routine. Enter the t command a few more times to exit the ISR and return to the main loop. Microcontrollers Debugger Manual...
  • Page 322 Figure 11.55. There are no USB packets specified yet in the window. Figure 11.56. It is in this window that the user can specify the Figure 11.57 shows the flow of packets between the USB host and Microcontrollers Debugger Manual...
  • Page 323 Each data packet can hold only eight bytes, so we need three transfers in this case. Figure 11.61 shows the USB IN window. Figure 11.62 shows the current appearance of the USB OUT window. Microcontrollers Debugger Manual...
  • Page 324 HC08 Full Chip Simulation Configuration Procedure Figure 11.57 USB Packet Exchange Diagram Microcontrollers Debugger Manual...
  • Page 325 HC08 Full Chip Simulation Configuration Procedure 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 Microcontrollers Debugger Manual...
  • Page 326 DATA0 packet from the host to be received, we get the USB IN window to look like that shown in Figure 11.64 the DATA0 packet output during the data stage. This packet and the USB out window to look like that shown in Microcontrollers Debugger Manual Figure 11.65...
  • Page 327 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. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 328: Usb Commands

    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 for USB simulation Microcontrollers Debugger Manual...
  • Page 329 Example >USBIN $55 Set the next input value to the USB to $55 >USBIN Pull up the data window with all the input values. Microcontrollers Debugger Manual is the USB address for the packet. HC08 Full Chip Simulation Configuration Procedure...
  • Page 330 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 Microcontrollers Debugger Manual...
  • Page 331 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. Microcontrollers Debugger Manual HC08 Full Chip Simulation Configuration Procedure...
  • Page 332 HC08 Full Chip Simulation Configuration Procedure Microcontrollers Debugger Manual...
  • Page 333: Mon08 Interface Connection

    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 Manager window opens with its Connect Target tab selected. Microcontrollers Debugger Manual...
  • Page 334 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 Microcontrollers Debugger Manual...
  • Page 335: Advanced Settings Tab

    Whenever power is automatically or manually 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 Microcontrollers Debugger Manual MON08 Interface Connection Connection Procedure...
  • Page 336 If these pins are not set up properly before the processor powers up, the processor may start up in user mode. Device Class Description. Device Class Microcontrollers Debugger Manual...
  • Page 337 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 12.6 Power Up Dialog Box Microcontrollers Debugger Manual MON08 Interface Connection Connection Procedure...
  • Page 338: Target Mcu Security Bytes

    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. Microcontrollers Debugger Manual...
  • Page 339 If you ignore 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 than security failure, the connection dialog box always appears. Microcontrollers Debugger Manual MON08 Interface Connection Connection Procedure...
  • Page 340: Status Area

    To pass security, the software must send 8 security bytes to the processor. The processor echoes each of these eight bytes twice. If all 8 bytes did not get the proper two-byte echo, this flag reads ‘N’. Reasons for this include: Microcontrollers Debugger Manual...
  • Page 341 – 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. Microcontrollers Debugger Manual MON08 Interface Connection Connection Procedure...
  • Page 342: Active Mode Connection Menu Options

    Active Mode Connection Menu Options When the microprocessor is connected, more menu entries become available to the user. Figure 12.9 Additional MON08 Connection Menu Options Microcontrollers Debugger Manual...
  • Page 343 Non-Volatile memory location. Sync 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. Microcontrollers Debugger Manual MON08 Interface Connection Connection Procedure...
  • Page 344 PROG08SZ. PROG08SZ lets an advanced user control the step-by- step execution of the Flash erase/programming procedure. See information on how to use PROG08SZ can be found on P&E Microcomputer Systems website at: www.pemicro.com. Figure 12.11 PROG08SZ Programmer Window Figure 12.11. More Microcontrollers Debugger Manual...
  • Page 345 The registers can be viewed and their values modified, and the values can be stored back into debugger memory. Figure 12.14 Register Window Microcontrollers Debugger Manual MON08 Interface Connection Figure 12.12) opens. You may also open it by Figure 12.13), which shows a list of the associated registers,...
  • Page 346: Device Class Description

    The user is be prompted to turn power on and off to reset the microprocessor, as the PC doesn't have control of the microprocessor reset. Turning off the power supply is necessary to pass the initial security Microcontrollers Debugger Manual...
  • Page 347 POR (power-on reset) which requires the processor's voltage to dip below 0.1v. Once security is passed, resetting the device is facilitated by the above circuitry. Microcontrollers Debugger Manual MON08 Interface Connection Device Class Description...
  • Page 348 MON08 Interface Connection Device Class Description Microcontrollers Debugger Manual...
  • Page 349: Ics Mon08 Interface Connection

    Simulation commands become unnecessary, and therefore do not function: I/O ports, SCI, SPI, IRQ, ADC, LCD, KBI. All other modules function as fully simulated modules. For information about relevant simulation commands, see the Microcontrollers Debugger Manual HC08 Full Chip Simulation section.
  • Page 350: Connection Procedure

    1. Choose the ICS MON08 Interface option from the set connection dialog box, as shown 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 Microcontrollers Debugger Manual...
  • Page 351 Manager. See 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 Selected Interface. Microcontrollers Debugger Manual ICS MON08 Interface Connection Figure 13.3.
  • Page 352: Advanced Settings Tab

    Tpu delay time before attempting to contact the 68HC08 processor. This is to allow time not only for power to be fully available, but to wait until any reset driver has finally released the RESET line. Microcontrollers Debugger Manual...
  • Page 353 1. Software automatically powers down the ICS. 2. Software prompts the user to power down the board as follows: Microcontrollers Debugger Manual ICS MON08 Interface Connection Connection Procedure Device Class Description.
  • Page 354: Cycle Power Radio Button

    1. Software automatically powers down the ICS. 2. Software asks the user to power cycle their board as follows: Figure 13.7 Power Cycle Dialog Box 3. Software automatically powers up the ICS, which configures the processors MON08 configuration pins. Microcontrollers Debugger Manual...
  • Page 355: Target Mcu Security Bytes

    PC. A valid character transmitted from the PC is echoed once by the loopback circuitry on the board and once by the monitor of the target processor itself. Microcontrollers Debugger Manual ICS MON08 Interface Connection Connection Procedure...
  • Page 356 Once the processor has properly received the eight bytes from the PC software to complete its security check, it transmits a break character to the PC signaling entry into monitor mode. This break character is sent regardless of whether the security Microcontrollers Debugger Manual...
  • Page 357 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 it in order to pass security. Microcontrollers Debugger Manual ICS MON08 Interface Connection Connection Procedure...
  • Page 358: Active Mode Connection Menu Options

    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 Microcontrollers Debugger Manual...
  • Page 359 PROG08SZ. PROG08SZ lets an advanced user control the step-by- step execution of the Flash erase/programming procedure. See information on using PROG08SZ, refer to P&E Microcomputer Systems website at: www.pemicro.com. Microcontrollers Debugger Manual ICS MON08 Interface Connection Connection Procedure Figure...
  • Page 360 This begins interactive setup of system registers such as I/O, timer, and COP watchdog. 13.11) opens. You may also open it by Figure Figure 13.12), which shows a list of the associated registers, Microcontrollers Debugger Manual...
  • Page 361: Device Class Description

    This is so that the software, when attempting to establish communications, can fully power the processor down. The software running on the PC controls power to the user’s MCU development board via the serial port DTR line. Microcontrollers Debugger Manual ICS MON08 Interface Connection Device Class Description Figure 13.13), which displays the...
  • Page 362 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. Microcontrollers Debugger Manual...
  • Page 363 POR (power-on reset) which requires the processor's voltage to dip below 0.1v. Once security is passed, resetting the device is facilitated by the above circuitry. Microcontrollers Debugger Manual ICS MON08 Interface Connection Device Class Description...
  • Page 364 ICS MON08 Interface Connection Device Class Description Microcontrollers Debugger Manual...
  • Page 365: Hc08 P&E Multilink/Cyclone Pro Connection

    Figure 14.1 Set Connections Dialog Box - P&E Multilink/Cyclone Pro Selected 3. Click the OK button - The Connection Manager Window opens with the Connect to Target Tab exposed, as shown in Microcontrollers Debugger Manual Device Class Description for a definition of each interface class.
  • Page 366 • The device has its own clock 6. Click on Refresh, which displays all P&E devices that are automatically detected, such as Cyclone Pro USB, Cyclone Pro Ethernet and USB-ML-MON08 Multilink. See Figure 14.2. Figure 14.3. Figure 14.4. Microcontrollers Debugger Manual...
  • Page 367 Connection Manager window and choose the interface to be deleted. Figure 14.6. Figure 14.6 Connection Manager Dialog Box - Remove A Manually Configured Multilink/ Cyclone Pro Interface Microcontrollers Debugger Manual HC08 P&E Multilink/Cyclone Pro Connection Figure 14.5. For more information about Connection Procedure...
  • Page 368: Advanced Settings Tab

    Tpu delay time before attempting to contact the 68HC08 processor. This is to allow time not only for power to be fully available, but to wait until any reset driver has finally released the RESET line. Microcontrollers Debugger Manual...
  • Page 369 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 14.8 Power Down Dialog Box Microcontrollers Debugger Manual HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 370 3. Software automatically powers up the ICS, which configures the processor’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. Microcontrollers Debugger Manual...
  • Page 371: Target Mcu Security Bytes

    Use this checkbox to make the software ignore a failure so that it can properly pass the M68HC08 security check. If the checkbox is set, the software attempts to establish Microcontrollers Debugger Manual HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 372: Status Area

    – 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. Microcontrollers Debugger Manual...
  • Page 373 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: Microcontrollers Debugger Manual HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 374: Connection (Multilinkcyclonepro) Menu

    Freescale processor that they wish to use. When choosing Device from the MultilinkCyclonePro menu, extended menus open that allow you to select the family (e.g. AB Family), and device type of the MCU that you are using. Microcontrollers Debugger Manual...
  • Page 375: Active Mode Menu Options

    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 Microcontrollers Debugger Manual HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 376 Non-Volatile memory location. Sync 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. Microcontrollers Debugger Manual...
  • Page 377 Flash erase/programming procedure. See information on how to use PROG08SZ can be found on P&E Microcomputer Systems website at: www.pemicro.com. Figure 14.16 PROG08SZ Programmer Window Microcontrollers Debugger Manual HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure...
  • Page 378 The registers can be viewed and their values modified, and the values can be stored back into debugger memory. Figure 14.19 Register Window Figure 14.17) opens. You may also Figure 14.18), which shows a list of the associated Figure 14.19), which displays the Microcontrollers Debugger Manual...
  • Page 379: Debugging Limitations

    7. When the target board is reset by the debugger, power to the microcontroller may be turned off for a short duration. Although much of RAM may look the same, some values may have changed. Microcontrollers Debugger Manual HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 380: Device Class Description

    16-pin MON08 header. In addition the Cyclone Pro can be used for programming and debugging the HC08/HC12/HCS12 Freescale microprocessors via a standard 6-pin ribbon cable. To take advantage of this functionality, connect proper signals to the standard 6-pin Background Debug Module header. Microcontrollers Debugger Manual...
  • Page 381: Hc08 Ics P&E Multilink/Cyclone Pro Connections

    Simulation commands become unnecessary, and therefore do not function: I/O ports, SCI, SPI, IRQ, ADC, LCD, KBI. All other modules function as fully simulated modules. For information about relevant simulation commands, see the Microcontrollers Debugger Manual HC08 Full Chip Simulation section.
  • Page 382: Connection Procedure

    1. Choose the ICS P&E Multilink/Cyclone Pro option from the set connection dialog box, as shown in 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 Figure 15.1. Microcontrollers Debugger Manual...
  • Page 383 Cyclone Pro for ethernet operation, see the Cyclone Pro User's Manual. 7. To remove a manually configured interface, click on Remove Connection button and choose the interface to be deleted. See Microcontrollers Debugger Manual HC08 ICS P&E Multilink/Cyclone Pro Connections Figure Figure 15.5.
  • Page 384: 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 Microcontrollers Debugger Manual...
  • Page 385 If these pins are not set up properly before the processor powers up, the processor may start up in user mode. Microcontrollers Debugger Manual HC08 ICS P&E Multilink/Cyclone Pro Connections...
  • Page 386 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: Figure 15.8 Power Up Dialog Box Microcontrollers Debugger Manual...
  • Page 387: Target Mcu Security Bytes

    This status indicates whether or not the first echoed character from the hardware loopback was received when one of the security bytes was transmitted. If the status is Microcontrollers Debugger Manual HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure...
  • Page 388 Once the processor has properly received the eight bytes from the PC software to complete its security check, it transmits a break character to the PC signaling entry into monitor mode. This break character is sent regardless of whether the security Microcontrollers Debugger Manual...
  • Page 389 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 it in order to pass security. Microcontrollers Debugger Manual HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure...
  • Page 390: Active Mode Menu Options

    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 Microcontrollers Debugger Manual...
  • Page 391 PROG08SZ. PROG08SZ lets an advanced user control the step-by- step execution of the Flash erase/programming procedure. See information on using PROG08SZ, access P&E Microcomputer Systems website at: www.pemicro.com. Microcontrollers Debugger Manual HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Figure...
  • Page 392 Register Block register listing (see registers, their addresses, and their descriptions. This begins interactive setup of system registers such as I/O, timer, and COP watchdog. Figure 15.13) opens. You may also Figure 15.14), which shows a list of the associated Microcontrollers Debugger Manual...
  • Page 393: Device Class Description

    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 target. Microcontrollers Debugger Manual HC08 ICS P&E Multilink/Cyclone Pro Connections Figure Device Class Description 15.15), which displays the...
  • Page 394: Class 8 Device

    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 of this functionality, connect proper signals to the standard 6-pin Background Debug Module header. Microcontrollers Debugger Manual...
  • Page 395: Softec Hc08 Connection

    CodeWarrior IDE and the SofTec inDART-HC08 connection. The differences between the two paths hinge on the starting point for the steps: • Using the Stationary Wizard at the start of the project • From within an existing project Microcontrollers Debugger Manual...
  • Page 396: Using The Stationery Wizard

    Figure 16.1 Wizard Connection Selection 5. Finish the Wizard steps - the IDE opens. 6. In the IDE main window toolbar Project menu, choose Project > Make. 7. Now choose Project > Debug to start the debugger. Microcontrollers Debugger Manual...
  • Page 397: From Within An Existing Project

    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 box, choose the correct target processor. Microcontrollers Debugger Manual SofTec HC08 Connection From Within an Existing Project...
  • Page 398: Indart-Hc08 Menu Options

    Select the inDART-HC08 > MCU Configuration option to display the 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 User’s Manual from SofTec. MCU Configuration Microcontrollers Debugger Manual...
  • Page 399: Mcu Configuration Dialog Box

    Settings and Power Supply Parameters. All of the parameters must be carefully set to ensure successful operation. Refer to the inDART®-HC08 In-Circuit Debugger/Programmer for Freescale HC08 Family FLASH Devices User’s Manual from SofTec for further details. Microcontrollers Debugger Manual SofTec HC08 Connection From Within an Existing Project About Dialog Box.
  • Page 400: About Dialog Box

    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 Box Microcontrollers Debugger Manual...
  • Page 401: Hc08 Fsicebase Emulator

    The environment allows you to perform source-level debugging. The CodeWarrior IDE software also simplifies the process of managing and building a software project, and debugging code for an embedded MCU system. The benefit to you is reduced development time. Microcontrollers Debugger Manual...
  • Page 402: System Requirements

    – As many as 1.33M pre- or post-trigger points – Trace buffer can be filled while single-stepping through user software – 32-bit time tag – Custom clock from 4100Hz to 40MHz in 5kHz steps, permitting wide time variance between analyzer events Microcontrollers Debugger Manual...
  • Page 403: System Components

    – Online Help and PDFs • Two logic clip cable assemblies: twisted-pair cables that connect the station module to your target system. You can also use the cable assembly to connect a test fixture, a Microcontrollers Debugger Manual HC08 FSICEBASE Emulator FSICEBASE Overview...
  • Page 404 FSICEBASE. • Optional Bus State Analyzer (BSA) cables The base station contains ports for three BSA pods. You can purchase BSA cables in addition to those supplied with the FSICEBASE system. Microcontrollers Debugger Manual...
  • Page 405: Setting Up The Fsicebase System

    Connect one end of ethernet cable to ethernet port of FSICEBASE (make sure to use the cross-over ethernet cable when connecting directly to a Network Interlace Card (NIC)) Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Setting Up the FSICEBASE System...
  • Page 406 LED before attempting to connect. The FSICEBASE is now ready to accept communication with a host computer. Install the CodeWarrior IDE software, create a project, and start the debugger to establish communication between your host computer and the FSICEBASE. Microcontrollers Debugger Manual...
  • Page 407: Establishing Communication

    Select FSICEBASE emulator from connection drop-down box d. Click OK — the debugger adds the FSICEBASE-HC08 menu to the main menu 5. From debugger main menu, select FSICEBASE-HC08 6. Select Communication— Communication dialog box appears Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Establishing Communication Setting Up the Hardware.
  • Page 408: Communication Through Usb Port

    From debugger main menu, select Component b. Select Set Connection — Set Connection dialog box appears c. Select FSICE emulator from Connection drop-down box d. Click OK Setting Up the Hardware. Starting the Debugger. Microcontrollers Debugger Manual “Assigning an...
  • Page 409: Setting Up The System

    2. From debugger main menu, select Component 3. Select Set Connection from the Component menu — Set Connection dialog box opens Figure 17.2 Set Connection Dialog Box Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Setting Up the System (Figure 17.1)
  • Page 410: Specifying Communication Information

    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 connection see Figure 17.3. The Specifying A Connection. Microcontrollers Debugger Manual...
  • Page 411 The debugger attempts to connect to the FSICEBASE. An information box shows the progress. You can click Cancel in the information box if you do not want to immediately connect to the FSICEBASE. Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Setting Up the System...
  • Page 412: Assigning An Ip Address To Fsicebase

    Browse to the following executable file: installation_directory \prog\GDI\FSICEBASE\setup.exe The installation_directory is the directory where you installed the CodeWarrior IDE software. The default installation directory is C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\ d. Click OK — The FSICEBASE Configuration Utility starts (Figure 17.4) Microcontrollers Debugger Manual...
  • Page 413 All the hosts in a sub-network must have the same subnet mask. For that reason, if you connect the host computer directly to the FSICEBASE (not through a LAN), you must ensure that the host computer uses the same subnet mask as the FSICEBASE. Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Figure 17.1.
  • Page 414: Specifying A Memory Map

    MCU supported by an emulator module (EM). Personality files ship with the separately purchased EMs. Refer to the appropriate EM user’s manual to determine the personality files used by a particular EM module. 17.5) with the information that you specified. If information is Microcontrollers Debugger Manual...
  • Page 415 MCU registers. Figure 17.6 Command Window in the Debugger Microcontrollers Debugger Manual HC08 FSICEBASE Emulator (Figure 17.6) displays memory map information: a representation...
  • Page 416 In Comment text box, type new description of range if appropriate f. Click Update button to update highlighted range, or Add button to add a new range (be careful not to overlap ranges) Specifying A Connection. (Figure 17.7) Microcontrollers Debugger Manual...
  • Page 417: Specifying The Clock Speed

    FSICEBASE-HC08 menu, you need to specify the connection. For more information on specifying a connection see 3. Select Target Signals — Target Signals dialog box opens Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Starting the Debugger.
  • Page 418 9.8304MHz, you get an accurate crystal-sourced clock. 6. Click OK The debugger instructs the FSICEBASE to use new clock information. The Command window (Figure Figure 17.9 Confirmation Message in Command Window 17.9) of the debugger shows confirmation message. Microcontrollers Debugger Manual...
  • Page 419: Emulation System Reset

    The table also provides color code information for each pod. The external clock inputs are through pin 17 of each pod. Pod A pin 17 is the external clock input for the emulator. To Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Setting Up Logic Cables and Connectors Table 17.1...
  • Page 420 Table 17.1 Pod and Logic Cable Pin Assignments Pod Pin Pod A Signal Pod B Signal LC10 LC11 LC12 LC13 LC14 LC15 EXT_OSC TT_OSC Probe Color Brown (BRN) Red (RED) Orange (ORG) Yellow (YEL Green (GRN) Blue (BLU) Purple (PUR) Gray (GRY) White Black Microcontrollers Debugger Manual...
  • Page 421: Bus State Analyzer (Bsa)

    It also records the data that is in the lines of Pods A, B, and C. You can control the way that the BSA records this information by specifying a recording mode. Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Bus State Analyzer (BSA)
  • Page 422 FSICEBASE-HC08 menu, you need to specify the connection. For more information on specifying a connection see 4. Select Bus Analyzer Configuration — Bus Analyzer Configuration dialog box opens (Figure 17.10) Figure 17.10 Bus Analyzer Configuration Dialog Box Specifying A Connection. Microcontrollers Debugger Manual...
  • Page 423 16. Click Arm to ready the BSA to collect data. The BSA does not start collecting data until execution begins. The debugger indicates that the BSA is armed by showing the word Armed in the status bar. Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Bus State Analyzer (BSA) Recording Modes.
  • Page 424: Recording Modes

    A -> B -> C !D After execution begins, the trace buffer begins storing data from all cycles. This continues through the occurrence of three events, A, B, and C, in order, if event D does not occur. (If Microcontrollers Debugger Manual...
  • Page 425 • 8 Mhz Selects the 8 MHz oscillator. • 4 Mhz Selects the 4 MHz oscillator. • 2 Mhz Selects the 2 MHz oscillator. • 1 Mhz Selects the 1 MHz oscillator. Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Bus State Analyzer (BSA) Defining...
  • Page 426 You can view the data collected by the BSA in several formats. You can view: raw data, disassembled instructions, mixed raw data and disassembled instructions, and source code. To view data: 1. From debugger main menu, select FSCICEBASE-HC08 2. Select Trace — the Trace window opens Figure 17.11 Debugger Trace Window (Figure 17.11) Microcontrollers Debugger Manual...
  • Page 427 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. Microcontrollers Debugger Manual HC08 FSICEBASE Emulator Bus State Analyzer (BSA)
  • Page 428 HC08 FSICEBASE Emulator Bus State Analyzer (BSA) Microcontrollers Debugger Manual...
  • Page 429: Book Iii - Hcs08 Debug Connections

    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 • Flash Programming Microcontrollers Debugger Manual...
  • Page 430 Book III Contents Microcontrollers Debugger Manual...
  • Page 431: Hcs08 Full Chip Simulation

    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. 2. Click the OK button. Figure 18.1 Set Connection Dialog Box Microcontrollers Debugger Manual...
  • Page 432: Connection (Hcs08Fcs) Menu

    HCS08 Full Chip Simulation Configuration Procedure 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 Microcontrollers Debugger Manual...
  • Page 433 Initialize Input Ports On Startup The Initialize Input Ports on Startup option initializes all simulated inputs to $00 when you start the software, or when you switch the Device Mode or Debug Target. This Microcontrollers Debugger Manual HCS08 Full Chip Simulation Configuration Procedure...
  • Page 434 The registers can be viewed and their values modified, and the values can be stored back into debugger memory. Figure 18.4) opens. You may Figure 18.5), which shows a list of the files, their Figure 18.6), which displays the Microcontrollers Debugger Manual...
  • Page 435: Peripheral Modules Commands

    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. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 436: Adc Module

    After the conversion is complete, the first queued value is passed from the data buffer into the ADC data register. It can be observed in the memory window by displaying the memory location corresponding to the ADC data register. Figure 18.9 Memory Component Window Microcontrollers Debugger Manual...
  • Page 437: Adc Module Commands

    Notice that if the ADC is currently using a value, this command does not prevent the ADC from using it. See ADDI command for information on how to access the input buffer of the ADC interface. Syntax >ADCLR Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 438: Clock Generation Module

    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 select the MCU Clocks Menu, the Cycles Window displays all of the above- mentioned Clock Frequencies. Microcontrollers Debugger Manual...
  • Page 439: Clock Generation Module Commands

    Use the XTAL command to change the value of the simulated external oscillator. This in turn affects the input to the PLL/DCO, and therefore the bus frequency. The P&E simulator is a cycle-based simulator, so changing the XTAL value does not affect the Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 440: Inter-Integrated Circuit Module

    IIC module is turned on and properly configured for receiving data from an external IIC device. Once simulation of the data transmission is over, the arrow moves to the next value in the IIC Input Buffer. Microcontrollers Debugger Manual...
  • Page 441 The user can also observe different IIC flags in the Memory Window. If you run the module in Flag Polling mode, poll the flag corresponding to the expected IIC event. If the Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 442 • ACK corresponds to ACK signal • NACK corresponds to NACK signal For a detailed description of the IIC protocol and a proper way to configure the IIC module, refer to the Freescale user manual for your microprocessor. Example >IICDI Microcontrollers Debugger Manual...
  • Page 443 1. A start signal comes in 2. The address $55 comes, in specifying a write (slave receive). The Address Register in the current simulated device has been previously set to $55 Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 444: Input/Output (I/O) Ports Module

    I/O port pins. To define an input state of the specific port, write the INPUT <x> <n> command in the Command line window. The <x> represents corresponding I/O port, while the <n> stands for the input value to write to this port. At Microcontrollers Debugger Manual...
  • Page 445: Input/Output Ports User Commands

    I/O pins, refer to the Freescale user manual for your microprocessor. Input/Output Ports User Commands The following user commands are available for accessing the M68HCS08 I/O ports. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands Input/Output Ports User...
  • Page 446 <x> is set as an input port. Syntax >INPUT<x> 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. <n> Microcontrollers Debugger Manual...
  • Page 447: External Interrupt (Irq) Module

    See INPUT<x> Command command. In addition, you can modify the state of the IRQ pin directly using the IRQ <n> command (documented below). Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.18. The user may then use this box to specify the...
  • Page 448 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. Figure 18.20 Memory Component Window Microcontrollers Debugger Manual...
  • Page 449 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. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.21.
  • Page 450: Keyboard Interrupt Module

    KEYF Flag bit, which is a part of the Keyboard Status and Control register, in the Memory Window. Figure 18.23 Memory Component Window for more information about the various forms of this command. Timer Microcontrollers Debugger Manual...
  • Page 451 INPUTS Command In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port Inputs dialog box shown in input states of port pins and IRQ. Microcontrollers Debugger Manual HCS08 Full Chip Simulation <n> Figure 18.24. The user may then use this box to specify the...
  • Page 452: Modulo Timer Interrupt Module

    Once the MTIM Status and Control register properly configures the operation of the module, the MTIM Counter starts incrementing. If modulo up count operation is enabled, you can observe the MTIM overflow flag in the MTIM Status and Control register in the Memory Window. Microcontrollers Debugger Manual...
  • Page 453: Serial Communications Interface Module

    SCI data register once the SCI module has been turned on and is properly configured for receiving data from an external serial device. Once the simulation of the data transmission is over, the arrow moves to the next value in the SCI IN Buffer. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 454 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 data register. Figure 18.28 Memory Component Window Microcontrollers Debugger Manual...
  • Page 455: Sci Commands

    An arrow points to the next value to be used as input to the SCI. The maximum number of input values is 256 bytes. Syntax >SCDI [<n>] Where: ><n> The value to be entered into the next location in the input buffer Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 456 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 OUT Buffer Display Microcontrollers Debugger Manual...
  • Page 457: Serial Peripheral Interface Module

    SPI data output buffer simulation allows the user to gain access to the past 256 SPI data values transmitted out of the module. To bring up the SPI OUT buffer dialog box, use the SPDO command. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 458: Spi Commands

    SPI control register. For more information on how to configure the SPI module for desired operation, refer to the Freescale user manual for your microprocessor. SPI Commands The following serial peripheral interface commands are available for the HCS08. Microcontrollers Debugger Manual...
  • Page 459 <n> The value to be entered into the next location in the input buffer Example >SPDI $55 Set the next input value to the SPI to $55 >SPDI Pull up the data window with all the input values. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 460 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 Microcontrollers Debugger Manual...
  • Page 461: Timer Interface Module

    Simulated Port Inputs for all general IO ports. It displays the current simulated values to all applicable input ports. See the documentation for Module Commands Microcontrollers Debugger Manual for more information about the various forms of this command. HCS08 Full Chip Simulation...
  • Page 462 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 Microcontrollers Debugger Manual...
  • Page 463: Timer Module Commands

    Window shows the cycle counter. The cycle count can be 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. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands...
  • Page 464 <x> is set as an input port. Syntax INPUT<x> 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. <n> Microcontrollers Debugger Manual...
  • Page 465 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. Microcontrollers Debugger Manual HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.39. The user may then use this box to specify the...
  • Page 466 HCS08 Full Chip Simulation Peripheral Modules Commands Microcontrollers Debugger Manual...
  • Page 467: Hcs08 P&E Multilink/Cyclone Pro Connection

    Figure 2. Click the OK button. Figure 19.1 Set Connections Dialog Box 3. Choose the P&E device that you are using from the Connection drop-down menu and click on Refresh. See Microcontrollers Debugger Manual 19.1. Figure 19.2 Figure 19.3.
  • Page 468 HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 19.2 HCS08 Connection Assistant Interface Selection Microcontrollers Debugger Manual...
  • Page 469 Freescale Data Sheet for your specific device. Hotsync Button The Hotsync button in the Connection Assistant (see connect to an already running target. Microcontrollers Debugger Manual HCS08 P&E Multilink/Cyclone Pro Connection Figure 19.3) allows the user to Connection Procedure...
  • Page 470: Multilinkcyclonepro Menu Description

    (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 Connect option initiates an attempt to communicate with the device selected under the device section of the menu. Microcontrollers Debugger Manual...
  • Page 471: Active Mode 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. Microcontrollers Debugger Manual HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 472 Sync 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. This option is always enabled for M68HCS08 devices. Microcontrollers Debugger Manual...
  • Page 473 Choose a Register Block window (see also open it by entering the R command in the Command Window command line. Microcontrollers Debugger Manual HCS08 P&E Multilink/Cyclone Pro Connection 19.8. More information on how to use the PROGHCS08 can be...
  • Page 474: Trigger Module Settings Option

    Figure 19.11 Register Window Trigger Module Settings Option For more information about the Trigger Module Settings menu option, see Settings Window. Figure 19.10), which shows a list of the associated Figure 19.11), which displays the Microcontrollers Debugger Manual Trigger Module...
  • Page 475: Bus Trace Option

    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. Microcontrollers Debugger Manual...
  • Page 476 HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Microcontrollers Debugger Manual...
  • Page 477: Hcs08 Open Source Bdm Connection

    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: (keyword: OSBDM08). CodeWarrior IDE and HCS08 Open Source...
  • Page 478: First Steps Using The Stationery Wizard

    Source BDM using the Stationery Wizard: 1. Run the CodeWarrior IDE. 2. In the Microcontrollers New Project Wizard, follow the path to create a new project and name the project. 3. Click the Next button to open the New Project window.
  • Page 479: First Steps From Within An Existing Project

    6. Click the OK button - Set Derivative dialog box typically opens (if not, you can start debugging immediately). 7. In the Set Derivative dialog box, select your target processor. Microcontrollers Debugger Manual HCS08 Open Source BDM Connection First Steps From Within an Existing Project Normally, use the New Project or Change wizard to change the connections.
  • Page 480: 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 Dialog Box. HCS08 Open Source BDM Setup Microcontrollers Debugger Manual...
  • Page 481: Bus Trace

    Select HCS08 Open Source BDM > Reset to Normal Mode to reset the hardware CPU to normal mode. Show Status Option Select HCS08 Open Source BDM > Show Status to display the Microcontrollers Debugger Manual HCS08 Open Source BDM Connection First Steps From Within an Existing Project Information Required to Unsecure the Device...
  • Page 482: Hcs08 Open Source Bdm Setup Dialog Box

    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. Cables are numbered #1, #2, etc. in the order they have been plugged into the computer USB hub. Microcontrollers Debugger Manual...
  • Page 483: Select Derivative Dialog Box

    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. Microcontrollers Debugger Manual HCS08 Open Source BDM Connection First Steps From Within an Existing Project...
  • Page 484: Information Required To Unsecure The Device

    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 in this window to run the Unsecure command file script. Microcontrollers Debugger Manual...
  • Page 485: 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. Microcontrollers Debugger Manual HCS08 Open Source BDM Connection First Steps From Within an Existing Project...
  • Page 486 HCS08 Open Source BDM Connection First Steps From Within an Existing Project Microcontrollers Debugger Manual...
  • Page 487: Hcs08 Serial Monitor Connection

    CodeWarrior IDE and the HCS08 Serial Monitor connection. The differences between the two paths hinge on the starting point for the steps: • Using the Stationary Wizard at the start of the project • From within an existing project Microcontrollers Debugger Manual...
  • Page 488: First Steps Using The Stationery Wizard

    Monitor connection: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. In the 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.
  • Page 489: First Steps From Within An Existing Project

    Set Connection dialog box. 6. Click the OK button. 7. Now in the Monitor Setup window, Monitor Communication tab, choose the correct Host serial communication port if necessary. Microcontrollers Debugger Manual HCS08 Serial Monitor Connection First Steps from Within an Existing Project...
  • Page 490 “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. Otherwise, vectors cannot be programmed as captured and protected from erasing or overwriting by the HCS08 Serial Monitor. Microcontrollers Debugger Manual...
  • Page 491 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. Microcontrollers Debugger Manual HCS08 Serial Monitor Connection First Steps from Within an Existing Project...
  • Page 492: Monitor-Hcs08 Menu Options

    Trigger Module Settings Select the MONITOR-HCS08 > Trigger Module Settings option to open the Trigger Module Settings dialog box. Refer to the Debugger HCS08 On-chip DBG Module User Interface manual for all related information. Tab. Tab. Microcontrollers Debugger Manual Monitor Monitor...
  • Page 493: Monitor Setup Window

    Check the Show Monitor TX/RX checkbox to report all low level communication frames between the host computer and the HCS08 Serial Monitor, in the debugger Command Line window. Microcontrollers Debugger Manual HCS08 Serial Monitor Connection First Steps from Within an Existing Project...
  • Page 494 Auto Detect button to make the debugger search for the vector table address and vectors reserved by the HCS08 Serial Monitor. Once auto detection has succeeded, you can press the OK button to save and quit this window. Microcontrollers Debugger Manual...
  • Page 495: 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. Microcontrollers Debugger Manual HCS08 Serial Monitor Connection First Steps from Within an Existing Project...
  • Page 496 HCS08 Serial Monitor Connection First Steps from Within an Existing Project Microcontrollers Debugger Manual...
  • Page 497: Softec Hcs08 Connection

    CodeWarrior IDE and the SofTec inDART-HCS08 connection. The differences between the two paths hinge on the starting point for the steps: • Using the Stationary Wizard at the start of the project • From within an existing project Microcontrollers Debugger Manual...
  • Page 498: First Steps Using The Stationery Wizard

    Wizard: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. In the 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.
  • Page 499: First Steps From Within An Existing Project

    Figure 22.2 Set Connection Dialog Box - SofTec HCS08 Selection 6. Press the OK button - MCU Configuration dialog box opens. 7. In the MCU Configuration dialog box, choose the correct target processor. Microcontrollers Debugger Manual SofTec HCS08 Connection First Steps from Within an Existing Project...
  • Page 500: Softec Hcs08 Menu Options

    SofTec-HCS08. Figure 22.4 SofTec-HCS08 Menu Options MCU Configuration Option Select SofTec-HCS08 > MCU Configuration to display the Box. About Option Select SofTec-HCS08 > About to display the MCU Configuration Dialog About Dialog Box. Microcontrollers Debugger Manual...
  • Page 501: Communication Settings Dialog Box

    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 can vary depending on the Microcontrollers Debugger Manual First Steps from Within an Existing Project HCS08 On-Chip DBG Module Box.
  • Page 502: About Dialog Box

    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.7 About Dialog Box Microcontrollers Debugger Manual...
  • Page 503: Hcs08 On-Chip Dbg Module

    • Expert Triggers, as powerful as predefined preset triggers • Code program flow rebuild from DBG data capture within the Trace window component (open the Trace component to display the code program flow rebuild). Microcontrollers Debugger Manual Instruction Triggers, Memory Access Triggers...
  • Page 504: Specific Connection Menu Options

    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 open the Choose Bus Trace to open the Trigger Module Settings Trace Component Window. Microcontrollers Debugger Manual Window.
  • Page 505: Context Menu Entries In Source, Data, Assembly And Memory Windows

    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), different triggers Microcontrollers Debugger Manual HCS08 On-Chip DBG Module to set the DBG module Triggers Settings and the...
  • Page 506 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. Microcontrollers Debugger Manual...
  • Page 507 Context Menu Entries in Source, Data, Assembly and Memory Windows 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. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module...
  • Page 508: Trigger Stored As Markpoints

    Source or Assembly window. Figure 23.5 Show Markpoints Option Selecting the Show Markpoints option from the Source window causes the Controlpoints Configuration window to open with its Markpoints tab displayed. Microcontrollers Debugger Manual...
  • Page 509: Data And Memory Windows

    Trigger Module Usage Setting a trigger, which can be assimilated as a complex breakpoint or watchpoint, is as simple as setting a watchpoint. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Trigger Settings option to set the DBG module triggers settings and option to globally set the DBG module functionality.
  • Page 510 (one or two), a different trigger chosen. To set a trigger, choose a Set Trigger Address entry and the kind of access - Read, Write, Read/Write. This sets a trigger at the selected place. DBG Module Mode Setup can be Microcontrollers Debugger Manual...
  • Page 511 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. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module...
  • Page 512: Expert Triggers

    Indeed, to completely Expert Triggers are independent from the regular triggers Expert Mode Tab. Instruction Capture Triggers designs are grayed out. When the automatic mode Triggers, Memory Access Microcontrollers Debugger Manual...
  • Page 513 Restore on load option (also available with breakpoints and watchpoints) can be very useful to automatically save the application with the current DBG module setup and trigger positions just as they were used in the application. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module...
  • Page 514: Trigger Settings

    (Instruction, Read Access, Read/Write Access, Write Access. Only possible combinations are displayed. Also DBG Module Options Figure 23.11 Triggers Setting Menu Option - Extended Menu Trigger Module Settings Window. However, the amount of trigger can be directly edited. Microcontrollers Debugger Manual...
  • Page 515: Trigger Module Usage

    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 Module Settings Window Figure 23.13 Status Bar Item Microcontrollers Debugger Manual HCS08 On-Chip DBG Module to do the DBG Module Mode (future debugger revision only).
  • Page 516: Trigger Module Settings Window

    The on-chip DBG module can be fully controlled from within this window. Figure 23.15 Trigger Module Settings Window - Trigger Settings Tab DBG Module Mode Setup Triggers, Memory Access Triggers Setup. Microcontrollers Debugger Manual (as shown above) or the Capture Triggers used or...
  • Page 517: Dbg Module Mode Setup

    The DBG module is setup to record the executed change of flows. As no triggers are set, the debugger is stopped on the user request or typical breakpoints/watchpoint. To summarize, in this mode, the DBG module is used to set regular hardware breakpoints and watchpoints. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Trigger Module Settings Window...
  • Page 518: Expert Mode

    Figure 23.17 Trigger Settings Tab - Expert Mode Information To set Expert triggers, the Trigger Module Settings window Expert triggers tab must be used. Select the Expert mode in the list menu to enable the Expert Mode Tab. Microcontrollers Debugger Manual...
  • Page 519: Expert Mode Tab

    The longer the program runs the more precise are the statistics. See also Limitations Refer to the debugger engine manual for Coverage and Profiler component features. Microcontrollers Debugger Manual Trace Component section for this mode. HCS08 On-Chip DBG Module Trigger Module Settings Window...
  • Page 520: Disabled Mode

    By default, the FIFO content is protected from unexpected reads, the DBG module is automatically disarmed and the FIFO is analyzed when the debugger stops. This can be optionally disabled by the user. section and documents to get all information about the HCS08 on- Microcontrollers Debugger Manual...
  • Page 521: Memory Access Triggers

    Address A memory location then reading and/or writing at Address B memory location. The code program flow rebuild is displayed in the automatically switched to Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Trigger Module Settings Window Trace Component Window Instructions Display mode.
  • Page 522 Figure 23.21 Trigger Address Settings Dialog Box The code program flow rebuild is displayed in the automatically switched to dialog box is not available for trigger B. Special Match value edit Trace Component Window Instructions Display mode. Microcontrollers Debugger Manual...
  • Page 523: Instruction Triggers

    This mode is used to trigger on a program instruction execution (program counter) at Address A. The code program flow rebuild is displayed in the automatically switched to Microcontrollers Debugger Manual dialog box is not available for the trigger B. Special Match value edit Trace Component Window Instructions Display mode.
  • Page 524 Address A then at Address B. The code program flow rebuild is displayed in the automatically switched to Trace Component Window Instructions Display mode. Trace Component Window Instructions Display mode. Trace Component Window Instructions Display mode. Trace Component Window Instructions Display mode. Microcontrollers Debugger Manual...
  • Page 525 Also when setting this trigger via a context sensitive context menu, the following message is displayed if the match value was never set. Microcontrollers Debugger Manual dialog box is not available for the trigger B. Special Match value edit...
  • Page 526: Capture Triggers

    Triggering/capture starts only after accessing the trigger A address. dialog box is not available for the trigger B. Special Match value edit Trace Component Window Instructions Display mode. Trace Component Window mode. automatically switched Microcontrollers Debugger Manual...
  • Page 527: Dbg Module Options

    • Start recording after trigger hit and halt when the fifo is full: The DBG module starts recording program flow information on trigger condition match and halts the processor/debugger when the capture buffer is full. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Trigger Module Settings Window Trace Component Window mode.
  • Page 528 • Do not halt when the fifo is full: The DBG module records data accesses continuously but does not halt the processor/debugger when the capture buffer is full. Capture Triggers only and are selected from Microcontrollers Debugger Manual...
  • Page 529: Trigger Editing

    • Pressing Delete Trigger in the dialog box removes the trigger in the trigger database (Trigger Stored as Microcontrollers Debugger Manual and Read, Write and R/W Access for Triggers.
  • Page 530: Trigger Module Settings Window - Display Information

    Here, the Memory Write Access type of trigger selected by the mouse cursor does not match with the Instruction Triggers Trigger Module Settings Window type selected in the list menu. Microcontrollers Debugger Manual dynamically checks...
  • Page 531: General Settings Tab

    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 Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Trigger Module Settings Window...
  • Page 532: Trace Component Window

    The context sensitive context menu is set up by the connection (or the GDI DLL) using the component. Any debugger connections including the DBG user interface are synchronized with the Trace component. Trace Component Window Instruction Triggers. When this option is Microcontrollers Debugger Manual...
  • Page 533: Instructions Display

    Program flow rebuild gap means that the debugger was unable to completely track the code program flow between two frames. Microcontrollers Debugger Manual Options, from Context Menu Entries in Source, Data, Assembly and...
  • Page 534: Graphical Display

    This display mode is rather useless for the DBG user interface, as no read/write accesses are recorded at the same time than program change of flow information by the Instruction Triggers Memory Access Triggers Microcontrollers Debugger Manual...
  • Page 535: Column Display And Moving

    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 Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Trace Component Window...
  • Page 536: Goto Frame

    Selecting Display DBG FIFO data in the Trace window context sensitive menu displays data information retrieved from the on-chip DGB module Fifo/buffer. Selecting Display program flow in the Trace window context sensitive menu displays code program flow. Microcontrollers Debugger Manual...
  • Page 537 The first frame (Depth 1) is the oldest value in the time. • Data value: the byte value retrieved from the DBG Fifo/buffer from the DBGFL DBG on-chip module register. Figure 23.42 Trace Window - Recorded Data Display Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Trace Component Window Capture Triggers...
  • Page 538: Limitations

    Select the LOOP1 module in the Trigger Module Settings dialog by selecting FIFO LOOP1 mode in a list menu. The genuine mode is called FIFO Normal mode. Instruction Triggers, Memory Access Triggers Expert Triggers can be set. Microcontrollers Debugger Manual Capture...
  • Page 539: Ability To Record Until Reset And From Reset

    Also the debugger displays in the status bar the source of the reset decoded from the System Reset Status (SRS) on-chip register. CAUTION Microcontrollers Debugger Manual After interpreting the Trace window recorded information, reset the debugger and hardware (press the debugger Reset button) to clear the SRS register.
  • Page 540 HCS08 On-Chip DBG Module HCS08 DBG V3 New Features Figure 23.44 Recording a PIN reset Microcontrollers Debugger Manual...
  • Page 541 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”. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module HCS08 DBG V3 New Features...
  • Page 542 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. Microcontrollers Debugger Manual...
  • Page 543: Expert Triggers Tab Extended

    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 Microcontrollers Debugger Manual HCS08 On-Chip DBG Module HCS08 DBG V3 New Features...
  • Page 544 HCS08 On-Chip DBG Module HCS08 DBG V3 New Features Microcontrollers Debugger Manual...
  • Page 545: Book Iv Contents

    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 Microcontrollers Debugger Manual...
  • Page 546 Book IV Contents Microcontrollers Debugger Manual...
  • Page 547: Rs08 Full Chip Simulation

    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. Click the OK button. Figure 24.1 Set Connection Dialog Box Microcontrollers Debugger Manual...
  • Page 548: Connection (Rs08Fcs) Menu

    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 RS08FCS Device Extended Menus Microcontrollers Debugger Manual...
  • Page 549 This dialog box allows the user to set the frequency of the TCLK signal for the MTIM peripheral. In order for this value to have any effect, the TCLK must be selected as the clock source for the MTIM. Microcontrollers Debugger Manual RS08 Full Chip Simulation Configuration Procedure...
  • Page 550 At the bottom of the dialog box are two additional buttons. The Show Clocks button brings up the simulated clock frequencies. The Set Inputs button brings up the Inputs dialog box, which allows the user to set the simulated input buffers to any valid value. Microcontrollers Debugger Manual...
  • Page 551 If register files have been installed on the host computer, selecting a block brings up the Register Block register listing (see addresses, and their descriptions. This begins interactive setup of system registers such as I/O, timer, and COP watchdog. Microcontrollers Debugger Manual RS08 Full Chip Simulation Configuration Procedure Figure 24.8) opens.
  • Page 552: Peripheral Modules Commands

    Figure 24.10 Register Window Peripheral Modules Commands When you select a device (see peripheral modules and the associated commands for the device you have chosen. Figure 24.10), which displays the Device Option), the RS08FCS Menu displays a list of Microcontrollers Debugger Manual...
  • Page 553: Rs08 P&E Multilink/Cyclone Pro Connection

    Figure 2. Click the OK button. Figure 25.1 Set Connection Dialog Box 3. Choose the P&E device that you are using from the Interface list menu and click on Refresh List. See Microcontrollers Debugger Manual 25.1. Figure 25.2 Figure 25.3.
  • Page 554 Connection Procedure 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 connect to an already running target. Figure 25.3) allows the user to Microcontrollers Debugger Manual...
  • Page 555: Multilinkcyclonepro Menu Description

    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 using. Figure 25.5 RS08 Device Extended Menu Microcontrollers Debugger Manual RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 556: Active Mode Menu Options

    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 Advanced Options Dialog Box Microcontrollers Debugger Manual...
  • Page 557 Flash erase/programming procedure. See Figure 25.8. More information on how to use the PROGRS08 can be found on the P&E Microcomputer Systems website at www.pemicro.com. Figure 25.8 PROGRS08 Programmer Window Microcontrollers Debugger Manual RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure...
  • Page 558 If register files are available for the device that you chose, the Choose a Register Block window (see it by entering the R command in the Command Window command line. Figure 25.10) opens. You may also open Microcontrollers Debugger Manual...
  • Page 559 The registers can be viewed and their values modified, and the values can be stored back into debugger memory. Figure 25.12 Register Window Microcontrollers Debugger Manual RS08 P&E Multilink/Cyclone Pro Connection Figure 25.11), which shows a list of the associated...
  • Page 560 RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Microcontrollers Debugger Manual...
  • Page 561: Rs08 Open Source Bdm Connection

    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: (keyword: OSBDM08). CodeWarrior IDE and RS08 Open Source...
  • Page 562: First Steps Using The Stationery Wizard

    Source BDM using the stationery Wizard: 1. Run the CodeWarrior IDE 2. In the Microcontrollers New Project Wizard, follow the path to create a new project and name the project. 3. Click the Next button to open the New Project window.
  • Page 563: First Steps From Within An Existing Project

    6. Click the OK button - Set Derivative dialog box typically opens (if not, you can start debugging immediately). 7. In the Set Derivative dialog box, select your target processor. Microcontrollers Debugger Manual RS08 Open Source BDM Connection First Steps From Within an Existing Project...
  • Page 564: Rs08 Open Source Bdm Menu Options

    Select RS08 Open Source BDM > Select Derivative to display the Dialog Box. NOTE If there is only one derivative recognized by the debugger, this menu entry is not available. RS08 Open Source BDM Setup Select Derivative Microcontrollers Debugger Manual...
  • Page 565: Rs08 Open Source Bdm Setup Dialog Box

    Command window. Cables are enumerated #1, #2, etc. in the order they have been plugged into the computer USB hub. Microcontrollers Debugger Manual RS08 Open Source BDM Connection First Steps From Within an Existing Project Show Status Dialog Box.
  • Page 566: Select Derivative Dialog Box

    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 Select the OK button to close this dialog box. Microcontrollers Debugger Manual...
  • Page 567: Softec Rs08 Connection

    CodeWarrior IDE and the SofTec inDART-RS08 connection. The differences between the two paths hinge on the starting point for the steps: • Using the Stationary Wizard at the start of the project • From within an existing project Microcontrollers Debugger Manual...
  • Page 568: First Steps Using The Stationery Wizard

    Wizard: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. In the 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.
  • Page 569 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. Microcontrollers Debugger Manual SofTec RS08 Connection First Steps Using the Stationery Wizard...
  • Page 570: First Steps From Within An Existing Project

    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 button - MCU Configuration dialog box opens. 7. In the MCU Configuration dialog box, choose the correct target processor. Microcontrollers Debugger Manual...
  • Page 571: Softec Rs08 Menu Options

    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 Microcontrollers Debugger Manual SofTec RS08 Connection First Steps From Within an Existing Project...
  • Page 572: Mcu Configuration Dialog Box

    DCO Output Frequency (Hz) edit box. The trimming data is then programmed automatically at application loading time at specified locations (Flash Trimming locations). Refer to the inDART®-HCS08 In-Circuit Debugger/Programmer for Motorola HCS08 Family FLASH Devices User’s Manual from SofTec for further details. Microcontrollers Debugger Manual...
  • Page 573: About Dialog Box

    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 Microcontrollers Debugger Manual SofTec RS08 Connection First Steps From Within an Existing Project...
  • Page 574 SofTec RS08 Connection First Steps From Within an Existing Project Microcontrollers Debugger Manual...
  • Page 575: Book V - Coldfire® V1.0 Debug Connections

    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 Microcontrollers Debugger Manual...
  • Page 576 Book V Contents Microcontrollers Debugger Manual...
  • Page 577: Coldfire V1 Full Chip Simulation Connection

    Full Chip Simulation Menu Figure 28.1 shows the menu associated with the Full Chip Simulation connection. Use this menu to load an application that uses FCS. Figure 28.1 ColdFire FCS Menu Microcontrollers Debugger Manual Table 28.1 describes the FCS menu entries.
  • Page 578 Opens the Bus Trace dialog box to enable instructions and memory access recording and to display recording captures. Selects the processor core. Figure 28.3) shows status and other information. As well Microcontrollers Debugger Manual Window. dialog box to set the Real...
  • Page 579 Peripheral Builder, a separate product. Demo Version Limitations There are no limitations in the Demo Version. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Clock Frequency Figure 28.4, allows you to open an I/O device (peripheral)
  • Page 580: Memory Configuration

    The memory configuration facility uses a binary file format to read and set the FCS configuration. The extension for binary files is .mem; the default memory file is default.mem. (The subsection syntax definition of the file format.) TestTerm Component includes Microcontrollers Debugger Manual Listing 28.2, the EBNF-...
  • Page 581 – misaligned access: allowing misaligned access on words and longs • Open and save memory configuration • Add, delete, or update memory blocks Figure 28.6 Memory Configuration Dialog Box Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection (Figure 28.6) lets you perform these memory-block...
  • Page 582 Defines the FCS memory as RAM, ROM, or non- volatile RAM, depending on your configuration. You construct this definition interactively with the Memory Configuration dialog box, or read it in from a file. The Mode combo box displays user defined . Microcontrollers Debugger Manual...
  • Page 583 Memory configuration is a dynamically loaded facility. That is, the new entry Configure appears in the Simulator menu upon loading of the FCS (the Full Chip Simulation dll). Selecting Configure opens the Memory Configuration dialog box, so that you can configure memory. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection...
  • Page 584 Flag that allows Word misaligned and Long misaligned USER_DEF (block you define), AUTO_GEN (block automatically generated), AUTO_MEM (master block for standard configuration), AUTO_RAM (RAM master block for auto configuration), or AUTO_ROM (ROM master block for auto configuration) Microcontrollers Debugger Manual...
  • Page 585 Figure 28.7 Memory Configuration Dialog Box - Access Details Dialog Box Follow this guidance to use the Access Details dialog box: • A check box indicates whether an access kind is allowed. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection...
  • Page 586: Clock Frequency Setup

    This does not affect the accumulated elapsed time, and applies a new cycle time to the next simulated instructions in real time. Open the Clock Frequency Setup dialog (Simulator > Clock Frequency) to set, enter, or edit either the oscillator frequency or the CPU frequency. However, the saved project Microcontrollers Debugger Manual...
  • Page 587: Bus Trace

    Figure 28.9 Trace Window Context Menu By default, FCS records instructions only (faster). Check Record memory accesses and choose Textual mode in the Trace menu or context-sensitive menu to record memory accesses as well. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection...
  • Page 588: Full Chip Simulation Warnings

    Command window. For example, the following messages can be indefinitely repeated in the Command window: FCS Warning (ID 12): reading from unimplemented register at pc = 0x400a'L. Value: 0x0, Memory Address: 0x106. Flash CONTROL module not implemented Microcontrollers Debugger Manual...
  • Page 589 Debugger engine. Usage WARNING_SETUP <HALT|CLMSG|MSGBOX|NONE|STATUS> WARNING_SETUP STATUS: displays the current warning setup status. Example: in>warning_setup status WARNING_SETUP STATUS: CLMSG WARNING_SETUP HALT: The FCS stops the debugger when a warning message occurs. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection...
  • Page 590 WARNING_SETUP STATUS: MSGBOX WARNING_SETUP NONE: clears all kinds of warning messages. in>warning_setup none in>warning_setup status WARNING_SETUP STATUS: No warning messages NOTE With HALT, CLMSG and MSGBOX options, executing the command several times toggles the setup on and off. Microcontrollers Debugger Manual...
  • Page 591 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 display them again. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection...
  • Page 592: Fcs And Silicon On-Chip Peripherals Simulation

    The CORE entries allow you to simulate the chip without FCS support (plain instructions only) and the SAMPLE entries allow you to simulate a chip with a minimal set of commonly-available on-chip peripherals. Figure 28.12 ‘Set Derivative Dialog Box Microcontrollers Debugger Manual...
  • Page 593: Fcs Visualization Utilities

    This section describes the components of the visualization utilities that belong to the standard Debugger installation. WARNING! Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Debugger Status Bar with Full Chip The following visualization components can only be used with the Full Chip Simulation connection.
  • Page 594: Analog Meter Component

    In the knob, the value is adjusted when tracking the mouse around the center. Analog Meter Menu The Analog Meter does not have a menu. Figure 28.13, as a basis for user- Microcontrollers Debugger Manual...
  • Page 595: Io_Led Component

    Memory Component window. Specify the location with a string in the form object.value. Possible objects and their values can be listed in the Inspector component. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.14...
  • Page 596 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. 28.15. Use this dialog box to specify the PORT and DDR addresses. Microcontrollers Debugger Manual...
  • Page 597: Led Component

    In the text field, the user can specify which value the LED bar displays. Specify the location with a string in the form object.value. Possible objects and their values can be listed in the Inspector component. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Figure 28.16...
  • Page 598: Phone Component

    If the mouse is on top of an active key, the arrow shape of the cursor changes to a pointing hand. Currently, the LCD component is not operational. Figure 28.18 is an input utility that provides a graphical Microcontrollers Debugger Manual...
  • Page 599 Nothing can be dragged out. Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection 28.19. In the text field of this dialog box, the user can specify the address FCS Visualization Utilities...
  • Page 600: Adc/Dac Component

    The ADC/DAC component consists of four units as shown in • A signal generator • An analog to digital converter (ADC) • A digital to analog converter (DAC) • A visualization unit Figure 28.20 consists of an Analog to Digital (ADC) Figure Microcontrollers Debugger Manual 28.21:...
  • Page 601 At the end of a conversion, the ADC sets the state bit. This bit automatically resets after read. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.20, and...
  • Page 602 Erases the visualization screen and re-initializes the display properties. Opens the Conversion Parameters dialog box, allowing you to set the signal frequency Runs the conversion process Opens the Display Properties dialog box allowing you to set the display properties Microcontrollers Debugger Manual...
  • Page 603: Conversion Parameters Dialog Box

    Figure 28.24 Conversion Parameters Dialog Box Now you can start the conversion with Start conversion menu entries. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Figure 28.23 allows you to define the port and address or select Component.
  • Page 604 4. Define the sampling frequency 5. Start the application 6. Choose Start Conversion Drag Out: Nothing can be dragged out. Drag Into: Nothing can be dragged in. Figure 28.25, allows you to modify the display properties from Microcontrollers Debugger Manual...
  • Page 605: It_Keyboard Component

    1 to logical level 0 when the « B » key is pressed. An interruption is raised when an active key (line or column activated) is pressed. Figure 28.27 IT_Keyboard Constitution Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.26...
  • Page 606 IT_Keyboard Menu Figure 28.28 shows the IT_Keyboard menu. Figure 28.28 IT_Keyboard menu Table 28.5 IT_Keyboard Menu Description Menu Entry Setup Table 28.5 describes the menu entries. Description Opens the Interrupt keyboard setup dialog. Microcontrollers Debugger Manual...
  • Page 607: Interruption Keyboard Setup

    Nothing can be dragged out. Drop Into: Nothing can be dropped into the IT_Keyboard Component window. Demo Version Limitations No limitations. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.29 Programmable IO_Ports allows you to set the...
  • Page 608: Lcd Component

    This RAM can be seen as organized in two lines: the first one starts at address 00h and ends at 1Fh, and the second one starts at 40h and ends at 5Fh. arrangement. Figure 28.31. These ports communicate with the mainframe. Figure 28.30 is the LCD utility, Figure 28.32 illustrates this Microcontrollers Debugger Manual...
  • Page 609 For an instruction, only step 2 is different: the Byte to write on the data port is the instruction code you want the display controller to execute. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities...
  • Page 610: Clear Display

    • Moves the cursor to the right if ID = 1 or to the left if I/D = 0 Display On/Off Control • The display is on if D = 1 and off if D = 0 (data stays in RAM) • If C = 1 the cursor is visible. Microcontrollers Debugger Manual...
  • Page 611 • If DL = 1, the data exchange is 8 bits wide. • If N = 0, the display takes place on one line. If N = 1, the display takes place on two lines. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities...
  • Page 612: Lcd Menus

    Figure 28.35 The LCD Display Initialization LCD Menus Figure 28.36 shows the LCD menu, which is identical to the context menu. describes the entry. Figure 28.36 LCD Menu Figure 28.35 configures the display module in 8-bit mode, two Microcontrollers Debugger Manual Table 28.6...
  • Page 613: Lcd Display

    Nothing can be dragged out. Drop Into: Nothing can be dropped into the LCD display Component. Demo Version Limitations No limitations. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Description Opens the LCD Display dialog box (Setup) Figure 28.37...
  • Page 614: Monitor Component

    Opens the dialog box to create a new Channel in the Monitor. Deletes the Selected Monitor Channel (click on it in the monitor view) Opens the Settings dialog box to change the time base. Changes colors from the selected Channel. Microcontrollers Debugger Manual...
  • Page 615: Monitor Settings

    Pixels field to define the horizontal scale. Click OK to validate or Cancel to exit. Figure 28.41 Settings Dialog Box Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.40 allows you to create a new Channel in Figure 28.41...
  • Page 616 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. Figure 28.42 allows you to change the colors Microcontrollers Debugger Manual...
  • Page 617: Push Buttons Component

    Figure 28.44 shows the Push Buttons menu and Figure 28.44 Push Buttons Menu Table 28.8 Push Buttons Menu Description Menu Entry Setup Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Figure 28.43 is a basic input device. Table 28.8 Description Opens the Push Buttons Setup dialog box.
  • Page 618 Sending a value of 1 for a bit lights on the corresponding LED on the LEDs device. For example, if you press button 3, a read access at the address of the component port returns the value 00001000b (08h). Figure 28.45 allows you to specify the port address (in Programmable IO_Ports Component. Microcontrollers Debugger Manual...
  • Page 619: Programmable Io_Ports Component

    The programmable IO_Ports allows you to define the coupler in input and output. You can modify this configuration during program execution. The first step in the test program is to configure the appropriate couplers. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.47...
  • Page 620 1 to configure the port as output and clear to 0 to configure the port as input, as shown Figure 28.50. Description Opens the Programmable IO_Ports Port Address dialog. Figure 28.49 allows you to set the port address and Microcontrollers Debugger Manual Table 28.9 describes its entry.
  • Page 621: Segments Display Component

    Scanning consists of selecting a display and activating its segments with adequate code to the input terminals and then attending to the next display. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.51...
  • Page 622 Figure 28.53 shows the 7-segments display component menu and entry. Figure 28.53 7-Segments Display Menu Table 28.10 7-Segments Display Menu Description Menu Entry Setup Description Opens the Seven segments display component setup dialog. Microcontrollers Debugger Manual Table 28.10 describes its...
  • Page 623 In simulation it is not necessary to insert delays between each display scan (for segments light on and observer eye perception). Drag Out: Nothing can be dragged out. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.54...
  • Page 624: Stimulation Component

    Figure 28.56 Stimulation Window Stimulation Context Menu Figure 28.57 shows functions associated with the Source component. describes these functions. Figure 28.57 Stimulation Context Menu section describes using this feature in detail, Figure 28.56 provides the basic Table 28.11 Microcontrollers Debugger Manual...
  • Page 625 = TargetObject.#210.B; PERIODICAL 200000, 50: 50000 a = 128; 150000 a = 4; Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Description Opens a dialog box to load a stimulation file. Starts execution of the input file.
  • Page 626 The TestTerm component emulates a serial communication interface based at the address 200 (hexadecimal), thus providing five simulated memory mapped registers described in Table 28.12. section describes using this component in Figure 28.59 is a user-friendly terminal input/output. It Microcontrollers Debugger Manual...
  • Page 627 Output can be redirected to a TestTerm window, a file, or to both at the same time. File output is monitored by the target system and cannot be specified interactively. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Function...
  • Page 628 Output to both Terminal window and file. Output to file only. Read from keyboard Read input from file fileName Output to Terminal window and append to file Append to file only gives the source code in terminal.c. Table 28.14 Microcontrollers Debugger Manual...
  • Page 629 #define SCI (*((SCIStruct*)(0x0200))) char GetChar(void) while (!(SCI.SCSR & 0x20)); /* wait for input */ return SCI.SCDR; void PutChar(char ch) while (!(SCI.SCSR & 0x80)); /* wait for output buffer Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities...
  • Page 630 Figure 28.61 TestTerm Cache Size Dialog Box Drag Out: Nothing can be dragged out. /* baud rate 9600 at 8 MHz */ /* 8 bit, TE and RE set */ Figure 28.60 Microcontrollers Debugger Manual empty */ lets you set the Cache Size in Figure 28.61.
  • Page 631: Terminal Component

    To control and configure a terminal component use the Terminal menu of the terminal shown in Figure Figure 28.63 Terminal Menu and Context Menu To open the context menu, right click in the terminal window. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Figure 28.62 28.63. FCS Visualization Utilities...
  • Page 632 To remove connections, select them in the list of active connections and press the Remove button. In the Serial Port section you can specify which serial port to use and its properties. This is only possible if at least one connection from or to the serial port exists. Figure 28.64. Microcontrollers Debugger Manual...
  • Page 633 Escape Sequence ESC “h” “1” ESC “h” “2” filename ESC “h” “3” filename ESC “h” “4” ESC “h” “5” filename Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Table 28.15 Function Close output file. Open output file. Open output file and suppress output to terminal display.
  • Page 634 • TERM_APPEND_FILE: append output to file fileName See also terminal.h for further details. Function Append to existing output file. Append to existing output file and suppress output to terminal display. Listing 28.5 gives the source code in terminal.c. Microcontrollers Debugger Manual...
  • Page 635 The item Cache Size in the context menu allows you to set the number of lines in the terminal window, using the dialog shown in Figure 28.65 Size of the Cache Dialog Box Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities...
  • Page 636 Wagon menu. Figure 28.67 Wagon Menu Table 28.16 Wagon Menu Description Menu Entry Setup Figure 28.66 simulates a tool machine wagon functionality. Table 28.16 describes its entry. Description Opens the Wagon setup dialog box shown in Microcontrollers Debugger Manual Figure 28.68.
  • Page 637 START button with the left mouse button, and sets stp when you click the STOP button. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection Component.
  • Page 638: True Time I/O Stimulation

    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. Figure 28.70 Figure 28.70 FCS I/O-Simulation Main Window shows the Main Window. Microcontrollers Debugger Manual...
  • Page 639 The raise direction depends on a global variable dir that is turned back when the top or bottom value is reached. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection shows the IO_LED component.
  • Page 640 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 Stimulation > Execute. 7. Choose Run > Start/Continue. // endless loop Microcontrollers Debugger Manual...
  • Page 641 5. Choose Source > Open Module io_demo.c. 6. Scroll into the procedure Interrupt_Routine. 7. Set a breakpoint in the Interrupt_Routine as shown below. Figure 28.74 Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection 28.7. shows the Source component window.
  • Page 642 MCU. Using an editor, open the io_demo.prm file in the same demo directory. You can see at the end of this file how to set the interrupt vector (adapt it to your needs). Microcontrollers Debugger Manual...
  • Page 643 +20000 b = pbits + 1; PERIODICAL 100000, 10: 10000 a = 128; 30000 RAISE 7, 3, "test_interrupt"; 1000000 RAISE 7, 3, "test_interrupt"; Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection /* set vector on Interrupt 7 True Time I/O Stimulation...
  • Page 644 This line of code sets a to 0. Without # or + in front of the time marker, the time refers to the absolute time after starting execution of the Stimulation file. NOTE In a periodical loop, the time marker without operator is interpreted as +. +20000 b = pbits + 1; Microcontrollers Debugger Manual...
  • Page 645: Stimulation Input File Syntax

    StimulationFile = { IdDeclaration | TimedEvent | PeriodicEvent }. IdDeclaration = “def” ObjectId “=” ObjectField “;”. ObjectField = ObjectSpec [ “[” BitRange “]” ]. BitRange = StartBit “:” NoOfBits. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation...
  • Page 646 • The requirement specification defines ObjectSpec for Object Pool as shown below: ObjectSpec ::= ObjectName [“.” FieldName]. ObjectName ::= Ident [“:” Index]. FieldName ::= IdentNum ( [“..” IdentNum] | [“.” Size] ). IdentNum ::= Ident | “#“ HexNumber. Size ::= “B” | “W” | “L”. Microcontrollers Debugger Manual...
  • Page 647: Electrical Signal Generators And Signals Application To Device Pins

    You can run up to 16 Signal Generators at the same time. Signal Description File EBNF Signal File Format FILELOOP=<INF| nbr of file loops to perform> {signal block}* Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection...
  • Page 648 {<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 1.220703e-004 3.051758e-005 1.525879e-004 3.051758e-005 1.831055e-004 3.051758e-005 LOOP=16 TIMEUNIT=SECONDS Microcontrollers Debugger Manual...
  • Page 649 OPTION=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 File Example 2 FILELOOP=INF LOOP=INF TIMEUNIT=NONE TIMEFACTOR=0.5 GAIN=1 DCOFFSET=0 OPTION=NORMAL -0.4e-3 File Parameters The following parameters apply to the previous code examples. • LOOP/FILELOOP Microcontrollers Debugger Manual...
  • Page 650 You can open the Signal component within Open I/O Component Dialog Box within the same dialog or with the close signal command. Signal Commands The following signal commands are available in FCS: or with the openio signal command. Release it Microcontrollers Debugger Manual...
  • Page 651 Commands to create a signal generators can be placed in a command file like a Postload command file. CLOSESIGNALFILE Command CLOSESIGNALFILE closes the current signal file and generator. Syntax CLOSESIGNALFILE <value (0-15)> Example CLOSESIGNALFILE 1 Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection "saw_11bit_0_5v_1Hz.txt" "square_1_5v_1Hz.txt" Pinconn IO CONNECT command:...
  • Page 652: Base Signal Files Provided

    Use the Pinconn IO component to create virtual links or shortcuts between processor device pins, like a simple wire. Open the Pinconn component within Dialog Box or with the openio pinconn command. Release it within the same dialog or with the close pinconn command. Open I/O Component Microcontrollers Debugger Manual...
  • Page 653 There is no limitation of connections. Inspect NOTE FCS under the Object Pool key. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection It is the user’s responsibility to properly connect input pins to output pins without bus or level conflicts.
  • Page 654: Command Set To Apply Signal On Atd Pin

    2. In the CodeWarrior menu, Select File > New Project 3. Select a derivative like ColdFire V1 / MCF51QE Family / MCF51QE128 4. Select Full Chip Simulation and click Next 5. Enter a project name like MyGuessTheNumber Microcontrollers Debugger Manual...
  • Page 655 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 28.75 Created Project Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Tutorials...
  • Page 656 Step 4 - Bean Selector Window The Bean Selector window offers the developer a list of beans to add to the project. Some of the beans may not be usable with the version of CodeWarrior IDE installed. The Microcontrollers Debugger Manual...
  • Page 657 A green tick indicates whether the named method or event is selected and a red cross indicates that code has not been generated. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Tutorials...
  • Page 658 • 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 only you can enter 9600. Microcontrollers Debugger Manual...
  • Page 659 This is the .C files for the code associated with the beans added to the project. This includes initialization, input, output and the declarations necessary for using the functions. Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Tutorials...
  • Page 660 = rand() / (RAND_MAX / 9); } else if(c > ran + '0') { PutString("lower\n"); } else { PutString("greater\n"); PutString("Number: "); } else { // could wait a bit here } // for 3. Call the function GuessTheNumber in the main routine. Microcontrollers Debugger Manual...
  • Page 661 3. From the context menu of the Terminal window select Configure Connections and change the name of the SCI peripheral to SCI1 (the SCI you chose in the previous Processor Expert bean configuration). Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Tutorials...
  • Page 662 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. Microcontrollers Debugger Manual...
  • Page 663: Pwm Sample

    2. In the CodeWarrior menu, Select File > New Project 3. Select a derivative like ColdFire V1 / MCF51QE Family / MCF51QE128 4. Select Full Chip Simulation and click Next Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Tutorials...
  • Page 664 A green tick indicates whether the named method or event is selected and a red cross indicates that code has not been generated. Locate the previously created bean with the name PWM1:PWM under Beans. Microcontrollers Debugger Manual...
  • Page 665 Step 9 - Entering User Code • Open the user module PMW_Sample.C • Replace the main routine with the following code: volatile static unsigned int pwmRatio= 6939; void main(void) { Microcontrollers Debugger Manual ColdFire V1 Full Chip Simulation Connection FCS Tutorials...
  • Page 666 2. Double click on the Chart to see the Chart Properties. 3. Select Subscribe for Kind of Port 4. Use PIM.PTA0 for Port to Display (this is the simulated pin of the device) 5. Select 2 for High Display Value ***/ Microcontrollers Debugger Manual...
  • Page 667 1. Right mouse click > Edit Mode (or [Ctrl-E]) 2. Select the Save icon in debugger (or the menu bar File > Save Configuration) to save the window layout. 3. Select the Debug icon in debugger (or the menu bar Run > Start/Continue or [F5]). Microcontrollers Debugger Manual...
  • Page 668 ColdFire V1 Full Chip Simulation Connection FCS Tutorials Figure 28.82 Debugger Main WIndow - Final Application Microcontrollers Debugger Manual...
  • Page 669: Coldfire P&E Multilink/Cyclone Pro Connection

    CodeWarrior IDE and the P&E Multilink/Cyclone Pro connection. The differences between the two paths hinge on the starting point for the steps: • Using the Stationary Wizard at the start of the project • From within an existing project Microcontrollers Debugger Manual...
  • Page 670: First Steps Using The Stationery Wizard

    Multilink/Cyclone Pro using the stationery Wizard: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. In the 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.
  • Page 671: First Steps From Within An Existing Project

    Figure 29.2 Set Connection Dialog Box - P&E Multilink/Cyclone Pro Selection 6. Press the OK button - Set Derivative dialog box opens. 7. In the Set Derivative dialog box, choose the correct target processor. Microcontrollers Debugger Manual ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project...
  • Page 672 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 Microcontrollers Debugger Manual...
  • Page 673: P&E Multilink/Cyclone Pro Menu Options

    Select MultilinkCyclonePro > 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. Microcontrollers Debugger Manual ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project Box.
  • Page 674: P&E Multilink/Cyclone Pro Setup Dialog Box

    SR core register. When the step is performed, the interrupt level is reverted to previous state, and if necessary, adjusted according to last executed instruction (when the stepped instruction affects the interrupt level). Flash Programming. Microcontrollers Debugger Manual...
  • Page 675: Connection Manager Dialog Box

    The Show this dialog before attempting to contact target checkbox can be unchecked to remove this dialog window at connection. The dialog still pops up if the connection cannot be opened with any hardware. Microcontrollers Debugger Manual ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project...
  • Page 676: Set Derivative Dialog Box

    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 Microcontrollers Debugger Manual...
  • Page 677: Softec Coldfire Connection

    CodeWarrior IDE and the SofTec inDART-ColdFire connection. The differences between the two paths hinge on the starting point for the steps: • Using the Stationary Wizard at the start of the project • From within an existing project Microcontrollers Debugger Manual...
  • Page 678: First Steps Using The Stationery Wizard

    Wizard: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. In the 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.
  • Page 679: First Steps From Within An Existing Project

    Figure 30.2 Set Connection Dialog Box - SofTec ColdFire Selection 6. Press the OK button - Set Derivative dialog box opens. 7. In the Set Derivative dialog box, choose the correct target processor. Microcontrollers Debugger Manual SofTec ColdFire Connection First Steps From Within an Existing Project...
  • Page 680 First Steps From Within an Existing Project 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 Microcontrollers Debugger Manual...
  • Page 681: Softec Coldfire Menu Options

    Select SofTec-MCF51 > Trigger Module Settings to open the Trigger Module Settings dialog. Refer to the Debugger ColdFire On-chip DBG Module User Interface manual for all related information. Microcontrollers Debugger Manual SofTec ColdFire Connection First Steps From Within an Existing Project...
  • Page 682: Softec Coldfire Setup Dialog Box

    (when the stepped instruction affects the interrupt level). When checking “Program trim data open application loading”, the SofTec driver calculates the data to be Flashed to trim the device according to trimming information Flash Programming. About Dialog Microcontrollers Debugger Manual Box.
  • Page 683: Target Connection Dialog Box

    The debugger state synchronizes with the hardware state. Checking Do not show this dialog box again hides this dialog when starting the project. Microcontrollers Debugger Manual SofTec ColdFire Connection First Steps From Within an Existing Project...
  • Page 684: Communication Settings Dialog Box

    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 can vary depending on the specific ColdFire derivative. Box. Communication Microcontrollers Debugger Manual...
  • Page 685: 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 Microcontrollers Debugger Manual SofTec ColdFire Connection First Steps From Within an Existing Project...
  • Page 686: About Dialog Box

    SofTec ColdFire Connection First Steps From Within an Existing Project 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 Microcontrollers Debugger Manual...
  • Page 687: Coldfire On-Chip Dbg Module

    When setting triggers (A or/and B or/and C), the debugger still allows to set two instruction hardware breakpoints. Triggers A and B relate to the program counter, whereas Trigger C relates to memory operations. Microcontrollers Debugger Manual HCS08 On-Chip DBG Module Instruction Triggers Memory Access for general information.
  • Page 688: Context Menu Entries In Source, Data, Assembly And Memory Windows

    The recording mode can also be set when selecting the “Trace Setup” menu entry. The “Trigger Module Usage” entry provides a straight-forward way to switch between the Automatic, User Triggers, Expert, and Profiling/Coverage mode. Figure 31.1 Source Context Menu - Added Options Microcontrollers Debugger Manual...
  • Page 689: Trigger Module Settings Window

    DBG module. The debugger still provides the Trace rebuild window and support to display, when available, the results of the captured data. Microcontrollers Debugger Manual ColdFire On-Chip DBG Module Trigger Module Settings Window...
  • Page 690 • Disabled: not recording any data and not displaying anything in the Trace window, • Enabled: recording continuously. Each time the debugger is halted, the Trace window is refreshed with the latest program flow recorded. Profiling and Coverage Mode. Microcontrollers Debugger Manual...
  • Page 691 Using this feature automatically reduces the amount of change of flow information in the DBG buffer/FIFO, and restricts program flow rebuild code range in the Trace window. Microcontrollers Debugger Manual ColdFire On-Chip DBG Module Trigger Module Settings Window...
  • Page 692 Figure 31.6 Trace Settings for User Triggers mode The Trigger Stop Condition list menu allows you to specify basic sequences and triggers to pass to break the debugger. for information about the Browse for Trigger interface. HCS08 On- Microcontrollers Debugger Manual...
  • Page 693 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 Microcontrollers Debugger Manual ColdFire On-Chip DBG Module Trigger Module Settings Window...
  • Page 694 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 CSR2 by using the Select button automatically updates the Mode and Start/Stop list menu selection, and vice versa. Microcontrollers Debugger Manual...
  • Page 695: General Settings

    Issue warning on attempt to execute with incorrect Sequencer settings: When the on- chip DBG module sequencer is set up incorrectly, the debugger displays an informative error message when started. Figure 31.11 Sequencer Error Message Microcontrollers Debugger Manual ColdFire On-Chip DBG Module Trigger Module Settings Window...
  • Page 696 ColdFire On-Chip DBG Module Trigger Module Settings Window Figure 31.12 General Settings tab Microcontrollers Debugger Manual...
  • Page 697: Book Vi - Connection Common Features

    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 Microcontrollers Debugger Manual...
  • Page 698 Book VI Contents Microcontrollers Debugger Manual...
  • Page 699: Flash Programming

    By default, the debugger prompts a warning dialog box to get user acceptance before mass erasing, then programming the application. Use the FLASH-specific command (FLASH NOUNSECURE) described in this chapter to incorporate device security byte programming in user code. Microcontrollers Debugger Manual...
  • Page 700: Setup

    To permanently set this option, a check box is available in the Load tab of the debugger Preferences dialog box, as shown in command to display this dialog box. Figure 32.3 Load Preferences Figure 32.3. Select the File > Configuration menu Microcontrollers Debugger Manual...
  • Page 701: Advanced Options: Erase Prevention

    Non-Volatile Memory Control dialog box. The NVM Programming Selection dialog box is tightly associated with the FLASH AEFSKIPERASING command of the debugger. Microcontrollers Debugger Manual The debugger ignores pre-programmed modules and the user is responsible for reprogramming limitations, risks and impossibilities.
  • Page 702: Nvmc Graphical User Interface

    Other important expressions are: • Enabled — An enabled module is a module currently active on the chip. It is possible to read (as a ROM) or program an enabled module. Hardware Considerations for more information about the Flash Microcontrollers Debugger Manual...
  • Page 703: Nvmc Dialog Box

    Before you use the command line to perform any operation on a module, you must use the SELECT command to select the module. Also see the FLASH SELECT and FLASH UNSELECT commands in this chapter. Microcontrollers Debugger Manual Flash Programming NVMC Graphical User Interface...
  • Page 704 It displays Unprotected only if it is possible to protect a module. The Configuration group identifies the current.FPP parameter file. This group also includes the Auto select according to MCUID checkbox. The Configuration: FPP loading section explains this option. Microcontrollers Debugger Manual...
  • Page 705: Flash Module Handling

    • Load — The Load button arms all selected modules, executes a LOAD command, then disarms the modules. If you click the Load button without selecting any Flash modules, the NVMC utility selects and loads all modules. Microcontrollers Debugger Manual Flash Programming NVMC Graphical User Interface...
  • Page 706: Mcu Speed Information

    6. The utility always displays the MCUID, if the Id is available from the connection. A non-relevant displayed speed is symptomatic of a Flash programmer diagnostic problem. If this occurs, close the dialog box, check the hardware, and reset the connection. Microcontrollers Debugger Manual...
  • Page 707 NV_PARAMETER_FILE entry of the project.ini file. If you check this checkbox, the utility does not save the .FPP in the project file. Click the Cancel button to close the dialog box without saving changes. Microcontrollers Debugger Manual Flash Programming NVMC Graphical User Interface...
  • Page 708: Loading An Application In Flash

    Figure 32.9 FLASH Writing Error Message Box This means that you tried to load a program into an unselected section. The NVMC utility’s selecting/unselecting feature reduces the risk of overwriting, erasing, or unprotecting valuable data. Microcontrollers Debugger Manual...
  • Page 709: Hardware Considerations

    When available on-chip, EEPROM type modules are by default not selected for automatic erasing. Refer to ColdFire CPU devices WARNING! Microcontrollers Debugger Manual Advanced Options: Erase Prevention Programming ColdFire devices via the NVMC dialog requires proper device initialization. Otherwise the device speed sensing fails and programming/erasing cannot be performed correctly.
  • Page 710: Nvmc Commands

    The FLASH command displays names, locations, and states of all available modules; provided that a parameter (.fpp) file is already loaded. If no parameter file is loaded, this command loads either the .fpp file for the current MCUID or the last-used .fpp file. Microcontrollers Debugger Manual...
  • Page 711 This command is required before loading FLASH. FLASH DISARM ends a load process. The system executes the VPPOFF.CMD file specified in the Command Files user interface. FLASH SAVECONTEX backs up current SRAM content into a buffer. Microcontrollers Debugger Manual Flash Programming NVMC Commands...
  • Page 712 = {number["-"number][","]} If the device security byte is not programmed to the “Unsecured” state, after the device is reset, debugging is no longer possible until the next mass erase and security byte is programmed to “Unsecured” state. Microcontrollers Debugger Manual...
  • Page 713 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 modules armed. Microcontrollers Debugger Manual Flash Programming NVMC Commands...
  • Page 714 Flash Programming NVMC Commands Microcontrollers Debugger Manual...
  • Page 715: Debugging Memory Map

    (factory) setup, and most of the time, the user does not even need to edit/change settings within the DMM GUI. The DMM GUI can be opened when choosing Debugging Memory Map in the connection menu entry in the debugger. Microcontrollers Debugger Manual...
  • Page 716 More memory range information is displayed in the edition dialog, and an enhanced diagnostic is also displayed. Pressing the Delete button removes the memory range, after a warning dialog. Microcontrollers Debugger Manual...
  • Page 717: Edition Dialog And Memory Range Edition

    The Start–End range is a range address for a Type and for a Priority. Internally, ranges can overlap only if they are of the same type and of the same priority. The debugger always reads with rules of the range with the highest priority. Microcontrollers Debugger Manual Debugging Memory Map The DMM GUI...
  • Page 718 PPAGE to read the memory, then restoring this value as it was before reading. Also this banked type does not physically provide a memory access while running. Memory access while running is possible in physical memory (RAM, registers). Microcontrollers Debugger Manual...
  • Page 719 Priority list menu (e.g. HCS08 and ColdFire cores): Figure 33.4 HCS08 or ColdFire Core Priorities When left at the default setting, the CPU treats all memory block with the same priority. Microcontrollers Debugger Manual Debugging Memory Map The DMM GUI...
  • Page 720: Remarks

    Automatic DMM range remapping can be disabled by a debugger command. The default settings are retrieved from a complete database describing each derivative, or, in some cases, describing the CPU core (when not necessary to go to derivative level). Microcontrollers Debugger Manual...
  • Page 721: Cpu Core Types And Priorities

    Memory window with a physical/local address in addition to the bit(s) to switch EEPROM pages << 16. This logical address is therefore only valid in the EEPROM range window. Microcontrollers Debugger Manual Debugging Memory Map The DMM GUI...
  • Page 722: Dmm Commands

    The commands allow the user to fully script the debugging device memory mapping. Limit the usage of these commands to special debugging purposes, as the default mapping is typically sufficient. A script setup may be complex and may lead to debugger malfunctions. Microcontrollers Debugger Manual...
  • Page 723: List Of Commands

    DMM ADD <comment> <address> <size> <handle> <type> <cache locking> <priority> <mapping> <access while running> <access kind> <access size> with: <comment> a string for Comment field; "£" must be used for " " (space). Microcontrollers Debugger Manual Debugging Memory Map DMM Commands...
  • Page 724 <module handle>, a memory range module handle as given/listed with the DMM command. Purpose Delete one specific DMM memory range module by handle reference. User defined handles must be a value superior or equal to 100. Microcontrollers Debugger Manual...
  • Page 725 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 active. Microcontrollers Debugger Manual Debugging Memory Map DMM Commands...
  • Page 726 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 Microcontrollers Debugger Manual...
  • Page 727 DMM HCS12MERHANDLINGOFF command Syntax DMM HCS12MERHANDLINGOFF Purpose Not relevant for HCS08 and ColdFire cores. Disables completely the feature here above. Microcontrollers Debugger Manual Debugging Memory Map DMM Commands...
  • Page 728 <back size when running>: amount of bytes to read after the exact block of read addresses, when the hardware is running. Purpose Special debugger memory cache tuning in case of slow connection with hardware. Microcontrollers Debugger Manual...
  • Page 729: Book Vii Contents

    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 Microcontrollers Debugger Manual...
  • Page 730 Book VII Contents Microcontrollers Debugger Manual...
  • Page 731: Debugger Engine Commands

    ‘<‘ redirects a command to a specific component (in this example: Memory:2). Some commands are valid for several or all components; if the command is not redirected to a specific component, all components are affected. Also, a mismatch can occur because a command’s parameters may differ for different components. Microcontrollers Debugger Manual...
  • Page 732: Available Command Lists

    Executes a command file Defines a user symbol Other operation associated with IF command Other conditional operation associated with IF command Resets the current focus (refer to FOCUS command) Exits a FOR loop Exits an IF condition Microcontrollers Debugger Manual...
  • Page 733 UNDEF symbol | * UNTIL condition WAIT [time] [;s] WHILE condition Microcontrollers Debugger Manual Debugger Engine Commands Commands Overview Short Description Exits a WHILE loop Sets the focus on a specified component FOR loop instruction FPRINTF instruction Unconditional branch to a label in a command file...
  • Page 734 Enables or disables logging of a specified information type Displays the memory map Sets memory bytes Closes the record file Closes the log file Single assembly steps into program Restarts the loaded application Displays the content of registers Microcontrollers Debugger Manual...
  • Page 735 STEPOVER STOP SAVEBP on|off [address][,count] range list range lis range list Microcontrollers Debugger Manual Debugger Engine Commands Commands Overview Short Description Sets a register Stops execution of the loaded application Steps to the next source instruction of the loaded application...
  • Page 736 Sets text font Loads a framework application (code and debug information) Loads the code of a framework application Loads debugging information of a framework application Opens a Windows component Sets a new target Saves the general window layout Microcontrollers Debugger Manual...
  • Page 737 RESET SMEM range SMOD module address SPROC level Microcontrollers Debugger Manual Debugger Engine Commands Table 34.4 contains all available Component Short Description Specify a command file state and full name Terminates the application Displays a list of available commands Resets statistics...
  • Page 738 Selects the output file filter options Finds and highlights a pattern Opens a procedure file Folds a source block Sets the maximum number of frames Switches graphic bars on/off [name Prints content of Inspector to Command window Table 34.5 Microcontrollers Debugger Manual...
  • Page 739 TUPDATE on|off UNFOLD UPDATERATE ZOOM address in|out Microcontrollers Debugger Manual Short Description Updates content of Inspector Displays the list of symbols Sets the base of arithmetic operations Redirects the coverage component results Switches on /off the pointer as array display...
  • Page 740: Command Syntax Terms

    Use backslash (\) or slash (/) as a directory delimiter. The parser is case insensitive. If no path is specified, it looks for (or edits) the file in the current project directory. When no path is specified, the default directory is the project directory. Microcontrollers Debugger Manual...
  • Page 741 .o extension (e.g., fibo.o). In ELF format, module name extensions 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. Microcontrollers Debugger Manual...
  • Page 742: Debugger Commands

    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 highlighted. If the window shows icons, its title bar is activated and displayed in the foreground. Usage ACTIVATE component Components Debugger engine. Microcontrollers Debugger Manual...
  • Page 743 (".HWL") file to save and reload component window layouts. An interactive equivalent operation is typically possible, using Simulator/Debugger menus and operations, drag and drops, etc., as described in the following sections in “Equivalent Operations”. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 744 Assembly component in order to display the code location given as an argument on the first line of Assembly component window. The SYMB command displays or hides the symbolic names of objects. ON | OFF is used to switch the symbolic display on or off. Usage ATTRIBUTES list Microcontrollers Debugger Manual...
  • Page 745 (the vposition value is in lines: each register and bitfield have the same height, which is the height of a line). vposition is the absolute vertical scroll position. The value 0 represents the first position at the top. Microcontrollers Debugger Manual Debugger Engine Commands SMEM...
  • Page 746 FORMAT (hex|bin|dec|udec|oct) | VSCROLLPOS vposition | HSCROLLPOS hposition | COMPLEMENT(none|one) Where vposition=expression and hposition=expression Example in>Register < ATTRIBUTES FORMAT BIN Contents of registers are displayed in binary format in the Register component window. in>Register < ATTRIBUTES VSCROLLPOS 3 Microcontrollers Debugger Manual...
  • Page 747 Equivalent Operations • ATTRIBUTES SPC ~ Drag and drop from Register component to Source component. • ATTRIBUTES SMEM ~ Drag and drop from Memory component to Source component. Microcontrollers Debugger Manual Debugger Engine Commands Component Windows Object Info SMEM SPC,...
  • Page 748 The format is one of the following: binary, octal, hexadecimal, signed decimal, unsigned decimal or symbolic. Usage ATTRIBUTES list where list=command{,command}) command=FORMAT(bin|oct|hex|signed|unsigned|symb)| S COPE (global|local|user) | MODE (automatic|periodical| locked|frozen) | SPROC level | SMOD module | UPDATERATE rate | COMPLEMENT(none|one)| NAMEWIDTH width Microcontrollers Debugger Manual...
  • Page 749 • ATTRIBUTES SCOPE ~ Select menu Data > Scope • ATTRIBUTES SPROC ~ Drag and drop from Procedure component to Data component. • ATTRIBUTES SMOD ~ Drag and drop from Module component to Data component. Microcontrollers Debugger Manual Debugger Engine Commands command). UPDATERATE SMOD...
  • Page 750 – SMOD selects the module name for the global variable located in the window. • The FORMAT command selects the format for the list of variables. The format is one of the following: – binary, – octal, – hexadecimal, Microcontrollers Debugger Manual...
  • Page 751 • ATTRIBUTES SMOD ~ Drag and drop from Source component to Memory component. • ATTRIBUTES MODE ~ Select menu Memory > Mode • ATTRIBUTES UPDATERATE ~ Select menu Memory > Mode > Periodical Microcontrollers Debugger Manual Debugger Engine Commands command). SMOD...
  • Page 752 Inspector component window. Usage ATTRIBUTES list where list=command{,command}) command= COLUMNWIDTH columnname columnfield columnsize | EXPAND [name {subname}] deep | COLLAPSE name {subname}| SELECT name {subname} | SPLIT pos | MAXELEM ( ON | OFF ) [number] | FORMAT (Hex|Int) Microcontrollers Debugger Manual...
  • Page 753 The symbol Table, Stack or other Items may have recursive information. So it may occur that the information tree grows with the depth. Therefore, specifying large expand values may use a large amount of memory. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 754 Inspector prompts for 1000 subitems: inspect < ATTRIBUTES MAXELEM ON 1000 The FORMAT command specifies whether to display integral values like addresses as hexadecimal or decimal. The following command specifies the hexadecimal display: inspect < ATTRIBUTES FORMAT Hex Microcontrollers Debugger Manual...
  • Page 755 Components Debugger engine. Example: AT 10 OPEN Command This command (in command file) opens the Command Line component 10 ms after the command file is executed. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 756 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 Microcontrollers Debugger Manual...
  • Page 757 The breakpoint is removed from the breakpoint list. Example 2: in>BC &FIBO.C:Fibonacci In this example, an expression replaces the address. FIBO.C is the module name and Fibonacci is the function where the breakpoint is cleared. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 758 The background color of all currently open component windows is set to Lightcyan. To return to the original display, enter BCKCOLOR WHITE. In the Command Line component, the BD command displays the list of all breakpoints currently set with addresses and types (temporary, permanent). Usage Microcontrollers Debugger Manual...
  • Page 759 .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 .abs application file format. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 760 It is usually a constant number to specify (for security) the source (text) size of a function where a breakpoint is set. If the size specified does not match the size of the function in the source file, the breakpoint is set but disabled. Microcontrollers Debugger Manual...
  • Page 761 FIBO.C module. CALL Executes a command in the specified command file. NOTE If no path is specified, the destination directory is the current project directory. Usage CALL FileName [;C][;NL] Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 762 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 working directory (case insensitive). Components Debugger engine. Example: in>cd.. C:\Program Files\Freescale\demo in>cd C:\Program Files\Freescale\demo in>cd /Freescale/prog C:\Program Files\Freescale\prog Microcontrollers Debugger Manual...
  • Page 763 The new project directory is C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\prog The CF command reads the commands in the specified command file, which are then executed by the command interpreter. The command file contains ASCII text commands. Command files can be nested. By default, after executing the commands from a nested command file, the command interpreter resumes execution of remaining commands in the calling file.
  • Page 764 Execution: in>cf command1.txt executing command1.txt !bckcolor green !cf command2.txt executing command2.txt 1!bckcolor red 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 Microcontrollers Debugger Manual...
  • Page 765 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 Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 766 Usage COPYMEM <Source address range> dest-address Components Memory. Example: in>copymem 0x3FC2A0..0x3FC2B0 0x3FC300 The memory from 0x3FC2A0 to 0X3FC2B0 is copied to the memory at 0x3FC300 to 0x3FC310. This Memory range appears in red in the Memory Component. Microcontrollers Debugger Manual...
  • Page 767 ;A specifies to open a file fileName in append mode. Records are appended at the end of an existing record file. If the ;A option is omitted and fileName is an existing file, the file is cleared before records are written to it. Components Debugger engine. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 768 Show PC dialog box. Usage DASM [address|range][;OBJ] address: A constant expression representing the address where disassembly begins. range: An address range constant that specifies addresses to be disassembled. When range is omitted, a maximum of sixteen instructions are disassembled. Microcontrollers Debugger Manual...
  • Page 769 Depending on the target, the above code may vary. Disassembled instructions are displayed in the Command Line component window. Therefore, it is necessary to open the Command Line component before executing this command to see the dumped code. Microcontrollers Debugger Manual Debugger Engine Commands #0x0450 0x80...
  • Page 770 &TCR 0012: 5A Z displays the byte that is at the address of the TCR I/O register. I/O registers are defined in a DEFAULT.REG file. command of a Microcontrollers Debugger Manual...
  • Page 771 DDEPROTOCOL ON - DISPLAYING ON The DDE protocol is activated and displayed, and status is given in the command line component. NOTE For more information on Debugger/Simulator DDE implementation, refer to Debugger DDE Capabilities Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands chapter.
  • Page 772 UNDEF command. A symbol is a maximum of 31 characters long. In a command line, all symbol occurrences (after the command name) are substituted by their values before Microcontrollers Debugger Manual...
  • Page 773 A symbol defined in the loaded application can be redefined on the command line using the DEFINE command. The symbol defined in the application is not accessible until an UNDEF on that symbol name is detected in the command file. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 774 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 components. Example: in>DETAILS source test.abs testCase testCase testCase Microcontrollers Debugger Manual...
  • Page 775 0x8000,2 8000: FE8045FD 80432710 The content of two longwords starting at 0x8000 is displayed as longword values (four bytes). Memory longwords are displayed in the Command Line component window. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands command of a...
  • Page 776 When address and range are omitted, the first word displayed is taken from the address following the last word displayed by the most recent DB, DW, or DL command, or from address 0x0000 (for the first DB, DW, session). command of a Microcontrollers Debugger Manual...
  • Page 777 256 is displayed. All values are displayed in the current font. Control characters (<32) are displayed as decimal. ;B: displays the value of expression as a binary (base 2) number. Components Debugger engine. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 778 ELSEIF The ELSEIF keyword is associated with the Usage ELSEIF condition where condition is same as defined in C language. Components Debugger engine. command. set sim command /* Condition */ /* Other Condition */ command. Microcontrollers Debugger Manual...
  • Page 779 Then the Assembly component is released by the ENDFOCUS command and the second ATTRIBUTES command is redirected to the Source component by the FOCUS Source command. Marks are displayed in the Source window. Microcontrollers Debugger Manual set sim set bdi...
  • Page 780 = 5 * i endfor After the ENDFOR instruction, i is equal to 5. ENDIF The ENDIF keyword is associated with the Usage ENDIF Components Debugger engine. Example: if (CUR_CPU == 12) DW &counter else DB &counter endif command. command. Microcontrollers Debugger Manual...
  • Page 781 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 Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands WHILE command.
  • Page 782 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>FILL 0x8000..0x8008 0xFF The memory range 0x8000...0x8008 is filled with the value 0xFF. Microcontrollers Debugger Manual...
  • Page 783 Where string is the “pattern” to match. It must be enclosed in double quotes. See the example below. ;B the search is backwards, default is forwards. ;MC match case sensitive is set. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 784 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 component. Example: in>findproc Fibonacci The Fibonacci procedure is displayed and the title is highlighted. Microcontrollers Debugger Manual...
  • Page 785 Then the Assembly component is released by the ENDFOCUS command and the second ATTRIBUTES command is redirected to the Source component by the FOCUS Source command. Marks are displayed in the Source window. Microcontrollers Debugger Manual Debugger Engine Commands ENDFOCUS command.
  • Page 786 Equivalent Operation The Font dialog box is available by selecting the Component > Fonts menu entry. Usage FONT ‘FontName’ [size][color] Components Debugger engine. Example: FONT ‘Arial’ 8 BLUE The font type is Arial, 8 points and blue. Microcontrollers Debugger Manual...
  • Page 787 Components Debugger engine. Example: DEFINE loop = 0 FOR loop = 1..6,1 ENDFOR The T Trace command is performed six times. Microcontrollers Debugger Manual command. Debugger Engine Commands Debugger Commands ENDFOR...
  • Page 788 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 component. Example: FRAMES 10000 Microcontrollers Debugger Manual...
  • Page 789 Usage GO [address] When no address is entered, the address in the program counter is not altered and execution begins at the address in the program counter. Alias Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 790 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: When the instruction GOTO MyLabel is reached, the program pointer jumps to MyLabel and follows program execution from this position. // comments Microcontrollers Debugger Manual...
  • Page 791 (T Trace command) is executed. GRAPHICS In the Profiler component, GRAPHICS switches the percentages display in the graph bar on/off. Usage GRAPHICS on|off Components Profiler component. Microcontrollers Debugger Manual jump == 10 MyLabel // comments Debugger Engine Commands Debugger Commands...
  • Page 792 The ELSE command guards all commands up to the next ENDIF command on the same nesting level. Any occurrence of a subcommand not in sequence of “IF, zero or more ELSEIF, zero or one ELSE, ENDIF” is an error. ELSE and ENDIF) allow you to execute Microcontrollers Debugger Manual...
  • Page 793 INSPECTOROUTPUT [name {subname}] The name specifies any of the root items. The subname specifies a recursive path to subitems. If a name contains a space, it must be surrounded by double quotes ("). Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 794 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 Swap Name Value Address IO_Reg_1 0x1000 IO_Reg_2 0x1001 Init... 0x0 ... 0x0 ... Microcontrollers Debugger Manual...
  • Page 795 Debugger engine. Example in>lf /mcuez/demo/logfile.txt ;A The logfile.txt file is opened as a Log File in “append” mode. NOTE If no path is specified, the destination directory is the current project directory. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 796 • RUNAFTERLOAD runs application after loading • RUNANDSTOPAFTERLOAD runs application after loading and set temporary breakpoint at the specified function • functionName is the name of the function to set temporary breakpoint at • NORUNAFTERLOAD doesn't run application after loading (default) Microcontrollers Debugger Manual...
  • Page 797 “Error: no target is connected” Usage LOADCODE [applicationName] Components Debugger engine. Example: LOADCODE FIBO.ABS Code of the FIBO.ABS application is loaded. NOTE If no path is specified, the destination directory is the current project directory. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 798 Protocol messages are not responses. ERRORS: Errors are displayed in red in Command Line component. Protocol messages are not errors. NOTICES: Notices are displayed in green in the Command Line. command). If Microcontrollers Debugger Manual...
  • Page 799 “-”. Example 1: When executing the following command file: define truth = 1 IF truth bckcolor blue at 2000 bckcolor white else Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 800 TRUE. Example 2: When executing the following file: define i = 1 FOR i = 1..3 ENDFOR The following log file is generated: !define i = 1 !FOR i = 1..3 !ENDFOR !ENDFOR 0x1 (1) 0x2 (2) Microcontrollers Debugger Manual...
  • Page 801 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. Microcontrollers Debugger Manual Debugger Engine Commands 0x3 (3) 0x2 (2)
  • Page 802 = i + 1 ! ls !UNTIL i == 4 define i = i + 1 ! ls !UNTIL i == 4 define i = i + 1 ! ls !UNTIL i == 4 0x2 (2) 0x3 (3) 0x4 (4) Microcontrollers Debugger Manual...
  • Page 803 Example: in>ls User Symbols: Application Symbols: counter fiboCount fib1 fib2 fibo Fibonacci Entry Microcontrollers Debugger Manual Debugger Engine Commands UNDEF command to delete symbols. 0x2 (2) 0x80 (128) 0x81 (129) 0x83 (131) 0x84 (132) 0x85 (133) 0x87 (135) 0x89 (137)
  • Page 804 0x83 (131) Addresses Comment 0.. 3F PRU or TOP TOP board resource or the PRU 40.. NONE 50.. 64F 650.. 7FF NONE EEPROM A80..3DFF NONE 3E00..FDFF FE20..FFDB NONE FFDC..FFFE FFFF..FFFF special ram for cop 0.. 3FF (enabled) Microcontrollers Debugger Manual...
  • Page 805 Independent of the default base number, the ANSI C standard notation for constant is supported inside an expression. That means that independent of the current number base you can specify hexadecimal or octal constants using the standard ANSI C notation shown Table 34.6. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 806 Hexadecimal constant Octal constant /* Octal Constant */ /* Decimal Constant */ Meaning Hexadecimal constant Octal constant Binary constant /* Hexadecimal Constant */ /* Octal Constant */ /* Binary Constant */ Table 34.7. Table 34.8. Otherwise, the Microcontrollers Debugger Manual...
  • Page 807 The current record file is closed. NOLF The NOLF command closes the current Log File. The log file is opened with the command. Usage NOLF Microcontrollers Debugger Manual Debugger Engine Commands Meaning Hexadecimal constant $5AFD Hexadecimal constant $AFD Debugger Commands...
  • Page 808 Led, Memory, Module, Phone, Procedure, Profiler, Recorder, Register, SoftTrace, Source, Stimulation. Components Debugger engine. Example: in>OPEN Terminal 0 78 60 22 The Terminal component and window is opened at specified positions and with specified width and height. Microcontrollers Debugger Manual...
  • Page 809 When the instruction specified in the P command has been executed, the software displays the content of the CPU registers, the instruction bytes at the new value of the program counter and a mnemonic disassembly of that instruction. Microcontrollers Debugger Manual Debugger Engine Commands commands are equivalent.
  • Page 810 Contents of registers are displayed and the current instruction is disassembled. PAUSETEST Displays a modal message box, shown in Figure 34.1 Test Pause Message Box Usage PAUSETEST Components Debugger engine. Example: in> pausetest Figure 34.1, for testing purposes. Microcontrollers Debugger Manual...
  • Page 811 • nb is the number of elements to display in the array when unfolding a pointer displayed as array. Components Data component. Example: in>Ptrarray on 5 Display content of pointers as array of five items. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 812 If list is omitted, the list and any other parameters of the previous RD command are used. For the first RD command of a session, all CPU registers are displayed. Components Debugger engine. Example 1: in>rd a hx A=0x14 HX=0x2 Example 2: in>rd cpu A=0x0 HX=0x450 SR=0x70 PC=0xF04E SP=0xFF Microcontrollers Debugger Manual...
  • Page 813 UNTIL var == 2 The REPEAT-UNTIL loop is identical to the ANSI C loop. The operation DEFINE var = var + 1 is done twice, then var = = 2 and the loop ends. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 814 < 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>RESTART After the RESTART command, the cycle counter is initialized to zero. Microcontrollers Debugger Manual...
  • Page 815 RS command. If the specified register is not a CPU register, then the register is searched in a register file as an I/O register. This file is called: MCUIxxxx.REG (where xxxx is a number related to the MCU). Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 816 The S command stops execution of the emulation processor. Use the Go start the emulator. NOTE The S command ends as soon as the PC is changed. Usage Alias STOP Components Debugger engine. Example: in>s STOPPING HALTED Current application debugging is stopped/halted. command to Microcontrollers Debugger Manual...
  • Page 817 .BPT file. This command is only used in .BPT files and is related to the checkbox Save & Restore on load in the Controlpoints Configuration Window. It is used to store currently defined Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 818 Sets a new current target for the debugger by loading the targetName component. Usage SET targetName where targetName is name without extension of the target to set. Components Debugger engine. Example: in>SET Sim The debugger’s current target is Simulator. chapter. Microcontrollers Debugger Manual command and to the...
  • Page 819 Layout files usually have a .HWL extension. However, you can specify any file extension. NOTE If no path is specified, the destination directory is the current project directory. Microcontrollers Debugger Manual Debugger Engine Commands ( Background) ( Text ) Debugger Commands...
  • Page 820 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 number Components Source component Example: in>sline 15 Microcontrollers Debugger Manual...
  • Page 821 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 or program sources in Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 822 (the assembler address) and select/highlights the assembler instruction of the address given as parameter. In the Memory component, the SPC command scrolls the memory dump component, shows the location (the memory address) of the address given as parameter. Usage SPC address Microcontrollers Debugger Manual...
  • Page 823 Usage SPROC level Components Data and Source components. Example: in>Source < SPROC 1 This command displays the source code associated with the caller function in the Source component window. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 824 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 for user input after completing a debugging command). Usage STEPINTO Components Debugger engine. Microcontrollers Debugger Manual...
  • Page 825 Usage STEPOUT Components Debugger engine. Example: in>STEPOUT STEP OUT STARTED RUNNING STOPPED STOPPED in the status line indicates that the application is stopped by a step out function. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 826 Usage STEPOVER Components Debugger engine. Example: in>STEPOVER STEP OVER STARTED RUNNING STOPPED STEPPED OVER (or STOPPED) in the status line indicates that the application is stopped by a step over function. Microcontrollers Debugger Manual...
  • Page 827 CPU registers, the instruction bytes at the new address in the program counter and a mnemonic disassembly of the current instruction. This command can be stopped by typing the Esc key. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 828 A=0x0 HX=0x7F02 SR=0x62 PC=0xF032 SP=0x44D 00F032 B787 Contents of registers are displayed and current instruction is disassembled. TESTBOX Displays a modal message box shown in Figure 34.2 Test Box Message Box Usage TESTBOX "<String>" 0x87 Figure 34.2 with a given string. Microcontrollers Debugger Manual...
  • Page 829 Undefining an undefined symbol is not considered an error. Usage UNDEF symbol | * If * is specified, all symbols defined previously using the command DEFINE are undefined. Components Debugger engine. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands UNDEF command are visible...
  • Page 830 DEFINE command. 0x0 (0) // apple is equal to 0 0x1 (1) // apple is equal to 1 0x2 (2) // apple is equal to 2 // there is no user symbol // symbols of the loaded Microcontrollers Debugger Manual...
  • Page 831 User Symbols: // there is no user symbol Application Symbols: // symbols of the loaded application fiboCount counter _startupData 0x84D (2125) Fibonacci main Init _Startup Microcontrollers Debugger Manual Debugger Engine Commands 0x800 (2048) 0x802 (2050) 0x867 (2151) 0x896 (2198) 0x810 (2064) 0x83D (2109) 0x1 (1)
  • Page 832 Where condition is defined as in “C” language definition. Components Debugger engine. Example: repeat open assembly wait 20 define i = i + 1 until i==3 At the end of the loop, i = 3. REPEAT command. Microcontrollers Debugger Manual...
  • Page 833 The VER command displays the version number of the Debugger engine and components currently loaded in the Command line window. Usage Components Debugger engine. Example: in>ver HI-WAVE HI-WAVE Engine Source Assembly Microcontrollers Debugger Manual Debugger Engine Commands 6.0.27 6.0.49 6.0.20 6.0.14 Debugger Commands...
  • Page 834 If the target is already halted, command file execution is not halted (time delay is ignored). NOTE The Wait instruction ends as soon as the PC is changed. Usage WAIT [time] [;s] Components Debugger engine. 6.0.10 6.0.14 6.0.19 6.0.27 6.0.27 6.0.16 Microcontrollers Debugger Manual...
  • Page 835 Alias Components Debugger engine. Example in>WB 0x0205..0x0220 0xFF This command fills up the memory range 0x0205..0x0220 with the 0xFF byte value. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 836 When the range is not an integer or a multiple of the length of the list, the last copy of the list is truncated accordingly. When a size is specified in the range, this size represents the number of longwords to modify. Microcontrollers Debugger Manual...
  • Page 837 Components Debugger engine. Example: in>WW 0x2000..0x200F 0xAF00 This command fills up the memory range 0x2000...0x200F with the 0xAF00 word value. Microcontrollers Debugger Manual Debugger Engine Commands Debugger Commands...
  • Page 838 Components Data component. Example: in>ZOOM 0x1FE0 in The variable structure located at address 0x1FE0 is zoomed in. in>zoom &_startupData zooms in the _startupData structure (&_startupData is the address of the _startupData structure). UNFOLD command, where Microcontrollers Debugger Manual...
  • Page 839: Book Viii Contents

    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 Variables Microcontrollers Debugger Manual...
  • Page 840 Book VIII Contents Microcontrollers Debugger Manual...
  • Page 841: Debugger Engine Environment Variables

    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 Order for Source Files • Debugger Files Microcontrollers Debugger Manual...
  • Page 842: Debugger Environment

    Normally, the current directory of a tool is determined by the operating system or program that launches another one (for example, WinEdit). For MS Windows-based operating systems, the current directory definition is more complex. DEFAULTDIR: Default Current Microcontrollers Debugger Manual Directory.
  • Page 843 If the tool is started outside the D:\INSTALL\PROG directory, the project file in the Windows directory is used (C:\WINDOWS\MCUTOOLS.INI). NOTE For more information about MCUTOOLS.INI entries, see the compiler manual. Microcontrollers Debugger Manual Debugger Engine Environment Variables Debugger Environment DEFAULTDIR: Default Current (MCUTOOLS.INI - PC...
  • Page 844: Local Configuration File (Usually Project.ini)

    If the option prod is used, then the current directory is the directory in which the project file is located. If prod is used with a directory, the project.ini file in this directory is loaded. (usually project.ini) Microcontrollers Debugger Manual...
  • Page 845 (in percentage relative to the width of the main application client window). height specifies the height of the component (in percentage relative to the height of the main application client window). Microcontrollers Debugger Manual Debugger Engine Environment Variables Local Configuration File (usually project.ini) Listing PROJECT.INI...
  • Page 846: Other Parameters

    Layout parameter, also containing layout information. MainFrame=<nbr.>,<nbr.>,<nbr.>,<nbr.>,<nbr.>,<nbr.>, <nbr.>,<nbr.>,<nbr.>,<nbr.> This variable is used to save and load the Debugger main window states: positions, size, maximized, minimized, display icons when opened, etc. This entry is used for internal purposes only. Microcontrollers Debugger Manual...
  • Page 847 When a project file (PROJECT.INI) is activated, the following occurs (from first action to last): • The old Project file is closed. • Target Component is unloaded • The environment variable (Path) is added from the Project file. Microcontrollers Debugger Manual Debugger Engine Environment Variables Local Configuration File (usually project.ini)
  • Page 848: Environment Variable Paths

    We strongly recommend working with WinEdit and setting the environment by means of a DEFAULT.ENV file in your project directory. This project directory can be set in WinEdit's Project Configure menu command. This way, you can have different projects in different directories, each with its own environment. Microcontrollers Debugger Manual...
  • Page 849 GENPATH=.\ TEXTFILE=.\txt Results in: GENPATH=.TEXTFILE=.\txt To avoid such problems, use a semicolon’;’ at the end of a path, if there is a ‘\’ at the end: GENPATH=.\; TEXTFILE=.\txt Microcontrollers Debugger Manual Debugger Engine Environment Variables Local Configuration File (usually project.ini)
  • Page 850: Environment Variables

    Provides a detailed description of the option and how to use it. Gives an example of usage and effects of the variable where possible. The examples show an entry in the default.env file for PC. Names related sections. Microcontrollers Debugger Manual...
  • Page 851 (for example, editor). 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). Microcontrollers Debugger Manual Debugger Engine Environment Variables Environment Variables...
  • Page 852: Global Initialization File (Mcutools.ini - Pc Only)

    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 system level (global environment variable). It CANNOT be specified in a default environment file (DEFAULT.ENV/.hidefaults). Example: ENVIRONMENT=\Freescale\prog\global.env for an environment file named default.env. Using Microcontrollers Debugger Manual...
  • Page 853 (“*”), the whole directory tree is searched recursively. All subdirectories and their subdirectories are searched. Within one level in the tree, search order is random. Example: GENPATH=\sources\include;..\..\headers;\usr\local\lib See also: Environment variable LIBPATH Microcontrollers Debugger Manual Debugger Engine Environment Variables Environment Variables Path.
  • Page 854 Within one level in the tree, search order is random. Example: LIBRARYPATH=\sources\include;..\..\headers;\usr\local\ See also: Environment variable Environment variable GENPATH: #include “File” Path LIBRARYPATH: ‘include <File>’ GENPATH: #include “File” Path USELIBPATH: Using LIBPATH Environment Variable and finally in Path. Microcontrollers Debugger Manual...
  • Page 855 HIPATH. Example: OBJPATH=\sources\obj TMP: Temporary directory Tools Compiler, Assembler, Linker, Librarian, Debugger. Synonym None. Syntax "TMP=" <directory>. Microcontrollers Debugger Manual Debugger Engine Environment Variables Environment Variables GENPATH: #include “File” Path...
  • Page 856 USELIBPATH: Using LIBPATH Environment Variable Tools Compiler, Linker, Debugger. Synonym None. Syntax "USELIBPATH=" ("OFF" | "ON" | "NO" | "YES") Arguments ON, YES: The environment variable used to look for system header files <*.h>. LIBRARYPATH: ‘include <File>’ Path Microcontrollers Debugger Manual...
  • Page 857: Search Order For Source Files

    2. Project file directory (where .pjt or .ini file is located) 3. Paths defined in the GENPATH environment variable (from left to right) 4. Abs File directory Microcontrollers Debugger Manual Debugger Engine Environment Variables Search Order for Source Files LIBRARYPATH: ‘include <File>’ Path LIBRARYPATH: ‘include...
  • Page 858: In The Debugger For Object Files (Hiloader)

    C and C++ source files Compiled HTML help file Command File Script, for example, Reset.cmd Specific CPU configuration file Help Contents File, for example, cxa.cnt Central Processor Unit Awareness file Debug listing files, for example, Fibo.dbg Debugger Default Environment file. Microcontrollers Debugger Manual...
  • Page 859 *.MAP *.MEM *.MON *.PDF *.PRM Microcontrollers Debugger Manual Debugger Engine Environment Variables Description A .DLL file that contains one or more functions compiled, linked, and stored separately from the processes that use them. The operating system maps the DLLs into the process's address space when the process is starting up or while it is running.
  • Page 860 CPU Awareness file, for example, st7.sim S-Record file, for example, fibo.sx General Text Information file. Target File for the Debugger, for example, xtend-g3.tgt Debugger Window Component File, for example, recorder.wnd Debugger User Expression file, for example, Fibo.xpr Microcontrollers Debugger Manual...
  • Page 861: Connection-Specific Environment Variables

    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. Microcontrollers Debugger Manual...
  • Page 862 Connection-Specific Environment Variables Connection-Specific Environment Variables Microcontrollers Debugger Manual...
  • Page 863: Book Ix Contents

    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 Microcontrollers Debugger Manual...
  • Page 864 Book IX Contents Microcontrollers Debugger Manual...
  • Page 865: Legacy Pedebug Target Interface

    It is now necessary to open the Set Connection dialog box and to choose the FCS if that is the connection you want. The FCS is now a Connection with the same priority as any other connection. Microcontrollers Debugger Manual...
  • Page 866: Connection Selection Or Change Always Available Within Ide

    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 TN 241. Microcontrollers Debugger Manual...
  • Page 867 The following 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 Microcontrollers Debugger Manual...
  • Page 868 Legacy Target Interfaces Removed Microcontrollers Debugger Manual...
  • Page 869: List Of Hc(S)08 Fcs Components No Longer Supported

    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 • Push_buttons • Segments_display • Softtrace • Stimulation • Taillight • Template Microcontrollers Debugger Manual...
  • Page 870 HC(S)08 Full-Chip Simulator Components No Longer Supported List of HC(S)08 FCS Components No Longer Supported • Testterm • Timer • Wagon • Winlift Microcontrollers Debugger Manual...
  • Page 871 Assembly Menu entries 65 Assembly Step menu entry 42 Assembly Step Out menu entry 43 Assembly Step Over menu entry 43 AT command 755 Microcontrollers Debugger Manual Attributes 147 ATTRIBUTES command 743 Auto configure 581 Auto menu entry 113 Auto on Access 582...
  • Page 872 INSPECTORUPDATE 794 LF 795 LOAD 796 LOADCODE 797 LOADSYMBOLS 798 LOG 798 LS 803 MEM 804 MS 805 NB 805 NOCR 807 NOLF 807 OPEN 808 OUTPUT 809 P 809 PAUSETEST 810 PRINTF 811 PTRARRAY 811 RD 812 Microcontrollers Debugger Manual...
  • Page 873 Procedure 104 Profiler 106 Recorder 109 Register 111 SoftTrace 130 Source 115 Stimulation 624 Terminal 214 Microcontrollers Debugger Manual VisualizationTool 141 Window 61 Component Files 53 Component menu 47 Components 403 COMPOPTIONS variable 844 Configuration menu entry 35 Configure menu entry 578...
  • Page 874 DASM 768 DB 770 DDEPROTOCOL 771 DEFINE 772 DETAILS 774 DL 775 DUMP 776 DW 776 E 777 ELSE 778 ELSEIF 778 ENDFOCUS 779 ENDFOR 780 ENDIF 780 ENDWHILE 781 EXECUTE 781 EXIT 782 FILL 782 FILTER 783 Microcontrollers Debugger Manual...
  • Page 875 RD 812 RECORD 813 REPEAT 813 RESET 814 RESTART 814 RETURN 815 RS 815 S 816 SAVE 817 SAVEBP 817 Microcontrollers Debugger Manual SET 818 SETCOLORS 819 SLAY 819 SLINE 820 SMEM 821 SMOD 821 SPC 822 SPROC 823 SREC 824...
  • Page 876 Environment ABSPATH 850 DEFAULTDIR 851 ENVIRONMENT 842 File 842 GENPATH 853 HIENVIRONMENT 852 HIPATH 853 LIBPATH 854 LIBRARYPATH 854 OBJPATH 855 TMP 855 USELIBPATH 856 Variable 850 -ENVpath Option 31 EQUAL Mask 148 Erase Flash 492 Events Microcontrollers Debugger Manual...
  • Page 877 External Interrupt Module 268 High Resolution PWM Module 262 Input/Output (I/O) Ports Module 265 Keyboard Interrupt Module 269 Modules (Peripherals) Options 257 Microcontrollers Debugger Manual Multi-Master Inter-Integrated Circuit Module Option 272 Programmable Timer Interrupt Module 291 Select Device Option 255...
  • Page 878 Full Chip Simulation ColdFire 577 HC08 253 HCS08 431 RS08 547 Full Chip Simulation (FCS) Connection 253 Full Chip Simulation Module Commands 255 G command 789 GDI 532 GDI connection 524 GENPATH 853 Global menu entry 82 Global variable Microcontrollers Debugger Manual...
  • Page 879 Connection Menu 432 Connection Menu module commands 433 Device Option Extended Menu 433 External Interrupt (IRQ) module 447 Input/Output (I/O) Ports module 444 Microcontrollers Debugger Manual Input/Output Ports user commands 445 Inter-Integrated Circuit module 440 Inter-Integrated Circuit module IRQ commands 449...
  • Page 880 487 Connection menu options 492 Derivative Selection dialog box 490 First Steps from within existing project 489 First Steps using Stationery Wizard 488 Microcontrollers New Project Wizard window 488 Monitor Communication Tab 493 Monitor Setup Window Monitor Communication Tab 493...
  • Page 881 .INI 35 init.cmd 201 INPUT command 267 INPUTS Command 267 INPUTS command 271 Inspector Component 133 Microcontrollers Debugger Manual 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...
  • Page 882 Menu Component 47 Connection 43 Help 51 Run 41 View 38 Window 50 Misaligned access 581 Mismatch value 523 Mode menu entry 82 Mode submenu entries 84 Modify Trigger 529 Module Component 102 Modules Source 103 MON08 Microcontrollers Debugger Manual...
  • Page 883 Connect to Target Tab 366 Connection Manager Window Interface Details Area 371 Connection Manager Window STATUS Area 372 Connection Menu Added Options 375 Microcontrollers Debugger Manual Connection Menu Advanced Programming/ Debug Option 376 Connection Menu View Register Files Option 378 Connection Procedure 365...
  • Page 884 Procedure Component 104 -Prod Option 30 Profiler Component 106 Profiler menu entries 107 Profiling 519 Program flow rebuild gap 533 Program loading in Flash 708 Project 846 PROJECT.INI 43 project.ini 845 project.ini file 706 Properties menu entry 142 Microcontrollers Debugger Manual...
  • Page 885 Register values 167 Registration information 52 Relative Mode 154 Remove menu entry 143 Remove MON08 Interface connection 335 REPEAT command 799 Microcontrollers Debugger Manual Replay menu entry 110 Requirements 402 RESET command 814 Reset command file 47 Reset Connection 44...
  • Page 886 Simulator Menu 578 Single Step menu entry 42 Size menu entry 144 Size of Port 146 SLAY command 819 SLCCLR Command 298 SLCDI Command 299 SLCOUT Command 300 SLINE command 820 Sloping 151 Small Borders menu entry 38 Microcontrollers Debugger Manual...
  • Page 887 CodeWarrior IDE and SofTec HCS08 connection 497 Communication Settings dialog box 501 Connection menu options 500 Microcontrollers Debugger Manual First Steps from within existing project 499 First Steps using Stationery Wizard 498 MCU Configuration 500 MCU Configuration dialog box 500...
  • Page 888 Undefined 529 Trigger address editing 529 Trigger B 505 Trigger Module Settings 504 Trigger Module settings 481 Trigger stored as markpoints 508 Trigger types 514 Memory Write Access 530 Triggers Expert 518 True-Time Simulator and Real-Time Debugger Microcontrollers Debugger Manual...
  • Page 889 User menu entry 82 User’s Manual 398 Variable Address 208 Displaying Format 79 Displaying Global Variables 206 Displaying Local Variables 205 Microcontrollers Debugger Manual Editing Value 208 Local and Global 79 Mode 82 Scope 79 Showing Location 209 Type 79...
  • Page 890 WorkDir 200 WorkingDirectory 200 Write 529 Write access 510 Write Access trigger type 514 WRITEACCESS markpoint type 513 WW command 837 X-Position 146 .xpr file 81 XTAL Command 261 Y-Position 146 ZOOM command 838 Zoom menu entry 82 Microcontrollers Debugger Manual...
  • Page 891 Microcontrollers Debugger Manual...
  • Page 892 Microcontrollers Debugger Manual...

Table of Contents