Microcontrollers Debugger Manual Revised: 22 October 2007
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. CodeWarrior is a trademark or registered trademark of Freescale Semiconductor, Inc. in the United States and/or other countries. All other product or service names are the property of their respective owners. Copyright © 1989–2007 by Freescale Semiconductor, Inc. All rights reserved. Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products.
Table of Contents Introduction Manual Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Book I - Debugger Engine Book I Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1 Introduction 25 Freescale Debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Debugger Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Component Windows Object Info Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 Component Context Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 Highlights of the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 Activating Services with Drag and Drop. . . . . . . . . . . . . . . . . . . . . . . . . . . .54 To Drag and Drop an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Breakpoints Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Multiple Selections in List Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Checking Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Saving Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Setting Breakpoints. . . . . . . . . . . . . . . . . . . . . .
Table of Contents Inspecting Task State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186 Task Description Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186 Application Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .188 Inspecting Kernel Data Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189 OSEK Kernel Awareness. . . . . . . . . . . . . . . . . .
Table of Contents How to View Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 How to Communicate with the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 7 CodeWarrior IDE Integration 215 Debugger Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 8 Debugger DDE Capabilities 217 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Loading the Full Chip Simulation Connection . . . . . . . . . . . . . . . . . . . . . .246 Loading the P&E Multilink/Cyclone Pro Connection. . . . . . . . . . . . . . . . .248 Loading the HC(S)08 or RS08 Open Source BDM Connection . . . . . . . . .251 11 HC08 Full Chip Simulation 253 Configuration Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253 Select Device Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Cycle Power Radio Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 Target MCU Security Bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 STATUS Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 Active Mode Connection Menu Options. . . . . . . . . . . . . . . . . . . . . . . . . . . 358 Device Class Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents From Within an Existing Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .397 inDart-HC08 Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .398 MCU Configuration Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .399 Communication Settings Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . .399 About Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Connection (HCS08FCS) Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 Peripheral Modules Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 ADC Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 Clock Generation Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 Inter-Integrated Circuit Module . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Monitor Setup Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .493 Derivative Selection Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .495 22 SofTec HCS08 Connection 497 SofTec HCS08 Technical Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497 CodeWarrior IDE and SofTec HCS08 Connection . . . . . . . . . . . . . . . . . . . . . .497 First Steps Using the Stationery Wizard . . . . . . . . . . . .
Table of Contents DBG Module Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 Trigger Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 Trigger Module Settings Window - Display Information . . . . . . . . . . . . . . 530 General Settings Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 Trace Component Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents 26 RS08 Open Source BDM Connection 561 RS08 Open Source BDM Technical Considerations. . . . . . . . . . . . . . . . . . . . .561 CodeWarrior IDE and RS08 Open Source BDM Connection . . . . . . . . . . . . .561 First Steps Using the Stationery Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .562 First Steps From Within an Existing Project. . . . . . . . . . . . . . . . . . . . . . . . . . .563 RS08 Open Source BDM Menu Options . . . . . . . . . . . . . . . . . . . . . .
Table of Contents FCS Visualization Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 Analog Meter Component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594 IO_LED Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595 LED Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597 Phone Component . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents P&E Multilink/Cyclone Pro Setup Dialog Box. . . . . . . . . . . . . . . . . . . . . .674 Connection Manager Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .675 Set Derivative Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .676 30 SofTec ColdFire Connection 677 SofTec ColdFire Technical Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . .677 CodeWarrior IDE and SofTec ColdFire Connection. . . . . . . . . .
Table of Contents Advanced Options: Erase Prevention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 NVMC Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702 Modules and Module States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702 NVMC Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 Flash Module Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Book VIII - Environment Variables Book VIII Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .839 35 Debugger Engine Environment Variables 841 Debugger Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .842 The Current Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .842 Global Initialization File (MCUTOOLS.INI - PC Only) . . . . . . . . . . . . . .
Table of Contents 38 Legacy Target Interfaces Removed 867 39 HC(S)08 Full-Chip Simulator Components No Longer Supported 869 List of HC(S)08 FCS Components No Longer Supported . . . . . . . . . . . . . . . .
Table of Contents 20 Microcontrollers Debugger Manual
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. • Introduction • Debugger Interface • Debugger Components • Control Points • Real Time Kernel Awareness • How To...
Manual Contents • HCS08 On-Chip DBG Module Book 4: RS08 Debug Connections • RS08 Full Chip Simulation • RS08 P&E Multilink/Cyclone Pro Connection • RS08 Open Source BDM Connection • SofTec RS08 Connection Book 5: ColdFire V1.
Book I - Debugger Engine Book I Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment. This book, the Debugger engine, defines the HC(S)08, RS08, and ColdFire® common and base features and their functionality, and gives a description of the components that are available in the debugger.
Book I Contents 24 Microcontrollers Debugger Manual
1 Introduction This section is an introduction to the Debugger from Freescale used in 8/16 bit embedded applications. Freescale Debugger The Debugger is a member of the tool family for Embedded Development. It is a Multipurpose Tool that you can use for various tasks in the embedded system and industrial control world. Some typical tasks are: • Simulation and debugging of an embedded application. • Simulation and debugging of real-time embedded applications.
Introduction Debugger Features Debugger Features • True 32-bit application • Powerful features for embedded debugging • Special features for real time embedded debugging • Powerful features for True Time Simulation • Various and Same look Target Interfaces • User Interface • Versatile and intuitive drag and drop functions between components • Folding and unfolding of objects like functions, structures, classes • Graphical editing of user defined objects • Visualization functions • Smart interactions with o
2 Debugger Interface This chapter describes the Debugger Graphical User Interface (GUI). Topics include: • Introduction • Application Programs • Starting the Debugger • Debugger Main Window • Component Associated Menus • Highlights of the User Interface Introduction The CodeWarrior™ IDE main window acts as a container for windows of debugger components. The main window provides a main menu bar, a tool bar, a status bar for status information, and object information bars for several components.
Debugger Interface Starting the Debugger The following list is an overview of files that the CodeWarrior IDE uses for C/C++ debugging: • hiwave.exe Debugger executable file • hibase.dll Debugger main function dll • elfload.dll Debugger loader dll • *.wnd Debugger component • *.tgt Debugger target file • *.cpu Debugger CPU awareness file Starting the Debugger This section explains how you can start the debugger from within the CodeWarrior IDE or from a DOS command line.
Debugger Interface Starting the Debugger Starting Debug from the Main Window Menu Bar You can also start the debugger from the main menu bar of the CodeWarrior IDE. To start the debugger from the main menu bar, select Debug from the Project menu: (Project > Debug.) Figure 2.2 Main Window Project Menu Debugger Command Line Start You can start the debugger from a DOS command line. The command syntax is as follows: HIWAVE.
Debugger Interface Starting the Debugger Command Line Options DOS command line options are: -T=
Debugger Interface Starting the Debugger -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 = 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" -C This option specifies a command file to be executed at start-up.
Debugger Interface Debugger Main Window NOTE 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. Figure 2.
Debugger Interface Debugger Main Window Debugger Main Window Toolbar The Debugger Main Window toolbar is the default toolbar. Most of the Main Window menu commands have a related shortcut icon on this toolbar. Figure 2.4 identifies each default icon. t ar ge lt Ha st ep St ep ov er St As ep se ou m t bl y st ep n Ru R es et t le Si ng ic lp to p He He lp on y st e Pa op C Cu t n e Sa v pe O N ew Figure 2.
Debugger Interface Debugger Main Window Table 2.1 Description of the Main Menu Toolbar Entries Menu entry Description File Contains entries to manage debugger configuration files. View Contains entries to configure the toolbar. Run Contains entries to monitor a simulation or debug session. Connection Contains entries to select the debugger connection. Once a connection has been selected, the name of this heading changes. Component Contains entries to select and configure extra component window.
Debugger Interface Debugger Main Window Table 2.2 describes File Menu entries. Table 2.2 File Menu Entry Description Menu Entry Description New Creates a new project. Load Application Loads an executable file (or debugger connection if nothing is selected). ...\restart.abs Recent applications list ...\await.abs ... Open Configuration Opens the debugger project window. You can load a project file .PJT or .INI. Additionally you can load an existing .
Debugger Interface Debugger Main Window Configuration Window Open the Configuration window by selecting Configuration from the Files menu. With this window (Figure 2.8) it is possible to set up environment variables for the current project. New variables are saved in the current project file when you click the OK button. NOTE The corresponding menu entry (File > Configuration) is only enabled if a project file is loaded. Figure 2.
Debugger Interface Debugger Main Window Command Buttons: • OK: Changes are confirmed and saved in current project file. • Cancel: Closes dialog box without saving changes. • Help: Opens the help file. Figure 2.9 Configuration Window - Load Tab The Configuration Window - Load tab contains the following controls: • Automatically erase and program into FLASH and EEPROM checkbox. • A Verify memory image after loading code checkbox, with two radio buttons that let you define the memory image.
Debugger Interface Debugger Main Window View Menu In the Main Window View menu (Figure 2.10) you can choose to show or hide the toolbar, status bar, window component titles and headlines (see the Component Windows Object Info Bar). You can select smaller window borders and customize the toolbar. Table 2.3 describes the View Menu entries. Figure 2.10 View Menu Table 2.3 View Menu Description Menu Entry Description Toolbar Check / uncheck Toolbar if you want to display or hide it.
Debugger Interface Debugger Main Window Figure 2.11 Customize Toolbar Dialog Box • Select the desired shortcut button in the Available buttons list box and click Add to install it in the toolbar. • Select a button in the Toolbar buttons list box and click Remove to remove it from the toolbar. Demo Version Limitations The default toolbar cannot be configured. Examples of View Menu Options Figure 2.12 shows a typical component window display. Figure 2.12 Typical Component Window Display Figure 2.
Debugger Interface Debugger Main Window Figure 2.13 Component Window without Title and Headline Figure 2.14 shows a component window without a title and headline, and with a small border. Figure 2.14 Component Window without Title and Headline, and with Small Border Figure 2.
Debugger Interface Debugger Main Window Figure 2.15 Component Window without Headline and Small Border Run Menu The Main Window Run menu, shown in Figure 2.16 is associated with the debug session. You can monitor a simulation or debug session from this menu. Run menu entries are described in Table 2.4. Figure 2.
Debugger Interface Debugger Main Window Table 2.4 Run Menu Description Menu entry Description Start/Continue Starts or continues execution of the loaded application from the current program counter (PC) until a breakpoint or watchpoint is reached, runtime error is detected, or user stops the application by selecting Run > Halt. Shortcut: F5 key Restart Starts execution of the loaded application from its entry point. Shortcut: CTRL + Shift + F5 keys Halt Interrupts and halts a running application.
Debugger Interface Debugger Main Window Table 2.4 Run Menu Description (continued) Menu entry Description Assembly Step Over Similar to the Step Over command, but steps over subroutine call instructions. Shortcut: CRTL + F10 keys Assembly Step Out If the application is halted inside a function, this command continues execution and stops on the CPU instruction following the current function invocation.
Debugger Interface Debugger Main Window Table 2.5 Connection Menu Common Option Description Menu Entry Description Load Loads a connection. Reset Resets the current connection. Loading an Executable File Use the Connection menu to load a debugger connection: • Choose Connection > Load The Load Executable File window shown in Figure 2.18 appears. Load Executable File Window From the Load Executable File window, set the load options and choose a Simulation Execution Framework (an .
Debugger Interface Debugger Main Window Load Options Buttons These three buttons allow you to select which part of the executable file to load: • Load Code Button: Loads the application code only. Loads only the application into the target system. Use this button if no debugging is needed. • Load Symbols Button: Loads symbols only. Loads only debugging information. This button can be used if the code is already loaded into the target system or programmed into a non-volatile memory device (ROM/FLASH).
Debugger Interface Debugger Main Window Figure 2.19 Connection Command File Window The command file in the edit box is executed when the corresponding event occurs. Click the Browse button to set the path and name of the command file. The Enable Command File check box allows you to enable/disable a command file on an event. By default, all command files are enabled: • The default Startup command file is STARTUP.CMD • The default Reset command file is RESET.CMD • The default Preload command file is PRELOAD.
Debugger Interface Debugger Main Window The default settings enable the STARTUP.CMD file located in the current project directory as the current Startup command file. Reset Command File The reset.cmd command file is a Debugger system command file. The Reset command file executes after clicking the reset button, selecting Connection Name > Reset in the menu (Connection Name is the real name of the connection, such as MMDS0508 or SDI) reset.cmd or selecting Command Line command.
Debugger Interface Debugger Main Window Figure 2.20 Component Menu Table 2.6 describes the Component Menu entries. Table 2.6 Component Menu Description Menu entry Description Open Loads an extra component window that has not been loaded by the Debugger at startup. The context-sensitive dialog box presents a set of different components that are introduced in the Typical Component Window Display section. Set Connection Sets the Debugger connection.
Debugger Interface Debugger Main Window Figure 2.21 Set Connection Dialog Box 6. Use the Processor list menu to select the desired processor. 7. Use the connection list menu to select the desired connection. A text panel displays information about the selected connection. NOTE When a connection cannot be loaded, the combo box displays the correct path for you to install the missing DLL. 8. Click OK to load connection in debugger.
Debugger Interface Debugger Main Window Window Menu In this menu, shown in Figure 2.22, you can set the component windows general arrangement. The Submenu Window > Options is shown in Figure 2.23 and the Submenu Window > Layout in Figure 2.24. Figure 2.22 Window Menu Figure 2.23 Window Menu Options SubMenu Figure 2.24 Window Menu Layout SubMenu Table 2.7 specifies the Window Menu entries.
Debugger Interface Debugger Main Window Table 2.7 Window Menu Description Menu entry Description Cascade Option to arrange all open windows in cascade (so they overlap). Tile Option to display all open windows in tile format (non overlapping). Arrange Icons Arranges icons at the bottom of windows. Options - Autosize Component windows always fit into the debugger window whenever you modify the debugger window size.
Debugger Interface Component Associated Menus About Box Select Help > About to display the About box. The about box lists directories for the current project, system information, program information, version number and copyright. It contains information to send for Registration. You can copy this information and send to license@freescale.com. For more information on all components, click on the Extended Information button.
Debugger Interface Component Associated Menus Component Files Each component is a windows file with a .wnd extension Component Windows Object Info Bar The object info bar of the debugger window, as shown in Figure 2.27, provides information about the selected object. Figure 2.27 Object Info Bar of Debugger Component Windows Component Context Menu The context menu is a dynamic context sensitive menu. It contains entries for additional facilities available in the current component.
Debugger Interface Highlights of the User Interface Highlights of the User Interface This section describes some of the main features of the Debugger user interface. Activating Services with Drag and Drop You can activate services by dragging objects from one component window to another. This is known as drag and drop, an example is shown in Figure 2.29. Figure 2.
Debugger Interface Highlights of the User Interface To Drag and Drop an Object To drag an object from one component window to another: 1. Select the component containing the object you want to drag. 2. Make sure the destination component window where you want to drag the object is visible. 3. Select the object you want. 4. Press and hold the left mouse button, drag the object into the destination component window and then release the mouse button.
Debugger Interface Highlights of the User Interface Dragging from Data Component Window Table 2.10 summarizes dragging from the Data Component. Table 2.10 Dragging from the Data Component Window Destination Component Window Action Command Line Dragging the name appends the address range of the variable to the current command in the Command Line Window. Dragging the value appends the variable value to the current command in the Command Line Window.
Debugger Interface Highlights of the User Interface Dragging from Source Component Window Table 2.11 summarizes dragging from the Source Component. Table 2.11 Dragging from the Source Component Window Destination Component Window Action Assembly Displays disassembled instructions starting at the first high level language instruction selected.
Debugger Interface Highlights of the User Interface Dragging from the Memory Component Window Table 2.12 summarizes dragging from the Memory Component. Table 2.12 Dragging from the Memory Component Window Destination Component Window Action Assembly Displays disassembled instructions starting at the first address selected. Instructions corresponding to the selected memory area are highlighted in the Assembly component. Command Line Appends the selected memory range to the Command Line window.
Debugger Interface Highlights of the User Interface Table 2.14 Dragging from the Register Component Window Destination Component Window Action Assembly Assembly component receives an address range, scrolls to the corresponding instruction and highlights it. Memory Dumps memory starting at the address stored in the selected register. The corresponding address is selected in the memory component. Dragging from Module Component Window Table 2.15 summarizes dragging from the Register Component. Table 2.
Debugger Interface Highlights of the User Interface 60 Microcontrollers Debugger Manual
3 Debugger Components This chapter explains how the different components of the Debugger work. This chapter contains the following sections: • Component Introduction • Loading Component Windows • General Debugger Components • Visualization Utilities Component Introduction The Debugger kernel includes various components. CPU Components CPU components handle processor-specific properties such as register naming, instruction decoding (disassembling), and stack tracing.
Debugger Components Component Introduction Connection Components Different debugger connections are available. For example, you can set a CPU awareness to simulate your .ABS application files, and also set a background debugger. Different connections are available to connect the target system (hardware) to the debugger. For example, the connection may be connected using a Full Chip Simulator, an Emulator, a ROM monitor, a BDM pod cable, or any other supported device.
Debugger Components Component Introduction Figure 3.2 Open Window Component Window 3. In the Open Window Component window, use the mouse to select a component. 4. Click the OK button to open the selected component. There are three tabs in the Open Window Component window: • The Icon tab shows components with large icons. • The List tab shows components with small icons. • The Details tab shows components with their description.
Debugger Components General Debugger Components General Debugger Components This section describes the various features and usage of the debugger components. Assembly Component The Assembly window, shown in Figure 3.3, displays program code in disassembled form. It has a function very similar to that of the Source component window but on a much lower abstraction level. Thus it is therefore possible to view, change, monitor and control the current location of execution in a program. Figure 3.
Debugger Components General Debugger Components Assembly Menu The Assembly menu shown in Figure 3.4 contains all functions associated with the assembly component. Table 3.1 describes these menu entries. Figure 3.4 Assembly Menu Table 3.1 Assembly Menu Description Menu Entry Description Address Opens a dialog box prompting for an address: Show PC. Display Code Displays machine code in front of each disassembled instruction. Symbolic Displays symbolic names of objects.
Debugger Components General Debugger Components Setting Breakpoints Breakpoints can be set, edited and deleted when using the context menu. Right-click on any statement in the Source component window, then choose Set Breakpoint, Delete Breakpoint, etc. NOTE For information on using breakpoints, see Control Points chapter. Show PC Dialog Box If a hexadecimal address is entered in the Show PC dialog box shown in Figure 3.
Debugger Components General Debugger Components Table 3.2 Assembly Context Menu Description Menu Entry Description Set Breakpoint 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.
Debugger Components General Debugger Components Retrieving Source Statement • Point to an instruction in the Assembly component window, drag and drop it into the Source component window. The Source component window scrolls to the source statement generating this assembly instruction and highlights it.
Debugger Components General Debugger Components Table 3.4 Drop Into Assembly Component Source Component Window Action Source Displays disassembled instructions starting at the first high level language instruction selected. The assembler instructions corresponding to the selected high level language instructions are highlighted in the Assembly component Memory Displays disassembled instructions starting at the first address selected.
Debugger Components General Debugger Components Keying In Commands You can type Debugger commands after the in> terminal prompt in the Command Line Component window. Recalling a Line from the Command Line History To recall a command in the DOS window use either the up or down arrow, or the F3 function key, to retype the previous command.
Debugger Components General Debugger Components Closing the Command Line During Execution When a command is executed from a Command Line component, it cannot be closed. If the Command Line component is closed with the close button or with the 'Close' entry of the system menu, the following message is displayed 'Command Component is busy. Closing will be delayed' and the Command component is closed as soon as command execution is complete.
Debugger Components General Debugger Components Cache Size Select Cache Size in the menu to bring up the Size of the Cache dialog box and set the cache size in lines for the Command Line window, as shown in Figure 3.9. Figure 3.9 Cache Size Dialog Box This Cache Size dialog box is the same for the Terminal Component and the TestTerm Component. Drag Out Nothing can be dragged out. Drop Into Memory range, address, and value can be dropped into the Command Line Component window, as described in Table 3.5.
Debugger Components General Debugger Components Demo Version Limitations Only 20 commands can be entered and then command component is closed and it is no longer possible to open a new one in the same Debugger session. Command files with more than 20 commands cannot be executed. Associated Commands BD, CF, E, HELP, NB, LS, SREC, SAVE. NOTE For more details about commands, refer to Debugger Engine Commands. Coverage Component The Coverage window, shown in Figure 3.
Debugger Components General Debugger Components Figure 3.11 Split Views Coverage Operations Click the folded/unfolded icons the functions defined. to unfold/fold the source module and display/hide Coverage Menu The Coverage menu and submenus are shown in Figure 3.12. Figure 3.12 Coverage Menu Table 3.6 Coverage Menu Description 74 Menu Entry Description Reset Resets all simulator statistic information. Details Opens a split view in the chosen component (Source or Assembly).
Debugger Components General Debugger Components Output File You can redirect Coverage component results to an output file by selecting Output File > Save As in the menu or context menu. Output File Filter Select Output Filter to display the dialog box shown in Figure 3.13. Select what you want to display, i.e. modules only, modules and functions, or modules, functions and code lines. You can also specify a range of coverage to be logged in your file. Figure 3.
Debugger Components General Debugger Components Split View Associated Context Menu The context menu for the split view (Figure 3.14) contains the Delete entry, which is used to remove the split view. Figure 3.14 Coverage Split View Associated Context Menu Drag Out All displayed items can be dragged into a Source or Assembly component. Destination component displays marks in front of the executed source or assembler instruction. Drop Into Nothing can be dropped into the Coverage Component window.
Debugger Components General Debugger Components DA-C Link Operation When you load the DA-C Link component, communication is established with DA-C (if open) in order to exchange synchronization information. The Setup entry of the DA-C Link main menu allows you to define the connection parameters. NOTE For related information refer to the Chapter Synchronized Debugging Through DA-C IDE. DA-C Link Menu Selecting Setup from the DA-C Link menu opens the Connection Specification dialog box. Figure 3.
Debugger Components General Debugger Components Connection Specification Dialog Box In the Connection Specification dialog box you can set the DA-C debugger name. Figure 3.17 Connection Specification Dialog Box The DA-C debugger name must be the same as the one selected in the DA-C IDE. Check the Show Protocol checkbox to display the communication protocol in the Command component of the Debugger. To validate the settings, click the OK button.
Debugger Components General Debugger Components Data Component The Data window shown in Figure 3.18 contains the names, values and types of global or local variables. Figure 3.18 Data Window The Data window shows all variables present in the current source module or procedure. Changed values are in red. The Component Windows Object Info Bar contains the address and size of the selected variable.
Debugger Components General Debugger Components • Select a variable in the Data component, and left mouse button + W key to set a Write watchpoint on the selected variable. A red vertical bar is displayed on the left side of the variables on which a write watchpoint has been defined. If write access is detected on the variable during execution, the program is halted and the current program state is displayed in all window components.
Debugger Components General Debugger Components Example: With two variables variable_1, variable_2; expression entered: (variable_1<>~variable_2)* 0x1000 results in an integer type. NOTE It is not possible to drag an expression defined with the Expression Editor. The forbidden cursor is displayed.
Debugger Components General Debugger Components Table 3.8 Data Menu Entry Description Menu Entry Description Zoom Zooms in or out of the selected structure. The member field of the structure replaces the variable list. Scope Opens a variable display submenu. Format Symb, Hex (hexadecimal), Oct (octal), Bin (binary), Dec (signed decimal), UDec (unsigned decimal) display format. Mode Switches between Automatic, Periodical, Locked, and Frozen update mode.
Debugger Components General Debugger Components In Local Scope, if the Data component is in Locked or Periodical mode, values of the displayed local variables may be invalid (since these variables are no longer defined in the stack). Format Submenu The Format Submenu is activated by highlighting the format entry on the Data menu: Figure 3.22 Format Submenu Table 3.10 describes the Format submenu entries. Table 3.
Debugger Components General Debugger Components Table 3.11 Format Selected and All Submenu Menu entry Description Symbolic Select the Symbolic (display format depends on the variable type) display format. This is the default display.
Debugger Components General Debugger Components Table 3.12 Mode Submenu (continued) Menu Entry Description Locked Switches to Locked mode; value from variables displayed in the data component are updated when the connection is stopped. Frozen Switches to Frozen mode; value from variables displayed in the data component are not updated when the connection is stopped. NOTE In Locked and Frozen mode, variables from a specific module are displayed in the data component.
Debugger Components General Debugger Components Pointer as Array Option In the Data menu’s Options submenu, choose Options > Pointer as Array to open the dialog box shown in Figure 3.27. Figure 3.27 Pointer as Array Dialog Box Within this dialog box, you can display pointers as arrays, assuming that the pointer points to the first item (pointer[0]). Note that this setup is valid for all pointers displayed in the Data window.
Debugger Components General Debugger Components Associated Context Menu This section describes the context menus associated with each debug component. Menu contents vary when the DBG module is available. Figure 3.30 Data Context Menu Table 3.13 describes the Data Context Menu entries. Table 3.13 Data Context Menu Menu Entry Description Open Module Opens the Open Module dialog box. Set Watchpoint Appears only in the context menu if no watchpoint is set or disabled on the pointed to variable.
Debugger Components General Debugger Components Table 3.13 Data Context Menu (continued) Menu Entry Description Show Watchpoints Opens the Watchpoints Setting dialog box and allows you to view the list of watchpoints defined in the application. (Refer to Control Points.) Show location Forces all open components to display information about the pointed to variable (e.g., the Memory component selects the memory range where the variable is located). SUBMENU Open Module The dialog box shown in Figure 3.
Debugger Components General Debugger Components Table 3.14 Dragging Data Possibilities (continued) Destination Component Window Action Source Dragging the name of a global variable in the source Window displays the module where the variable is defined and highlights the first occurrence of the variable. Register Dragging the name loads the destination register with the address of the selected variable. Dragging the value loads the destination register with the value of the variable.
Debugger Components General Debugger Components Associated Commands ADDXPR, ATTRIBUTES, DUMP, PTRARRAY, SMOD, SPROC, UPDATERATE, ZOOM. Memory Component The Memory window shown in Figure 3.32 displays unstructured memory content or memory dump, that is continuous memory words without distinction between variables. Figure 3.
Debugger Components General Debugger Components NOTE Memory values that have changed since the last refresh status are displayed in red. However, if a memory item is edited or rewritten with the same value, the display for this memory item remains black. Memory Address Spaces Some devices might have one or more additional address spaces, and the Memory window can display the different address spaces when selecting the Address Space menu entry.
Debugger Components General Debugger Components Banked/Window Paged Memory: Physical/Local vs. Logical display This section applies only to devices having on-chip program pages or data pages. For Legacy reasons, the debugger provides two ways to display the banked/window paged memory, such as the PPAGE window $8000-$BFFF range with HCS08 devices with onchip MMU, or EEPROM windows bit selectable: • The default display is called the physical display in the Debugging Memory Map (DMM) interface.
Debugger Components General Debugger Components • Hold down the left mouse button + A key to jump to a memory address. The pointed to value is interpreted as an address and the memory component dumps memory starting at this address. • Select a memory range, and hold down the left mouse button + R key to set a Read watchpoint for the selected memory area. Memory ranges where a read watchpoint has been defined are underlined in green.
Debugger Components General Debugger Components Table 3.16 Memory Menu Description Menu Entry Description Word size Opens a submenu to specify the display unit size. Format Opens a submenu to select the format to display items. Mode Opens a submenu to choose the update mode. Display Opens a submenu to toggle the display of addresses and ASCII dump. Fill Opens the Fill Memory to fill a memory range with a bit pattern. Address Opens the memory dialog box and prompts for an address.
Debugger Components General Debugger Components Format Submenu With the Format Submenu shown in Figure 3.36, you can set the memory display format. Table 3.18 describes the menu entries. Figure 3.36 Format Submenu Table 3.
Debugger Components General Debugger Components Table 3.19 Mode Submenu Description Menu Entry Description Automatic Selects Automatic mode (default), memory dump is updated when the connection is stopped. Periodical Selects the Periodical mode, memory dump is updated at regular time intervals when the connection is running. The default update rate is 1 second, but it can be modified by steps of up to 100 ms using the associated dialog box (see below).
Debugger Components General Debugger Components Fill Memory The Fill Memory dialog box shown in Figure 3.39 allows you to fill a memory range (from Address edit box and to Address edit box) with a bit pattern (value edit box). Figure 3.39 Fill Memory dialog box NOTE If Hex Format is checked, numbers and letters are interpreted as hexadecimal numbers. Otherwise, type expressions and prefix Hex numbers with 0x or $. Display Address With the Display Address dialog box, shown in Figure 3.
Debugger Components General Debugger Components CopyMem Submenu The CopyMem dialog box shown in Figure 3.41 allows you to copy a memory range to a specific address. Figure 3.41 CopyMem Dialog Box To copy a memory range to a specific address, enter the source range and the destination address. Press the OK button to copy the specified memory range. Press the Cancel button to close the dialog box without changes. Press the Help button to open the help file associated with this dialog box.
Debugger Components General Debugger Components Refresh Select the Refresh menu entry to refresh the Memory window current data cache. The debugger refreshes the data cache as if the debugger was halted or stepped. Note that only memory ranges defined with the Refresh memory when halting option in the Debugging Memory Map (DMM) interface are refreshed. The Refresh menu entry addresses, by DMM factory setup, the volatile memory, i.e. the RAM and on-chip I/O Registers.
Debugger Components General Debugger Components Memory Context Menu The Memory Context menu allows you to execute memory associated commands. Figure 3.44 shows the Memory Context menu and Table 3.21 describes the menu entries. Menu contents vary when the DBG module is available. Figure 3.44 Memory Context Menu Table 3.21 explains the menu entries in the Memory Context menu. Table 3.
Debugger Components General Debugger Components Table 3.21 Memory Context Menu Description (continued) Menu Entry Description Show Watchpoints When selected, brings up the Controlpoints Configuration Window Watchpoints Tab. This is the interface through which watchpoints are controlled. (See Control Points chapter). Set Markpoint Appears in the context menu only if no watchpoint is set or disabled on the selected memory range. When selected, sets a Read/Write watchpoint at this memory area.
Debugger Components General Debugger Components Drop Into Table 3.23 shows the drop actions possible in the Memory component. Table 3.23 Memory Component Drop Possibilities Source Component Window Action Assembly Dumps memory starting at the selected PC instruction. The PC location is selected in the memory component. Data Dumps memory starting at the address where the selected variable is located. The memory area where the variable is located is selected in the memory component.
Debugger Components General Debugger Components The Module component displays all source files (source modules) bound to the application. The Module window displays all modules in the order they appear in the absolute file. Module Operations Double-clicking a module name forces all open windows to display information about the module: the Source Component window shows the module's source and the global Data Component window displays the module's global variables.
Debugger Components General Debugger Components Procedure Component The Procedure window shown in Figure 3.46 displays the list of procedure or function calls that have been made up to the moment the program was halted. This list is known as the procedure chain or the call chain. Figure 3.46 Procedure Window In the Procedure Component window, entries in the call chain are displayed in reverse order from the last call (most recent on top) to the first call (initial on bottom).
Debugger Components General Debugger Components Table 3.25 Procedure Menu Description Menu Entry Description Show Values Switches to the display of function parameter values in the procedure component. Show Types Toggles to the display of function parameter types in the procedure component. Drag Out Table 3.26 shows the drag actions possible from the Procedure component. Table 3.26 Procedure Component Drag Possibilities.
Debugger Components General Debugger Components Profiler Component The Profiler window shown in Figure 3.48 provides information on the application profile. NOTE In cases of advanced code optimizations (like linker overlapping ROM/code areas), the profiler output/data is affected. In such a case, it is recommended to switch linker optimizations. Figure 3.
Debugger Components General Debugger Components Profiler Operations Click the fold/unfold icon to unfold/fold the source module. Profiler Menu Figure 3.50 shows the Profiler Menu entries, with the Details submenu and the Base submenu. Figure 3.51 shows the Profiler Output File submenu. Entries are described in Table 3.27. Figure 3.50 Profiler Menu and Submenus Figure 3.51 Profiler Output File Submenu : Table 3.27 Profiler Menu Entries Description Menu Entry Description Reset Resets all statistics.
Debugger Components General Debugger Components Split View Associated Context Menu Figure 3.52 shows the Profiler context menu, the Delete and Graphics menu entries are described in Table 3.28. Figure 3.52 Profiler Split View Associated Context Menu Table 3.28 Profiler Split View Associated Context Menu Description Menu Entry Description Delete Removes the split view from the host component. Graphics Toggles the graphic bars display in the split view.
Debugger Components General Debugger Components Output File Save The Save As entry opens a Save As dialog box where you can specify the output file name and location. Associated Context Menu Identical to menu. Drag Out All displayed items can be dragged out. Destination windows may display information about the time spent in code in a split view. Drop Into Nothing can be dropped into the Profiler Component window. Demo Version Limitations Only modules are displayed and the Save function is disabled.
Debugger Components General Debugger Components An animation occurs during recording, replaying and pausing. The current action (record, play or pause) and path of the involved file are displayed in the Object Info bar of the window. Recorder Operations When there is no record or play session (e.g., when the window is open), only the record and play buttons are enabled. When you click the record button, the debugger prompts you to enter a file name.
Debugger Components General Debugger Components In Listing 3.2, an .abs file is loaded, a breakpoint is set, the assembly component is configured to display the code and addresses. The Data1 component display is switched to local variables, and the application starts and stops at the breakpoint. Listing 3.2 Record File Example at 4537 load C:\Freescale\DEMO\fibo.
Debugger Components General Debugger Components TIP Many more registers and registers information might by provided by the Inspector Component, in the IO Registers field. Status Register Bits Set bits are displayed dark, whereas reset bits are displayed gray. Double-click a bit to toggle it. During program execution, contents of registers that have changed since the last refresh are displayed in red, except for status register bits.
Debugger Components General Debugger Components Table 3.
Debugger Components General Debugger Components Table 3.32 Register Component Drop Possibilities Source Component Window Action Assembler Loads the destination register with the PC of the selected instruction. Data Dragging the name loads the destination register with the start address of the selected variable. Dragging the value loads the destination register with the value of the variable. Source Loads the destination register with the PC of the first instruction selected.
Debugger Components General Debugger Components Source Component The Source window shown in Figure 3.58 displays the source code of your program, i.e. your application file. Figure 3.58 Source Window The Source window allows you to view, change, monitor and control the current execution location in the program. The text displayed in the Source Component window is chromacoded, i.e. language keywords, comments and strings are emphasized with different colors (respectively blue, green, red).
Debugger Components General Debugger Components to the Control Points chapter. If execution stops, the current position is marked in the source component by highlighting the corresponding statement. The complete path of the displayed source file is written in the Object Info bar of this window. NOTE You cannot edit the visible text in the Source window. This is a file viewer only. Tool Tips Features The Debugger source component provides tool tips to display variable values.
Debugger Components General Debugger Components • Holding down the left mouse button and pressing the T key: Highlights a code range in the Assembly component window corresponding to the first line of code selected in the Source component window where the operation is performed. This line or code range is also highlighted. Figure 3.60 On Line Disassembling Setting Temporary Breakpoints For information on setting breakpoints refer to the Control Points chapter.
Debugger Components General Debugger Components Setting Permanent Breakpoints • Point to an instruction in the Source component Window and click the right mouse button. The Source Component context menu is displayed. Select Set Breakpoint from the context menu. The permanent breakpoint icon is displayed in front of the source statement pointed to. • Holding down the left mouse button and pressing the P key: Sets a permanent breakpoint at the nearest code position (visible with marks).
Debugger Components General Debugger Components Figure 3.63 Source Associated Context Menu Table 3.33 Source Associated Context Menu Description Menu Entry Description Set Breakpoint 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.
Debugger Components General Debugger Components Table 3.33 Source Associated Context Menu Description (continued) 120 Menu Entry Description Run To Cursor When selected, sets a temporary breakpoint at the nearest code position and continues program execution immediately. Disabling a permanent breakpoint at this position disables the temporary breakpoint and prevents the program from halting. Temporary breakpoints are automatically removed when they are reached.
Debugger Components General Debugger Components Table 3.33 Source Associated Context Menu Description (continued) Menu Entry Description Find Procedure (CTRL+I) Opens a dialog box for searching a procedure. Foldings Opens the folding window. Marks Toggles the display of source positions where breakpoints may be set. If this switch is on, these positions are marked by small triangles.
Debugger Components General Debugger Components Go to Line This menu entry is only enabled if a source file is loaded. It opens the dialog box shown in Figure 3.65. In this dialog box, enter the line number you want to go to in the source component, and the selected line appears at the top of the source window. If the number is incorrect, a message appears. Figure 3.
Debugger Components General Debugger Components NOTE If an item (single word or source section) has been selected in the Source component window before opening the Find dialog box, the first line of the selection is copied into the Find what edit box. Find Procedure The Find Procedure dialog box, shown in Figure 3.67 is used to find the procedure name in the currently loaded application. Enter the procedure name you want to search for in the Find Procedure edit box.
Debugger Components General Debugger Components Table 3.34 Folding Menu Description Menu Entry Description Unfold Unfolds the displayed source code Fold Folds the displayed source code Unfold All Text Unfolds all displayed source code Fold All Text Folds all displayed source code All Text Folded At Loading Folds all source code at load time Drag Out Table 3.35 shows the drag actions possible from the Source component. Table 3.
Debugger Components General Debugger Components Drop Into Table 3.36 shows the drop actions possible into the Source component. Table 3.36 Source Drop Possibilities Source Component Window Action Assembly Source component scrolls to the source statements corresponding with the pointed to assembly instruction and highlights it. Memory Displays high level language source code starting at the first address selected.
Debugger Components General Debugger Components You can use a virtual SCI (Serial Communication Interface) port provided by the framework for communication with the target, but it is also possible to use the keyboard, the display, some files or even the serial port of your computer as I/O-devices. To control and configure a terminal component use the Terminal menu of the terminal shown in Figure 3.70. Figure 3.70 Terminal Menu and Context Menu To open the context menu, right click in the terminal window.
Debugger Components General Debugger Components You can simply choose one of the default configurations in the Default Configuration combo box. In the Connections section all active connections are listed in a list box. There you can customize input to output device redirection by adding and removing connections. To add a connection specify the source and target devices using the From and To combo boxes and then press the Add button.
Debugger Components General Debugger Components Table 3.37 Terminal File Control Commands Escape Sequence Function ESC “h” “1” Close output file. ESC “h” “2” filename Open output file. ESC “h” “3” filename Open output file and suppress output to terminal display. ESC “h” “4” Close input file ESC “h” “5” filename Open input file. ESC “h” “6” filename Append to existing output file. ESC “h” “7” filename Append to existing output file and suppress output to terminal display.
Debugger Components General Debugger Components • TERM_APPEND_BOTH: append output to file and window • TERM_APPEND_FILE: append output to file fileName See also terminal.h for further details. How to Use Virtual SCI In its default Virtual SCI configuration the terminal component accesses the target through the Object Pool interface. To make the terminal component work in this default configuration, the target must provide an object with the name Sci0.
Debugger Components General Debugger Components Trace Component The Trace window shown in Figure 3.73 records and displays instruction frames and time or cycles. Figure 3.73 Trace Window Trace Operations Pointing at a frame and dragging the mouse forces all open windows to show the corresponding code or location. Time and cycles of all other frames are evaluated relative to this base. Holding down the left mouse button and pressing the Z key sets the zero base frame to the pointed frame.
Debugger Components General Debugger Components Figure 3.74 Trace Menu Table 3.38 Trace Menu Description Menu Entry Description Textual Displays window contents in text format. Graphical Displays window contents in graphical format. Instructions Displays instructions in window Items Use to specify the window display items. Dump Select a file to dump or a range of frames to dump. Go to Frame Search for a specific frame. Disable Trace/ Enable Trace Disable or enable tracing function.
Debugger Components General Debugger Components Figure 3.75 Trace Associated Context Menu Table 3.39 Trace Associated Context Menu Description Menu Entry Description Search Trace Setup Select this menu entry to activate the Trace Search Setup dialog box (see Figure 3.76). Specify either the frame or a condition for which to search. (Not available with all connections.) Next Steps to the next occurrence of the condition. Pressing the N key has the same effect.
Debugger Components Visualization Utilities Demo Version Limitations The number of frames is limited to 50. Associated Commands CLOCK, CYCLE, FRAMES, RECORD, RESET.
Debugger Components Visualization Utilities In the figure above, for example, the Object Pool is expanded. The Object Pool contains the TargetObject, which contains the Leds and Swap peripheral devices. The Swap peripheral device is selected and registers of the Swap device are displayed. Components Icon When the components icon is selected in the Inspect window, as shown in Figure 3.78, the right side displays various information about all loaded components.
Debugger Components Visualization Utilities Symbol Table The symbol table shown in Figure 3.80 displays all loaded symbol table information in raw format. There are no stack frames associated with functions. Therefore the content of local variables is not displayed. Global variables and their types are displayed. Figure 3.80 Inspector Window Symbol Table Events Icon The Inspect window Events icon shown in Figure 3.81 shows all currently installed events.
Debugger Components Visualization Utilities Figure 3.82 Inspector Window Exceptions Icon Events are only used in the HC(S)08 Freescale Full Chip Simulator. This information is used for simulation I/O device development. Since interrupts are usually simulated immediately when they are raised, the Exceptions are usually empty. Only when interrupts are disabled or an interrupt is handled, something is visible in this item.
Debugger Components Visualization Utilities IO Registers The IO Registers icon shown in Figure 3.84 shows all the IO Registers and Core Registers referenced by the debugger database. The Inspector can therefore provide many more registers information than the regular Register window. Figure 3.84 Inspector Window IO Registers: ColdFire registers set example Each group of registers can be expanded, and registers can be directly edited in the Value column when double-clicking directly on the value.
Debugger Components Visualization Utilities Values can be entered in hexadecimal (with preceding 0x), in decimal, in octal (with preceding 0), or in binary (with preceding &). To see the IO_Led in the Inspector, as shown in Figure 3.85, open the IO_Led with the context menu Component-Open and then open the Inspector. If the Inspector is already loaded, select Update from the context menu in the Inspector. Then click on the Components icon to see the Component list, which now includes the “IO_Led” component.
Debugger Components Visualization Utilities Inspector Menu The Inspector menu contains entries described in Table 3.40. Table 3.40 Inspector Menu Entries Menu Entry Description Update All displayed information is updated Items that no longer exist are removed and new items are added. Associated Context Menu Commands in the Inspector context menu depend on the selected item. It can contain entries described in Table 3.41. Table 3.
Debugger Components Visualization Utilities Drag Out Items that can be dragged, depends on which icon is selected. Table 3.42 gives a brief description. Table 3.42 Inspector Component Drag Possibilities Dragging Item Description Components The components cannot be dragged Stack The Stack Icon itself cannot be dragged. All subitems can be dragged the same way as the Symbol Table subitems, described below. Symbol Table The Symbol Table icon cannot be dragged out.
Debugger Components Visualization Utilities Visualization Tool Component The Visualization Tool component is a very convenient tool for presenting your data. For software demonstration, or for your own debugging session, take advantage of all its virtual instruments. The VisualizationTool window, shown in Figure 3.88, consists of a plain workspace that can be equipped with many different instruments. Figure 3.
Debugger Components Visualization Utilities Instrument Selection You can select a single instrument by left clicking the mouse on it, and change the selection by pressing the tab-key. To make multiple selections, hold down the control key and left-click on the desired instruments. You can also left click, hold and move to create a selection rectangle. Move Instruments There are two ways to move instruments. First, make your desired selection.
Debugger Components Visualization Utilities Table 3.43 Visualization Tool Menu Description (continued) Menu Entry Description Load Layout Loads a VisualizationTool-Layout (*.vtl). Does not remove the actual instruments. Shortcut: Save Layout Saves the current layout to a file (*.vtl). Shortcut: Associated Context Menu The context menu of the VisualizationTool depends on the current selection. It can contain the entries described in Table 3.44. : Table 3.
Debugger Components Visualization Utilities Table 3.44 VisualizationTool Context Menu (continued) Menu entry Context Description Paste Edit mode Adds instruments, which are temporary stored in the clipboard, to the workspace. Shortcut: Ctrl + V 144 Send to Back At least one selection Sends current instrument to the back of the Z-order. Send to Front At least one selection Brings current instrument to the front of the Z-order.
Debugger Components Visualization Utilities VisualizationTool Properties Like other instruments, the VisualizationTool itself has Properties. There are several configuration possibilities for the VisualizationTool, shown in Table 3.45. To view the property dialog box of the VisualizationTool, use the shortcut or double click on the background. Table 3.45 VisualizationTool Properties Menu Entry Description Edit mode Switches from Edit mode to Display mode.
Debugger Components Visualization Utilities Instruments When you first add an instrument, it is in “move mode”. Place it at the desired location on the workspace. All new instruments are set to their default attributes. To configure an instrument, right-click on an instrument and choose Properties, or double click on it. All instruments have the common attributes shown in Table 3.46. : Table 3.
Debugger Components Visualization Utilities Analog Instrument The Analog instrument (Figure 3.89) represents the classical pointer instrument, also known as speedometer or voltage meter. Figure 3.89 Analog Instrument Analog instrument attributes are shown in Table 3.47. Table 3.47 Analog Instrument Attributes Attribute Description Low Display Value Defines zero point of the indicator. Values below this definition are not displayed. High Display Value Defines highest position of the indicator.
Debugger Components Visualization Utilities Table 3.48 Bar Instrument Attributes Attribute Description Low Display Value Defines zero point of the indicator. Values below this definition are not displayed. High Display Value Defines highest position of the indicator. Defines the value on which the indicator reads 100%. Bardirection Sets desired direction of the bar that displays the value. Barcolor Specifies color of the bar. Default color is red.
Debugger Components Visualization Utilities flasher is on, while bit 1 says that the brake light is on. So for your simple application you need the following bitmaps with their settings: • No light on bitmap: AND mask 3, EQUAL mask 0 • Flasher on bitmap: AND mask 3, EQUAL mask 1 • Brake light on bitmap: AND mask 3, EQUAL mask 2 • Brake and flasher light on: AND mask 3, EQUAL mask 3 DILSwitch Instrument The DILSwitch instrument is also known as Dual-in-Line Switch (Figure 3.91).
Debugger Components Visualization Utilities Table 3.51 Knob Instrument Attributes Attribute Description Low Display Value Defines the zero point of the indicator. The values below this definition are not displayed. High Display Value Defines the highest position of the indicator. It defines the value on which the indicator reads 100%. Indicator Color Defines the color and the width of the pen used to draw the indicator. Knob Color Defines the color of the knob side.
Debugger Components Visualization Utilities 7-Segment Display instrument attributes are shown in Table 3.53 . Table 3.53 7-Segment Display Instrument Attributes Attribute Description Decimalmode Displays the first four or the second four bits of one byte in hexadecimal mode. When it is switched off, each segment represents one bit of one byte. Sloping Switches the sloping on or off. Display Version Selects the appearance of the instrument. Two versions are available.
Debugger Components Visualization Utilities Table 3.54 Switch Instrument Attributes (continued) Attribute Description Top Position is Specifies if the 'up' position is either zero or one. Especially useful to easily transform the push button into a reset button. Kind of Switch Changes the look of the instrument. Following kinds of switches are available: Slide Switch, Toggle Switch, Jumper, Push Button.
Debugger Components Visualization Utilities Table 3.55 Text Instrument Attributes Attribute Description Text Mode Specifies the mode. Choose among four modes: Static Text, Value, Relative Value, and Command Displayfont Defines the desired font. All installed Windows fonts are available. Horiz. Text Alignment Specifies the desired horizontal alignment of the text in the given bounding box. Vert. Text Alignment Specifies the desired vertical alignment of the text in the given bounding box.
Debugger Components Visualization Utilities Table 3.58 Relative Value Attributes Attribute Description Field Description Add the additional description text to be displayed in front of the value. Add a colon and/or space if desired. The default setting is Value: Low Display Value Fixes the minimal value that represents 0%. Values below this definition appear as an error: #ERROR. High Display Value Fixes the maximal value that represent 100%. Values above this definition appear as an error: #ERROR.
Debugger Components Visualization Utilities Drop Into In Edit mode, the drag and drop functionality supplies a very easy way to automatically configure an instrument. To assign a variable, simply drag it from the Data Window onto the instrument. The kind of Port is immediately set on “Memory” and the “Port to Display” field contains the address of the variable. Now repeat the drag-and-drop on a bare portion of the VisualizationTool window: a new text instrument is created, with correct port configuration.
Debugger Components Visualization Utilities 156 Microcontrollers Debugger Manual
4 Control Points This chapter provides an overview of the debugger control points: Breakpoints, Watchpoints, and Markpoints. Click any of the following links to jump to the corresponding section of this chapter: • Introduction • Breakpoints • Setting Breakpoints • Watchpoints • Setting Watchpoints • Markpoints • Setting Markpoints • Halting on a Control Point Introduction There are three kinds of control points: • Breakpoints (also called data breakpoints): Breakpoints are located at an address.
Control Points Breakpoints • Enable/disable a selected control point by checking or unchecking the related checkbox. • Enable/disable multiple control points by checking or unchecking the related checkbox. • Enter or modify the condition of a selected control point. • Enable/disable the condition of a selected control point by checking/unchecking the related checkbox. • Enter or modify the command of a selected control point.
Control Points Breakpoints Breakpoints are controlled through the Breakpoints tab of the Controlpoints Configuration window. This window can be opened through the Source Window Context menu, as described below: Figure 4.1 Source Window Context Menu 1. Point at a C statement in the Source window, and click the right mouse button. 2. Select Show Breakpoints from this menu. The Controlpoints Configuration Window (Breakpoints Tab) is opened. The Breakpoints tab of this window is shown in Figure 4.2.
Control Points Breakpoints Figure 4.2 Controlpoints Configuration Window (Breakpoints Tab) Breakpoints Tab The Controlpoints Configuration Window (Breakpoints Tab) contains: • List box that displays the list of currently defined breakpoints • Breakpoint: group box that displays the address of the currently selected breakpoint, name of procedure in which the breakpoint has been set, state of the breakpoint (disabled or not), and type of breakpoint (temporary or permanent).
Control Points Breakpoints • Update button to Update all modifications in the dialog box. • Add button to add new breakpoints. Specify the Address (in hexadecimal when Hex format is checked, or as an expression when Hex format is unchecked). • OK button to validate all modifications. • Cancel button to ignore all modifications. • Help button to open related help information.
Control Points Breakpoints Saving Breakpoints The Debugger provides a way to store all defined breakpoints of the currently loaded application (.ABS file) into the matching breakpoints file. The matching file has the same name as the loaded .ABS file but its extension is .BPT (for example, the FIBO.ABS file has a breakpoint file called FIBO.BPT). This file is generated in the same directory as the .ABS file. This is a text file, in which a sequence of commands is stored.
Control Points Breakpoints The codeSize value is an expression. It is usually a constant number to specify (for security) the code size of a function where a breakpoint is set. If the size specified does not match the size of the function currently loaded in the .ABS file, the breakpoint is set but it is disabled. The sourceSize value is an expression. It is usually a constant number to specify (for security) the source (text) size of a function where a breakpoint is set.
Control Points Setting Breakpoints NOTE For more information about this syntax, see BS and SAVEBP commands. Setting Breakpoints Breakpoints may be set in a Source or Assembly component window. Positions Where a Breakpoint Is Definable A compound statement is one that can be split into several base instructions. When using a high level language some compound statements can be generated, as shown in the following example. Figure 4.
Control Points Setting Breakpoints Temporary Breakpoints Temporary breakpoints are activated next time the instruction is executed. A temporary breakpoint is recognized by the following icon: Setting Temporary Breakpoints Using the Source Window Context Menu: 1. Point at a C statement in the Source window and right-click. The Source Context Menu is displayed. 2. Choose Run To Cursor from the Context Menu. The application continues execution and stops before executing the statement.
Control Points Setting Breakpoints Holding down the left mouse button and pressing the P key: 1. Point at a C statement in the Source window, hold down the left mouse button and press the P key. 2. A permanent breakpoint mark is displayed in front of the selected statement. Once a permanent breakpoint has been defined, you can continue program execution. The application stops before executing the statement. Permanent breakpoints remain active until they are disabled or deleted.
Control Points Setting Breakpoints 5. Select the breakpoint you want to modify by clicking on the corresponding entry in the list of defined breakpoints at the top of the tab. 6. In the Counter: group of this tab specify the interval for the breakpoint detection in the Interval: field. 7. Then close the window by clicking the OK button. If you continue program execution, the content of the Current: field is decremented each time the instruction containing the breakpoint is reached.
Control Points Setting Breakpoints Using the Source Window Context Menu: 1. Point at a C statement in the Source Component window and right-click. The Source Context Menu is displayed. 2. Select Set BreakPoint from the Context Menu. A breakpoint is defined on the selected instruction. 3. Point in the Source Component window and right-click. The Source Context Menu is displayed. 4. Select Show Breakpoints from the Context Menu.
Control Points Setting Breakpoints Choosing Show Breakpoints from Source Context Menu 1. Point in the Source Component window and right-click. The Source Context Menu is displayed. 2. Choose Show Breakpoints from the context menu. The Breakpoints Setting dialog box is displayed. 3. In the list of defined breakpoints, select the breakpoint to delete. 4. Click Delete. The selected breakpoint is removed from the list of defined breakpoints. 5. Click OK to close the Breakpoints Setting dialog box.
Control Points Watchpoints Watchpoints Watchpoints are control points associated with a memory range. Program execution stops when the memory range defined by the watchpoint has been accessed. The debugger supports different types of watchpoints: • Read Access Watchpoints, which are activated when a read access occurs inside the specified memory range. • Write Access Watchpoints, which are activated when a write access occurs inside the specified memory range.
Control Points Watchpoints Figure 4.4 Memory Context Menu Figure 4.
Control Points Watchpoints Figure 4.6 Controlpoints Configuration Window (Watchpoints Tab) Watchpoints Tab The Watchpoints tab of the Controlpoints Configuration window contains: • List box that displays the list of currently defined watchpoints.
Control Points Watchpoints NOTE Current and Interval values are limited to 2,147,483,647. A beep occurs and the character is not appended, if a number greater than this value is entered. NOTE When the Interval value is changed, the Counter value is automatically set to the Interval value. • Cancel button to ignore all modifications. • Help: button to display help file and related help information.
Control Points Setting Watchpoints Setting Watchpoints Watchpoints may be set in a Data or Memory window. NOTE Due to hardware restrictions, the watchpoint function might not be implemented on hardware connections. Setting a Read Watchpoint A green vertical bar is displayed in front of a variable associated with a read access watchpoint. The debugger provides two ways to define a read access watchpoint: Using the Data Context Menu: 1. Point at a variable in the Data window and right-click.
Control Points Setting Watchpoints Setting a Write Watchpoint A red vertical bar is displayed in front of a variable associated with a write access watchpoint. The Debugger provides two ways to define a write access 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. 3. Point in the Data Component Window and right-click.
Control Points Setting Watchpoints Using the Left Mouse Button and Pressing the B Key: 1. Point at a variable in the Data window, hold down the left mouse button and press the B key. 2. A read/write access watchpoint is defined for the selected variable. Once a read/write access watchpoint has been defined, you can continue program execution. The application stops after the next read or write access on the variable. Read/ write access watchpoints remain active until they are disabled or deleted.
Control Points Setting Watchpoints stops. Current is reloaded with the value stored in the interval field to enable the counting watchpoint again. Defining a Conditional Watchpoint A condition can be associated with any type of watchpoint described previously (read, write, read/write). The Debugger provides two ways to define a conditional 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.
Control Points Setting Watchpoints Deleting a Watchpoint The Debugger provides three ways to delete a watchpoint: Use Delete Breakpoint from Context Menu: 1. In the Data window, point to a variable where a watchpoint has been defined and rightclick. The Data Context Menu is displayed. 2. Select Delete Watchpoint from the Context Menu. The watchpoint is deleted and the vertical bar in front of the variable is removed. Using the Left Mouse Button and Pressing the D Key: 1.
Control Points Markpoints 4. You can enter the command in the Command field. The command is a single debugger command. At this level, the commands G, GO and STOP are not allowed. A command file can be associated with a watchpoint using the commands CALL or CF (Example CF breakCmd.cmd). 5. Click OK to close the window. 6. When the watchpoint is detected, the command execute and the application stops at this point. The Continue check button allows the application to continue after command execution.
Control Points Markpoints Figure 4.7 Source Window Context Menu Figure 4.
Control Points Markpoints 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.
Control Points Setting Markpoints • Markpoint: group box that displays the address of the currently selected markpoint, size of the markpoint, name of the procedure or variable on which the markpoint has been set, and type of the markpoint. • General group box that contains a checkbox that allows you to save and restore the markpoint selected. • Add button to add new markpoints. Specify the Address in hexadecimal when Hex format is checked or as an expression when Hex format is unchecked.
Control Points Setting Markpoints Setting a Data Markpoint A blue letter L is displayed in front of a variable associated with a markpoint. To define a data range markpoint: Use 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 Markpoint from the context menu. A markpoint is defined at the beginning of the data range selected. 3. Point in the Data window and right-click. The Data Context Menu is displayed. 4.
Control Points Halting on a Control Point Deleting a Markpoint To delete a markpoint: Using the Left Mouse Button and Pressing the D Key: 1. Point at the markpoint variable in the Data window, the memory range in the Memory window, or the codeline in the Source window: 2. Holding down the left mouse button, press the D key. 3. The markpoint is deleted and the blue letter L in front of the variable, memory range or codeline is removed. Choosing Show Markpoints from Appropriate Context Menu: 1.
5 Real Time Kernel Awareness The Debugger allows you to load and control applications on the target system, or applications simulated on the host. It also allows you to inspect the state of the application, which includes global variables, processor registers and the procedure call chain including the local (automatic) variables. This chapter describes how applications built of several tasks are handled by a generic awareness support and an OSEK awareness.
Real Time Kernel Awareness Task Description Language Inspecting Task State Each multitasking operating system stores the context of each task at a specific location, usually called the task descriptor. This context consists of the CPU context (CPU registers) and the content of the associated stack. There is more information in the task descriptor, depending on the specific implementation of the kernel.
Real Time Kernel Awareness Task Description Language Assignment = Ident ':=' Expression. ErrorMsg = 'MSG' ':=' String. IfStatemen = 'IF' BoolExpr 'THEN' StatSequence {ELSIFPart} [ELSEPart] 'END'. ELSIFPart = 'ELSIF' BoolExpr 'THEN' StatSequence. ELSEPart = 'ELSE' StatSequence. String = '"' {char} '"'. BoolExpr = Expression RelOp Expression. Expression = Term {Op Term}. Term = Ident | Function | Number. Ident = 'a'..'z' | 'R00'..'R31' | 'DL' | 'SP' | 'SR' | 'PC' | 'STATUS' | 'B'.
Real Time Kernel Awareness Application Example Application Example Listing 5.1 shows an example of a OSPARAM.PRM file for SOOM System/REM. Listing 5.1 OSPARAM.PRM File { File OSParam.PRM, implementation for SOOM System/REM } { R0..R7 = D0..D7, R8..R15 = A0..
Real Time Kernel Awareness Inspecting Kernel Data Structures Inspecting Kernel Data Structures To allow the debugger to display the data structures of the operating system, the corresponding symbol information has to be available. This is the case when using SOOM System/REM. When another kernel is used its source code must to be available and must be compiled.
Real Time Kernel Awareness OSEK Kernel Awareness END PLACEMENT ... OS_DATA INTO RTK_SEC; ... END The source file (for example: rtk.c) has to be compiled and listed in the NAMES section of the linker parameter file. To force linking, the name of the object file has to be immediately followed by a '+'. In this example the variable is linked to the address 0x1040. If an application is prepared in this way, all declared variables may be inspected in the data windows of the Debugger.
Real Time Kernel Awareness OSEK Kernel Awareness OSEK Run Time Interface The OSEK Run Time Interface (ORTI) is an interface for development tools to the OSEK Operating System. It is a part of the OSEK standard (refer to www.osek-vdx.org). The ORTI enables the attached tool to evaluate and display information about the operating system, its state, its performance, the different task states, the different operating system objects etc.
Real Time Kernel Awareness OSEK Kernel Awareness combination with the dynamic data. The dynamic data gives information about the current status of the system. The information given to the CodeWarrior IDE is represented in a text file (ORTI-File). The file describes the different objects configured in the OS and their properties. The information is represented in direct text, enumerated values, Symbolic names, or an equation that may be used for evaluating the attribute.
Real Time Kernel Awareness OSEK Kernel Awareness OSEK RTK Inspector Component OSEK awareness is described through the CodeWarrior RTK Inspector component as shown in Figure 5.2. Inspector window is displayed by clicking on the Component > Open menu entry and then by clicking on Inspect icon in the Open Window Component window. When the RTK components icon is selected in the hierarchical content of the items, the right side displays various information about OSEK Awareness. Figure 5.
Real Time Kernel Awareness OSEK Kernel Awareness The following sections offer a description of typical objects along with their attributes and how they are presented. NOTE Objects and their attributes depend on the OSEK implementation and OSEK configuration, and therefore may differ from this description. Inspector Task The Task shown in Figure 5.3 displays the current state of the OSEK task trace. Figure 5.
Real Time Kernel Awareness OSEK Kernel Awareness Inspector Stack The Stack shown in Figure 5.4 displays the current state of OSEK stack trace. Figure 5.4 Inspector Stack Select Stack in the hierarchical tree on the left side to display additional information concerning the stack on the right side of the window under the following headings: • Name: displays the name of the stack. • Stack Start Address: displays the start address of the stack. • Stack End Address: displays the end address of the stack.
Real Time Kernel Awareness OSEK Kernel Awareness • Current Value: displays the current value of the system timer. • Activated Alarm: displays associated alarms. Inspector Alarm The Alarm shown in Figure 5.6 displays the current state of OSEK alarm trace. Figure 5.6 Inspector Alarm Select Alarm in the hierarchical tree on the left side to display additional information concerning the alarm on the right side of the window under the following headings: • Name: displays the name of the alarm.
Real Time Kernel Awareness OSEK Kernel Awareness Inspector Message The Message shown in Figure 5.7 displays the current state of OSEK message trace. Figure 5.7 Inspector Message Select Message in the hierarchical tree on the left side to display additional information concerning task on the right side: • Name: displays the name of the message. • Message Type: displays message type. Possible values are: UNQUEUED/ QUEUED. • Notified Task: displays the task that shall be activated when the message is sent.
Real Time Kernel Awareness OSEK Kernel Awareness 198 Microcontrollers Debugger Manual
6 How To... This chapter provides answers to frequently asked questions.
How To... Starting Debugger from CodeWarrior IDE Defining the Default Directory in the MCUTOOLS.INI When starting from the desktop or Start menu, the working directory can be set in the configuration file MCUTOOLS.INI. The working directory including the path is defined in the environment variable DefaultDir in the [Options] group or WorkDir [WorkingDirectory].
How To... Automating Debugger Startup Automating Debugger Startup Often the same tasks have to be performed after starting the Debugger. These tasks can be automated by writing a command file that contains all commands to be executed after startup of the Debugger, as shown in Listing 6.1. Listing 6.1 Example of a Command File to Automate Tasks load fibo.abs bs &main t g This file first loads an application, then sets a temporary breakpoint at the start of the function main and start the application.
How To... How To Load an Application this file (for example, CALL INIT.CMD), it automatically executes when the connection component is loaded. NOTE Refer to Starting Debugger from CodeWarrior IDE. How To Load an Application 1. Choose HCS08FCS > Load. The Load Executable File dialog box opens. 2. Select an application (for example FIBO.ABS). 3. Click OK. The dialog box is closed and the application is loaded in the Debugger (refer to Figure 6.1).
How To... How to Stop an Application How to Stop an Application There are two ways to stop program execution: • Choose Run >Halt • Click on the Halt icon in the debugger tool bar HALTED in the status line indicates that execution has been stopped. The blue highlighted line in the source component is the source statement at which the program was stopped (next statement to be executed).
How To... How to Step in the Application On the Next Source Instruction The Debugger provides two ways of stepping to the next source instruction: • Choose Run > Single Step • Click the Single Step icon from the Debugger tool bar STEPPED in the status line indicates that the application is stopped by a step function. If the application was previously stopped on a subroutine call instruction, a Single Step stops the application at the beginning of the invoked function.
How To... How to Work on Variables STOPPED (STOP) in the status line indicates that the application is stopped by a step out function. If the application was previously stopped in a function, a Step Out stops the application on the source instruction following the function invocation. The display in the Assembly component is always synchronized with the display in the Source component.
How To... How to Work on Variables • Double-click Double-click a function name in the Procedure component. The Data component (for local that is neither frozen or locked) displays the list of variables defined in the selected function with their values and type. Display Global Variable from a Module The Debugger provides two ways to see a list of global variables defined in a module: Opening Module Component 1. Choose Component > Open. The list of all available components is displayed on the screen. 2.
How To... How to Work on Variables Change Format for Variable Value Display The Debugger allows you to see the value of variables in different formats. This is set by entries in the Format menu (Table 6.1). Table 6.1 Debugger Display Format Menu entry Description Hex Variable values are displayed in hexadecimal format. Oct Variable values are displayed in octal format. Dec Variable values are displayed in signed decimal format. UDec Variable values are displayed in unsigned decimal format.
How To... How to Work on Variables Modify a Variable Value The Debugger allows you to change the value of a variable, as shown in Figure 6.3. Figure 6.3 Modifying a Variable Value Double-click on a variable. The current variable value is highlighted and can be edited. 1. Formats for the input value follow the rule from ANSI C constant values (prefixed by 0x for hexadecimal value, prefixed by 0 for octal values, otherwise considered as decimal value).
How To... How to Work on the Register Inspect Memory Starting at a Variable Location Address The Debugger provides two ways to dump the memory starting at a variable allocation address. • Using Drag and Drop Drag a variable name from the Data Component to Memory component. • Holding down the left mouse button and pressing the A key Point to a variable name in a Data Component, hold the left mouse button down and press the A key.
How To... How to Work on the Register Modify a Register Content The Debugger allows you to change the content of indexes, accumulators or bit registers. Modify Index or Accumulator Register Content Double-click a register. The current register content is highlighted and may be edited. Figure 6.4 Modifying Index or Accumulator Register Content 1. The format of the input value depends on the format selected for the data component.
How To... How to Work on the Register Start Memory Dump at Address Where Register is Pointing The Debugger provides two ways to dump memory starting at the address to which a register points. Using Drag and Drop • Drag a register from the Register component to Memory component. Choose Address Figure 6.5 Memory menu Display Address 1. Right-click in the Memory component to display the Memory context menu. 2. Choose Address from the context menu to open the Memory dialog box shown in Figure 6.5. 3.
How To... Modify Content of Memory Address Modify Content of Memory Address The Debugger allows you to change the content of a memory address. Double-click the memory address you want to modify. Content from the current memory location is highlighted and can be edited. 1. The format for the input value depends on the format selected for the Memory component. If the format for the component is Hex, the input value is treated as a Hex value. An input value of 10 sets the memory address to 0x10 = 16. 2.
How To... How to View Code How to View Code The Debugger allows you to view the code associated with each assembler instruction. Figure 6.6 Viewing Code Associated with Assembler instruction Online disassembly can be performed in one of the following ways: Using Context Menu 1. Point in the Assembly component and right-click. The Assembly context menu is displayed. 2. Choose Display Code (Figure 6.6). Using Assembly Menu 1. Click the title bar of the Assembly component.
How To... How to Communicate with the Application How to Communicate with the Application The Debugger has a pseudo-terminal facility. Use the TestTerm or Terminal component window to communicate with the application using specific functions defined in the TERMINAL.H file and used in the calculator demo file. 1. Start the Debugger and choose Open from the Component menu. 2. Open the TestTerm or Terminal Component. 3. Choose Load from the Simulator menu. 4. Load the program CALC.ABS.
7 CodeWarrior IDE Integration This chapter provides information on how to use and configure the Simulator/Debugger within the CodeWarrior IDE using the following software: • CodeWarrior IDE - CW08 version 3.1 or later Debugger Configuration The New Project Wizard in the CodeWarrior IDE has default debugger settings that are correct for most projects, and no changes are necessary for normal use. At times, however, you may wish to make some configuration changes.
CodeWarrior IDE Integration Debugger Configuration Figure 7.
8 Debugger DDE Capabilities Introduction The DDE is a form of interprocess communication that uses shared memory to exchange data between applications. Applications can use DDE for one-time data transfers and for ongoing exchanges in applications that send updates to one another as new data becomes available. NOTE The DDE capabilities of the Debugger are deprecated. Future versions of the Debugger will have no DDE capabilities. You can use the Component Object Model (COM) Interface.
Debugger DDE Capabilities 3. Push the Connect button of the DDEClient. The following message appears in DDECLient: Connected to HI-WAVE|Command. 4. In the Exec field of DDECLient type a Debugger command, for example open recorder and click the Exec button. The command is executed by way of DDE and a new recorder component appears in the Debugger. NOTE 218 You can disconnect the DDE in the Debugger. The Debugger can be started without DDE (this is saved in the project file).
9 Synchronized Debugging Through DA-C IDE This chapter provides information on how to use and configure Freescale tools within the Development Assistant for C (DA-C) IDE. For more information on DA-C, refer to the Development Assistant for C documentation v 3.5. You must be running: DA-C - version 3.5 build 555 or later - (Development Assistant for C - RistanCASE).
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit current installation. An example configuration for the M68k CPU is provided, which can be adapted to each CPU supported by Freescale. Create New Project Start DA-C.exe and choose Project > New Project from the main menu. Browse to the directory and enter a project file name, for example: C:\Program Files\Freescale\work\c\myproject Change the field to your CPU).
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Referential Project Root Directory If not empty, this text box specifies an alternate Project Root Path for searching files not found in the original project path. Filenames in the original path with referential extensions are tried before those in the referential path. Specified path may be either full or relative to project root, and it may not specify a subdirectory in the project root directory tree.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Configure Library Path An additional configuration path must be defined to specify the location of library header files (needed for DA-C symbol analysis). This can be done by choosing Options > Analysis for Symbols > C Source in the main menu of DA-C. The window shown in Figure 9.3 contains options that determine parameters of the C source code analysis. Figure 9.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Preprocessor - Header Directories This text box determines the list of directories that are to be searched for files named within the #include directive. A semicolon separates directories. Only listed directories are searched for files named between < and >. Searching for files named between quotation marks (""), starts in the directory of the source file containing #include directive.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Adding Files to Project In the Project Window the Explorer View Tab replaces the Window's Explorer and supplies you with additional information on directories containing project files. It also gives you the option to add files into the project. For example, we will now set all files needed to run the fibo example: 1. In the Explorer View, browse to the \Freescale\WORK\c directory of your Freescale installation 2.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Building The Database Development Assistant for C provides the static code analysis of C source files, as well as generating various data based on the results. Analysis of the project source files and generation of the database are divided into two phases: the analysis of individual program modules and generation of data about global symbols usage.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Figure 9.6 Logical View Tab Double-click on Fibo.c file to open it. Configuring The Tools We will now configure the compiler and maker in the DA-C IDE. Procedures are defined in Project > User Defined Actions from the main menu of DA-C.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Compiler Configuration In Menu "Start" Actions, click on new and fill in the New Action box with "C&ompile", then press ENTER (Figure 9.7). In the Toolbar field, you can associate a bitmap with each tool, for example click on the Picture radio button and browse to the \Bitmap directory of your current DA-C installation and choose Compiler.bmp. This is a default bitmap delivered with the DA-C IDE.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Click on OK to validate these settings. Select the Fibo.c file. Click on the Compiler button (or from the main menu of DA-C select Start > Compile). This file is now compiled and the corresponding object file (Fibo.o) is generated. Linker Configuration In the same way, you can now configure the linker as illustrated in Figure 9.8.
Synchronized Debugging Through DA-C IDE Configuring DA-C IDE for Freescale Tool Kit Maker Configuration In the same way, you can now configure the maker as illustrated in Figure 9.9. In the Menu "Start" Actions, click on new and fill in the created New Action box with " &Make", then press ENTER. After setting the corresponding bitmap, copy the lines from Listing 9.3 in the Action Script field and change the directory to where the maker is located. Listing 9.
Synchronized Debugging Through DA-C IDE Debugger Interface Debugger Interface DA-C v3.5 currently integrates a DAPI interface (Debugging support Application Programming Interface). Through this interface DA-C is enabled to exchange messages with the Debugger. The advantages of this connection allow you to set or delete break points from within DA-C (in an editor, flow chart, graph, browser) and to execute other debugger operations.
Synchronized Debugging Through DA-C IDE Debugger Interface Figure 9.10 Communication between DA-C IDE and Debugger Communication DLL Installation As described previously, the Debugger needs the nDAPI communication DLL (provided by DA-C IDE). This dll (called Ndapi.dll) is automatically installed during the Freescale Tool Kit installation. However, if you install a new release of DA-C you have to follow this procedure: In the \Program directory of your DA-C installation, copy the Ndapi32.dll (Ndapi32.
Synchronized Debugging Through DA-C IDE Debugger Interface Figure 9.11 DA-C Debugger Options Dialog Box In the Debugger combo-box, select the corresponding debugger: HI-WAVE 6.0. Now specify the binary file to be opened: in our example we want to debug the fibo.abs file. Then click on the Setup button. The dialog box shown in Figure 9.12 is opened. Figure 9.12 DDE Debugger Setup Dialog Box Specify the path to the hiwave.exe file or use the Browse button, then click on OK.
Synchronized Debugging Through DA-C IDE Synchronized Debugging Figure 9.13 DA-C Component Opening The Debugger DAC window, which is needed for communication with the DA-C IDE is now opened (Figure 9.14). Figure 9.14 DA-C Window You must save this configuration by selecting File > Save Configuration from the main menu of the Debugger. This component loads automatically the next time this project is called. Close the Debugger.
Synchronized Debugging Through DA-C IDE Troubleshooting Figure 9.15 DA-C toolbar NOTE If changes are made to your source code, don't forget to rebuild the Database when generating new binary files to avoid misalignment between the Debugger and DA-C source positions. Troubleshooting This section describes possible trouble when trying to connect the Debugger with the DAC IDE. When loading the DAC component into the Debugger, if the message box shown in Figure 9.16 is displayed, ensure that Ndapi.
Synchronized Debugging Through DA-C IDE Troubleshooting Open the setup dialog box in the Debugger by clicking on the DA-C Link component and choose DA-C Link > Setup from the main menu. The Connection Specification dialog box opens (Figure 9.18). Figure 9.18 DA-C Connection Specification Dialog Box Compare the Debugger Name from this dialog box with the selected Debugger in the DAC IDE (Options > Debugger), as shown in Figure 9.19. Both must be the same. Figure 9.
Synchronized Debugging Through DA-C IDE Troubleshooting 236 Microcontrollers Debugger Manual
Book II - HC08 Debug Connections Book II Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment. This book, the HC08 Debug Connections, defines the connections available for debugging code written for HC08 CPUs.
Book II Contents 238 Microcontrollers Debugger Manual
10 Microcontroller Debugging First Steps Since the initial steps for creating a project are similar, the following information provides an example of the first few steps of the New Project wizard that apply to creating an HC(S)08, HC08 or RS08 project. Debugging code using the CodeWarrior IDE requires that a project be created or exists, which specifies a connection that can be used to debug the code.
Microcontroller Debugging First Steps Technical Considerations has a totally different simulation engine to accurately simulate the memory ranges, I/O, and peripherals for any given derivative. HC08 Serial Monitor Considerations The 8/16 bit debugger (and then the CodeWarrior IDE) might be connected to HC08 hardware using the HC08 Serial Monitor connection. This connection supports communication specifications described in the application note from Freescale.
Microcontroller Debugging First Steps Debugging First Steps Using the Wizard Refer to the inDART®-HC08 In-Circuit Debugger/Programmer for Motorola HC08 Family FLASH Devices User’s Manual from SofTec for communication hardware requirements and SofTec product installation. Debugging First Steps Using the Wizard To take the first steps toward debugging with the CodeWarrior IDE using the stationery Wizard: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2.
Microcontroller Debugging First Steps Debugging First Steps Using the Wizard Figure 10.
Microcontroller Debugging First Steps Debugging First Steps Using the Wizard 6. Choose the languages to be supported. • Assembly - If only Assembly is selected, you can later choose to use absolute/single file assembly application or relocatable assembly. • C - This sets up your application with an ANSI C-compliant startup code, doing initialization of global variables. • C++ - This sets up your application with an ANSI C++ startup code, doing global class object initialization. 7.
Microcontroller Debugging First Steps Debugging First Steps Using the Wizard 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.
Microcontroller Debugging First Steps Debugging First Steps Using the Wizard 13. Depending on CPU derivative selected, additional screens may appear; select startup code, memory model, and floating point format. • Minimal startup code - This startup code initializes the stack pointer and calls the main function. No initialization of global variables is done, giving the user the best speed/code density and a fast startup time. But, the application code has to care about variable initialization.
Microcontroller Debugging First Steps Switching Connections 17. In the IDE main window toolbar Project menu, choose Project > Make. 18. Now choose Project > Debug to start the debugger. Figure 10.7 Your Project in Debugger Main Window Switching Connections It is possible to switch connections from within an existing debugging project. To switch connections, select Set Connection from the Component menu. The following information provides three examples of switching a connection.
Microcontroller Debugging First Steps Switching Connections 1. From the Debugger main menu, select Component | Set Connection, as shown below. Figure 10.8 Component Menu The Set Connection dialog box now appears. Figure 10.9 Set Connection Dialog Box 2. Select the Processor, for example, HC08 and the Connection as Full Chip Simulation.
Microcontroller Debugging First Steps Switching Connections 3. Press the OK button. The Debugger main menu entry bar for the connection now changes to HC08FCS. Figure 10.10 HC08 FCS Menu You have successfully switched connections to the FCS connection. The values and use of each HC08FCS menu entry is explained in the Full Chip Simulation chapter of this manual.
Microcontroller Debugging First Steps Switching Connections The Set Connection dialog box now appears. Figure 10.12 Set Connection Dialog Box - Connection Menu 2. Within the Set Connection dialog box, press the Down Arrow button next to the Connection list box to display the list of available connections. 3. Select P&E Multilink/Cyclone Pro. The Connection menu selection P&E Multilink/Cyclone Pro loads the proper drivers, etc. for the connection. 4.
Microcontroller Debugging First Steps Switching Connections 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.
Microcontroller Debugging First Steps Switching Connections Loading the HC(S)08 or RS08 Open Source BDM Connection To switch to either the HC(S)08 or RS08 Open Source BDM Connection follow these steps: 1. From the Debugger main menu, select Component | Set Connection, as shown below. Figure 10.16 Component Menu The Set Connection dialog box appears. Figure 10.17 Set Connection Dialog Box 2. Select the Processor and Connection, for example, RS08 and RS08 Open Source BDM.
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.
11 HC08 Full Chip Simulation Full Chip Simulation (FCS) connection runs a complete simulation of all processor peripherals and I/O on the user's Personal Computer. Because of this it does not require an MCU development board to be connected to your PC. Each derivative has a totally different simulation engine to accurately simulate the memory ranges, I/O, and peripherals for a given derivative (for more information on selecting a specific derivative, see the Select Device Option section below.
HC08 Full Chip Simulation Configuration Procedure Figure 11.
HC08 Full Chip Simulation Configuration Procedure Select Device Option The Device option on the HC08FCS menu allows you to select the particular Freescale processor that you wish to use. If you choose Device from the HC08FCS menu, additional extended menus open that allow you to select the family and device type of the MCU that you are using. See Figure 11.3. Figure 11.
HC08 Full Chip Simulation Configuration Procedure This command is extremely useful for verifying specific timings of a given event, running until a given event is complete, or just before it completes to enable stepping through the event or any application where cycle-timed execution is desired. Initialize Input Ports On Startup The Initialize Input Ports on Startup option initializes all simulated inputs to $00 when the software is started, or when the Device Mode or Debug Target is switched.
HC08 Full Chip Simulation Configuration Procedure viewed and their values modified, and the values can be stored back into debugger memory. Figure 11.6 Register Window Peripheral Modules Options If you have selected a device (see Select Device Option), the HCS08FCS Connection Menu displays a list of peripherals (Modules) for the device you have chosen. The Module’s associated commands appear as extended menus. Figure 11.
HC08 Full Chip Simulation Configuration Procedure ADC Module Option In Full Chip Simulation Mode (FCS), this option lets you simulate all the functionality of the Analog to Digital Conversion (ADC) module including data input on all ADC channels, flag polling, interrupt operation as well as the bus and CGMXCLK reference clock sources. FCS mode uses the buffered input structure to simulate the ADC inputs. The user can queue up to 256 data values.
HC08 Full Chip Simulation Configuration Procedure For more information on ADC configuration, refer to the Freescale Manual for your microprocessor. ADC User Commands The following ADC commands are available on the HC08 processor in Full Chip Simulation mode. ADDI Command The ADDI command allows the user to input the data into the ADC converter. If a data parameter is given, the value is placed into the next slot in the input buffer.
HC08 Full Chip Simulation Configuration Procedure Example >ADCLR Clear the input buffer for ADC simulation.
HC08 Full Chip Simulation Configuration Procedure Figure 11.11 Frequency Display Once the CGM is properly configured, the user can monitor the status of the PLL by polling the corresponding flag. If PLL interrupt is enabled, FCS jumps to an appropriate subroutine as long as the interrupt vector is properly defined. To observe the flag going up as a result of the corresponding CPU event, situate your Memory Window on the memory location of the CGM Status and Control register. Figure 11.
HC08 Full Chip Simulation Configuration Procedure Certain peripherals that run directly from the XTAL run at different speeds than those that run from the bus clock. Syntax >XTAL Where: n, by default, is a hexadecimal number, representing the simulated frequency of an external oscillator. Adding the suffix “t” to the n parameter forces the input value to be interpreted as base 10. Example >XTAL Brings up an input window. The default base for this input value is 10.
HC08 Full Chip Simulation Configuration Procedure Figure 11.13 Memory Component Window If you enable the Shutdown pin on the HRP module, you can observe the SHTIF Flag via the Memory window once the Shutdown event takes place. If you enable the HRP interrupt, the FCS jumps to an appropriate subroutine as long as the HRP interrupt vector is properly defined.
HC08 Full Chip Simulation Configuration Procedure CYCLES Command The CYCLES command changes the value of the cycles counter. The cycles counter counts the number of processor cycles that have passed during execution. The Cycles Window shows the cycle counter. The cycle count can be useful for timing procedures. Syntax >Cycles Where: Integer value for the cycles counter Examples >CYCLES 0 Reset cycles counter >CYCLES 1000 Set cycle counter to 1000.
HC08 Full Chip Simulation Configuration Procedure SHTDWN Command When you enable the Shutdown pin in the High Resolution PWM Control Register (HRPCTRL), you can use this command to change the state of the SHTDWN pin. The Shutdown pin then takes on this state after the simulator executes the next step. If interrupts are enabled, issuing a SHTDWN 0 command triggers an interrupt that is cleared until the SHTIF bit is cleared in the HRPCTRL and a SHUTDWN 1 command is issued.
HC08 Full Chip Simulation Configuration Procedure Figure 11.15 Simulated Port Inputs Dialog Box Using the Simulated Port Inputs dialog box, the input value to any I/O port can be reconfigured. The INPUTS command can be used to reconfigure the output values on any relevant I/O port. The manipulation of I/O port pins can be observed in the Memory Window. Figure 11.
HC08 Full Chip Simulation Configuration Procedure INPUT Command The INPUT command sets the simulated inputs to port . The CPU reads this input value when port is set as an input port. Syntax >INPUT Where: is the letter representing corresponding port Eight-bit simulated value for port Example >INPUTA AA Simulate the input AA on port A.
HC08 Full Chip Simulation Configuration Procedure Example >INPUTS Show I/O port input values. External Interrupt Module In Full Chip Simulation (FCS) Mode, this option lets you simulate the input, flag polling and interrupt functionality of the External Interrupt (IRQ) module. The FCS Mode uses the INPUTS command to let the user monitor and change the simulated value of the IRQ input pin state.
HC08 Full Chip Simulation Configuration Procedure INPUTS Command In Full Chip Simulation and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port Inputs dialog box shown in Figure 11.19. The user may then use this box to specify the input states of port pins and IRQ. Figure 11.19 Simulated Port Inputs Dialog Box When using In-Circuit Simulation mode, the INPUTS command shows the simulated input values to any applicable port. Syntax >INPUTS Example >INPUTS Show I/O port input values.
HC08 Full Chip Simulation Configuration Procedure the INPUTS command to bring up the Simulated Port Inputs for all general I/O ports. It displays the current simulated values to all applicable input ports. See FCS Timer Interface Module Commands for more information about the various forms of this command. Figure 11.20 Simulated Port Inputs Dialog Box Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port.
HC08 Full Chip Simulation Configuration Procedure INPUT Command The INPUT command sets the simulated inputs to port . The CPU reads this input value when port is set as an input port. Syntax >INPUT Where: is the letter representing corresponding port Eight-bit simulated value for port Example >INPUTA AA Simulate the input AA on port A.
HC08 Full Chip Simulation Configuration Procedure Example >INPUTS Show I/O port input values.
HC08 Full Chip Simulation Configuration Procedure The MMIIC data input/output log buffer simulation allows the user to gain access to the past 256 MMIIC data bytes that have been shifted in and out of the module. To bring up the IIC IN/OUT LOG buffer dialog box, use the IICDO command. Figure 11.24 IIC IN/OUT LOG Buffer Display At any point, the IICCLR command can flush the input as well as input/output log MMIIC buffers.
HC08 Full Chip Simulation Configuration Procedure Multi-Master Inter-Integrated Circuit Module Commands The following commands are available for multi-master inter-integrated circuit manipulation. IICDI Command The IICDI command allows the user to input data into a buffer of data which is shifted into the MMIIC module when it receives data from an external device. If a data parameter is given, the value is placed into the next slot in the input buffer.
HC08 Full Chip Simulation Configuration Procedure The next two data bytes read are 22 and 23. If the microprocessor attempts to read another byte, it gets an $FF value followed by a NACK signal (NACK because nothing remains in the input buffer). The receiving device then generates a STOP signal. A more exact input from a device designed to return two bytes is: >IICDI ACK 22 ACK 23 NACK MMIIC in master mode transmits to a slave.
HC08 Full Chip Simulation Configuration Procedure IICDO The IICDO command displays a window, which shows data shifted in as well as shifted out of the IIC peripheral. An arrow is used to point to the last output value transmitted/ received. The maximum number of output values that the buffer can hold is 256. Syntax >IICDO Example IICDO View data from the input/output log buffer for IIC simulation. IICCLR Use the IICCLR command to flush the input and output buffers for MMIIC simulation.
HC08 Full Chip Simulation Configuration Procedure FCSMSCAN08 Background and Assembly Example 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.
HC08 Full Chip Simulation Configuration Procedure RomStart VectorStart equ equ $8000 $FFCC ; start of Flash1 for AZ60 ; start of Vectors for AZ60 $Include 'az60regs.
HC08 Full Chip Simulation Configuration Procedure db $02 db $55 db $AA M3Desc_End: ; Message 3 Length ; Data Byte 1 ; Data Byte 2 *************************************************************** * Init_CAN - The CAN is placed into the soft reset state, * * where the control and timing registers can be * * set and the identifier and mask registers can be * * configured. After this, the module is placed in * * normal mode in order to synchronize with the CAN * * bus.
HC08 Full Chip Simulation Configuration Procedure lda and lsra lsra lsra lsra lsra ora sta lda and lsla lsla lsla ora sta lda and lsla ora sta lda and rola rola ora sta lda and lsla sta lda and rola rola ora sta lda and lsla sta lda sta lda sta sta lda sta 280 1,x #$E0 CT0IDR0 CT0IDR0 1,x #$1C #$18 CT0IDR1 1,x #$03 CT0IDR1 CT0IDR1 2,x #$80 CT0IDR1 CT0IDR1 2,x #$7F CT0IDR2 3,x #$80 CT0IDR2 CT0IDR2 3,x #$7F CT0IDR3 4,x CT0TBPR 5,x CT0DLR datacount 6,x CT0DSR0 ; get next byte in message address ; get n
HC08 Full Chip Simulation Configuration Procedure lda sta lda sta lda sta lda sta lda sta lda sta lda sta ldhx lda lsla lsla lsla sta lda and lsra lsra lsra lsra lsra ora sta lda and lsla lsla lsla ora sta lda and lsla ora sta lda and rola rola ora sta lda 7,x CT0DSR1 8,x CT0DSR2 9,x CT0DSR3 0a,x CT0DSR4 0b,x CT0DSR5 0c,x CT0DSR6 0d,x CT0DSR7 #Msg2_Desc 0,x CT1IDR0 1,x #$E0 CT1IDR0 CT1IDR0 1,x #$1C #$18 CT1IDR1 1,x #$03 CT1IDR1 CT1IDR1 2,x #$80 CT1IDR1 CT1IDR1 2,x Microcontrollers Debugger Manual ; g
HC08 Full Chip Simulation Configuration Procedure and lsla sta lda and rola rola ora sta lda and lsla sta lda sta lda sta sta lda sta lda sta lda sta lda sta ldhx lda lsla lsla lsla sta lda and lsra lsra lsra lsra lsra ora sta lda and lsla lsla lsla ora sta 282 #$7F CT1IDR2 3,x #$80 CT1IDR2 CT1IDR2 3,x #$7F CT1IDR3 4,x CT1TBPR 5,x CT1DLR datacount 6,x CT1DSR0 7,x CT1DSR1 8,x CT1DSR2 9,x CT1DSR3 #Msg3_Desc 0,x CT2IDR0 1,x #$E0 CT2IDR0 CT2IDR0 1,x #$1C ; get next byte in message address ; get next byte
HC08 Full Chip Simulation Configuration Procedure lda 1,x and #$03 lsla ora CT2IDR1 sta CT2IDR1 lda 2,x and #$80 rola rola ora CT2IDR1 sta CT2IDR1 lda 2,x and #$7F lsla sta CT2IDR2 lda 3,x and #$80 rola rola ora CT2IDR2 sta CT2IDR2 lda 3,x and #$7F lsla sta CT2IDR3 lda 4,x sta CT2TBPR lda 5,x sta CT2DLR sta datacount lda 6,x sta CT2DSR0 lda 7,x sta CT2DSR1 SYNCHCAN: lda #$00 sta CMCR0 lda #$FF sta CRFLG lda #01 sta CRIER lda #$07 sta CTFLG rts ; get next byte in message address ; get next byte in message
HC08 Full Chip Simulation Configuration Procedure * after a RESET.
HC08 Full Chip Simulation Configuration Procedure sta rti CRFLG ; reset receive flag ************************************************************** * DUMMY_ISR - Dummy Interrupt Service Routine. * * Just does a return from interrupt.
HC08 Full Chip Simulation Configuration Procedure which give the addresses of peripheral registers on the microcontroller. Following this comes the variable declarations for pointers, counters, and buffers for the received data. In the Flash ROM, the message descriptions are given, which indicate the destination address, message priority, message length, and the actual data. Note that the number of data bytes can be variable sizes from 0-8.
HC08 Full Chip Simulation Configuration Procedure Figure 11.26 CAN IN Display Input packets can be added by double-clicking in the window where the packet is to go or by selecting the row for the packet and clicking the OK button. At this point a new window comes up as shown in Figure 11.27. It is in this window that the user can specify the parameters of the message. The Packet Type list menu allows the user to select the type of CAN packet, that is, a DATA, REMOTE, ERROR, or OVERLOAD packet.
HC08 Full Chip Simulation Configuration Procedure Figure 11.28 CAN Example Input Packet Once the DATA packet information is entered, the CANIN window looks as shown in Figure 11.29. The user can then set a breakpoint in the interrupt service routine that handles CAN packets and execute the code by typing GO in the simulator. The user is now at the CAN ISR. By entering the t command and single stepping through the code, the user exits the ISR and return to the main loop.
HC08 Full Chip Simulation Configuration Procedure key to break the execution. Now type the CANOUT command. Figure 11.31 shows the result, where all three output packets are seen. Select the first packet by double clicking on it. Figure 11.32 shows the first CAN packet sent out. Note that the first packet sent out was the packet with the highest priority. You can now select the other packets in the CAN OUT window to open them up and see which data packet they were in. Figure 11.31 CAN OUT Display Figure 11.
HC08 Full Chip Simulation Configuration Procedure FCSMSCAN Commands You can use the following FCSMSCAN commands with the HC08 processor. CANCLR Command You can use the CANCLR command to flush the input and output buffers for CAN simulation. This resets the buffers and clears out all values. Notice that if the CAN is currently shifting a value, this command does not prevent the CAN from finishing the transfer.
HC08 Full Chip Simulation Configuration Procedure Where is the value to be entered into the next location in the input buffer. Example >CANIN $55 Set the next input CAN value to $55 >CAN Pull up the data window with all the input packets. CANOUT Command The CANOUT command displays the output of the buffer from the CANOUT. A window is opened that shows all the data that the CAN has shifted out. An arrow is used to point to the last output value transmitted.
HC08 Full Chip Simulation Configuration Procedure Figure 11.34 Memory Component Window If the PIT interrupt is enabled, the FCS jumps to an appropriate subroutine as long as the PIT interrupt vector is properly defined.
HC08 Full Chip Simulation Configuration Procedure Figure 11.35 SCI IN Buffer Display SCI Data Output Buffer simulation allows the user to gain access to the past 256 SCI data values transmitted out of the module. To bring up the SCI OUT buffer dialog box, use the SCDO command. Figure 11.36 SCI OUT Buffer Display At any point, the SCCLR command can flush the input and output SCI buffers.
HC08 Full Chip Simulation Configuration Procedure The user can also observe different SCI flags in the Memory window. If the module is run in Flag Polling mode, poll the flag corresponding to the expected SCI event. If the SCI interrupts are enabled, the FCS jumps to an appropriate subroutine, as long as the SCI interrupt vectors are properly defined. For more information on how to configure the SCI module for desired operation, refer to the Freescale user manual for your microprocessor.
HC08 Full Chip Simulation Configuration Procedure Syntax >SCDI [] Where: The value to be entered into the next location in the input buffer Example >SCDI $55 Set the next input value to the SCI to $55 >SCDI Pull up the data window with all the input values. Figure 11.38 SCI IN Buffer Display SCDO Command The SCDO command displays the output buffer from the SCI. A window is opened that shows all the data that the SCI has shifted out. An arrow is used to point to the last output value transmitted.
HC08 Full Chip Simulation Configuration Procedure Figure 11.39 SCI OUT Buffer Display FCS Slave LIN Interface Controller Module In FCS Mode, this module simulates all functionality of the Slave LIN Interface Controller (SLIC) Module, including: • Flag polling • Interrupt enabled mode • Transmission and reception of external data • Check sum generation and verification • Different message lengths data modes FCS mode uses a buffered structure to simulate SLIC inputs and outputs.
HC08 Full Chip Simulation Configuration Procedure Figure 11.40 SLIC IN Buffer Display Figure 11.41 SLIC Input Data Configuration Dialog Box The SLIC data output buffer simulation allows the user to gain access to the past 256 SLIC data bytes transmitted out of the module. To bring up the SLIC OUT buffer dialog box, use the SLCOUT command. Figure 11.42 SLIC OUT Buffer Display At any point, use the SLCCLR command to flush the input and output SLIC buffers.
HC08 Full Chip Simulation Configuration Procedure After the simulated SLIC input is received, the first queued-in packet is passed from the data buffer into the corresponding SLIC module registers. It can be observed in the Memory Window by displaying the appropriate register location there. Figure 11.43 Memory Component Window The user can also observe different SLIC flags in the Memory window. If the module is run in Flag Polling mode, poll the flag corresponding to the expected SLIC event.
HC08 Full Chip Simulation Configuration Procedure Example >SLCCLR Clear input and output buffer for SLC simulation SLCDI Command The SLCDI command is used to simulate SLIC input packets. The first input must be of type “identifier.” Subsequent bytes may either be “data” or “identifier.” After the SLIC Data IN buffer is filled with some data, the SLIC simulation module begins reception of the data packet as soon as it is properly configured and turned on within the user’s firmware.
HC08 Full Chip Simulation Configuration Procedure SLCOUT Command The SLCOUT command displays the output buffer from the SLIC. A window is opened that shows all the data that the SLIC has shifted out, in either Byte Transfer or SLIC Mode. 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 >SLCOUT Example >SLCOUT View packets from the output buffer for SLIC simulation.
HC08 Full Chip Simulation Configuration Procedure Figure 11.46 SPI IN Buffer Display 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. Figure 11.47 SPI OUT Buffer Display At any point, SPCLR command can flush the input as well as output SPI buffers.
HC08 Full Chip Simulation Configuration Procedure interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the SPI channel interrupt vectors are properly defined. To simulate the frequency of the SPI slave input clock, use the SPFREQ command. If the SPI is configured for slave mode, this command allows the user to enter the number of cycles in the period of the input clock. If the SPFREQ command is not used, then clocking is set by the SPI control register.
HC08 Full Chip Simulation Configuration Procedure Syntax >SPDI [] Where: 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. Figure 11.49 SPI IN Buffer Display SPDO Command The SPDO command displays the output buffer from the SPI. A window is opened that shows all the data that the SPI has shifted out. An arrow is used to point to the last output value transmitted.
HC08 Full Chip Simulation Configuration Procedure Figure 11.50 SPI OUT Buffer Display SPFREQ Command The SPFREQ command lets the user set the frequency of the SPI slave input clock. If the SPI is configured for the slave mode, this command allows the user to enter the number of cycles per one input clock period. If no value is given, a window appears and the user is prompted for a value. If this command is not used, then the clocking is assumed to be set by the SPI control register.
HC08 Full Chip Simulation Configuration Procedure • Flag polling • Interrupt enabled mode of operation. FCS mode uses the simulated port inputs to trigger the input capture on a given timer channel. To define an input state of the specific port, use the INPUT command in the Command line window. The represents the corresponding I/O port, while stands for the input value to write to this port.
HC08 Full Chip Simulation Configuration Procedure If the Timer module is configured for an Output Compare event, once the event takes place the same CHxF Flag can be observed via the Memory window. If the timer channel interrupt is enabled, the FCS jumps to an appropriate subroutine as long as the Timer channel interrupt vector is properly defined.
HC08 Full Chip Simulation Configuration Procedure FCS Timer Interface Module Commands The following FCS timer interface module commands are available for use with the HC08 processor. CYCLES Command The CYCLES command changes the value of the cycles counter. The cycles counter counts the number of the processor cycles that have passed during execution. The Cycles Window shows the cycle counter. The cycle count can be useful for timing procedures.
HC08 Full Chip Simulation Configuration Procedure INPUT Command The INPUT command sets the simulated inputs to port . The CPU reads this input value when port is set as an input port. Syntax INPUT Where: is the letter representing corresponding port Eight-bit simulated value for port Example >INPUTA AA Simulate the input AA on port A.
HC08 Full Chip Simulation Configuration Procedure Syntax >INPUTS Example >INPUTS 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.
HC08 Full Chip Simulation Configuration Procedure ; (C)opyright P&E Microcomputer Systems, 2005 ; ; You may use this code freely as long as this copyright notice ; and website address is included. Visit us at www.pemicro.com ; ; ; ; ; ; ; ; ; This application is meant to demonstrate a framework for an application running on the 68HC908JW32. It demonstrates a simple HID interface for a USB device and uses interrupts from the USB peripheral.
HC08 Full Chip Simulation Configuration Procedure * The following descriptors give the information to the PC what type of * USB device this is and what its capabilities are. They are retrieved * during the configuration phase. * Note that the Vendor and Product IDs specified in this demo are * invalid USB IDs and are given for demonstration purposes only! * * Device Descriptor Dev_Desc: db {DDesc_End-Dev_Desc} ; Descriptor Length db $01 ; Descriptor Type (Device) db $00,$02 ; USB specification Release (2.
HC08 Full Chip Simulation Configuration Procedure db db db db IDesc_End: $03 $00 $00 $00 ; ; ; ; Class Code (HID) Subclass Code Protocol Code Index to String Descriptor * HID Descriptor HID_Desc: db {HDesc_End-HID_Desc} ; Descriptor Length db $21 ; Descriptor Type (HID) db $00,$01 ; HID Class Release (1.
HC08 Full Chip Simulation Configuration Procedure db db db db $26,$FF,$00 $75,$08 $95,$01 $81,$02 db $C0 RDesc_End: ; ; ; ; Logical Maximum ($FF) Report Size (8 bits) Report Count (1 field) Input (Data, Variable, Absolute) ; End Collection *************************************************************** * Init_USB - Disables receive and transmit for all endpoints. * * The USB state is set to powered, where the part * * is waiting for an USB reset and for it to be * * addressed and configured.
HC08 Full Chip Simulation Configuration Procedure ldhx lda cbeqa cbeqa cbeqa cbeqa jmp GETDEVDESC: lda sta incx cpx bne ldhx sthx ldhx bra GETCONDESC: lda #0 wValueH #$1,GETDEVDESC #$2,GETCONDESC #$21,GETHIDDESC #$22,GETREPDESC GETDESC_STALL ; ; ; ; ; ; ; Dev_Desc,x UE0D0,x ; take device descriptor information ; store in USB endpoint 0 data buffer #8 GETDEVDESC #DDesc_End descendptr #Dev_Desc ; all descriptors more than 8 bytes Con_Desc,x UE0D0,x bra GETDESC_END #8 GETCONDESC #E2Desc_End descendpt
HC08 Full Chip Simulation Configuration Procedure cpx #8 bne GETREPDESC ldhx #RDesc_End sthx descendptr ldhx #REP_Desc ; all descriptors more than 8 bytes ; store end location of the descriptor ; store pointer to next byte in descriptor GETDESC_END: sthx descptr lda descptr+1 ; add length specified in setup packet add wLengthL ; and store in tptr sta tptr+1 lda descptr adc wLengthH sta tptr ldhx tptr ; is calculated pointer >= end of descriptor? cphx descendptr ; if so then end_pointer = end of descriptor
HC08 Full Chip Simulation Configuration Procedure ldhx SAVE_SETUP: lda sta dbnzx lda and bne #8 {UE0D0-1},x {Setup_packet-1},x SAVE_SETUP bmReqType #$60 SETUP_STALL ; save data to array ; Setup_packet holds info ; if request type is standard ; then go handle standard request ; otherwise, force stall STANDARD: lda bRequest ; get request type cbeqa #GET_DESC,GET_DESCR ; if getting descriptors then ; ready the next IN packets for ; the descriptor information bra SETUP_STALL ; otherwise, force stall GET_DESC
HC08 Full Chip Simulation Configuration Procedure sthx ldhx cphx beq ldhx cphx beq bra LAST_DESC: clr DATAFILLED: lda asla asla asla asla ora sta rts IN_PROC2: bclr packets rts buffptr descptr descendptr LAST_DESC buffptr #8 DATAFILLED IN_SEND_DATA ; save index to data buffer ; is it last descriptor byte? control ; if so then end of data transfer buffptr+1 ; set the size of the buffer ; shift to upper nibble #$08 UEP0CSR ; set DVALID_IN bit that data is ready 2,UEP0CSR ; clear the TFRC_IN bit for
HC08 Full Chip Simulation Configuration Procedure cli main_loop: bra ; Allow interrupts to happen main_loop ************************************************************** * USB_ENDP_ISR - USB Endpoint Interrupt Service Routine. * * Interrupts here if packets are received or * * transmitted on any endpoint.
HC08 Full Chip Simulation Configuration Procedure rti ************************************************************** * USB_SYS_ISR - USB System Interrupt Service Routine. * * Interrupts here if USB suspend, resume, reset, * * config_chg, start of frame, or setup event * * occurs.
HC08 Full Chip Simulation Configuration Procedure * Vectors - Specifying Reset and USB Interrupt Routines * ************************************************************** org VectorStart dw dw dw dw dw dw dw dw dw dummy_isr dummy_isr dummy_isr dummy_isr dummy_isr USB_ENDP_ISR USB_SYS_ISR dummy_isr main_init ; ; ; ; ; ; ; ; ; 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 This code utilizes three endpoin
HC08 Full Chip Simulation Configuration Procedure In the FLASH, the descriptor tables are created, which describe the type of USB device, the configuration, the interface, HID specific information, the endpoints, and reporting information. All information needed in these descriptors, can be found in the Freescale documentation describing USB module specifications for the microprocessor that you are using.
HC08 Full Chip Simulation Configuration Procedure Now we can use the USBIN command to specify USB packets that come across the USB bus from the host. When a user types this command in the simulator, the USB IN window appears as shown in Figure 11.55. There are no USB packets specified yet in the window. Figure 11.55 USB IN Buffer Add input packets by double-clicking in the window where the packet is to go or by selecting the row for the packet and clicking the OK button.
HC08 Full Chip Simulation Configuration Procedure To replicate this stage in the simulator, enter the SETUP packet as shown in Figure 11.56 and the DATA0 packet as shown in Figure 11.58, using the USBIN command. The USB peripheral automatically sends out the ACK after the code services the other packets, which are received in the simulator. Once the SETUP and DATA0 packets are entered, the USBIN window looks as shown in Figure 11.59.
HC08 Full Chip Simulation Configuration Procedure Figure 11.
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.
HC08 Full Chip Simulation Configuration Procedure Figure 11.62 USB OUT Buffer Notice in Figure 11.63 the DATA0 packet output during the data stage. This packet contains the data found in the device descriptor table in the code. This shows exactly what USB packet information was sent out from the device. Figure 11.
HC08 Full Chip Simulation Configuration Procedure Figure 11.64 USB IN Buffer Figure 11.65 USBOUT Buffer Now that we have gone through this device descriptor exchange, the host has an idea of what type of USB slave device it is, and next needs to give it an address. We can go through the same process for the SET ADDRESS request from the host. Once the device is addressed, you must use this address in the SETUP packets sent to the device.
HC08 Full Chip Simulation Configuration Procedure Figure 11.66 Set Address Packet Exchange USB Commands The following USB commands are available for use with the HC08 processor. USBCLR Command Use the USBCLR command to flush the input and output buffers for USB simulation. This resets the buffers and clears out all packets. If the USB is currently shifting a value, this command allows the USB to finish the transfer.
HC08 Full Chip Simulation Configuration Procedure USBIN Command The USBIN command allows the user to create packets for input into the USB. If you specify packet parameters, this command places the packet into the next slot in the USB input buffer. If no parameter is given, this command displays a pick window with the input buffer packets. Enter the packets while the window is open. An arrow points to the next input packet to the USB. The maximum number of input packets is 256.
HC08 Full Chip Simulation Configuration Procedure Figure 11.67 USB IN Buffer Display USBOUT Command The USBOUT command displays the output buffer from the USB. A window is opened that shows all the data that the USB has shifted out. An arrow is used to point to the last output packet transmitted. The maximum number of output packets that the buffer holds is 256 bytes. Syntax >USBOUT Example >USBOUT View packets from the output buffer for USB simulation. Figure 11.
HC08 Full Chip Simulation Configuration Procedure USBRESET Command The USB RESET command simulates a USB reset from the USB connection. If the URSTD bit is clear in the CONFIG register, then a reset of the MCU occurs just as with a RESET command. If the URSTD bit is set, then a USB interrupt occurs. See the technical description of the USB peripheral in the Freescale Manual for more information. Syntax >USBRESET Example >USBRESET Simulate USB reset of the MCU.
HC08 Full Chip Simulation Configuration Procedure 332 Microcontrollers Debugger Manual
12 MON08 Interface Connection The MON08 connection setting permits a connection to Class 1-4 devices. Refer to the descriptions below for a definition of each interface class. MON08 connection mode allows the user to debug code, as the firmware is fully resident in the FLASH of the microprocessor. The operation of all modules fully reflects the actual operation of the on-board resources. Connection Procedure To make the MON08 Interface debugger connection: 1.
MON08 Interface Connection Connection Procedure Figure 12.2 P&E Connection Manager Window - Connect to Target Tab 3. Access the Interface Selection dialog box by clicking the Add A Connection button in the Connection Manager window’s - Connect Target Tab. Choose a device class corresponding to the type of interface that you are using. Figure 12.
MON08 Interface Connection Connection Procedure 4. Define the proper communication port and baud rate setting in the Connection Manager. 5. To remove a pre-configured MON08 Interface connection, proceed to the Remove section of the connection manager. Select the interface to be removed and click on Remove Selected Interface. Advanced Settings Tab The Advanced Settings tab allows the user to set specific protocol settings. The following is an explanation of each part of the Advanced Settings tab. Figure 12.
MON08 Interface Connection Connection Procedure for a short time after the supply has been switched off, but the supply voltage must reach less than 0.1v before it is turned back on if a Power-On reset is to occur. Whenever power is automatically or manually switched on, the software waits for an amount of time equal to the Tpu delay time before attempting to contact the 68HC08 processor.
MON08 Interface Connection Connection Procedure Power Up and Power Down Radio Buttons This is the default option and works for most, if not all, ICS08/Target Board solutions. It requires the user go through two dialog box stages, and requires more time than simply cycling the power. 1. Software automatically powers down the ICS. 2. Software asks the user to power down the board as follows: Figure 12.5 Power Down Dialog Box 3.
MON08 Interface Connection Connection Procedure Turn Target Power Off and Leave Target Power On Radio Buttons This option works for many ICS boards as well, but relies on the fact that while the ICS is powered off, it holds the target in reset until it is powered up itself and has configured the MON08 configuration pins. The sequence of events in this mode is: 1. Software automatically powers down the ICS. 2. Software asks the user to power cycle their board as follows: Figure 12.
MON08 Interface Connection Connection Procedure Figure 12.8 P&E Connection Manager Window - MON08 16-Pin Header Signals Tab The MON08 16-Pin Header Signals tab of the P&E Connections Manager window can be used by the user to manually enter the proper security bytes via the USER setting, or to load the security bytes from the same .S19 file which was programmed. The bytes are loaded from a .S19 file by clicking the Load from S19 button.
MON08 Interface Connection Connection Procedure STATUS Area The status area of the MON08 16-Pin Header Signals tab consists of one status string following the Status: label, and seven items which list the state of the last attempt to connect to a target and pass security.
MON08 Interface Connection Connection Procedure – The part did not start the monitor mode security check on reset. Signals to force monitor mode may be incorrect. – The baud rate specified was incorrect. – The processor was not reset properly. Check the Target Hardware Type and, if you are connecting to a class II board, check the MON08 cable communication connections type in the Advanced Settings dialog box.
MON08 Interface Connection Connection Procedure • 6 – ROM is accessible (un-secured): If the device properly entered monitor mode (4), the software reads locations $FFF6$FFFF to determine if the processor passes the security check. Memory locations which are invalid or protected read back from the device as $AD. If all bytes from $FFF6-$FFFF read a value of $AD, it is assumed the device is secure, and the flag value is an ‘N’.
MON08 Interface Connection Connection Procedure 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 12.10 Advanced Options Dialog Box Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking lets the software transparently program the microprocessor.
MON08 Interface Connection Connection Procedure NOTE The Non-Volatile Memory Preservation and Custom Trim functionality are only available for the M68HCS08 devices, and as such these options are disabled for all M68HC08 devices. Start Expert Mode Programmer Option Start Expert Mode Programmer grants the user access to P&E’s graphical Flash programming utility, PROG08SZ. PROG08SZ lets an advanced user control the step-bystep execution of the Flash erase/programming procedure. See Figure 12.11.
MON08 Interface Connection Connection Procedure View Register Files Option The View Register Files menu option also gives the user the option of running the register file viewer/editor. If register files are available for the device that you have chosen, the Choose a Register Block window (see Figure 12.12) opens. You may also open it by entering the R command in the Command Window command line. Figure 12.
MON08 Interface Connection Device Class Description Device Class Description The following device information summarizes the different classes of boards available to the user. Detailed information about specific devices is available from Freescale. Class 1 Device ICS Board with processor installed. This is the standard and most common configuration of the ICS08 boards. In this configuration, the processor is resident in one of the sockets on the ICS board itself.
MON08 Interface Connection Device Class Description mode check and access the Flash on the processor. A simple reset is not enough; to pass the security check, you must first force the processor to encounter a POR (power-on reset) which requires that the processor's voltage dip below 0.1v. Once security is passed, resetting the device or re-entering the software is easier. Class 3 selection also applies to use of the ICS board with the two-pin blank part programming connector.
MON08 Interface Connection Device Class Description 348 Microcontrollers Debugger Manual
13 ICS MON08 Interface Connection ICS Mode In-Circuit Simulation (ICS) Mode is a P&E Microcomputer Systems mode of operation that is a hybrid between In-Circuit Debugging, and Full Chip simulation. P&E has combined the benefits of each of these modes, while minimizing their respective deficiencies. ICS mode simulates the CPU core instructions on the user's PC. However, Inputs/Outputs are read directly from the user's development device, and certain modules are run on the actual device.
ICS MON08 Interface Connection Connection Procedure Connection Procedure To select the ICS MON08 Interface connection: 1. Choose the ICS MON08 Interface option from the set connection dialog box, as shown in Figure 13.1. 2. Click the OK button to open the P&E Connection Manager Window. Figure 13.1 ICS MON08 Set Connection Dialog Box Figure 13.
ICS MON08 Interface Connection Connection Procedure 3. Access the Interface Selection Manager assistant by clicking on the Add A Connection button in the P&E Connection Manager Window (Figure 13.2). Choose a device class that corresponds to the Interface that you are using. Figure 13.3 Interface Selection Dialog Box 4. Define the proper communication port and baud rate setting in the Connection Manager. See Figure 13.3. 5.
ICS MON08 Interface Connection Connection Procedure Advanced Settings Tab The P&E Connection Manager window’s Advanced Settings tab allows the user to set specific protocol settings. The following is an explanation of each part of the advanced settings tab. Figure 13.4 P&E Connection Manager Window - Advanced Settings Tab Tpd and Tpu Timing Textboxes Tpu and Tpd set the power-up and power-down delay (respectively) that is observed when power-cycling a target for entry into Monitor Mode.
ICS MON08 Interface Connection Connection Procedure Target Has RESET Button In Class III boards, the software occasionally needs to get control of the target. For a detailed definition of board classes, see Device Class Description. On systems which are Class III boards with the monitor mode circuitry built-in (including RS-232 driver), there is no means to reset the target to gain control. If the board has a reset button, the software can use this to gain control of the target system.
ICS MON08 Interface Connection Connection Procedure Figure 13.5 Power Down Dialog Box 3. Software automatically powers up the ICS, which configures the processor’s MON08 configuration pins. 4. Software asks the user to power up the board as follows: Figure 13.6 Power Up Dialog Box Cycle Power Radio Button Power Down ICS button asks the user to power cycle their board. Power UP ICS button does the opposite.
ICS MON08 Interface Connection Connection Procedure Serial Port Stop Bits Serial Port Stop Bits allow users of Class 1-4 devices that are experiencing unreliable communication to increase the number of stop bits to 2. Pulse IRQ on Stop The IRQ on Stop allows the users to execute a mechanism to stop a running HC08 microprocessor. For more information, refer to the Stop a Running HC908 Target.pdf application note that is available from P&E Microcomputer Systems website: www.pemicro.com.
ICS MON08 Interface Connection Connection Procedure 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 ‘N’, which indicates that the character was not received, it is most likely due to one of the following reasons: – Wrong Com Port specified. – The baud rate specified was incorrect (probably too low). – The ICS/Target is not connected. – No Power to the ICS.
ICS MON08 Interface Connection Connection Procedure check was successfully passed. If a break character is not received from the processor, this flag returns an ‘N’. Reasons for this include: – The baud rate specified was incorrect. – The processor was not reset properly. Check the Target Hardware Type. If you are connecting to a class II board, check the MON08 cable communication connections type in the Advanced Settings dialog box.
ICS MON08 Interface Connection Connection Procedure Active Mode Connection Menu Options When the microprocessor is connected, more Connection menu entries become available to the user. Figure 13.8 Additional Connection Menu Options Advanced Programming/Debug Options The Advanced Programming/Debug Options menu entry take you to the Advanced Options dialog box, where you can configure the software settings for the Flash programming procedure. Figure 13.
ICS MON08 Interface Connection Connection Procedure Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking lets the software transparently program the microprocessor. Trim Options The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables automatic calculation and programming of the trim value in a designated non-volatile memory location.
ICS MON08 Interface Connection Connection Procedure Figure 13.10 PROG08SZ Programmer Window View Register Files Option The View Register Files menu option also gives the user the option of running the register file viewer/editor. If register files are available for the device that you have chosen, the Choose a Register Block window (see Figure 13.11) opens. You may also open it by entering the R command in the Command Window command line. Figure 13.
ICS MON08 Interface Connection Device Class Description Figure 13.12 Timer Interface Module Register Listing Selecting a file brings up the Register Window (see Figure 13.13), which displays the values and significance for each bit in the register. The registers can be viewed and their values modified, and the values can be stored back into debugger memory. Figure 13.
ICS MON08 Interface Connection Device Class Description Class 2 Device ICS Board without processor, connected to the user’s microprocessor system via MON08 Cable. In this configuration, there is no processor resident in any of the sockets of the ICS board itself. The processor is mounted down in the user’s MCU system. The connection from the ICS board to the user’s MCU system is accomplished via the 16-pin MON08 connector.
ICS MON08 Interface Connection Device Class Description Figure 13.14 Reset Connection In this configuration, because the software does not directly control power to the processor, the user is prompted to turn the processor's power supply on and off. Turning off the power supply is necessary to pass the initial security mode check and access the Flash on the processor.
ICS MON08 Interface Connection Device Class Description 364 Microcontrollers Debugger Manual
14 HC08 P&E Multilink/Cyclone Pro Connection The HC08 P&E Multilink/Cyclone Pro Connection setting permits a connection to Class 5, 7 or 8 devices. See Device Class Description for a definition of each interface class. HC08 P&E Multilink/Cyclone Pro connection mode allows the user to debug code, as the firmware is fully resident in the FLASH of the microprocessor. The operation of all modules fully reflects the actual operation of the on-board resources.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 14.2 P&E Connection Manager Window - Connect to Target Tab 4. The device power selection allows the user to specify whether the target is 2, 3, or 5 Volts, and whether this power is switched/generated by the P&E interface or if it is separately supplied to the target and under user control. If it is under user control, the software uses dialog boxes to ask the user to power the target up and down when necessary (similar to Class II-IV).
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure 7. To add a serial/parallel port P&E device such as Cyclone Pro Serial, MON08 Multilink and Cyclone Pro Ethernet (IP outside of subnet mask), proceed to the Interface Selection Window by pressing the Add A Connection button on this tab of the Connection Manager window. See Figure 14.5. For more information about configuring Cyclone Pro for ethernet operation, refer to the Cyclone Pro User's Manual. Figure 14.5 Interface Selection Dialog Box 8.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure 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 each part of the advanced settings dialog box. Figure 14.7 Advanced Settings Tab Tpd And Tpu Timing Textboxes Tpd and Tpu set the power-down and power-up delay that is observed when powercycling a target for entry into Monitor Mode.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure Target Has RESET Button Checkbox With Class III boards, the software occasionally needs to get control of the target. On systems which are Class III boards with the monitor mode circuitry built-in (including RS232 driver), there is no means to reset the target to gain control. If the board has a reset button, the software can use this to gain control of the target system.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure 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 14.9 Power Up Dialog Box Cycle Power Down/Up Radio Button These buttons ask the user to power cycle their board.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure Pulse IRQ on Stop The IRQ on Stop allows the users to execute a mechanism to stop a running HC08 microprocessor. For more information, refer to the Stop a Running HC908 Target.pdf application note that is available from the P&E Microcomputer Systems website: www.pemicro.com.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure monitor mode communications regardless of the security status. As long as the Baud and Port are correct, and the device has been properly powered, monitor mode entry is allowed. By ignoring the security check failure you can still use monitor mode, but the ROM/Flash are not accessible. NOTE If a connection is not established for any reason other than security failure, the connection dialog box always appears.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure – No Power to the ICS. If this status bit returns an ‘N’, you must correct this before analyzing the rest of the status bits. • 2 – Device echoed all security bytes: To pass security, the software must send eight security bytes to the processor. The processor echoes each of these eight bytes twice. If all eight bytes do not get the proper two-byte echo, this flag returns an ‘N’.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure – The processor did not power all the way down because power was being supplied to the processor through either the port pins, IRQ line, RESET line, or power pins. – The voltage driven on the power pin of the processor did not go below 0.1 volts. – The processor was not reset properly. Check the Target Hardware Type.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 14.13 HC08 Device Extended Menus Connect Option The Connect option initiates an attempt to communicate with the device chosen under the device section of the menu. Active Mode Menu Options When the microprocessor is connected, more Connection menu entries become available to the user. Figure 14.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure Advanced Programming/Debug Options The Advanced Programming/Debug Options menu entry opens the Advanced Options dialog box, where you can configure software settings for the FLASH programming procedure. Figure 14.15 Advanced Options Dialog Box Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking lets the software transparently program the microprocessor.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure NOTE The Non-Volatile Memory Preservation and Custom Trim functionality are only available for the M68HCS08 devices, and as such these options are disabled for all M68HC08 devices. Start Expert Mode Programmer Option Start Expert Mode Programmer grants the user access to P&E’s graphical Flash programming utility, PROG08SZ. PROG08SZ lets an advanced user control the step-bystep execution of the Flash erase/programming procedure. See Figure 14.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure View Register Files Option The View Register Files menu selection also gives the user the option of running the register file viewer/editor. If register files are available for the device that you have chosen, the Choose a Register Block window (see Figure 14.17) opens. You may also open it by entering the R command in the Command Window command line. Figure 14.
HC08 P&E Multilink/Cyclone Pro Connection Connection Procedure Debugging Limitations The following limitations are inherent in MON08 debugging. Observe these restrictions carefully. 1. Do not step a command that branches to itself. 2. Do not step a software interrupt (SWI) command. 3. The hardware breakpoint registers are reserved for use by the debugger. Attempting to use these registers for other purposes may not work. 4.
HC08 P&E Multilink/Cyclone Pro Connection Device Class Description Device Class Description The following device information summarizes the different classes of boards available to the user. Detailed information about specific devices is available from Freescale. Class 5 Device P&E’s MON08 Cyclone Device connects to a PC via the serial port. The Cyclone-toMCU connection occurs via a standard 16-pin MON08 ribbon cable.
15 HC08 ICS P&E Multilink/ Cyclone Pro Connections In-Circuit Simulation (ICS) Mode is a P&E Microcomputer Systems mode of operation that is a hybrid between In-Circuit Debugging and Full Chip simulation. P&E has combined the benefits of each of these modes, while minimizing their respective deficiencies. ICS mode simulates the CPU core instructions on the user's PC. However, Inputs/Outputs are read directly from the user's development device, and certain modules are run on the actual device.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Connection Procedure 1. Choose the ICS P&E Multilink/Cyclone Pro option from the set connection dialog box, as shown in Figure 15.1. Figure 15.1 Set Connection Dialog Box 2. Click the OK button to bring up the P&E Connection Manager Window. Figure 15.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure 3. The device power selection in the Power/Clock Details area allows the user to specify whether the target is 2, 3, or 5 Volts, and whether this power is switched/generated by the P&E interface or if it is separately supplied to the target and under user control. If it is under user control, the software uses dialog boxes to prompt the user to power the target up and down when necessary (similar to Class II-IV). See Figure 15.3. Figure 15.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Figure 15.5 Remove A Manually Configured Multilink/Cyclone Pro Interface Advanced Settings Tab The Advanced Settings tab of the P&E Connection Manager window allows the user to set specific protocol settings. The following is an explanation of the Advanced Settings tab. Figure 15.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Tpu and Tpd Timing Textboxes Tpu and Tpd set the power-up and power-down delay (respectively) that is observed when power-cycling a target for entry into Monitor Mode. These settings are only valid for devices with automatically controlled power. 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.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Power Up/Down Radio Buttons Power Down ICS prompts the user to power down the board. Power Up ICS prompts the user to power up the board. This is the default option and works for most, if not all, ICS08/Target Board solutions. 1. Software automatically powers down the ICS. 2. Software asks the user to power down the board as follows: Figure 15.7 Power Down Dialog Box 3.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Cycle Power Up/Down Radio Buttons Cycle Power ICS asks the user to power cycle the board. This option works for many ICS boards as well, but relies on the fact that while the ICS is powered off, it holds the target in reset until it is powered up itself and has configured the MON08 configuration pins. The sequence of events in this mode is: 1. Software automatically powers down the ICS. 2.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure ‘N’, which indicates that the character was not received, it is most likely due to one of the following reasons: – Wrong Com Port specified. – The baud rate specified was incorrect (probably too low). – The ICS/Target is not connected. – No Power to the ICS. If this status bit returns an ‘N’, you must correct this before analyzing the rest of the status bits.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure check was successfully passed. If a break character is not received from the processor, this flag returns an ‘N’. Reasons for this include: – The baud rate specified was incorrect. – The processor was not reset properly. Check the Target Hardware Type. If you are connecting to a class II board, check the MON08 cable communication connections type in the Advanced Settings dialog box.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Active Mode Menu Options When the microprocessor is connected, more Connection menu options become available to the user. Figure 15.10 Additional Connection Menu Options Advanced Programming/Debug Options The Advanced Programming/Debug Options menu entry takes you to the Advanced Options dialog box, where you can configure the software settings for the Flash programming procedure. Figure 15.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking in this dialog box lets the software transparently program the microprocessor. Trim Options The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables automatic calculation and programming of the trim value in a designated Non-Volatile memory location.
HC08 ICS P&E Multilink/Cyclone Pro Connections Connection Procedure Figure 15.12 PROG08SZ Programmer Window View Register Files Option The View Register Files menu selection also gives the user the option of running the register file viewer/editor. If register files are available for the device that you have chosen, the Choose a Register Block window (see Figure 15.13) opens. You may also open it by entering the R command in the Command Window command line. Figure 15.
HC08 ICS P&E Multilink/Cyclone Pro Connections Device Class Description Figure 15.14 Timer Interface Module Register Listing Selecting a file brings up the Register Window (see Figure 15.15), which displays the values and significance for each bit in the register. The registers can be viewed and their values modified, and the values can be stored back into debugger memory. Figure 15.
HC08 ICS P&E Multilink/Cyclone Pro Connections Device Class Description Class 8 Device P&E’s Cyclone Pro communicates with the PC through a Serial, Ethernet or USB port. One can use the Cyclone Pro to debug and program the firmware inside of Freescale M68HC08 microprocessors via a standard 16-pin MON08 ribbon cable. The Cyclone Pro can provide its own power and clock signals to the target, as long as proper signals are connected to the corresponding pins of the 16-pin MON08 header.
16 SofTec HC08 Connection This section guides you through the first steps toward debugging with the CodeWarrior IDE and the SofTec HC08 connection. It does not replace all the additional documentation provided in this manual, but gives you a good starting point. SofTec HC08 Technical Considerations The 8/16 bits debugger (and then the CodeWarrior IDE) might be connected to HC08 hardware using the SofTec HC08.
SofTec HC08 Connection Using the Stationery Wizard Using the Stationery Wizard To take the first steps toward debugging with the CodeWarrior IDE and the SofTec inDART-HC08 using the stationery Wizard: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. Choose the menu File > New to create a new project from a stationery - the HC08 New Project Wizard first screen appears. 3. In the list box on the left of the screen, select the HC08 MCU you are targeting. 4.
SofTec HC08 Connection From Within an Existing Project From Within an Existing Project To take the first steps toward debugging with the CodeWarrior IDE and setting the SofTec HC08 connection from within an existing debugging project: 1. Run the CodeWarrior IDE. 2. Open the project. 3. Choose Project > Debug to start the debugger. 4. In the Debugger, choose Component > Set Connection to select another target interface in the Set Connection dialog box. 5. Select HC08 as Processor. 6.
SofTec HC08 Connection From Within an Existing Project Figure 16.3 MCU Configuration Dialog Box 8. Press the OK button to start debugging. inDart-HC08 Menu Options Once the SofTec HC08 connection is set, the connection menu entry in the debugger main toolbar is inDART-HC08. Figure 16.4 inDART-HC08 Menu Options MCU Configuration Option Select the inDART-HC08 > MCU Configuration option to display the MCU Configuration Dialog Box.
SofTec HC08 Connection From Within an Existing Project About Option Select the inDART-HC08 > About option to display the About Dialog Box. MCU Configuration Dialog Box You can expand the Hardware Model list menu to select another type of debug interface than the SofTec inDART-HC08. You can expand the Device Code list menu to select another HC08 derivative. Figure 16.5 MCU Configuration Dialog Box Pressing the Communication Settings button opens the Communication Settings Dialog Box.
SofTec HC08 Connection From Within an Existing Project Figure 16.6 Communication Settings Dialog Box NOTE If your hardware supports stopping the application while running, an additional interrupt service routine is required for the IRQ vector. See Stop Command Handling section in inDART®-HC08 In-Circuit Debugger/Programmer for Motorola HC08 Family FLASH Devices User’s Manual from SofTec for further details.
17 HC08 FSICEBASE Emulator This chapter is intended for developers, testers, application engineers, and anyone interested in using the Freescale In-Circuit Emulator Base (FSICEBASE) development system. This chapter contains information about how to use the FSICEBASE tool that helps you develop applications for embedded systems based on a Freescale M68HC08 microcontroller unit (MCU).
HC08 FSICEBASE Emulator FSICEBASE Overview System Requirements The FSICEBASE system requires a host computer with the following minimum specifications: • Processor: 200 MHz Pentium® II processor or AMD-K6® class processor • Operating System: Microsoft® Windows® 2000, Windows® XP, or Windows Vista™ • RAM: 128 MB • Hard drive space: Compact software installation: 232 MB Full software installation: 344 MB • USB port or Ethernet port to connect host computer to the FSICEBASE System Features The Freescale In-C
HC08 FSICEBASE Emulator FSICEBASE Overview – 24 general-purpose logic clips, five of which can be used to trigger the bus state analyzer sequencer • Four software-selectable internally generated oscillator clock sources • Command and response logging to disk files • Assembly-language source-level debugging • On-screen, context-sensitive help via pop-up menus and windows • Emulation that allows multiple types of reset System Components The FSICEBASE system includes the basic components that you need to conn
HC08 FSICEBASE Emulator FSICEBASE Overview clock, an oscillator, or any other circuitry that you might use to perform analysis. One end of each cable assembly has a molded connector, which fits into the FSICEBASE. Leads at the other end of each cable terminate in female probe tips. Ball clips come with the cables. Additional Components You can purchase other components to enhance your development efforts.
HC08 FSICEBASE Emulator Setting Up the FSICEBASE System Setting Up the FSICEBASE System The Freescale In-Circuit Emulator Base (FSICEBASE) development system includes cables and software. You need to connect the cables and install the software in order to use the FSICEBASE.
HC08 FSICEBASE Emulator Setting Up the FSICEBASE System c. Connect other end of USB cable to host computer NOTE The host computer (PC) must have an assigned IP address and subnet mask that matches the FSICEBASE. 3. If you are using a USB connection to connect your host computer directly to the FSICEBASE: a. Make sure power supply is not connected to board b. Connect U-shaped end of USB cable to FSICEBASE c.
HC08 FSICEBASE Emulator Establishing Communication Establishing Communication The Freescale In-Circuit Emulator Base (FSICEBASE) allows you to connect to a host computer in two ways: • Through an ethernet port • Through a USB port Communication Through Ethernet Port If you use an Ethernet connection to establish communication between your host computer and the FSICEBASE through a LAN, you need to do three things: • Have network administrator assign IP address on LAN to the FSICEBASE • Set IP address on FS
HC08 FSICEBASE Emulator Establishing Communication Figure 17.1 Communication Dialog Box 7. Select TCP/IP 8. In the text box, type the IP Address that your network administrator assigned to the FSICEBASE NOTE For more information on the IP address of the FSICEBASE, see “Assigning an IP Address to FSICEBASE” . 9. Click OK The debugger connects to the FSICEBASE through the ethernet port.
HC08 FSICEBASE Emulator Setting Up the System 4. From debugger main menu, select FSICEBASE-HC08 5. Select Communication— Communication dialog box appears (Figure 17.1) 6. Select USB 7. Click OK The debugger connects to the FSICEBASE through the USB port. Setting Up the System In order to use the Freescale In-Circuit Emulator Base (FSICEBASE), you need to make sure that the system is configured properly.
HC08 FSICEBASE Emulator Setting Up the System 4. Select appropriate processor from Processor drop-down menu 5. Select appropriate connection. To specify the FSICEBASE as the connection, select FSICE emulator. 6. Click OK — The debugger configures itself to work with the connection that you specified. Notice that the main menu of the debugger reflects your selection. The menu item between the Run menu and the Component menu shows the name of the connection that you selected.
HC08 FSICEBASE Emulator Setting Up the System 3. Select Communication — The FSICE Communication dialog box opens (Figure 17.1) 4. Specify communication information a. If you use an ethernet connection to connect your host computer to the FSICEBASE through a LAN: • Select TCP/IP, and • Type the IP address of the FSICEBASE in the text box. NOTE The network administrator of your Local Area Network (LAN) needs to assign the IP address of the FSICEBASE on the network.
HC08 FSICEBASE Emulator Setting Up the System The debugger saves the communication information that you specified. It uses the communication information the next time that it connects to the FSICEBASE. Assigning an IP Address to FSICEBASE The FSICEBASE ships from the factory with the following internal default IP address: 192.168.0.1 Depending on how you connect the host computer to the FSICEBASE, you might need to change the IP address of the FSICEBASE.
HC08 FSICEBASE Emulator Setting Up the System Figure 17.4 FSICEBASE Configuration Utility Window 3. Click Connect to FSICEBASE button — FSICEBASE Communication dialog box appears, as shown in Figure 17.1. 4. Select USB NOTE You can also use the default IP address to connect through TCP/IP. 5. Click OK — the FSICEBASE Configuration Utility connects to the FSICEBASE 6. Click Network tab of FSICEBASE Configuration Utility 7. In Address text box, type the IP address that you want to assign to the FSICEBASE.
HC08 FSICEBASE Emulator Specifying a Memory Map 9. If applicable, in Default Gateway text box, type the IP address that you want the FSICEBASE to use as the gateway to connect to a network. 10. If applicable, in Broadcast Address text box, type the IP address that you want the FSICEBASE to use as the broadcast address on the network NOTE The broadcast IP address is the last IP address in the range of IP addresses on a network.
HC08 FSICEBASE Emulator Specifying a Memory Map If an EM is connected to the FSICEBASE, the CodeWarrior IDE software automatically loads the default personality file that corresponds to the EM. If the CodeWarrior IDE software does not find an appropriate personality file, the debugger displays an error message when it tries to connect to the FSICEBASE. After the debugger has loaded a memory map, you can view the memory map and modify it. To use the Command line to view the current memory map: 1.
HC08 FSICEBASE Emulator Specifying a Memory Map To Modify a Memory Map: 1. Start the debugger — the True-time Simulator & Real-time Debugger window appears. 2. From debugger main menu, select FSICEBASE-HC08 The FSICEBASE-HC08 menu is between the Run menu and the Component menu. If you do not see the FSICEBASE-HC08 menu, you need to specify the connection. For more information on specifying a connection see Specifying A Connection. 3. Select Memory Map — Memory Map dialog box opens (Figure 17.7) Figure 17.
HC08 FSICEBASE Emulator Specifying a Memory Map 5. To delete an existing range: a. From Memory list box, select portion of map to delete b. Click Delete 6. To Save the definitions of the memory map that you specified: a. Click Save — Save Memory Configuration dialog box appears b. In File Name text box, type name you want to give the memory map file (.mem file) c. Click Save — debugger saves .mem file, which you can use (load) later 7. Click OK — The debugger loads the new memory map information.
HC08 FSICEBASE Emulator Specifying a Memory Map Figure 17.8 Target Signals Dialog Box 4. Specify clock source. From MCU Clock section of dialog box, select whether the clock is connected externally, on a connected emulator module (EM), or FSICE Generated. 5. Specify clock speed if internally generated a. If you selected FSICE Generated, select the clock speed to be emulated b.
HC08 FSICEBASE Emulator Setting Up Logic Cables and Connectors Emulation System Reset The debugger allows you to reset the emulation MCU and set the PC register to the contents of the reset vector. To reset the FSICEBASE: 1. If the FSICEBASE is connected to an emulator module (EM), specify the type of reset available to the EM. a. From debugger main menu, select FSICEBASE-HC08 The FSICEBASE-HC08 menu is between the Run menu and the Component menu.
HC08 FSICEBASE Emulator Setting Up Logic Cables and Connectors use this source, make the desired clock connection to the white probe tip and use the OSC command to select an external source. Pod B pin 17 is the external timetag input for the bus state analyzer. To use this source, make the desired clock connection to the white probe tip and use the TIMETAG command to select an external time tag source for the analyzer. Table 17.
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) Bus State Analyzer (BSA) The bus state analyzer (BSA) shows the logical state of the target MCU bus. The BSA takes a snapshot of the MCU bus. It also captures the signals from the logic clips of Pods A, B, and C of the FSICEBASE (24 lines in total). This capturing of data enables you to determine what is occurring in a system without actually disturbing the system.
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) To define an event: 1. Start the debugger 2. Load the program to debug a. If you launched the debugger from a project in the CodeWarrior IDE, the debugger automatically loads the program (.abs or .elf file) b. If the debugger has not loaded the program that you want to debug: • From the debugger main menu, select File > Load Application • Specify the location of the executable program file (.abs or .
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) 5. Select Term or Range A range consists of two 32-bit values. Range does not refer to a range of addresses. If you define an event as a range, the BSA triggers every time the input falls between the range starting term (the first 32-bit value) and the range ending term (the second 32-bit value). 6. In Address area, specify the address(es) that the BSA monitors 7. In Data area, specify the data that the BSA monitors 8.
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) Recording Modes When you define an event, you can specify the recording mode that the Bus State Analyzer uses to collect data. This section explains how the different modes work. Continuous: All Cycles After execution begins, the trace buffer begins storing data from the first cycle. This continues until execution arrives at a breakpoint, or until you halt execution.
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) D occurs, the sequencer starts again looking for event A.) Data storage ends after the specified number of post-trigger cycles. If you select this mode, you must enable events A, B, and C. Otherwise, the bus state analyzer cannot be triggered. If you disable event D, you convert this mode to a simple, three-event sequence. A -> B -> C -> D After execution begins, the trace buffer begins storing data from all cycles.
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) • External Selects the external clock • Custom selects the programmable clock. • Bus Clock selects the emulator clock, the bus clock of the emulating MCU. If you select External, make sure to connect the TT_OSC clip (white) of the pod B cable to the external clock source. NOTE If you specify a custom clock speed, be aware that the FSICEBASE can provide clock speeds from 4100Hz to 40MHz in steps of 5kHz.
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) 3. To change the kinds of data and the way that data is displayed: a. Place mouse cursor over Trace window b. Right-click mouse — Menu appears allowing you to change various aspects of the Trace window The Trace window can display trace buffer contents as raw bus cycles, as disassembled instructions, as mixed instructions and raw bus cycles, or as source code.
HC08 FSICEBASE Emulator Bus State Analyzer (BSA) 428 Microcontrollers Debugger Manual
Book III - HCS08 Debug Connections Book III Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment. This book, the HCS08 Debug Connections, defines the connections available for debugging code written for HCS08 CPUs.
Book III Contents 430 Microcontrollers Debugger Manual
18 HCS08 Full Chip Simulation Full Chip Simulation (FCS) does not involve real input and output. Because of this, it does not require a target device to be connected to your PC. The HCS08FCS connection simulates the execution of code on the user’s MCU system, including the function of any peripherals associated with the device that you select. For more detailed information, refer to the Full Chip Simulation description for the module that you are using.
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.
HCS08 Full Chip Simulation Configuration Procedure Device Option The Device selection of the HCS08FCS menu allows the user to select the particular Freescale processor that they wish to use. When choosing the Device option from the HCS08FCS menu, extended menus open which allow you to select the family (e.g. GB Family), and device type (e.g. 9S08GB60) of the MCU that you are using. Figure 18.
HCS08 Full Chip Simulation Configuration Procedure initialization does not apply to a reset command. When you change this option, the new state takes effect the next time you start HiWave (or switch Device Mode/Debug Target). View Register Files Command The View Register Files selection in the HCS08FCS menu also gives the user the option of running the register file viewer/editor. If register files are available for the device that you have chosen, the Choose a Register Block window (see Figure 18.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.6 Register Window Peripheral Modules Commands If you select a device (see Device Option), the HCS08FCS Menu displays a list of peripheral modules and the associated commands for the device you have chosen. Figure 18.7 HCS08FCS Menu: Peripherals/Commands Extended Menus Placing your mouse over a peripheral opens a box which lists its associated commands. Click on a command in order to execute that command.
HCS08 Full Chip Simulation Peripheral Modules Commands ADC Module In Full Chip Simulation (FCS), this module simulates all functionality of the Analog to Digital Conversion (ADC) module including data input on all ADC channels, flag polling, interrupt operation as well as the bus and CGMXCLK reference clock sources. FCS mode uses the buffered input structure to simulate the ADC inputs. The user can queue up to 256 data values. To queue the ADC Input Data, use the ADDI command in the command prompt.
HCS08 Full Chip Simulation Peripheral Modules Commands When the conversion is complete, the FCS sets the appropriate flag. If interrupts are enabled, the Program Counter changes flow to the interrupt routine (as defined in the vector space of the MCU). For more information on ADC configuration, refer to the Freescale user manual for your microprocessor. ADC Module Commands The following commands are available for the M68HCS08 ADC Module.
HCS08 Full Chip Simulation Peripheral Modules Commands Example >ADCLR Clear the input buffer for ADC simulation. Clock Generation Module In FCS, this module simulates all functionality of the Clock Generation Module (ICG), including: • Phase Locked Loop (PLL) generation • Automatic lock detection • Interrupt • Acquisition • Tracking • Flag polling FCS mode uses simulated External Oscillator Frequency change command (XTAL) to allow the user to input the desired XTAL value.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.11 Frequency Display Once the ICG is properly configured, the user can monitor the status of the PLL by polling the corresponding flag. If PLL interrupt is enabled, FCS jumps to an appropriate subroutine, as long as the interrupt vector is properly defined. To observe the flag going up as a result of the corresponding CPU event, situate your Memory Window on the memory location of the ICG Status and Control register. Figure 18.
HCS08 Full Chip Simulation Peripheral Modules Commands speed of simulation; it does, however, affect the ratio in which peripherals receive cycles. Certain peripherals which run directly from the XTAL run at different speeds than those that run from the bus clock. Syntax >XTAL Where: • , by default, is a hexadecimal number, representing the simulated frequency of an external oscillator. Adding the suffix t to the n parameter forces the input value to be interpreted as base 10.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.13 IIC Input Buffer Display The IIC data input/output log buffer simulation allows the user to gain access to the past 256 IIC data bytes that have been shifted in and out of the module. To bring up the IIC IN/ OUT LOG buffer dialog box, use the IICDO command. Figure 18.14 IIC IN/OUT LOG Buffer Display At any point, use the IICCLR command to flush the input as well as input/output log IIC buffers.
HCS08 Full Chip Simulation Peripheral Modules Commands IIC interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the IIC interrupt vectors are properly defined. For more information on how to configure IIC module for desired operation, refer to the Freescale user manual for your microprocessor. Inter-Integrated Circuit Module Commands The following commands are available for the M68HCS08 Inter-Integrated Circuit Module.
HCS08 Full Chip Simulation Peripheral Modules Commands Pulls up the data window with all the input values >IICDI 22 33 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 and ACK from the slave device. An ACK is implied unless a NACK is specified via the IICDI command. The next two data bytes read are 22 and 23.
HCS08 Full Chip Simulation Peripheral Modules Commands 3. The data byte $AA comes in 4. The data byte $22 comes in 5. A STOP signal comes in IICDO Command The IICDO command displays a window, which shows data shifted in as well as shifted out of the IIC peripheral. An arrow points to the last output value transmitted/received. The maximum number of output values that the buffer can hold is 256. Syntax >IICDO Example IICDO View data from the input/output log buffer for IIC simulation.
HCS08 Full Chip Simulation Peripheral Modules Commands the same time, you can use the INPUTS command to bring up the Simulated Port Inputs for all general I/O ports. It displays the current simulated values to all applicable input ports. See the Input/Output Ports User Commands and Input/Output Ports User Commands for more information about the various forms of this command. Figure 18.
HCS08 Full Chip Simulation Peripheral Modules Commands INPUT Command The INPUT command sets the simulated inputs to port . The CPU reads this input value when port is set as an input port. Syntax >INPUT Where: is the letter representing corresponding port Eight-bit simulated value for port Example >INPUTA AA Simulate the input AA on port A.
HCS08 Full Chip Simulation Peripheral Modules Commands INPUTS Command In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port Inputs dialog box shown in Figure 18.18. The user may then use this box to specify the input states of port pins and IRQ. Figure 18.18 Simulated Port Inputs Dialog Box When using In-Circuit Simulation mode, the INPUTS command shows the simulated input values to any applicable port. Syntax >INPUTS Example >INPUTS Show I/O port input values.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.19 Simulated Port Inputs Dialog Box An IRQ event occurrence sets the appropriate flag in the corresponding IRQ register. The user can poll the IRQ flag if the Polling Mode is simulated. In the Interrupt Mode, the simulator branches to an appropriate interrupt subroutine as long as the IRQ interrupt vector is properly configured. For more information on IRQ configuration, refer to the Freescale user manual for your microprocessor.
HCS08 Full Chip Simulation Peripheral Modules Commands IRQ Commands The following interrupt request command is available for the HCS08. INPUTS Command In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port Inputs dialog box shown in Figure 18.21. The user may then use this box to specify the input states of port pins and IRQ. Figure 18.
HCS08 Full Chip Simulation Peripheral Modules Commands Keyboard Interrupt Module In FCS, this module simulates all functionality of the Keyboard Interrupt (KBI) module, including the edge-only, edge and level interrupt, and flag polling modes of operation. FCS mode uses simulated port inputs to trigger the KBI event from the proper I/O port pin. To define an input state of the specific port, write the INPUT command in the Command line window.
HCS08 Full Chip Simulation Peripheral Modules Commands The user can poll the KBI Interrupt Pending flag if the Polling Mode is simulated. In Interrupt Mode, the simulator branches to an appropriate interrupt subroutine as long as the KBI interrupt vector is properly configured. For more information on KBI configuration, refer to the Freescale user manual for your microprocessor. Keyboard Interrupt Commands The following Keyboard interrupt commands are available during full chip simulation on the HCS08.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.24 Simulated Port Inputs Dialog Box When using In-Circuit Simulation mode, the INPUTS command shows the simulated input values to any applicable port. Syntax >INPUTS Example >INPUTS Show I/O port input values.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.25 Memory Component Window If the MTIM interrupt is enabled, the FCS jumps to an appropriate subroutine as long as the MTIM interrupt vector is properly defined.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.26 SCI IN Buffer Display SCI Data Output Buffer simulation allows the user to gain access to the past 256 SCI data values transmitted out of the module. To bring up the SCI OUT buffer dialog box, use the SCDO command. Figure 18.27 SCI OUT Buffer Display At any point, use the SCCLR command to flush the input and output SCI buffers.
HCS08 Full Chip Simulation Peripheral Modules Commands The user can also observe different SCI flags in the Memory window. If the module is run in Flag Polling mode, poll the flag corresponding to the expected SCI event. If the SCI interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the SCI interrupt vectors are properly defined. For more information on how to configure SCI module for desired operation, refer to the Freescale user manual for your microprocessor.
HCS08 Full Chip Simulation Peripheral Modules Commands Example >SCDI $55 Set the next input value to the SCI to $55 >SCDI Pull up the data window with all the input values. Figure 18.29 SCI IN buffer display SCDO Command The SCDO command displays the output buffer from the SCI. A window is opened that shows all the data that the SCI has shifted out. An arrow is used to point to the last output value transmitted. The maximum number of output values that the buffer holds is 256 bytes.
HCS08 Full Chip Simulation Peripheral Modules Commands Serial Peripheral Interface Module In FCS, this module simulates all functionality of the Serial Peripheral Interface (SPI) module including: • flag polling • interrupt enabled mode • master and slave modes • slave input clock • transmission and reception of external data FCS mode uses the buffered input/output structure to simulate SPI inputs. The user can queue up to 256 data values into the input buffer.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.32 SPI OUT Buffer Display At any point, you can use the SPCLR command to flush the input and output SPI buffers. After the SPI simulated input is received, the first queued value is passed from the data buffer into the SPI data register. It can be observed in the Memory Window by displaying the memory location corresponding to the SPI data register. Figure 18.
HCS08 Full Chip Simulation Peripheral Modules Commands SPCLR Command Use the SPCLR command to flush the input and output buffers for SPI simulation. This resets the buffers and clears out all values. Notice that if the SPI is currently shifting a value, this command does not prevent the SPI from finishing the transfer. See SPDI command and SPDO command for accessing the input and output buffers of the SPI interface.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.34 SPI IN Buffer Display SPDO Command The SPDO command displays the output buffer from the SPI. A window is opened that shows all the data that the SPI has shifted out. An arrow is used to point to the last output value transmitted. The maximum number of output values that the buffer holds is 256 bytes. Syntax >SPDO Example >SPDO View data from the output buffer for the SPI simulation. Figure 18.
HCS08 Full Chip Simulation Peripheral Modules Commands SPFREQ Command The SPFREQ command lets the user set the frequency of the SPI slave input clock. If the SPI is configured for the slave mode, this command allows the user to enter the number of cycles per one input clock period. If no value is given, a window appears and the user is prompted for a value. If this command is not used, then the clocking is assumed to be set by the SPI control register.
HCS08 Full Chip Simulation Peripheral Modules Commands Figure 18.36 Simulated Port Inputs Dialog Box Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port. Depending on whether the input capture is set for rising/falling edge, to trigger the event, first set the port inputs high or low and then invert them to an opposite value. Once the Input Capture event takes place, you can observe the CHxF in the Channel Status and Control register in the Memory window. Figure 18.
HCS08 Full Chip Simulation Peripheral Modules Commands the user steps through the code. To determine the exact amount of cycles over which the event occurs, one can either observe the cycle display in the Register window or use the built in simulation commands. To display the current number of cycles in the Command window, use the CYCLES command. To change the number of cycles in the cycle counter, use CYCLES , where is the new cycle value.
HCS08 Full Chip Simulation Peripheral Modules Commands GOTOCYCLE Command The GOTOCYCLE command executes the program in the simulator beginning at the address in the program counter (PC). Execution continues until the cycle counter is equal to or greater than the specified value, until a key or the Stop button on the toolbar is pressed, until it reaches a break point, or until an error occurs.
HCS08 Full Chip Simulation Peripheral Modules Commands INPUTS Command In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port Inputs dialog box shown in Figure 18.39. The user may then use this box to specify the input states of port pins and IRQ. Figure 18.39 Simulated Port Inputs Dialog Box When using In-Circuit Simulation mode, the INPUTS command shows the simulated input values to any applicable port. Syntax >INPUTS Example >INPUTS Show I/O port input values.
HCS08 Full Chip Simulation Peripheral Modules Commands 466 Microcontrollers Debugger Manual
19 HCS08 P&E Multilink/ Cyclone Pro Connection The HCS08 P&E Multilink/Cyclone Pro Connection setting permits a connection to Multilink/Cyclone Pro devices. HCS08 P&E Multilink/Cyclone Pro connection mode allows the user to debug code, as the firmware is fully resident in the Flash of the microprocessor. The operation of all modules fully reflects the actual operation of the onboard resources. Connection Procedure To select the P&E Multilink/Cyclone Pro as your debugger connection: 1.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 19.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 19.3 HCS08 Connection Assistant Interface Selected Trim Control The Use custom trim reference frequency option allows the user to select a custom trim value for the target device (valid only for devices with an Internal Clock). The allowable trim value is only limited by the device itself; the user can input any value within the valid internal clock frequency range.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure MultilinkCyclonePro Menu Description When you select P&E Multilink/Cyclone Pro as your connection, the Connection menu’s name is changed and other options are added. Figure 19.4 Connection (MultilinkCyclonePro) Menu Device Option The Device option in the MultilinkCyclonePro menu allows the user to select the particular Freescale processor that they wish to use.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Active Mode Menu Options When the microprocessor is connected, more Connection menu options become available. Figure 19.6 Additional Connection Menu Options Debugging Memory Map Option Select MultilinkCyclonePro > Debugging Memory Map to display the Debugging Memory Map dialog. For more information about the Debugging Memory Map menu option, see the Debugging Memory Map window.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 19.7 Advanced Options Dialog Box Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking in this dialog box lets the software transparently program the microprocessor. Trim Options The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables automatic calculation and programming of the trim value in a designated Non-Volatile memory location.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Start Expert Mode Programmer Option The Start Expert Mode Programmer option of the Connection Menu grants the user access to P&E’s graphical Flash programming utility, PROGHCS08. PROGHCS08 lets an advanced user control the step-by-step execution of the Flash erase/programming procedure. See Figure 19.8. More information on how to use the PROGHCS08 can be found on the P&E Microcomputer Systems website at www.pemicro.com. Figure 19.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 19.9 Choose A Register Block Window If register files have been installed on the host computer, selecting a block brings up the Register Block register listing (see Figure 19.10), which shows a list of the associated registers, their addresses, and their descriptions. This begins interactive setup of system registers such as I/O, timer, and COP watchdog. Figure 19.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Bus Trace Option The Bus Trace menu option allows you to gather pertinent bus data by operating the bus analyzer in different modes. The various trace modes let you choose appropriate actions to take when a certain pattern (event), or sequence of patterns, appears on the bus. To trigger the Bus analyzer, define specific bus states as terms, and select a sequence of terms as a trigger event.
HCS08 P&E Multilink/Cyclone Pro Connection Connection Procedure 476 Microcontrollers Debugger Manual
20 HCS08 Open Source BDM Connection This chapter guides you through the first steps toward debugging with the CodeWarrior IDE and the HCS08 Open Source BDM connection. It does not replace all the additional documentation provided in this manual, but gives you a good starting point. HCS08 Open Source BDM Technical Considerations The 8/16 bits debugger (and then the CodeWarrior IDE) can be connected to HCS08 hardware using the HCS08 OSBDM (Open Source BDM) cable.
HCS08 Open Source BDM Connection First Steps Using the Stationery Wizard First Steps Using the Stationery Wizard To take the first steps toward debugging with the CodeWarrior IDE and the HCS08 Open 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. 4.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project First Steps From Within an Existing Project CAUTION Normally, use the New Project or Change wizard to change the connections. This information is provided for advanced users only. To take the first steps toward debugging with CodeWarrior IDE and setting the HCS08 Open Source BDM connection from within an existing debugging project: 1. Run the CodeWarrior IDE. 2. Open the project. 3. Choose Project > Debug to start the debugger.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project Figure 20.3 MCU Configuration Dialog Box 8. Click the OK button to start debugging. HCS08 Open Source BDM Menu Options Once the HCS08 Open Source BDM connection is set, the connection menu entry in the debugger main toolbar changes to HCS08 Open Source BDM. Figure 20.4 HCS08 Open Source BDM Menu Options Setup Option Select HCS08 Open Source BDM > Setup to display the HCS08 Open Source BDM Setup Dialog Box.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project Select Derivative Option Select HCS08 Open Source BDM > Select Derivative to display the Select Derivative Dialog Box. NOTE If the debugger recognizes only one derivative, this menu entry is not available. Unsecure Option Select HCS08 Open Source BDM > Unsecure to unsecure the device when necessary. This leads to the Information Required to Unsecure the Device dialog box.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project HCS08 Open Source BDM Setup Dialog Box This dialog box is used for setting up communication with a communication device. The Communication Device list menu shows which OSBDM cables are plugged into the computer. Figure 20.5 HCS08 Open Source BDM Setup Dialog Box Select the desired cable as your communication device, then click the OK button to start debugging. The Show Protocol checkbox option is only for support usage.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project Select Derivative Dialog Box This dialog box is used to set up a derivative. The list menu gives a list of derivatives that match the target silicon System Device Identification Registers (SDIDH, SDIDL). Figure 20.6 Select Derivative Dialog Box Select your target hardware derivative, then click the OK button to start debugging.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project Information Required to Unsecure the Device To unsecure a device, the debugger needs to know the value of the FCDIV register to correctly mass erase the device and program the security byte. The “Information required to unsecure the device” dialog box provides an FCDIV value to the Unsecure Command File script. To access this dialog box, select the menu option HCS08 Open Source BDM > Command Files and click on the Unsecure tab.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project 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.
HCS08 Open Source BDM Connection First Steps From Within an Existing Project 486 Microcontrollers Debugger Manual
21 HCS08 Serial Monitor Connection This section guides you through the first steps toward debugging with the CodeWarrior IDE and the HCS08 Serial Monitor connection. It does not replace all the additional documentation provided in this manual, but gives you a good start. Serial Monitor Technical Considerations The 8/16 bit debugger (and then the CodeWarrior IDE) can be connected to HCS08 hardware using the HCS08 Serial Monitor connection.
HCS08 Serial Monitor Connection First Steps Using the Stationery Wizard First Steps Using the Stationery Wizard To take the first steps toward debugging with CodeWarrior IDE and the HCS08 Serial 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. 4.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project First Steps from Within an Existing Project To take the first steps toward debugging with CodeWarrior IDE and setting the HCS08 Serial Monitor connection from within an existing debugging project: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. Open the existing project. 3. Choose the menu Project > Debug to start the debugger - debugger main window opens. 4.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project Figure 21.3 Monitor Setup Window - Monitor Communication Tab 8. Press the OK button. The HCS08 Serial Monitor connection reads the device silicon ID. This ID can match several derivatives. 9. Set the correct derivative matching your hardware in the Derivative Selection dialog box. Figure 21.4 Derivative Selection Dialog Box 10. Press the OK button.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project Figure 21.5 Monitor Setup Window - Vector Table Mirroring Tab 11. To enable this feature, check the Enable Vector Table Mirroring checkbox. Figure 21.6 Monitor Setup Window - Vector Table Mirroring Tab 12. Press the Auto Detect button to make the debugger search for the vector table address and vectors reserved by the HCS08 Serial Monitor. 13. Once the auto detection succeeds, press the OK button to start debugging.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project MONITOR-HCS08 Menu Options Once the HCS08 Serial Monitor connection is set, the MONITOR-HCS08 menu entry is is set in the Debugger menu. Figure 21.7 MONITOR-HCS08 Menu Entries Monitor Communication Select the MONITOR-HCS08 > Monitor Communications option to display the Monitor Setup Window - Monitor Communication Tab.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project Bus Trace Select the MONITOR-HCS08 > Bus Trace option to open the Trace component window within the debugger main window. Refer to the Debugger HCS08 On-chip DBG Module User Interface manual for all related information. Select Derivative Select the MONITOR-HCS08 > Select Derivative option to open the Derivative Selection Dialog Box.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project Figure 21.9 Monitor Setup Window - Vector Table Mirroring Tab Vector Table Mirroring Tab Using the Vector Table Mirroring tab, it is possible to set the “Vector Table Mirroring” feature. See the Vector Redirection section of Freescale Serial Monitor for MC9S08GB/ GT Application Note AN2140/D for all details. The HCS08 Monitor start address is given in the Monitor Start Address edit box.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project Derivative Selection Dialog Box Within this dialog box, it is possible to select a specific derivative according to the System Device Identification Register (SDIDH, SDIDL) (sometimes called PARTID) returned by the silicon device. Figure 21.
HCS08 Serial Monitor Connection First Steps from Within an Existing Project 496 Microcontrollers Debugger Manual
22 SofTec HCS08 Connection This chapter guides you through the first steps toward debugging with the CodeWarrior IDE and the SofTec HCS08 connection. It does not replace all the additional documentation provided in this manual, but gives you a good starting point. SofTec HCS08 Technical Considerations The 8/16 bit debugger (and then the CodeWarrior IDE) can be connected to HCS08 hardware using the SofTec HCS08.
SofTec HCS08 Connection First Steps Using the Stationery Wizard First Steps Using the Stationery Wizard To take the first steps toward debugging with the CodeWarrior IDE and the SofTec inDART-HCS08 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. 4.
SofTec HCS08 Connection First Steps from Within an Existing Project First Steps from Within an Existing Project To take the first steps toward debugging with the CodeWarrior IDE and setting the SofTec HCS08 connection from within an existing debugging project: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. Open the project. 3. Choose Project > Debug to start the debugger. 4.
SofTec HCS08 Connection First Steps from Within an Existing Project Figure 22.3 MCU Configuration Dialog Box 8. Press the OK button to start debugging. SofTec HCS08 Menu Options Once the SofTec HCS08 connection is set, the connection menu entry in the debugger main toolbar changes to SofTec-HCS08. Figure 22.4 SofTec-HCS08 Menu Options MCU Configuration Option Select SofTec-HCS08 > MCU Configuration to display the MCU Configuration Dialog Box.
SofTec HCS08 Connection First Steps from Within an Existing Project Trigger Module Settings Select SofTec-HCS08 > Trigger Module Settings to open the Trigger Module Settings dialog box. Refer to the Debugger HCS08 Onchip DBG Module User Interface manual for related information. Bus Trace Select SofTec-HCS08 > Bus Trace to open the Trace component window within the debugger main window. Refer to the HCS08 On-Chip DBG Module section for related information.
SofTec HCS08 Connection First Steps from Within an Existing Project specific HCS08 derivative. In the case of the MC9S08GB60, for example, this constant clock source is an 8 MHz internal clock. Other derivatives may use the external crystal frequency. Refer to the inDART®-HCS08 In-Circuit Debugger/Programmer for Motorola HCS08 Family FLASH Devices User’s Manual from SofTec for further details. Figure 22.
23 HCS08 On-Chip DBG Module The HCS08 derivatives featuring an on-chip DBG module require a debugger graphical user interface to setup this module and take full advantage of this enhanced debugging feature. This chapter describes the debugger DBG module user interface. Within several HCS08 debugger connections (e.g. P&E Debug), the HCS08 Serial Monitor and inDART-HCS08, a complete graphical user interface is provided.
HCS08 On-Chip DBG Module Specific Connection Menu Options • Real time program code profiling and coverage within the Profiler and Coverage window components (open the Profiler and/or the Coverage components to display code profiling and code coverage). Specific Connection Menu Options Specific DBG support menu options are added to the Connection menu as soon as the debugger target processor is acknowledged by the DBG module.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Context Menu Entries in Source, Data, Assembly and Memory Windows Specific DBG support menu options are added to the Connection menu as soon as the debugger target processor is acknowledged by the DBG module.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows To set a trigger, select a Set Trigger Address entry at the selected source location/ address. Figure 23.3 Set Trigger Address A Option The trigger is displayed in the Source window and at the corresponding address in the Assembly window, just like a breakpoint icon. To distinguish from breakpoints, trigger A is marked with a red A icon and trigger B with a red B icon.
HCS08 On-Chip DBG Module 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.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Trigger Stored as Markpoints Triggers are stored in the debugger as special markpoints. Like breakpoints, markpoints can be viewed by choosing Show Markpoints in the menu. Triggers are stored as Trigger A and Trigger B markpoints. These markpoint names are therefore reserved by the debugger. The markpoint type INSTRUCTION is automatically selected when the trigger is set from the Source or Assembly window. Figure 23.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Figure 23.6 Controlpoints Configuration Window - Markpoints Tab Editing triggers through the Markpoints tab in the Controlpoints Configuration window below is not user friendly.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Figure 23.7 Data Window Context Menu - Set Trigger A Option In the Data window, instead of setting a watchpoint, a trigger can be set. Note that only 2 triggers can be set: Trigger A and trigger B. In a general way, the on-chip DBG module provides combinations of trigger A and trigger B conditions, and according to the number of triggers defined (one or two), a different trigger DBG Module Mode Setup can be chosen.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Figure 23.8 Triggers Set in Data and Memory Windows The trigger is displayed in the Data window and at the corresponding address in the Memory window like a watchpoint icon. To be distinguished from watchpoints, the trigger A is marked with a red dotted vertical line and trigger B with a blue dotted vertical line.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Expert Triggers The Expert Mode has a different set of triggers and trigger designs. Indeed, to completely separate the Expert mode from the Automatic mode, the debugger provides a second set of triggers for the Expert mode. Expert Triggers are independent from the regular triggers described previously.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Figure 23.10 Expert Triggers in Source, Assembly, Memory and Data Windows As shown above, expert triggers are stored in the Markpoints tab of the Controlpoints Configuration window as DBGCA and DBGCB markpoints. These markpoint names are therefore reserved by the debugger. The markpoint type INSTRUCTION is automatically selected when the trigger was set from the Source or the Assembly window.
HCS08 On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Trigger Settings The Trigger Settings option of a context menu can be chosen to set all kinds of triggers without opening the Trigger Module Settings Window.
HCS08 On-Chip DBG Module DBG Support Status Bar Item Trigger Module Usage This menu entry can be used to globally set the DBG module functionality without opening the Trigger Module Settings Window to do the DBG Module Mode Setup. Figure 23.12 Source Window Extended Menu DBG Support Status Bar Item A specific DBG support debugger status bar item is present as soon as the debugger target processor features the DBG module.
HCS08 On-Chip DBG Module Trigger Module Settings Window The status bar displays the current DBG Module Mode Setup (as shown above) or the current preset Instruction Triggers, Memory Access Triggers or Capture Triggers used or the current DBG Module Mode Setup. Figure 23.
HCS08 On-Chip DBG Module Trigger Module Settings Window DBG Module Mode Setup First of all, the on-chip DBG module provides some exclusive debugging features. Open the top list menu to display all modes and complex breakpoints/watchpoints, that is, kind of triggers available. Figure 23.
HCS08 On-Chip DBG Module Trigger Module Settings Window Expert Mode The User needs to know the on-chip DBG module really well to use this mode. It can be seen as a “Do It Yourself” way to set the DBG module. The HCS08 core manual is needed to understand the meaning of the registers and flags. The triggers comparator addresses can be set from the debugger Source, Assembly, Memory and Data windows using Set DBGCA or Set DBGCB. The DBG module is set by the debugger.
HCS08 On-Chip DBG Module Trigger Module Settings Window Expert Mode Tab The expert mode tab gives you an access to most of the on-chip DBG module registers. Trigger types can be directly set from the DBGT - Debugger Trigger Register list menu. Code program flow rebuild and data recording are also synchronized with the Expert mode and results are displayed in the Trace Component Window. Figure 23.
HCS08 On-Chip DBG Module Trigger Module Settings Window Figure 23.19 Debugger Main Window - Coverage and Profiler Windows Disabled Mode The user needs to know the on-chip DBG module to use this mode. It can be seen as a “Do It Yourself” way to set hardware breakpoints, watchpoints, and triggers. Consult the Reference Document section and documents to get all information about the HCS08 onchip DBG module before attempting to use this mode.
HCS08 On-Chip DBG Module Trigger Module Settings Window Memory Access Triggers This section describes the various types of Memory Access Triggers available on the onchip debug module. Memory Access at Address A This mode is used to trigger on a program instruction read and/or write at Address A memory location. The code program flow rebuild is displayed in the Trace Component Window automatically and switched to Instructions Display mode.
HCS08 On-Chip DBG Module Trigger Module Settings Window Memory Access at Address A and Value on Data Bus Match This mode is used to trigger on a program instruction read and/or write of a specific matching byte value at Address A memory location. When choosing this trigger type, the trigger B address is used as a match value rather than an address. Also when setting this trigger via a context sensitive context menu, the following message is displayed if the match value was never set. Figure 23.
HCS08 On-Chip DBG Module Trigger Module Settings Window Memory Access at Address A and Value on Data Bus Mismatch This mode is used to trigger on a program instruction read and/or write of a NOT matching byte value at Address A memory location. When choosing this trigger type, the trigger B address is used as a mismatch value rather than an address. Also when setting this trigger via a context sensitive context menu, the following message is displayed if the match value was never set. Figure 23.
HCS08 On-Chip DBG Module Trigger Module Settings Window Instruction at Address A or Address B is Executed This mode is used to trigger on a program instruction execution (program counter) at Address A or at Address B. The code program flow rebuild is displayed in the Trace Component Window automatically switched to Instructions Display mode.
HCS08 On-Chip DBG Module Trigger Module Settings Window Instruction at Address A and Value on Data Bus Match This mode is used to trigger on a program instruction execution (program counter) at Address A, this instruction opcode matching a specific byte value. When choosing this trigger type, the trigger B address is used as a match value rather than an address. Also when setting this trigger via a context sensitive context menu, the following message is displayed if the match value was never set.
HCS08 On-Chip DBG Module Trigger Module Settings Window Figure 23.26 Memory Access at Address A and Value on Data Bus Mismatch Dialog Box The Trigger Editing dialog box is not available for the trigger B. Special Match value edit boxes are displayed instead of Address B edit box. Figure 23.27 Trigger Address Settings Dialog Box The code program flow rebuild is displayed in the Trace Component Window automatically switched to Instructions Display mode.
HCS08 On-Chip DBG Module Trigger Module Settings Window The trigger addresses is typically not a program code address (program counter), but rather data/memory addresses. Captured byte data is displayed in the Trace Component Window and automatically switched to Recorded Data Display mode. DBG Module Options This section details the options available with the DBG module.
HCS08 On-Chip DBG Module Trigger Module Settings Window • Start recording after trigger hit and DO NOT halt when the fifo is full: The DBG module starts recording program flow information on trigger condition match. The DBG module does not halt the processor/debugger on trigger condition match. Data Recording The data recording options are available for Capture Triggers only and are selected from the list box in the Trigger Settings tab of the Trigger Module Settings window. Figure 23.
HCS08 On-Chip DBG Module Trigger Module Settings Window Trigger Editing Typically trigger addresses and/or type can be set using context sensitive context menus. It is also possible to modify trigger addresses and type within the Trigger Module Settings Window. Pressing Modify Trigger buttons opens a trigger editor dialog box. Figure 23.30 Browse for Trigger A Dialog Box In the trigger editor dialog box: • The Address edit box contains the initial and final trigger address value.
HCS08 On-Chip DBG Module Trigger Module Settings Window • The Show Location button shows the location of the trigger (as program code location or program data) in the Source, Data, Assembly and Memory windows.
HCS08 On-Chip DBG Module Trigger Module Settings Window Figure 23.32 Trigger Settings Tab Information General Settings Tab Most of the time, there is no reason to change any of these settings, which are default settings of the DBG user interface. However, in some debug special cases, it is possible to disable some automated debugger background processes. Figure 23.
HCS08 On-Chip DBG Module Trace Component Window • Automatically analyze the FIFO content: When the Trace Component Window is open, after the debugger is halted by the user or a breakpoint, watchpoint or a trigger, DBG module results are automatically analyzed then displayed in the Trace window. If the Trace window is closed, the DBG user interface does not perform any result analysis except trigger flags reported in the status bar. Unchecking this check box does the same, with the Trace window open.
HCS08 On-Chip DBG Module Trace Component Window It is not necessary to open the Trace window/component to make use of the DBG user interface triggers. However, several triggers are used to collect code program flow information or access data information. The Trace window can be opened from Specific Connection Menu Options, from Context Menu Entries in Source, Data, Assembly and Memory Windows, and from the DBG Support Status Bar Item.
HCS08 On-Chip DBG Module Trace Component Window Figure 23.35 Trace Window - Context Menu Options Selecting Show Location in the Trace window causes a context sensitive menu to appear in Source and Assembly window the frame matching source and assembly code. Graphical Display You can select this display mode when selecting Graphical in the Trace window context sensitive menu. It provides a graphical representation of the same information. Figure 23.
HCS08 On-Chip DBG Module Trace Component Window on-chip DBG module. By consequence, the Textual display mode simply expands instruction assembly code in the Trace window. Figure 23.37 Trace Window - Textual Display Column Display and Moving Selecting Items in the Trace window context sensitive menu opens a small dialog box to setup the columns to hide/display in each display mode. The Displaying mode list menu can be opened to make column display modification in Textual, Instructions or Graphical mode.
HCS08 On-Chip DBG Module Trace Component Window Dumping Frames to File Selecting Dump in the Trace window context sensitive context menu opens a small dialog box to dump/save Trace component frames to a text file. Figure 23.39 Dump Trace Frames Dialog Box Goto Frame Selecting Go to Frame in the Trace window context sensitive context menu opens a small dialog box to go to a frame in the Trace window. Figure 23.
HCS08 On-Chip DBG Module Trace Component Window Displayed columns: • FIFO Depth: A number representing the depth in the DBG/Fifo of the word data value. The first frame (Depth 1) is the oldest value in the time. • DBG FIFO Data: the word value retrieved from the DBG Fifo/buffer from DBGFH and DBGFL DBG on-chip module registers. Figure 23.41 Trace Window - FIFO Display Recorded Data Display This display mode is automatically set when Capture Triggers are used.
HCS08 On-Chip DBG Module Limitations Limitations The following limitations apply in demo/unregistered debugger mode: • In demo/unregistered debugger mode, code program reconstruction has a limited number of frames displayed in the Trace window. • Real time code Profiling and code Coverage are disabled. • No preset/predefined Instruction Triggers, Memory Access Triggers or Capture Triggers are provided. Only Expert Triggers can be set.
HCS08 On-Chip DBG Module HCS08 DBG V3 New Features Figure 23.43 LOOP1 recording mode selection Ability to record until Reset and from Reset The DBG module now has the ability to record data up until a reset occurs, and can begin recording immediately after reset.
HCS08 On-Chip DBG Module HCS08 DBG V3 New Features Figure 23.
HCS08 On-Chip DBG Module HCS08 DBG V3 New Features Figure 23.45 Recording an illegal opcode reset Recording from Reset In other cases, including Power On Reset (POR), the DBG module starts recording immediately out of reset. The Trigger Module Settings dialog provides a new setup to capture this recording from the reset vector entry point, when selecting “Start recording from asynchronous reset”.
HCS08 On-Chip DBG Module HCS08 DBG V3 New Features Figure 23.46 Recording out of reset mode selection Figure 23.47 Start recording from Reset trace CAUTION 542 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.
HCS08 On-Chip DBG Module HCS08 DBG V3 New Features Expert Triggers tab extended The Expert Triggers tab has been redesigned and extended with the newest comparator “C” controls. Figure 23.
HCS08 On-Chip DBG Module HCS08 DBG V3 New Features 544 Microcontrollers Debugger Manual
Book IV - RS08 Debug Connections Book IV Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment. This book, the RS08 Debugger Connections, defines the connections available for debugging code written for RS08 CPUs.
Book IV Contents 546 Microcontrollers Debugger Manual
24 RS08 Full Chip Simulation Full Chip Simulation (FCS) does not involve real input and output. Because of this, it does not require a target device to be connected to your PC. The RS08FCS connection simulates code execution on the user’s MCU system, including the function of any peripherals associated with the device that you select. For more detailed information, refer to the Full Chip Simulation description for the module that you are using.
RS08 Full Chip Simulation Configuration Procedure Connection (RS08FCS) Menu Once you have chosen Full Chip Simulation as your debugger connection, the name of the Connection menu is updated and additional options are added. Figure 24.2 RS08FCS Menu Device Option The Device selection of the RS08FCS menu allows the user to select the particular Freescale processor that they wish to use. When choosing the Device option from the RS08FCS menu, extended menus open which allow you to select the family (e.g.
RS08 Full Chip Simulation Configuration Procedure Full Chip Simulation Module Commands The RS08FCS Menu contains the Full Chip Simulation commands for the modules that have specialty commands associated with them for a chosen device. For more information about specific module commands refer to the Full Chip Simulation section describing the module. Port Pins Module Figure 24.4 shows the simulated port inputs dialog box. Figure 24.
RS08 Full Chip Simulation Configuration Procedure Show Processor Pins The Processor Pins dialog box is a convenient tool for monitoring the current state of the processor pins, as well as the peripheral with which a pin may be associated. The processor is represented, in graphical form, in the middle of the dialog box. Each pin is labeled with its current function. For example, Pin 2 is the BKGD pin upon reset.
RS08 Full Chip Simulation Configuration Procedure Run Till Cycle Command This menu option, which corresponds to the GOTOCYCLE command, brings up an input dialog box which allows the user to specify a given cycle value. When the master cycle counter for the simulator reaches the input value, simulation halts. Figure 24.
RS08 Full Chip Simulation Peripheral Modules Commands Figure 24.9 Timer Interface Module Register Listing Selecting a file brings up the Register Window (see Figure 24.10), which displays the value and significance of each bit in the register. The registers can be viewed and their values modified, and the values can be stored back into debugger memory. Figure 24.
25 RS08 P&E Multilink/Cyclone Pro Connection The RS08 P&E Multilink/Cyclone Pro Connection setting permits a connection to Multilink/Cyclone Pro devices. RS08 P&E Multilink/Cyclone Pro connection mode allows the user to debug code, as the firmware is fully resident in the FLASH of the microprocessor. The operation of all modules fully reflects the actual operation of the onboard resources. Connection Procedure To select the P&E Multilink/Cyclone Pro as your debugger connection: 1.
RS08 P&E Multilink/Cyclone Pro Connection 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 Figure 25.3) allows the user to connect to an already running target.
RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure MultilinkCyclonePro Menu Description When you have selected P&E Multilink/Cyclone Pro as your connection, the Connection menu’s name is changed and other options are added. Figure 25.4 Connection (MultilinkCyclonePro) Menu Device Option The Device option in the MultilinkCyclonePro menu allows the user to select the particular Freescale processor that they wish to use.
RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Connect Option The Connect option initiates an attempt to communicate with the device chosen under the Device section of the menu. Active Mode Menu Options When the microprocessor is connected, more Connection Menu options become available to the user. Figure 25.
RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Prompt on Flash Program Checkbox Checking Always Erase and Program Flash without asking in this dialog box lets the software transparently program the microprocessor. Trim Programming Checkbox The Trim Programming checkbox enables automatic calculation and programming of the trim value in a designated non-volatile memory location.
RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Show Processor Pins The Processor Pins dialog box is a convenient tool for monitoring the current state of the processor pins, as well as the peripheral with which a pin may be associated. The processor is represented, in graphical form, in the middle of the dialog box. Each pin is labeled with its current function. For example, Pin 2 is the BKGD pin upon reset.
RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure Figure 25.10 Choose A Register Block Window If register files have been installed on the host computer, selecting a block brings up the Register Block register listing (see Figure 25.11), which shows a list of the associated registers, their addresses, and their descriptions. This begins the interactive setup of system registers such as I/O, timer, and COP watchdog. Figure 25.
RS08 P&E Multilink/Cyclone Pro Connection Connection Procedure 560 Microcontrollers Debugger Manual
26 RS08 Open Source BDM Connection This chapter guides you through the first steps toward debugging with the CodeWarrior IDE and the RS08 Open Source BDM connection. It does not replace all the additional documentation provided in this manual, but gives you a good starting point. RS08 Open Source BDM Technical Considerations The 8/16 bits debugger (and then the CodeWarrior IDE) can be connected to RS08 hardware using the RS08 OSBDM (Open Source BDM) cable.
RS08 Open Source BDM Connection First Steps Using the Stationery Wizard First Steps Using the Stationery Wizard To take the first steps toward debugging with the CodeWarrior IDE and the RS08 Open 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. 4.
RS08 Open Source BDM Connection First Steps From Within an Existing Project First Steps From Within an Existing Project To take the first steps toward debugging with the CodeWarrior IDE and setting the RS08 Open Source BDM connection from within an existing debugging project: 1. Run the CodeWarrior IDE. 2. Open the project. 3. Choose Project > Debug to start the debugger. 4. In the debugger main window, choose Component > Set Connection to select another connection. 5.
RS08 Open Source BDM Connection First Steps From Within an Existing Project Figure 26.3 MCU Configuration Dialog Box 8. Select the OK button to start debugging. RS08 Open Source BDM Menu Options Once the RS08 Open Source BDM connection is set, the connection menu entry in the debugger main toolbar changes to RS08 Open Source BDM. Figure 26.4 RS08 Open Source BDM Menu Options Setup Option Select RS08 Open Source BDM > Setup to display the RS08 Open Source BDM Setup Dialog Box.
RS08 Open Source BDM Connection First Steps From Within an Existing Project Reset to Normal Mode Option Select RS08 Open Source BDM > Reset to Normal Mode to reset the hardware CPU to normal mode. Show Status Option Select RS08 Open Source BDM > Show Status to display the Show Status Dialog Box. RS08 Open Source BDM Setup Dialog Box This dialog box is used to set up your communication device. The communication device list menu shows the current OSBDM cables plugged into the computer. Figure 26.
RS08 Open Source BDM Connection First Steps From Within an Existing Project Select Derivative Dialog Box This dialog box is a derivative setup dialog box. The list menu gives a list of derivatives that match the target silicon System Device Identification Registers (SDIDH, SDIDL). Figure 26.6 Select Derivative Dialog Box Select the correct target hardware derivative then select the OK button to start debugging.
27 SofTec RS08 Connection This section guides you through the first steps toward debugging with the CodeWarrior IDE and the SofTec RS08 connection. SofTec RS08 Technical Considerations The 8/16 bit debugger (and then the CodeWarrior IDE) might be connected to RS08 hardware using the SofTec RS08.
SofTec RS08 Connection First Steps Using the Stationery Wizard First Steps Using the Stationery Wizard To take the first steps toward debugging with the CodeWarrior IDE and the SofTec inDART-RS08 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. 4.
SofTec RS08 Connection First Steps Using the Stationery Wizard 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.
SofTec RS08 Connection First Steps From Within an Existing Project First Steps From Within an Existing Project To take the first steps toward debugging with the CodeWarrior IDE and setting the SofTec RS08 connection from within an existing debugging project: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. Open the project. 3. Choose the menu Project > Debug to start the debugger. 4.
SofTec RS08 Connection First Steps From Within an Existing Project Figure 27.4 MCU Configuration Dialog Box 8. Press the OK button to start debugging. SofTec RS08 Menu Options Once the SofTec RS08 connection is set, the connection menu entry in the debugger main toolbar is set to SofTec-RS08. Figure 27.
SofTec RS08 Connection First Steps From Within an Existing Project MCU Configuration Option Select SofTec-RS08 > MCU Configuration to display the MCU Configuration dialog box. About Option Select the SofTec-RS08 > About option to display the About dialog box. MCU Configuration Dialog Box The Hardware Model list menu can be expanded to select another type of BDC debug interface than the SofTec inDART-RS08. The HW Code list menu can be expanded to select another RS08 derivative. Figure 27.
SofTec RS08 Connection First Steps From Within an Existing Project 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.
SofTec RS08 Connection First Steps From Within an Existing Project 574 Microcontrollers Debugger Manual
Book V - ColdFire® V1.0 Debug Connections Book V Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment.
Book V Contents 576 Microcontrollers Debugger Manual
28 ColdFire V1 Full Chip Simulation Connection The Full Chip Simulation (FCS) connection runs a complete simulation of all processor peripherals and I/O on the user's Personal Computer. No development board is required. Each derivative has a unique simulation engine to accurately simulate the memory ranges, I/O, and peripherals for a given derivative (for more information on selecting a specific derivative, see the FCS and Silicon On-Chip Peripheral Simulation sections).
ColdFire V1 Full Chip Simulation Connection Table 28.1 Simulator Menu Entry Description Menu Entry Description Load Opens the Load Executable Window menu. Reset Resets the Full Chip Simulation. Set Derivative Selects the current simulated derivative. Configure Opens the Memory Configuration Window.
ColdFire V1 Full Chip Simulation Connection The status bars show the selected simulated derivative or simulated CORE or core SAMPLE and the current derivative CPU frequency in MHz. NOTE Clicking on the CPU frequency opens the Clock Frequency Setup. NOTE Double-clicking on the CPU cycles or true time resets the value. NOTE Clicking on the displayed derivative, CORE, or core SAMPLE opens the Set Derivative dialog box.
ColdFire V1 Full Chip Simulation Connection Command Files Window Figure 28.5 shows the FCS connection Command Files window. Figure 28.5 Full Chip Simulation Connection Command Files Window Setcpu Command File The Setcpu command file is specific to FCS and the Debugger executes the command file after a CPU has been set or modified. This occurs when you use the setcpu command or when you load an application in the FCS when the corresponding CPU is not set.
ColdFire V1 Full Chip Simulation Connection Memory Configuration Dialog Box Features The memory configuration dialog box (Figure 28.
ColdFire V1 Full Chip Simulation Connection Memory Configuration Modes Use the Memory Configuration dialog box to select the memory configuration mode: auto configuration on access, auto configuration on load, or manual configuration (user defined). Depending on your settings, the FCS component initializes the FCS memory as Table 28.2 explains. Table 28.2 Memory Configuration Modes Mode Description Auto Configuration on Access (Standard Configuration) Defines the FCS memory as RAM of unlimited size.
ColdFire V1 Full Chip Simulation Connection Manual Configuration: The Memory Configuration dialog box lists an entry for each memory block. You can modify such entries without restriction. NOTE To simulate an absolute file generated in Freescale object file format, you must open the Memory Configuration dialog box, set the auto on load mode, then add a new RAM segment. The start and end addresses of this segment must match the associated .prm file.
ColdFire V1 Full Chip Simulation Connection Memory Block Setting You must set memory blocks within the available memory; each block must cover a certain range. The start address and end address define each memory block. Memory Block Properties Table 28.3 lists the properties you may specify for a memory block: Table 28.3 Memory Block Properties 584 Item Description Name Name of the memory block.
ColdFire V1 Full Chip Simulation Connection Memory Configuration Dialog Box Command Buttons The Memory Configuration dialog box contains these command buttons: • Add — Fills a new memory block according to the current data of the Name, Type, Start, End, Bus width, and Access Details controls. This new memory block appears at the end of the list box. If there are any errors in this new block (such as an improper field value), the system generates a message box that informs you of the problem.
ColdFire V1 Full Chip Simulation Connection • To modify the value of each read or write type, change the value of the associated spin box. • The lowest possible value is 0. • The highest possible value is 127. • To store changes into the currently selected memory block, click the OK button. The Access Details dialog box disappears, and the system clears the Auto Configure checkbox. • To abandon your changes, click the Cancel button.
ColdFire V1 Full Chip Simulation Connection frequency is always the oscillator frequency. Two radio buttons allow you to choose between cycles or true-time display in debugger status bar. Clearing Reset cycles/time makes the debugger accumulate cycles/time other than CPU reset. The true-time unit is the microsecond. The TRUETIME debugger command line command gives the time as a number in microseconds. The OSCFREQUENCY variable displays or sets the oscillator frequency.
ColdFire V1 Full Chip Simulation Connection You can retrieve the following types of information from the Trace window: • Instructions and instruction addresses, • Data address, data value and read/write access type, • True time, cycles and total simulation cycles for each instruction, • Function name and module name for each instruction, • Variable name and module name for each global variable data access. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Warning (ID 12): reading 0x400a'L. Value: 0x0, Memory implemented FCS Warning (ID 12): reading 0x400a'L. Value: 0x0, Memory implemented FCS Warning (ID 12): reading 0x400a'L. Value: 0x0, Memory implemented STOPPING HALTED from unimplemented register at pc = Address: 0x106. Flash CONTROL module not from unimplemented register at pc = Address: 0x106. Flash CONTROL module not from unimplemented register at pc = Address: 0x106.
ColdFire V1 Full Chip Simulation Connection Example: in>warning_setup none in>warning_setup halt in>warning_setup status WARNING_SETUP STATUS: HALT WARNING_SETUP CLMSG: Warning messages appear in the Command window (debugger default). Example: in>warning_setup none in>warning_setup clmsg in>warning_setup status WARNING_SETUP STATUS: CLMSG WARNING_SETUP MSGBOX: A message box appears on warning. Pressing Cancel stops the FCS. Pressing OK resumes the FCS. Figure 28.
ColdFire V1 Full Chip Simulation Connection MESSAGE_HIDE_ID Command The MESSAGE_HIDE_ID command hides a message of a specific ID. Components Debugger engine. Usage MESSAGE_HIDE_ID Example: in>MESSAGE_HIDE_ID 1 in>warning_setup status WARNING_SETUP STATUS: CLMSG Hidden message ID: 1 MESSAGE_SHOW_ID Command The MESSAGE_SHOW_ID shows back the hidden message of a specific ID. Components Debugger engine.
ColdFire V1 Full Chip Simulation Connection FCS and Silicon On-Chip Peripherals Simulation Components Debugger engine. Usage MESSAGE_HIDE_RESET Example: in>MESSAGE_HIDE_RESET Displays all previously hidden messages again. FCS and Silicon On-Chip Peripherals Simulation Full Chip Simulation not only simulates the core instruction set but also the on-chip I/O devices.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities You can see the current mode of Simulation (SAMPLE, CORE or MCU derivative) in the status bar. You can access the Set Derivative dialog box by double clicking on the FCS support entry in the status bar. See Debugger Status Bar with Full Chip Simulation.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Analog Meter Component Use the Analog Meter window component, shown in Figure 28.13, as a basis for userprovided debugger extension components. It displays several input and output controls that can be manipulated with the mouse. NOTE For legacy reasons, the Analog Meter component is called Template. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities IO_LED Component The IO_LED window shown in Figure 28.14 contains eight LEDs used to manipulate and display the values of memory at an address specified in the related dialog box. LED colors are set at the PORT address (red or green) and the LED states are switched on or off at the DDR address (symbolic values). Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities IO_LED Menu The IO LED Menu contains a single item, Setup, that opens the IO_LED Setup dialog box shown in Figure 28.15. Use this dialog box to specify the PORT and DDR addresses. Figure 28.15 LED Setup Dialog Box Associated Context Menu Identical to menu. Drag Out: Nothing can be dragged out. Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities LED Component The LED window shown in Figure 28.16 is a visual utility that displays an arbitrary 8-bit value using an LED bar. Figure 28.16 LED Window The LED component displays the value in a bit-wise manner with the most significant bit to the left and the least significant bit to the right. Bits with value 0 are shown using a green LED, and bits with value 1 use a red LED. Click an LED to toggle its state.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Click OK to accept the specified location. Click Cancel to discard changes and retain the previous location. Example: If the specified location is TargetObject.#210, the LED bar displays the memory byte at address 0x210. Drag Out: Nothing can be dragged out. Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations. Phone Component The Phone window shown in Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Phone Operations Click a phone key and the matching ASCII character of the label on the key is stored at the configured memory cell. Right-click within the component to display a context menu with the same menu entries as the Phone menu in the main debugger menu. Phone Menu The Phone menu contains the Address command, which opens the Phone Address dialog shown in Figure 28.19.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities ADC/DAC Component The ADC_DAC window shown in Figure 28.20 consists of an Analog to Digital (ADC) and a Digital to Analog (DAC) converter. Figure 28.20 ADC/DAC Window Description The ADC/DAC component consists of four units as shown in Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.21 Internal Converter Module Organization and Coupler Connections The fourth unit shows the value of the initial analog signal and value of the DAC output analog signal. This component communicates with the mainframe through three parallel ports of eight bits: • A port with 1 significant bit to indicate the conversion state.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities DAC The DAC is an 8-bit resolution converter whose output connects to the visualization screen. It is only necessary to send a byte into its data port to have its conversion displayed on the visualization screen. This screen only has a 200-point resolution. Sending more than 200 bytes to the converter has no effect. ADC/DAC Menu The ADC/DAC menu shown in Figure 28.22 contains all functions associated with the ADC-DAC component.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities ADC/DAC Setup Dialog Box The dialog box shown in Figure 28.23 allows you to define the port and address or select one port of the five proposed. These ports are used when this component functions with the Programmable IO_Ports Component. Figure 28.23 ADC/DAC - Setup Dialog Box Conversion Parameters Dialog Box The dialog box shown in Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Display Properties Dialog Box This dialog box, shown in Figure 28.25, allows you to modify the display properties from the ADC/DAC component. The Up and Down buttons allow you to define the vertical position of the input and output curves. Two control buttons allow you to change the axes scales. Figure 28.25 Display Properties Dialog Box ADC/DAC Operations To convert a signal from an example application: 1.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities IT_Keyboard Component The 20-key IT_Keyboard shown in Figure 28.26 generates an interruption when a key is pressed. Figure 28.26 IT_Keyboard Window These 20 keys are positioned at the intersection of the five lines, X0 to X4, and the four columns, Y0 to Y3. The resistor R connected to the positive supply gives a logical level 1 when there is no connection (key not pressed).
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Scanning is one method to read such keyboards. Typically, we can proceed as follows (the line being in output and the column in input): • Put a 0 at line X4 (X3, X2, X1, X0 being at 1). • Read the column successively, from Y3 to Y0. • Put a 0 at line X3 (X4, X2, X1, X0 being at 1). • Read the column again from Y3 to Y0.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Interruption Keyboard Setup The Interruption Keyboard Setup dialog box shown in Figure 28.29 allows you to set the address of the lines port, the columns port, and the number of the interruption vector. Figure 28.29 Interruption Keyboard - Setup Dialog Box In the Port address section, for each two ports you can insert an address (in hexadecimal) in the Lines field or select one of the five ports listed in the Columns field.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities LCD Component The LCD Display component message box shown in Figure 28.30 is the LCD utility, which can display one or two lines of 16 characters and show or hide the position cursor. Figure 28.30 LCD Display Message Box The display module consists of two 8-bit-wide parallel couplers: a data port and a control port, as shown in Figure 28.31. These ports communicate with the mainframe. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.32 The DDRAM Controller The Address Counter (AC) is an internal register of the display controller which points at the current address. In the default configuration AC is initialized at 00h and increases when an ASCII character is stored at the address to which AC points. When AC is equal to 1Fh, the next increased value is not 20h, but 40h.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Instruction Listing Figure 28.33 lists the instructions available for the LCD component. Figure 28.33 LCD Display Component Instruction Listing Clear Display • Completely fills the DDRAM with the code 20h (space character) • Puts the address 00h into AC (address counter) • Re-initializes the display if shifts occurred. • Puts the cursor in position 1 on the display first line.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Cursor or Display Shift • Doesn't change the DDRAM content. • Leaves AC in case of a screen shift. • Moves and/or shifts the cursor to the right or left. The cursor goes to the second line if it exceeds the 32nd position of the first line. It also goes to the first line when it exceeds the 32nd position of the second line. • During a screen shift the two lines only move horizontally, the first line never passes to the second one.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities The Initialization Step Initialization requires seven steps. The Function Set instruction must be sent three times successively to fix the exchange data width, and a fourth time to fix the number of lines used. The example shown in Figure 28.35 configures the display module in 8-bit mode, two lines, with the cursor visible and an increase of AC (the cursor moves to the right). Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Table 28.6 LCD Display Menu Description Menu Entry Description Setup Opens the LCD Display dialog box (Setup) LCD Display The LCD Display dialog box shown in Figure 28.37 allows you to set the address of the lines port and columns port. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Monitor Component The Monitor window shown in Figure 28.38 is a basic oscilloscope that displays the result of debugger objects. Figure 28.38 Monitor Window The purpose of this component is to display the results of debugger objects observation in a graphical format (similar to an oscilloscope). The monitor component can save the list of state modifications and associated time in a file. Monitor Menu Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Add Channel The Add Channel dialog box shown in Figure 28.40 allows you to create a new Channel in the monitor. Figure 28.40 Add Channel Dialog Box . In the text area Object to monitor, enter the object name and bit (e.g., TIM12.PORTT bit 0) and click OK to validate or Cancel to exit. Monitor Settings The Monitor Settings dialog box shown in Figure 28.41 allows you to change the time base.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Change Colors The Change Colors dialog box shown in Figure 28.42 allows you to change the colors from the selected Channel. Figure 28.42 Change Colors Dialog Box Select the intended element in the categories field and click Change to open the standard color selection dialog. Click OK to validate or Cancel to exit. Drag Out: Nothing can be dragged out. Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Push Buttons Component The Push Buttons window shown in Figure 28.43 is a basic input device. Figure 28.43 Push Buttons Window Push Buttons Menu Figure 28.44 shows the Push Buttons menu and Table 28.8 describes its entry. Figure 28.44 Push Buttons Menu Table 28.8 Push Buttons Menu Description Menu Entry Description Setup Opens the Push Buttons Setup dialog box.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Push Buttons Setup The Setup dialog box shown in Figure 28.45 allows you to specify the port address (in hexadecimal format) or select the port in the list. Figure 28.45 Setup Dialog Box NOTE The port is an output port for the LEDs component. Use with IO_Ports The component uses the address defined in the Push Buttons Setup dialog box when working with the Programmable IO_Ports Component. Use with LEDs Component Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Drag Out: Nothing can be dragged out. Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations. Programmable IO_Ports Component The Programmable IO_Ports window shown in Figure 28.47 consists of five IO_Ports with eight configurable bits in input or output. In the default configuration all couplers are in input. The graphical interface suggests the state of each one. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Programmable IO_Ports Menu Figure 28.48 shows the Programmable IO_Ports menu and Table 28.9 describes its entry. Figure 28.48 The Programmable IO_Ports Menu Table 28.9 Programmable IO_Ports Menu Description Menu entry Description Setup Opens the Programmable IO_Ports Port Address dialog. Port Address The Port Address dialog box shown in Figure 28.49 allows you to set the port address and control port address. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.50 Coupler Control Register Drag Out: Nothing can be dragged out. Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations. 7-Segments Display Component The 7-Segments Display window shown in Figure 28.51 consists of eight 7-segment display systems. Figure 28.51 7-Segments Display Window Operation of the 7-segments display component is based on the display scanning principle.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Figure 28.52 7-Segments Display Component Constitution 7-Segments Display Menu Figure 28.53 shows the 7-segments display component menu and Table 28.10 describes its entry. Figure 28.53 7-Segments Display Menu Table 28.10 7-Segments Display Menu Description 622 Menu Entry Description Setup Opens the Seven segments display component setup dialog.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities 7-Segments Display Setup The 7-Segments Display dialog box shown in Figure 28.54 allows you to select the display and related value. Figure 28.54 7-Segments Display Dialog Box (Setup) In the Select a display section, you can insert an address (in hexadecimal) to select the display. In the Segment Activation field, you can set the value of this display.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations. Stimulation Component The Debugger also supports I/O Stimulation. Using this feature you can generate (stimulate) interrupts or memory access generated by an external I/O device. NOTE The True Time I/O Stimulation section describes using this feature in detail, with accompanying examples. The Stimulation window component shown in Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Table 28.11 Stimulation Context Menu Description Menu Entry Description Open File Opens a dialog box to load a stimulation file. Execute Starts execution of the input file. Display Switches display of stimulated file on or off. Cache size Opens the 'Size of the Cache' dialog box. Cache Size The Size of the Cache dialog box, shown in Figure 28.58, allows you to define the number of lines displayed in the Stimulation component.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities END 10000000 a = 0; The first line defines the stimulated object. This object is located at address 0x210 and is 1 byte wide. Once 200,000 cycles have executed, debugger accesses the memory location 0x210 periodically 50 times (line 3). First the memory location is set to 128, and then 100000 cycles later, it is set to 4. NOTE The True Time I/O Stimulation section describes using this component in detail, with examples.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Table 28.12 TestTerm Simulated Memory Mapped Registers Register Name Function Register Address BAUD Baud Rate Control 0x0200 SCCR1 Serial Communication Control Register 1 0x0201 SCCR2 Serial Communication Control Register 2 0x0202 SCSR Serial Communication Status Register 0x0203 SCDR Serial Communication Data Register 0x0204 Table 28.13 describes the bits used in the Serial Communication Status Register. Table 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Use Escape sequences to handle redirection of the output data stream. Table 28.14 illustrates the different possible redirections and associated escape sequences where filename is a sequence of characters terminated by a control character (e.g., CR) and is a valid filename. Table 28.14 Redirections and Associated Escape Sequences Escape Sequence Function ESC “h” “1” Output to Terminal window only.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities • TERM_TO_WINDOW (sends output to terminal window), • TERM_TO_BOTH (send output to file and window), • TERM_TO_FILE (send output to file fileName), • TERM_FROM_KEYS (read from keyboard), • TERM_FROM_FILE (read input from file fileName), • TERM_APPEND_BOTH (append output to file and window), • TERM_APPEND_FILE (append output to file fileName). See terminal.h for more information. Using TestTerm Listing 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities empty */ SCI.SCDR = ch; } void PutString(char *str) { while (*str) { PutChar(*str); str++; } } void InitTermIO(void) { SCI.BAUD = 0x30; SCI.SCCR2 = 0x0C; } /* baud rate 9600 at 8 MHz */ /* 8 bit, TE and RE set */ TestTerm Menu The TestTerm component menu shown in Figure 28.60 lets you set the Cache Size in lines. Selecting this menu entry accesses the dialog box shown in Figure 28.61. Figure 28.60 TestTerm Menu Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Drop Into: Nothing can be dropped in. Demo Version Limitations No limitations. Terminal Component Use the Terminal window shown in Figure 28.62 to simulate input and output. It can receive characters from several input devices and send them to other devices. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Configure Terminal Connections The terminal window is very flexible and can redirect characters received from any available input device to any available output device. You can specify these connections by choosing Configure Connections in the context menu of the terminal component. This opens the dialog box shown in Figure 28.64. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities If you have chosen a connection from or to the virtual SCI port, you can also specify, in the Virtual SCI section, which ports to use as virtual SCI ports. This enables you to make a connection to any port in the FCS framework. Input and Output File You can use a file as an input stream for the terminal component or redirect the output to a file.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Table 28.15 Terminal File Control Commands (continued) Escape Sequence Function ESC “h” “6” filename Append to existing output file. ESC “h” “7” filename Append to existing output file and suppress output to terminal display. ESC is the ESC Character (ASCII code 27 decimal). You can give these commands in the data stream sent from the serial port or virtual SCI port, but not from the input file or the keyboard.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Using the Virtual SCI In its default Virtual SCI configuration the terminal component accesses the target through the Object Pool interface. To make the terminal component work in this default configuration, the target must provide an object with the name Sci0. If no Sci0 object is available, no input or output happens. It is possible to check, through the Inspector component, whether the environment currently provides an Sci0 object.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Wagon Component The Wagon window shown in Figure 28.66 simulates a tool machine wagon functionality. Figure 28.66 Wagon Window At first, the wagon is at the left border position. When you click the RUN button, the wagon goes to the right side. Upon arriving at the right border, the wagon returns to the left side. The RESET button positions the wagon at the left border. The STOP button stops the wagon at the current position.
ColdFire V1 Full Chip Simulation Connection FCS Visualization Utilities Wagon Setup When you select Setup from the Wagon Menu, the Ports Address Selection dialog box appears. This is the Wagon component Setup window. Figure 28.68 Ports Address Selection Dialog Box In the Motor Port section, you can insert an address (in hexadecimal) to select the Wagon direction. In the Sensor Port field you can insert an address (in hexadecimal) to select the Wagon position.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation True Time I/O Stimulation The FCS I/O Stimulation component is a facility to trigger I/O events. With the Stimulation component loaded, you can simulate interrupts and register modifications invoked by the hardware. This tutorial introduces and explains examples of stimulation files.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation 2. Choose Simulator > Set > Sim. 3. Choose Component > Open > Io_led Figure 28.71 shows the IO_LED component. Figure 28.71 IO_LED Component Window 4. Choose Component > Open >Template. Figure 28.72 shows the Template component. Figure 28.72 Template Component Window 5. Choose Simulator > Load io_demo.abs. 6. Choose Run > Start/Continue or click the green arrow icon. 7.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation Listing 28.6 IO_Show Procedure in io_demo.c static void IO_Show(void) { for (;;) { // endless loop dir = 1; do { Delay(); PORT_DATA++; } while ((dir == 1) && (PORT_DATA != 255)); dir = -1; do { Delay(); PORT_DATA--; } while ((dir == -1) && (PORT_DATA != 0)); } } Example Program with Periodic Variable Stimulation 1. Choose Simulator > Reset. 2. Choose Simulator > Load Io_demo.abs. 3. Choose Component > Open > Stimulation Figure 28.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation The Stimulation component executing io_var.txt accesses TargetObject at address 0x210 associated with PORT_DATA in the source. You can observe this by watching the Template component. The arrow is not raising steadily, but jumps around. The Stimulation component now handles the value of PORT_DATA. Using an editor, open the file named io_var.txt in the FCS demo directory. This file looks like Listing 28.7. Listing 28.7 io_var.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation Figure 28.74 Source Component Window 8. Activate the Stimulation Window by clicking on it. 9. Choose Stimulation > Execute. 10. Choose Run > Start/Continue. After about 300,000 cycles the FCS stops on the breakpoint in the interrupt routine and highlights the corresponding source line. The interrupt is called. Start the FCS. It stops approximately each 100,000 cycles on the same breakpoint.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation VECTOR 7 Interrupt_Function /* set vector on Interrupt 7 */ If the prm file does not specify the interrupt vector address, the FCS stops when interruption is generated. The exception mnemonic (matching the interrupt vector number) appears in the FCS status bar. The second argument specifies the interrupt priority and the third argument is a free chosen name of the interrupt. The file io_int.txt is used to generate 11 interrupts.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation Detailed Explanation def a = TargetObject.#210.B; This line of code defines a as byte mapped at address 0x210 in TargetObject. def x = TargetObject.#212; This line of code defines x as byte mapped at address 0x212 in TargetObject. Size can be omitted. .B for byte is default. def b = TargetObject.#216.W; This line of code defines b as word (.W) mapped at address 0x216 in TargetObject. def c = TargetObject.#220.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation This line of code reads pbits (three bits in Leds. Port_Register), increments this value and writes it to b. The + in front of the time marker refers to the time relative to the last encountered time value in the Stimulation file. PERIODICAL 100000, 10: This line of code executes the following block 10 times: 10000 a = 128; 30000 RAISE 7, 3, "test_interrupt"; This starts execution 100,000 cycles after the start of the simulation.
ColdFire V1 Full Chip Simulation Connection True Time I/O Stimulation TimedEvent = [ “+” | “#” ] Time AssignmentList. AssignmentList = { Assignment | Exception}. PeriodicEvent = “PERIODICAL” Start “,” NbTimes “:” { PerTimedEvent } “END” . PerTimedEvent = [“+”] Time AssignmentList . Exception = “RAISE” Vector “,” Priority [“,” ArbPrio] [“,” Name] “;” . Assignment = ( ObjectId | ObjectField ) “=” Expression “;”. Name = ““” {character} “”” .
ColdFire V1 Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins • The identifiers declared in IdDeclaration are stored in a table of identifiers and can be also used in Expression. • If “#” is specified, the time is absolute: it is the number of cycles since the Full Chip Simulation was started. • If “+” is specified, the time is relative to the previous time specification.
ColdFire V1 Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins Signal Block Description {signal header} {signal data} Signal Header Description LOOP= TIMEUNIT= TIMEFACTOR= GAIN= DCOFFSET= OPTION=NORMAL|ONLYPOSITIVE|ONLYNEGATIVE|ABSOLUTE Signal Data Description { [
ColdFire V1 Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins TIMEFACTOR=3.6 GAIN=-4.2 DCOFFSET=2.5 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 EOF File Example 2 FILELOOP=INF LOOP=INF TIMEUNIT=NONE TIMEFACTOR=0.5 GAIN=1 DCOFFSET=0 OPTION=NORMAL -5 5 2 8 -0.
ColdFire V1 Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins INF means infinite loop. If a block is INF, scanning stays in this block till the IO is closed or CLOSESIGNALFILE command is executed. If a number is specified, loops that number of times. • TIMEUNIT – CYCLES means that the second data field are cycles. – SECONDS means that the second data field are seconds.
ColdFire V1 Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins SETSIGNALFILE Command SETSIGNALFILE specifies the signal file to use. The SETSIGNALFILE X command creates a virtual SignalGeneratorX module having a SignalPin. The file name can include the path of the file. If no path is given, the Signal component will first search in the current project folder, then in the prog\FCSsignals folder of the debugger installation path.
ColdFire V1 Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins Remarks A message box appears showing the line error in the case of a signal file scripting error. The Signal component is compatible with cycle time duration modification (bus speed change via PLL) and the True Time feature, and automatically reprograms level duration (when duration in seconds is provided or no duration information is provided).
ColdFire V1 Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins WARNING! It is the user’s responsibility to properly connect input pins to output pins without bus or level conflicts. Pinconn Commands CONNECT Connects output pin to input. Syntax CONNECT "", "" Example CONNECT "Pim.PORTHPin0", "Pim.PORTPPin3" DISCONNECT Removes connection between pins. Syntax DISCONNECT "", "" Example DISCONNECT "Pim.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Command Set to Apply Signal on ATD Pin The following example loads the Pinconn and Signal IO components, and creates a signal generator generating the signal described in square_1_5v_1kHz.txt. The generator output signal pin connects to the on-chip ATD via the PAD0 pin. openio Pinconn openio Signal setsignalfile 0 "square_1_5v_1kHz.txt" connect "SignalGenerator0.SignalPin","Atd0.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials 6. Change the directory if you want (Location > Set) 7. Check C for the language and click Next. 8. Click Next again (you do not want to add additional files) 9. Choose Processor Expert and click Next. 10. Click Finish to stay with the default options. The CodeWarrior software creates a new project using the wizard, and Processor Expert is available. During this process, several windows may appear, allowing you to select additional options.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Step 3 - Target CPU Window The Target CPU window in the center shows a footprint of the processor selected for the development. You may increase the size of the Target CPU window to display more details. In the device, we see the different on-chip modules such as CPU, Timer, and ADC. Modules with an icon attached to them are modules used by the application.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Standard and Professional Editions offer a wider range of hardware and software beans than the Special Edition. • Select Bean Categories > CPU internal peripherals > Communication > AsynchroSerial • In the context menu select Add Bean to the Current Project to add an instance of the AsynchroSerial bean to the project. Figure 28.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Figure 28.78 Project Window - Processor Expert Tab Under Beans you can find the previously created bean with the name AS1:AsynchroSerial. Step 6 - Bean Inspector AS1:AsynchroSerial Window In this window you can modify the behavior of the bean to suit your needs. General settings are in the Properties tab. Software drivers are located under the tab Methods and Events. • Select Properties tab • Enter a proper baud rate.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Figure 28.79 Bean Inspector Window Step 7 - Generation of Driver Code We are going to generate the code for the I/O drivers and the files for the user code. • Select the Make icon in the Project Manager window (or the menu bar Project > Make or [F7]). Processor Expert shows several messages. One message indicates that we have started the code generation. The second message shows the progress with the information processed and the code generated.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Step 9 - Entering User Code 1. Open the user module MyGuessTheNumber.C 2. Insert the following code before the main routine: #include
ColdFire V1 Full Chip Simulation Connection FCS Tutorials void main(void) { /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ /*Write your code here*/ GuessTheNumber(); /***Processor Expert end of main routine. DON'T MODIFY THIS CODE!***/ for(;;); /***Processor Expert end of main routine. DON'T WRITE CODE BELOW!***/ } /*** End of main routine.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Figure 28.80 Terminal Configuration Dialog 4. Select the Save icon in the debugger (or the menu bar File > Save Configuration) to save the window layout. 5. Select the Run icon in the debugger (or the menu bar Run > Start/Continue or [F5]). 6. Enter numbers in the terminal window to guess the right number.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Figure 28.81 Debugger Main Window - Final Application PWM Sample This application uses the PWM. With the final application you will be able to change the period and duty time of the PWM and see the changes displayed in a chart. Step 1 - Environment Setup • The tutorial uses Processor Expert. You can get a free Processor Expert license (Special Edition) from www.codewarrior.com. Step 2 - Creating Project 1. Launch the CodeWarrior IDE 2.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials 5. Enter a project name like PWM_Sample 6. Change the directory if you want (Location > Set) 7. Check C for the language and click Next. 8. Click Next again (you do not want to add additional files) 9. Choose Processor Expert and click Next. 10. Click Finish to keep the default options. The debugger creates a new project using the wizard and Processor Expert is available.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Step 6 - Bean Inspector PWM1.PWM In the Bean Inspector window you can modify the behavior of the bean to suit your needs. General settings can be changed in the Properties tab. Software drivers are found under the Methods and Events tabs. • Select Properties tab • Select Period and enter 200 ms • Select Starting pulse width and enter 10 ms Step 7 - Generate Driver Code Now generate the code for the I/O drivers and the files for the user code.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ /*Write your code here*/ for(;;) { (void)PWM1_SetRatio16(pwmRatio); } /***Processor Expert end of main routine. DON'T MODIFY THIS CODE!***/ for(;;); /***Processor Expert end of main routine. DON'T WRITE CODE BELOW!***/ } /*** End of main routine.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials 6. Select Target Periodical for Type of Unit 7. Select 1000 for Unit Size 8. Select 2000 for Numbers of Units 9. Leave all others on default. Duty Time Bar Properties Now add a bar to change the duty time. 1. Right mouse click > Add New Instrument > Bar 2. Double click on the Bar to see the Bar Properties. 3. Select Variable for Kind of Port 4. Select pwmRatio for Port to Display 5. Select 65535 for High Display Value 6. Leave all others on default.
ColdFire V1 Full Chip Simulation Connection FCS Tutorials Figure 28.
29 ColdFire P&E Multilink/ Cyclone Pro Connection This chapter guides you through the first steps toward debugging with the CodeWarrior™ IDE and the P&E Multilink/Cyclone Pro connection for ColdFire®. It does not replace all the additional documentation provided in this manual, but gives you a good starting point. P&E Multilink/Cyclone Pro Technical Considerations The 8/16/32 bits debugger (and then the CodeWarrior IDE) might be connected to ColdFire hardware using the P&E Multilink Cyclone Pro connection.
ColdFire P&E Multilink/Cyclone Pro Connection First Steps Using the Stationery Wizard First Steps Using the Stationery Wizard To take the first steps toward debugging with the CodeWarrior IDE and the P&E 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. 4.
ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project First Steps From Within an Existing Project To take the first steps toward debugging with the CodeWarrior IDE and setting the P&E Multilink/Cyclone Pro connection from within an existing debugging project: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. Open the project. 3. Choose Project > Debug to start the debugger. 4.
ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project 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.
ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project P&E Multilink/Cyclone Pro Menu Options Once the P&E Multilink/Cyclone Pro connection is set, the connection menu entry in the debugger main toolbar changes to CFMultilinkCyclonePro. Figure 29.5 P&E Multilink/Cyclone Pro Menu Options Setup Select MultilinkCyclonePro > Setup to display the P&E Multilink/Cyclone Pro Setup Dialog Box.
ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project Trigger Module Settings Select MultilinkCyclonePro > 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. Bus Trace Select MultilinkCyclonePro > Bus Trace to open the Trace component window within the debugger main window.
ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project When checking “Program trim data open application loading”, the P&E driver calculates the data to be Flashed to trim the device according to trimming information provided in the Communication Settings dialog. The debugger programs automatically this data to the device Flash when an application is loaded.
ColdFire P&E Multilink/Cyclone Pro Connection First Steps From Within an Existing Project 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.
30 SofTec ColdFire Connection This chapter guides you through the first steps toward debugging with the CodeWarrior™ IDE and the SofTec ColdFire connection. It does not replace all the additional documentation provided in this manual, but gives you a good starting point. SofTec ColdFire Technical Considerations The 8/16/32 bits debugger (and then the CodeWarrior IDE) might be connected to ColdFire® hardware using the SofTec ColdFire.
SofTec ColdFire Connection First Steps Using the Stationery Wizard First Steps Using the Stationery Wizard To take the first steps toward debugging with the CodeWarrior IDE and the SofTec inDART-ColdFire 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. 4.
SofTec ColdFire Connection First Steps From Within an Existing Project First Steps From Within an Existing Project To take the first steps toward debugging with the CodeWarrior IDE and setting the SofTec ColdFire connection from within an existing debugging project: 1. Run the CodeWarrior IDE with the shortcut created in the program group. 2. Open the project. 3. Choose Project > Debug to start the debugger. 4.
SofTec ColdFire Connection 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.
SofTec ColdFire Connection First Steps From Within an Existing Project SofTec ColdFire Menu Options Once the SofTec ColdFire connection is set, the connection menu entry in the debugger main toolbar changes to SofTec-MCF51. Figure 30.5 SofTec-MCF51 Menu Options Setup Select SofTec-MCF51 > Setup to display the SofTec Coldfire Setup Dialog Box. Communication Select SofTec-MCF51 > Communication to display the Target Connection Dialog Box.
SofTec ColdFire Connection First Steps From Within an Existing Project Flash Select SofTec-MCF51 > Flash to open the Non-Volatile Memory Control dialog box. For more information see Flash Programming. About Option Select SofTec-MCF51 > About to display the About Dialog Box. Bus Trace Select SofTec-MCF51 > Bus Trace to open the Trace component window within the debugger main window. Refer to the Debugger ColdFire On-chip DBG Module User Interface manual for all related information.
SofTec ColdFire Connection First Steps From Within an Existing Project provided in the Communication Settings dialog. The debugger programs automatically this data to the device Flash when an application is loaded. When checking “Enable Terminal Printf Support”, the debugger handles hardware background breaks and checks if the application is broadcasting a message to the debugger. In this case, the message is forwarded to the Terminal window, and the debugger runs again the target application.
SofTec ColdFire Connection First Steps From Within an Existing Project Press the Communication Settings button in this window to open the Communication Settings Dialog Box. Figure 30.8 Target Connection Dialog Box Communication Settings Dialog Box The BDC Clock (CLKSW) group is intended to setup the best BDC synchronization between the SofTec inDART-ColdFire interface and the target processor.
SofTec ColdFire Connection First Steps From Within an Existing Project The dialog may slightly differ according to cable model. For additional options set up within this dialog, refer to the inDART®-ColdFire In-Circuit Debugger/Programmer for Freescale ColdFire Family FLASH Devices User’s Manual from SofTec. Figure 30.9 Communication Settings Dialog Box Set Derivative Dialog Box This dialog box is used to set up a derivative. The list menu can be expanded to select another ColdFire derivative. Figure 30.
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.
31 ColdFire On-Chip DBG Module The ColdFire® derivatives featuring an on-chip debugger (DBG) module require a debugger graphical user interface to setup this module and take full advantage of this enhanced debugging feature. This manual describes the DBG module user interface.
ColdFire On-Chip DBG Module Context Menu Entries in Source, Data, Assembly and Memory Windows Context Menu Entries in Source, Data, Assembly and Memory Windows In the Data and Memory windows, only the Trigger C is available in the context sensitive context menu, to set watchpoints. In the Source and Assembly windows context sensitive context menu, Trigger A and B can be selected to set breakpoints.
ColdFire On-Chip DBG Module Trigger Module Settings Window Trigger Module Settings Window This window can be opened from context sensitive context menus in the Source, Data, Memory and Assembly component windows, from the Connection menu and also when clicking on a Status Bar displayed mode (Automatic, by default). The on-chip DBG module can be fully controlled from within this window. The dialog is designed with three tabs.
ColdFire On-Chip DBG Module Trigger Module Settings Window • A User Triggers mode, which provides two complex breakpoints, triggers A and B, one complex watchpoint, trigger C, and two spares classic hardware breakpoints that can bet as usual (not in the dialog). • A Profile and Coverage mode, which provides code profiling and coverage information when opening the Profiler and Coverage components. Note that these features are not real time.
ColdFire On-Chip DBG Module Trigger Module Settings Window Figure 31.4 Trace Settings for Automatic mode Sync PC DBG Feature The Sync PC DBG feature forces the DBG module to capture the current program counter at regular intervals and record this PC in the on-chip DBG buffer/FIFO. This is disabled by default but is extremely useful when debugging program code loops without changes of flow.
ColdFire On-Chip DBG Module Trigger Module Settings Window User Triggers mode When choosing the User Triggers mode, the full strength of the on-chip DBG module can be exploited in the debugger, providing emulator functionalities. The A, B and C tabs become accessible to give exact triggering information. Triggers A and B hardware breakpoints can be set using the Set Trigger button. Refer to HCS08 OnChip DBG Module for information about the Browse for Trigger interface.
ColdFire On-Chip DBG Module Trigger Module Settings Window Figure 31.7 Trigger Stop Condition sequencer The trigger C provides specific data access options. When setting the Enable Data Compare edit box, additional fields are accessible to specify the data to compare, the mask, and the bus information to check for compare in the Compare Mode list menu. The watchpoint size can be edited within the Set Trigger/Browse for Trigger interface. Figure 31.
ColdFire On-Chip DBG Module Trigger Module Settings Window Expert Mode The Expert mode is a “Do It Yourself” interface to set the on-chip DBG module. In that case, the debugger does not use any on-chip module resources. Refer to silicon specifications to correctly set up the DBG module. The debugger still provides the Trace rebuild window and support to display, when available, the results of the captured data. Enhanced setup The ABxR (hex) edit box setup combines ABHR and ABLR registers setup.
ColdFire On-Chip DBG Module Trigger Module Settings Window Figure 31.10 Expert Trigger Settings: CSR2 interactive translation of start/stop condition General Settings Automatically analyze the FIFO content: When the debugger halts for any reason with the Trace window open, the DBG module results are automatically analyzed and displayed in the Trace window. If the Trace window is closed, the DBG user interface performs no result analysis except trigger flags reported in the status bar.
ColdFire On-Chip DBG Module Trigger Module Settings Window Figure 31.
Book VI - Connection Common Features Book VI Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment.
Book VI Contents 698 Microcontrollers Debugger Manual
32 Flash Programming Non-Volatile Memory Control Utility Introduction Writing to Flash modules, EEPROMs, or other non-volatile memory modules in modern MCUs requires special algorithms from microprocessor designers. Before you write to Flash devices, you must erase them. Many Flash devices need initialization to become accessible; some devices may need write protection removed.
Flash Programming Automated Application Programming Figure 32.1 Flash Programming Acceptance Dialog Box Select the OK button to launch background Flash commands. These commands arm programming, load/program an application file, then disarm programming, and are described later in this chapter. Check the Do not display this message anymore for this project checkbox to remove the Warning message for the current project.
Flash Programming Automated Application Programming Advanced Options: Erase Prevention Select the Advanced button in the Load tab of the debugger Preferences dialog box to open the following selection dialog box. Figure 32.4 Programming Selection The dialog box lists all the non-volatile memory modules registered by the debugger for the currently selected processor device. Click once on a line to select an item (highlighted in blue) and click again on a selected item to deselect it.
Flash Programming NVMC Graphical User Interface NVMC Graphical User Interface The NVMC utility is integrated into the debugger as an extension of certain debugger connections. If the NVMC utility is available, your connection menu includes a Flash selection. Figure 32.5 HCS08 Open Source BDM Connection Menu Example Modules and Module States In the following sections, the expression available modules means all the FLASH or EEPROM on-chip modules that the NVMC dialog box lists.
Flash Programming NVMC Graphical User Interface • Disabled — A disabled module is not active on the chip, so programming and reading are not possible. The usual control for enabling or disabling a module is setting/clearing a flag in a special register. Note that a few modules always must be active. You may not disable such modules. • Blank — A blank module is empty of code: you can program its full address range. (Each blank byte contains the value 0xFF or 0x00, depending on hardware.
Flash Programming NVMC Graphical User Interface Figure 32.
Flash Programming NVMC Graphical User Interface The second checkbox of the Configuration group is Save and restore workspace content. If this checkbox is clear, Flash programming applications overwrite any data in RAM. Check this box to save the current RAM data. Saving RAM data slows down the NVMC. Checking this checkbox is equivalent to entering the SAVECONTEXT and LOADCONTEXT commands. Flash Module Handling Flash parameter files (which have the extension .
Flash Programming NVMC Graphical User Interface NOTE You simply click on a module in the list to select and/or use Select All/ Unselect All buttons to adjust your selection. But selecting and unselecting are not automatic from the command line. 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.
Flash Programming NVMC Graphical User Interface Another way to load an .FPP parameter file is by clicking the Browse button. This brings up a standard Open dialog box, which you can use to select the file. When you do so, the Open dialog box disappears, and the NVMC utility loads the file, automatically clearing the Auto select according to MCUID: checkbox. In case of an error during loading, the utility displays an appropriate message. Figure 32.
Flash Programming NVMC Graphical User Interface Loading an Application in Flash The Load button and the Load menu selection perform the same function. Use either of these controls to bring up the Load Executable File dialog box, which lets you select the file to be loaded. The Load Executable File dialog box lists the executable files that relate to blocks selected in the NVMC dialog box. Figure 32.
Flash Programming Hardware Considerations Hardware Considerations This section consists of hardware-specific information about current .FPP files. New .FPP file features are explained in release notes. NOTE The Flash programming release note, in the toolkit installation documentation, contains the latest information about .FPP files. HCS08 CPU devices Typically, one or two Flash modules are listed: FLASH and SMALL_FLASH.
Flash Programming NVMC Commands NVMC Commands The following Flash commands can be issued through the debugger Command component window, as shown in the figure below. Figure 32.10 NVMC Commands In Command Window FLASH Short Description Displays Flash modules, loads .fpp file, or performs Flash operations.
Flash Programming NVMC Commands FLASH INIT |AUTOID loads the parameter file according to fileName (you can specify the path). If this command includes AUTOID, the MCUID determines the parameter file (autocheck is checked in the NVMC dialog box). FLASH RELEASE releases the current FPP file loaded by the Flash programmer. Therefore the Flash programmer address mapping is disabled and no non-volatile memory is handled.
Flash Programming NVMC Commands FLASH LOADCONTEX restores current buffer content into the MCU SRAM. FLASH OVLBACKUP backups application code overlap with programming runtime/ algorithm (RAM preset for debugging). Execute the command before loading the application/file. FLASH OVLRESTORE restores/installs (writes in RAM) the application code overlap with programming runtime/algorithm. Execute the command after the last FLASH command. FLASH PROTOCOLON displays the Flash programmer debug protocol.
Flash Programming NVMC Commands Examples FLASH ERASE 2,7 This erases memory blocks 2 and 7. FLASH ERASE 2,4-6 8 This erases memory blocks 2, 4, 5, 6, and 8. FLASH ERASE This erases all available memory blocks. While Flash modules are armed, execution of user code is not possible. If you enter a command such as run, step, or so forth, a message box prompts you to disarm the modules or cancel the command. If you click the OK button, the system disarms all Flash modules, then executes your command.
Flash Programming NVMC Commands 714 Microcontrollers Debugger Manual
33 Debugging Memory Map Introduction The Debugging Memory Map (DMM) is a software Manager handling all debugger accesses to device/chip memory and also handling memory data caching. The DMM provides a global approach for all different CPU families/cores, each family having its own method for memory access and its own memory on-chip layout and memory address range priorities. The DMM gets all memory read and write calls from the debugger.
Debugging Memory Map The DMM GUI Figure 33.1 DMM Graphical User Interface The DMM GUI shows a list of memory address ranges (called Modules in this manual) defined to access the device/chip memory. The Type column tells the type of memory for the defined memory address range given in the Range column. The Active column indicates whether the defined range is active or mapped by the DMM. If No, the DMM treats the range as if it is not defined at all.
Debugging Memory Map The DMM GUI Pressing the Revert to Default button removes (after a warning dialog) the current setup (usually saved in the current project) and retrieves the default (factory) setup from an internal database. Edition dialog and memory range edition Figure 33.2 shows the DMM Memory map dialog box. Figure 33.2 DMM Memory Address Range Edition Dialog box The Enable memory module option checkbox maps the module/memory range in the debugger.
Debugging Memory Map The DMM GUI Access kind The Access Kind list menu provides a way to indicate that the memory range is read/write (R/W), read only, write only or none of these. When defined as read only, the range is never written by the debugger. When defined as write only, the range is never read by the debugger. When defined as none, the range is never read or written by the debugger. This is internal equivalent as not defining the range in the DMM dialog.
Debugging Memory Map The DMM GUI Figure 33.3 DMM Type selection NOTE CPU core-specific memory types and Priorities are listed at the end of this section. Priorities The Priority list menu provides all types of memory overlap priorities available for a processor core. The debugger can have a bigger priority (highest (debugger)) to set an upper address range that can overlap an on-chip address range. This makes a debugger display filter (for a Memory window), e.g.
Debugging Memory Map The DMM GUI Memory Read Caching The Refresh memory when halting option controls the debugger memory cache. When this option is checked, internal images/caches of memory data are always deleted and the data is always retrieved from hardware when required by the debugger. When unchecked (usually by default for Non-Volatile Memory areas), the DMM keeps a copy of the data and does not read or retrieve the data from hardware until next application loading/ programming.
Debugging Memory Map The DMM GUI CPU Core Types and Priorities This section details the available cores and their respective types and priorities. HCS08 CPU The following types and priorities are available for the HCS08 CPU. Priorities: • highest (debugger): a high debugger priority that can be used by the user or defined for the debugger, typically to protect a memory area from being read.
Debugging Memory Map DMM Commands NOTE By factory/default setup, HCS08 DBG08 Fifo Registers have been protected to reserve the DBG08 Fifo Reading for the debugger DBG interface. Removing this protection leads to incorrect program flow rebuild. ColdFire CPU The following types and priorities are available for the ColdFire CPU. Priorities: • highest (debugger): a high debugger priority that can be used by the user or defined for the debugger; typically used to protect a memory area from being read.
Debugging Memory Map DMM Commands List of commands DMM DMM ADD DMM DEL DMM SAVE DMM DELETEALLMODULES DMM RELEASECACHES DMM CACHINGON|CACHINGOFF DMM WRITEREADBACKON|WRITEREADBACKOFF DMM HCS12MERHANDLINGON|HCS12MERHANDLINGOFF DMM OPENGUI [mcuid] DMM SETAHEADREADSIZE DMM command Syntax DMM Purpose Displays in the Command window the current DMM "Memory Types", "Overlap Prio
Debugging Memory Map DMM Commands
the start address of the memory range the size of the memory range a long value for the DMM to handle the memory range (duplicated handled is not allowed). WARNING! User defined handles must be a value superior or equal to 100. a value corresponding to a memory type handle, as given/listed with the DMM command. a "0" or "1" value, "0" forcing the memory range to be refreshed after each debugger halting.Debugging Memory Map DMM Commands DMM SAVE command Syntax DMM SAVE with , a part/device MCUID value in range $0-$FFFF. Purpose Saves the DMM current setup in current project.ini file, under "DMM_MCUIDxxxx_MODULEn=..." keys. DMM DELETEALLMODULES command Syntax DMM DELETEALLMODULES Purpose Removes all current DMM memory range modules. Useful to start a scripted DMM setup.
Debugging Memory Map DMM Commands DMM CACHINGON command Syntax DMM CACHINGON Purpose Data caching is engaged (default DMM setup). No refresh on halting is active for memory range modules defined with this option. DMM CACHINGOFF command Syntax DMM CACHINGOFF Purpose Data caching is disabled. The debugger flushes all caches even for memory range modules defined without this option. Each time the debugger halts, the memory data are retrieve from the target hardware for all memory range modules.
Debugging Memory Map DMM Commands DMM WRITEREADBACKOFF command Syntax DMM WRITEREADBACKOFF Purpose DMM HCS12MERHANDLINGON command Syntax DMM HCS12MERHANDLINGON Purpose Not relevant for HCS08 and ColdFire cores. Enables the handling of Memory Expansion Registers for HCS12 devices, i.e. INITRM, INITRG and INITEE. The DMM remaps automatically memory range module addresses according to the real value of these registers when halting. NOTE The debugger does not poll the MER registers while running.
Debugging Memory Map DMM Commands DMM OPENGUI command Syntax DMM OPENGUI [mcuid] with , a part/device MCUID value in range $0-$FFFF. Purpose Opens the DMM Graphical User Interface. Note that the MCUID parameter is not mandatory.
Book VII - Commands Book VII Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment. This book, the Debugger Commands, defines the HC(S)08 and RS08 commands.
Book VII Contents 730 Microcontrollers Debugger Manual
34 Debugger Engine Commands Commands Overview The debugger supports scripting with the use of commands and command files. When you script the debugger, you can automate repetitive, time-consuming, or complex tasks. You do not need to use or have knowledge of commands to run the Simulator/Debugger. However these commands are useful for editing debugger command files, for example, after a recording session, to generate your own command files, or to set up your applications and targets, etc.
Debugger Engine Commands Commands Overview Command Syntax To display the syntax of a command, type the command followed by a question mark. Syntax Example: in>printf? PRINTF (, , , ...) Available Command Lists Commands described on the following pages are sorted into 5 groups, according to their specific actions or targets. However, these groups have no relevance in the use of these commands. A list of all commands in their respective group is given below.
Debugger Engine Commands Commands Overview Table 34.
Debugger Engine Commands Commands Overview Base Commands Base commands are used to monitor the Simulator/Debugger target execution. Target input/output files, target execution control, direct memory editing, breakpoint management and CPU register setup are handled by these commands. Base commands can be executed independent of components that are open. Table 34.2 contains all available Base commands. Table 34.
Debugger Engine Commands Commands Overview Table 34.
Debugger Engine Commands Commands Overview Environment Commands Simulator/Debugger environment commands are used to monitor the debugger environment, specific component window layouts and framework applications and targets. Table 34.3 contains all available Environment commands. t Table 34.
Debugger Engine Commands Commands Overview Component Commands Component common commands are used to monitor component behaviors. They are common to more than one component. Table 34.4 contains all available Component commands. Table 34.
Debugger Engine Commands Commands Overview Component Specific Commands Component specific commands are associated with specific components. Table 34.5 contains all available Component Specific commands. Table 34.
Debugger Engine Commands Commands Overview Table 34.
Debugger Engine Commands Commands Overview Command Syntax Terms address A number matching a memory address. This number must be in the ANSI format (i.e. $ or 0x for hexadecimal value, 0 for octal, etc.). Example: 255, 0377, 0xFF, $FF NOTE address can also be an expression if constant address is not specifically mentioned in the command description. An expression can be: Global variables of application, I/O registers defined in DEFAULT.REG, definitions in the command line, or numerical constants.
Debugger Engine Commands Commands Overview Example: d:/demo/myfile.txt Example: layout.hwl Example: d:/work/project.hwc component The name of a debugger component. A list of all debugger components is given by choosing Component > Open. The parser is case insensitive. Example: Memory Example: SoUrCe Module Names Correct module names are displayed in the Module component window. Make sure that the module name of a command that you implement is correct: If the .
Debugger Engine Commands Debugger Commands Debugger Commands The commands available when you use the Simulator/Debugger are defined on the following pages. A The A command assigns an expression to an existing variable. The quoted expression must be used for string and enum expressions. Usage A variable = value or A variable = "value" Components Debugger engine. Example: in>a counter=8 The variable counter is now equal to 8.
Debugger Engine Commands Debugger Commands Example: in>ACTIVATE Memory Activates the Memory Component and brings the window to the foreground. ADDXPR The ADDXPR command adds a new expression in the data component. Usage ADDXPR “expression” Where the parameter expression is an expression to be added and evaluated in the data component. Components Data component. Example: in>ADDXPR “counter + 10” The expression “counter +10” is added in the data component.
Debugger Engine Commands Debugger Commands Usage ATTRIBUTES list where list=command{,command}) command=CACHESIZE value Example: command < ATTRIBUTES 2000 In the Procedure Component The ATTRIBUTES command allows you to set the display and state options of the Procedure component window. The VALUES and TYPES commands display or hide the Values or Types of the parameters.
Debugger Engine Commands Debugger Commands where list=command{,command} command= ADR (ON|OFF) | SMEM range | SPC address | CODE(ON|OFF) | ABSADR (ON|OFF) | TOPPC address | SYMB (ON|OFF) NOTE Also refer to SMEM and SPC command descriptions for more detail about these commands. The SPC command is similar to the TOPPC command but also highlights the code and does not scroll to the top of the component window.
Debugger Engine Commands Debugger Commands The HSCROLLPOS command sets the position of the horizontal scroll box (the hposition value is in columns: a column is about a tenth of the greatest register or bitfield width). hposition is the absolute horizontal scroll position. The value 0 represents the first position on the left. The parameters vposition and hposition can be constant expressions or symbols defined with the DEFINE command.
Debugger Engine Commands Debugger Commands Scrolls three positions down. The third line of registers is displayed on the top of the register component. in>Register < ATTRIBUTES VSCROLLPOS 0 Returns to the default display. The first line of registers is displayed on the top of the register component. in>DEFINE vpos = 5 in>Register < ATTRIBUTES HSCROLLPOS vpos Scrolls five positions right. The second column of registers is displayed on the left of the register component.
Debugger Engine Commands Debugger Commands • ATTRIBUTES SMOD ~ Drag and drop from Module component to Source component. • ATTRIBUTES SPROC ~ Drag and drop from Procedure component to Source component. • ATTRIBUTES MARKS ~ Select menu Source > Marks.
Debugger Engine Commands Debugger Commands The MODE command selects the display mode of variables. • In Automatic mode (default), variables are updated when the target is stopped. Variables from the currently executed module or procedure are displayed in the data component. Variables are updated when target is stopped. • In Locked and Frozen mode, variables from a specific module are displayed in the data component. The same variables are always displayed in the data component.
Debugger Engine Commands Debugger Commands • ATTRIBUTES UPDATERATE ~ Select menu Data > Mode > Periodical • ATTRIBUTES COMPLEMENT ~ Select menu Data > Format • ATTRIBUTES NAMEWIDTH ~ Select menu Data > Options > Name Width Example Data:1 < ATTRIBUTES MODE FROZEN In Data:1 (global variables), variables update is frozen mode. Variables are not refreshed when the application is running.
Debugger Engine Commands Debugger Commands – signed decimal, – unsigned decimal or – symbolic. • The COMPLEMENT command sets the display complement format of memory values: one sets the first complement (each bit is reversed), none deselects the first complement. • The MODE command selects the display mode of memory words. – In Automatic mode (default), memory words are updated when the target is stopped. Memory words from the currently executed module or procedure are displayed in the Memory component.
Debugger Engine Commands Debugger Commands Usage ATTRIBUTES list where list=command{,command}) command=FORMAT(bin|oct|hex|signed|unsigned) | WORD number | ADR (ON|OFF) | ASC (ON|OFF) | ADDRESS address | SPC address | SMEM range | SMOD module | MODE (automatic|periodical| frozen) | UPDATERATE rate | COMPLEMENT (NONE|ONE) Example: Memory < ATTRIBUTES ASC OFF, ADR OFF ASCII dump and addresses are removed from the Memory component window.
Debugger Engine Commands Debugger Commands The COLUMNWIDTH command sets the width of one column entry on the right pane of the Inspector Window. The first parameter (columnname) specifies which column.
Debugger Engine Commands Debugger Commands The COLLAPSE command folds one item. The item name must be given. The following command folds the TargetObject: inspect < ATTRIBUTES COLLAPSE “Object Pool” TargetObject The SELECT command shows the information of the specified item on the right pane. The following command shows all Objects attached to the TargetObject: inspect < ATTRIBUTES SELECT “Object Pool” TargetObject The SPLIT command sets the position of the split line between the left and right pane.
Debugger Engine Commands Debugger Commands Equivalent Operations • ATTRIBUTES COLUMNWIDTH ~ Modify column width with the mouse. • ATTRIBUTES EXPAND ~ Expand any item with the mouse. • ATTRIBUTES COLLAPSE ~ Collapse the specified item with the mouse. • ATTRIBUTES SELECT ~ Click on the specified item to select it. • ATTRIBUTES SPLIT ~ Move the split line between the panes with the mouse. • ATTRIBUTES MAXELEM ~ Select max. Elements... from the context menu.
Debugger Engine Commands Debugger Commands AUTOSIZE AUTOSIZE enables/disables windows autosizing. When on, the size of component windows are automatically adapted to the Simulator/Debugger main window when it is resized. Usage AUTOSIZE on|off Components Debugger engine. Example: in>AUTOSIZE off Windows autosizing is disabled. BASE In the Profiler component, the BASE command sets the profiler base to code (total code) or module (each module code). Usage BASE code|module Components Profiler component.
Debugger Engine Commands Debugger Commands BC BC deletes a breakpoint at the specified address. When * is specified, all breakpoints are deleted. You can point to the breakpoint in the Assembly or Source component window, rightclick and choose Delete Breakpoint in the context menu, or open the ControlPoints Window, select the breakpoint from the list and click Delete. NOTE Correct module names are displayed in the Module component window. Make sure that the module name of your command is correct: if the .
Debugger Engine Commands Debugger Commands BCKCOLOR BCKCOLOR sets the background color. The background color defined with the BCKCOLOR command is valid for all component windows. Avoid using the same color for the font and background, otherwise text in the component windows is not visible. Also avoid using colors that have a specific meaning in the command line window. These colors are: Red: used to display error messages. Blue: used to echo commands. Green: used to display asynchronous events.
Debugger Engine Commands Debugger Commands Components Debugger engine. Example: in>BD Fibonacci 0x805c T Fibonacci 0x8072 P Fibonacci 0x8074 T main 0x8099 T One permanent and two temporary breakpoints are set in the function Fibonacci, and one temporary breakpoint is set in the main function. NOTE From the list, it is not possible to know if a breakpoint is disabled or not. BS BS sets a temporary (T) or a permanent (P) breakpoint at the specified address.
Debugger Engine Commands Debugger Commands Usage BS address| function [{mark}] [P|T[ state]][;cond=”condition”[ state]] [;cmd=”command”[ state]][;cur=current[ inter=interval]] [;cdSz=codeSize[ srSz=sourceSize]] address is the address where the breakpoint is to be set. This address is specified in ANSI C format. address can also be replaced by an expression as shown in the example below. function is the name of the function in which to set the breakpoint.
Debugger Engine Commands Debugger Commands Components Debugger engine. Example: in>BS 0x8000 T This command sets a temporary breakpoint at the address 0x8000. in>BS $8000 This command sets a permanent breakpoint at the address 0x8000. BS &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 set.
Debugger Engine Commands Debugger Commands Components Debugger engine. Example: in>cf \util\config.cmd Loads the config command file. CD The CD command changes the current working directory to the directory specified in path. When the command is entered with no parameter, the current directory is displayed. The directory specified in the CD command must be a valid directory, that exists and is accessible from the PC.
Debugger Engine Commands Debugger Commands The new project directory is C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\prog CF 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.
Debugger Engine Commands Debugger Commands Example Without “;C” Option: If a command1.txt file contains: bckcolor green cf command2.txt bckcolor white If a command2.txt file contains: bckcolor red Execution: in>cf command1.txt executing command1.txt !bckcolor green !cf command2.txt executing command2.txt 1!bckcolor red 1! 1! done command2.txt !bckcolor white ! done command1.txt Example With “;C” Option: If a command1.txt file contains: bckcolor green cf command2.
Debugger Engine Commands Debugger Commands If a command2.txt file contains: bckcolor red Execution: in>cf command1.txt executing command1.txt !bckcolor green !cf command2.txt ;C executing command2.txt 1!bckcolor red 1! 1! done command2.txt done command1.txt CLOCK In the SoftTrace component, the CLOCK command sets the clock speed. Usage CLOCK frequency Where number is a decimal number, which is the CPU frequency in Hertz. Components SoftTrace component.
Debugger Engine Commands Debugger Commands CLOSE The CLOSE command is used to close a component. Component names are: Assembly, Command, Coverage, Data, Inspect, IO_Led, Led, Memory, Module, Phone, Procedure, Profiler, Recorder, Register, SoftTrace, Source, Stimulation. Usage CLOSE component | * where * means “all components”. Components Debugger engine. Example: in>CLOSE Memory The Memory component window is closed (unloaded).
Debugger Engine Commands Debugger Commands CMDFILE The CMDFILE command allows you to define all target specific commands in a command file. For example, startup, preload, reset, and path of this file. Usage CMDFILE ON|OFF [""] Components Simulator/target engine. Example: in>cmdfile postload on "c:\temp\myposloadfile.cmd" The myposloadfile command file executes after loading the absolute file.
Debugger Engine Commands Debugger Commands Example: in>cr /Freescale/demo/myrecord.txt ;A The myrecord.txt file is opened in “Append” mode for a recording session. CYCLE In the SoftTrace component, the CYCLE command displays or hides cycles. When cycle is off, milliseconds (ms) are displayed. Usage CYCLE on|off Components Softtrace component. Example: in>CYCLE on DASM The DASM command displays the assembler code lines of an application, starting at the address given in the parameter.
Debugger Engine Commands Debugger Commands When address and range are omitted, disassembly begins at the address of the instruction that follows the last instruction that has been disassembled by the most recent DASM command. If this is the first DASM command of a session, disassembly begins at the current address in the program counter. ;OBJ: Displays assembler code in hexadecimal. Components Debugger engine.
Debugger Engine Commands Debugger Commands DB The DB command displays the hexadecimal and ASCII values of the bytes in a specified range of memory. The command displays one or more lines, depending on the address or range specified. Each line shows the address of the first byte displayed in the line, followed by the number of specified hexadecimal byte values. The hexadecimal byte values are followed by the corresponding ASCII characters, separated by spaces.
Debugger Engine Commands Debugger Commands DDEPROTOCOL The DDEPROTOCOL command is used to configure the Debugger/Simulator dynamic data exchange (DDE) protocol. By default the DDE protocol is activated and not displayed in the command line component.
Debugger Engine Commands Debugger Commands DECODE_SKIP In the HC08 CPU and HCS08 CPU components, the DECODE_SKIP command defines usage of SKIP/SKIP2 pseudo instructions. NOTE The compiler generates these pseudo instructions by default in order to optimize code size and speed.
Debugger Engine Commands Debugger Commands processing starts. A symbol cannot represent a command name. Note that a symbol definition precedes (and hence conceals) a program variable with the same name. Defined symbols remain valid when a new application is loaded. An application variable or I/O register can be overwritten with a DEFINE command. NOTE This command can be used to assign meaningful names to expressions, which can be used in other commands.
Debugger Engine Commands Debugger Commands Example: A symbol named testCase is defined in the test application. /* Loads application test.abs */ LOAD test.abs /* Display value of testCase. */ DB testCase /* Redefine symbol testCase. */ DEFINE testCase = $800 /*Display value stored at address $800.*/ DB testCase /* Redefine symbol testCase. */ UNDEF testCase /* Display value of testCase. */ DB NOTE testCase Also refer to examples given for the command UNDEF.
Debugger Engine Commands Debugger Commands DL The DL command displays the hexadecimal values of the longwords in a specified range of memory. The command displays one or more lines, depending on the address or range specified. Each line shows the address of the first longword displayed in the line, followed by the number of specified hexadecimal longword values. When a size is specified in the range, this size represents the number of longwords that display in the command line window.
Debugger Engine Commands Debugger Commands DUMP The DUMP command writes everything visible in the Data component to the command line component. Usage DUMP Components Data component. Example: in> Data:1 < DUMP DW The DW command displays the hexadecimal values of the words in a specified range of memory. The command displays one or more lines, depending on the address or range specified.
Debugger Engine Commands Debugger Commands Components Debugger engine. Example: in>DW 0x8000,4 8000: FE80 45FD 8043 2710 The content of four words starting at 0x8000 is displayed as word values (two bytes). Memory words are displayed in the Command Line component window. E The E command evaluates an expression and displays the result in the Command Line component window.
Debugger Engine Commands Debugger Commands Example: in>define a=0x12 in>define b=0x10 in>e a+b in>=34 The addition operation of the two previously defined variables a and b is evaluated and the result is displayed in the Command Line window. The output can be redirected to a file by using the LF command (refer to LF and LOG command descriptions). ELSE The ELSE keyword is associated with the LF command. Usage ELSE Components Debugger engine.
Debugger Engine Commands Debugger Commands Example: if CUR_TARGET == 1000 /* Simulator */ set sim elseif CUR_TARGET == 1001 /* BDI */ set bdi ENDFOCUS The ENDFOCUS command resets the current focus. It is associated with the FOCUS command. Following commands are broadcast to all currently open components. This command is only valid in a command file. Usage ENDFOCUS Components Debugger engine.
Debugger Engine Commands Debugger Commands ENDFOR The ENDFOR keyword is associated with the FOR command. Usage ENDFOR Components Debugger engine. Example: for i = 1..5 define multi5 = 5 * i endfor After the ENDFOR instruction, i is equal to 5. ENDIF The ENDIF keyword is associated with the IF command. Usage ENDIF Components Debugger engine.
Debugger Engine Commands Debugger Commands ENDWHILE The ENDWHILE keyword is associated with the WHILE command. Usage ENDWHILE Components Debugger engine. Example: while i < 5 define multi5 = 5 * i define i = i + 1 endwhile After the ENDWHILE instruction, i is equal to 5 EXECUTE In the Stimulation component, the EXECUTE command executes a file containing stimulation commands. Refer to the I/O Stimulation document. Usage EXECUTE fileName Components Stimulation component. Example: in>EXECUTE stimu.
Debugger Engine Commands Debugger Commands EXIT In the Command line component, the EXIT command closes the Debugger application. Usage EXIT Components Debugger engine. Example: in>EXIT The Debugger application is closed. FILL In the Memory component, the FILL command fills a corresponding range of Memory component with the defined value. The value must be a single byte pattern (higher bytes ignored). Usage FILL range value The syntax for range is: LowAddress...HighAddress Components Memory component.
Debugger Engine Commands Debugger Commands FILTER In the Memory component, with the FILTER command, you select what you want to display, for example modules: modules only, functions: modules and functions, or lines: modules and functions and code lines. You can also specify a range to be logged in your file. Range must be between 0 and 100. Usage FILTER Options [] Options = modules|functions|lines Components Coverage component. Example: in>coverage < FILTER functions 25..
Debugger Engine Commands Debugger Commands ;WW match whole word is set. Components Source component. Example: in>FIND “this” ;B ;WW The “this” string (considered as a whole word) is searched in the Source component window. The search is performed backward. FINDPROC If a valid procedure name is given as parameter, the source file where the procedure is defined is opened in the Source Component. The procedure’s definition is displayed and the procedure’s title is highlighted.
Debugger Engine Commands Debugger Commands FOCUS The FOCUS command sets the given component (component) as the destination for all subsequent commands up to the next ENDFOCUS command. Hence, the focus command releases the user from repeatedly specifying the same command redirection, especially in the case where command files are edited manually. This command is only valid in a command file. NOTE It is not possible to visually notice that a component is “FOCUSed”.
Debugger Engine Commands Debugger Commands FOLD In the Source component, the FOLD command hides the source text at the program block level. Folded program text is displayed as if the program block was empty. When the folded block is unfolded, the hidden program text reappears. All text is folded once or (*) completely, until there are no more folded parts. Usage FOLD [*] Where * means fold completely, otherwise fold only one level. Components Source component.
Debugger Engine Commands Debugger Commands FOR The FOR loop allows you to execute all commands up to the trailing ENDFOR a predefined number of times. The bounds of the range and the optional steps are evaluated at the beginning. A variable (either a symbol or a program variable) may be optionally specified, which is assigned to all values of the range that are met during execution of the for loop. If a variable is used, it must be defined before executing the FOR command, with a DEFINE command.
Debugger Engine Commands Debugger Commands FPRINTF FPRINTF is the standard ANSI C command: Writes formatted output string to a file. Usage FPRINTF (, <&format>, , , ...) Components Debugger engine. Example: fprintf (test.txt,"%s %2d","The value of the counter is:",counter) The content of the file test.txt is: The value of the counter is: 25 FRAMES In the SoftTrace component, the FRAMES command sets the maximum number of frame records.
Debugger Engine Commands Debugger Commands G The G command starts code execution in the emulated system at the current address in the program counter or at the specified address. You can therefore specify the entry point of your program, skipping execution of the previous code. Usage G [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 GO Components Debugger engine.
Debugger Engine Commands Debugger Commands Components Debugger engine. Example: in>GO 0x8000 Program execution is started at address 0x8000. RUNNING is displayed in the status bar. The application runs until a breakpoint is reached or you stop execution. GOTO The GOTO command diverts execution of the command file to the command line that follows the Label. The Label must be defined in the current command file. The GOTO command fails, if the Label is not found.
Debugger Engine Commands Debugger Commands GOTOIF The GOTOIF command diverts execution of the command file to the command line that follows the label if the condition is true. Otherwise, the command is ignored. The GOTOIF command fails, if the condition is true and the label is not found. Usage GOTOIF condition Label where condition is same as defined in “C” language. Components Debugger engine. Example: DEFINE jump = 0 ... DEFINE jump = jump + 1 ... GOTOIF jump == 10 MyLabel T ...
Debugger Engine Commands Debugger Commands Example: in>GRAPHICS off HELP In the Command line component, the HELP command displays all available commands. Subcommands from the ATTRIBUTES command are not listed. Component specific commands, which are not open, are not listed. Usage HELP Components Debugger engine. Example: in>HELP HI-WAVE Engine: VER LF NOLF CR NOCR ....
Debugger Engine Commands Debugger Commands Usage IF condition Where condition is same as defined in “C” language. Components Debugger engine. Example: DEFINE jump = 0 ... DEFINE jump = jump + 1 ... IF jump == 10 T DEFINE jump = 0 ELSEIF jump == 100 DEFINE jump = 1 ELSE DEFINE jump = 2 ENDIF The jump = = 10 condition is evaluated and depending on the test result, the T Trace instruction is executed, or the ELSEIF jump = = 100 test is evaluated.
Debugger Engine Commands Debugger Commands Components Inspector component. Example: in>loadio swap in>InspectINSPECTOROUTPUT “Object Pool” Swap Swap * Name Value Address Init... - IO_Reg_1 0x0 0x1000 0x0 ... - IO_Reg_2 0x0 0x1001 0x0 ... INSPECTORUPDATE The Inspector displays various information. Some types of information are automatically updated.
Debugger Engine Commands Debugger Commands LF The LF command initiates logging of commands and responses to an external file or device. While logging remains in effect, any line that is appended to the command window is also written to the log file. Logging continues until a close log file (NOLF) command is executed. When the LF command is entered with no filename, the Open File dialog box is displayed to specify a filename. Use the logging option (LOG) command to specify information to be logged.
Debugger Engine Commands Debugger Commands LOAD The LOAD command loads a framework application (.abs file) for a debugging session. When no application name is specified, the LoadObjectFile dialog box is opened.
Debugger Engine Commands Debugger Commands • ADD_SYMBOLS appends the symbol information to the existing symbol table instead of replacing it NOTE By default, the LOAD command is “code+symbols” with no verification. NOTE If the ADD_SYMBOLS parameter is passed, PRELOAD and POSTLOAD files play for the first loaded application only. Components Debugger engine. Example: LOAD FIBO.ABS The FIBO.ABS application is loaded.
Debugger Engine Commands Debugger Commands LOADSYMBOLS This command is similar to the LOAD command but only loads debugging information into the debugger. This can be used if the code is already loaded into the target system or programmed into a non-volatile memory device.
Debugger Engine Commands Debugger Commands Usage LOG type [=] state {[,] type [=] state} Where type is one of the following types: CMDLINE: Commands entered on the command line. CMDFILE: Commands read from a file. RESPONSES: Command output response. ERRORS: Error messages. NOTICES: Asynchronous event notices, such as breakpoints. Where state is on or off. state is the new state of type: • When ON, enables logging of the type. • When OFF, disables logging of the type. Components Debugger engine.
Debugger Engine Commands Debugger Commands bckcolor yellow at 1000 bckcolor white ENDIF The following log file is generated: !define truth = 1 !IF truth ! bckcolor blue ! at 2000 bckcolor white !else !- bckcolor yellow !- at 1000 bckcolor white !ENDIF When commands executed from a command file are logged, all executed commands that are in the FOR loop are logged the number of times they have been executed.
Debugger Engine Commands Debugger Commands i 0x3 (3) !ENDFOR When commands executed from a command file are logged, all executed commands that are in the WHILE loop are logged the number of times they have been executed. That is, a command file executed with the CF or CALL command without the NL option and with the CMDFILE flag of the LOG command set to TRUE.
Debugger Engine Commands Debugger Commands Example 4: When executing the following file: define i = 1 REPEAT define i = i + 1 ls UNTIL i == 4 The following log file is generated: repeat until condition !define i = 1 !REPEAT ! define i = i + 1 ! ls i 0x2 (2) !UNTIL i == 4 ! define i = i + 1 ! ls i 0x3 (3) !UNTIL i == 4 ! define i = i + 1 ! ls i 0x4 (4) !UNTIL i == 4 802 Microcontrollers Debugger Manual
Debugger Engine Commands Debugger Commands LS In the Command Line window, the LS command lists the values of symbols defined in the symbol table and by the user. There is no limit to the number of symbols that can be listed. The size of memory determines the symbol table size. Use the DEFINE command to define symbols, and the UNDEF command to delete symbols. The symbols that are listed with the LS command are split in two parts: Applications Symbols and User Symbols.
Debugger Engine Commands Debugger Commands When LS is performed on a single symbol (e.g., in>ls counter) that is an application variable as well as a user symbol, the application variable is displayed. Example with j being an application symbol as well as a user symbol: in>ls j Application Symbol: j 0x83 (131) MEM The MEM command displays a representation of the current system memory map and lower and upper boundaries of the internal module that contains the MCU registers.
Debugger Engine Commands Debugger Commands MS The MS command sets a specified block of memory to a specified list of byte values. When the range is wider than the list of byte values, the list of byte values is repeated as many times as necessary to fill the memory block. When the range is not an integer multiple of the length of the list, the last copy of the list is truncated appropriately. This command is identical to the write bytes (WB) command.
Debugger Engine Commands Debugger Commands Usage NB [base] Where base is the new number base (2, 8, 10 or 16). Components Debugger engine. Table 34.6 ANSI C Constant Notation Notation Meaning 0x---- Hexadecimal constant 0---- Octal constant Table Example: 0x2F00, /* Hexadecimal Constant */ 043, /* Octal Constant */ 255 /* Decimal Constant */ In the same way, the Assembler notation for constant is also supported.
Debugger Engine Commands Debugger Commands Table 34.8 Base is 16: Constants Starting with Letter A, B, C, D, E or F Notation Meaning 5AFD Hexadecimal constant $5AFD AFD Hexadecimal constant $AFD Table Example: in>NB 16 The number base is hexadecimal. NOCR The NOCR command closes the current record file. The record file is opened with the CR command. Usage NOCR Components Debugger engine. Example: in>NOCR The current record file is closed. NOLF The NOLF command closes the current Log File.
Debugger Engine Commands Debugger Commands Components Debugger engine. Example: in>NOLF The current Log File is closed. OPEN The OPEN command is used to open a window component.
Debugger Engine Commands Debugger Commands OUTPUT With OUTPUT, you can redirect the Coverage component results to an output file indicated by the path and file name. Usage OUTPUT FileName Where FileName is file name (path + name). Components Coverage component. Example: in>coverage < OUTPUT c:\Program Files\Freescale\myfile.txt The Coverage output results are redirected to the file myfile.txt from the directory C:\Program Files\Freescale.
Debugger Engine Commands Debugger Commands Usage P [address] address: is an address constant expression, the address at which execution begins. If address is omitted, execution begins with the instruction pointed to by the current value of the program counter. Components Debugger engine. Example: in>p A=0x0 HX=0x450 SR=0x70 PC=0xF04E SP=0xFF 00F04E 94 TXS STEPPED Contents of registers are displayed and the current instruction is disassembled. PAUSETEST Displays a modal message box, shown in Figure 34.
Debugger Engine Commands Debugger Commands PRINTF The PRINTF is the standard ANSI C command: Prints formatted output to the standard output stream. Usage PRINTF (“[Text ]%format specification” , value) Components Debugger engine. Example in>PRINTF("The value of the counter is: %d", counter) The output is: The value of the counter is: 2 PTRARRAY The PTRARRAY command allows the user to specify a pointer to display as an array. Usage PTRARRY on|off [nb] Where: • on displays pointers as arrays.
Debugger Engine Commands Debugger Commands RD The RD command displays the content of specified registers. The display of a register includes both the name and hexadecimal representation. If the specified register is not a CPU register, then it looks for this register in a register file as an I/O register. This file is called: MCUIxxxx.REG (where xxxx is a number related to the MCU).
Debugger Engine Commands Debugger Commands RECORD In the SoftTrace component, the RECORD command switches frame recording on / off while the target is running. Usage RECORD on|off Components SoftTrace component. Example: in>RECORD on REPEAT The REPEAT command allows you to execute a sequence of commands until a specified condition is true. The REPEAT command may be nested. Press the Esc key to stop this command. Usage REPEAT Components Debugger engine. Example: DEFINE var = 0 ...
Debugger Engine Commands Debugger Commands RESET In the Profiler and Coverage component, the RESET command resets all recorded frames (statistics). In the SoftTrace component, the RESET command resets statistics and recorded frames. NOTE Make sure that the RESET command is redirected to the correct component. Targets also have their own RESET command and if RESET is not redirected, the target is reset. Usage RESET Components Profiler and Coverage.
Debugger Engine Commands Debugger Commands RETURN The RETURN command terminates the current command processing level (returns from a CALL command). If executed within a command file, control is returned to the caller of the command file (i.e. the first instance that did not chain execution). Usage RETURN Components Debugger engine. Example: In file d:\demo\cmd1.txt: ... CALL d:\demo\cmd2.txt T ... In file d:\demo\cmd2.txt ... ... RETURN // returns to the caller The command file cmd1.
Debugger Engine Commands Debugger Commands Usage RS register[=]value{,register[=]value} register: Specifies the name of a register to be changed. String register is any of the CPU register names, or name of a register in the register file. value: is an integer constant expression (in ANSI format representation). Components Debugger engine. Example: in>rs a=0xff hx=0x7fff S The S command stops execution of the emulation processor. Use the Go G command to start the emulator.
Debugger Engine Commands Debugger Commands SAVE The SAVE command saves a specified block of memory to a specified file in Freescale Srecord format. The memory block can be reloaded later using the load S-record (SREC) command. NOTE If no path is specified, the destination directory is the current project directory. Usage SAVE range fileName [offset][;A] offset: an optional offset to add or subtract from addresses when writing S-records. The default offset is 0.
Debugger Engine Commands Debugger Commands breakpoints (SAVEBP on) when the user quits the Simulator/Debugger or loads another .ABS file. NOTE For more information about this syntax, refer to BS command and to the Control Points chapter. Usage SAVEBP on|off Components Debugger engine. Example: Content of the FIBO.BPT file savebp on BS &fibo.c:Fibonacci+19 P E; cond = "fibo > 10" E; cdSz = 47 srSz = 0 BS &fibo.c:Fibonacci+31 P E; cdSz = 47 srSz = 0 BS &fibo.c:main+12 P E; cdSz = 42 srSz = 0 BS &fibo.
Debugger Engine Commands Debugger Commands SETCOLORS The SETCOLORS command is used to change the colors for a specific channel from the Monitor component. Usage SETCOLORS ( "Name" ) ( Background) ) ( Line ) ( Text ) ( Cursor ) ( Grid Name is the name of the channel to modify. Background is the new color for the channel background (the format is: 0x00bbggrr). Cursor is the new color for the channel cursor (the format is: 0x00bbggrr).
Debugger Engine Commands Debugger Commands Usage SLAY fileName Components Debugger engine. Example: in>slay /hiwave/demo/mylayout.hwl The current debugger layout is saved to the mylayout.hwl file in the /hiwave/demo directory. SLINE With the SLINE command, a line of the source file is made visible. If the line is not currently visible, the source scrolls so that it appears on the first line. If the line is currently in a folded part, it is unfolded so that it becomes visible.
Debugger Engine Commands Debugger Commands SMEM In the Source component, the SMEM command loads the corresponding module’s source text, scrolls to the corresponding text location (the code address) and highlights the statements that correspond to this code address range. In the Assembly component, the SMEM command scrolls the Assembly component, shows the location (the assembler address) and select/highlights the memory lines of the address range given as the parameter.
Debugger Engine Commands Debugger Commands assembler) (e.g., fibo.c), since all debugging information is contained in the .abs file and object files are not used. Adapt the following examples with your .abs application file format. Usage SMOD module Where module is the name of a module taking part of the application. Do not include a path in the module name. The module extension (i.e., .DBG for assembly sources or .C for C sources) must be specified.
Debugger Engine Commands Debugger Commands Components Assembler, Memory and Source component. Example: in>Assembly < SPC 0x8000 The Assembly component window is scrolled to the address 0x8000 and the associated instruction is highlighted. SPROC In the Data component, the SPROC command shows local variables of the corresponding procedure stack level.
Debugger Engine Commands Debugger Commands SREC The SREC command initiates the loading of Freescale S-Records from a specified file. NOTE If no path is specified, the destination directory is the current project directory. Usage SREC fileName [offset] offset: is a signed value added to the load addresses in the file when loading the file contents. Components Debugger engine. Example: in>SREC DUMP.SX The DUMP.SX file is loaded into memory.
Debugger Engine Commands Debugger Commands Example: in>STEPINTO STEP INTO TRACED TRACED in the status line indicates that the application is stopped by an assembly step function. STEPOUT The STEPOUT command executes the remaining lines of a function in which the current execution point lies. The next statement displayed is the statement following the procedure call. All of the code is executed between the current and final execution points.
Debugger Engine Commands Debugger Commands STEPOVER The STEPOVER command executes the procedure as a unit, and then steps to the next statement in the current procedure. Therefore, the next statement displayed is the next statement in the current procedure regardless of whether the current statement is a call to another procedure. NOTE This command works while the application is paused in break mode (program is waiting for user input after completing a debugging command).
Debugger Engine Commands Debugger Commands STOP The STOP command stops execution of the emulation processor. Use the Go G command to start the emulator. NOTE The STOP command ends as soon as the PC is changed. Usage STOP Alias S Components Debugger engine. Example: in>STOP STOPPING HALTED Current application debugging is stopped. T The T command executes one or more instructions at a specified address, or at the current address (the address in the program counter).
Debugger Engine Commands Debugger Commands Usage T [address][,count] address: is an address constant expression, the address where execution begins. If address is omitted, the instruction pointed to by the current value of the program counter is the first instruction traced. count: is an integer constant expression, in the decimal integral interval [1, 65535], that specifies the number of instructions to be traced. If count is omitted, one instruction is traced. Components Debugger engine.
Debugger Engine Commands Debugger Commands Components Debugger engine. Example: in>TESTBOX "Step 1: init all vars" TUPDATE In Profiler and Coverage components, the TUPDATE command switches the time update feature on/ off. Usage TUPDATE on|off Components Profiler and Coverage components. Example: in>TUPDATE on UNDEF The UNDEF command removes a symbol definition from the symbol table. This command does not undefine the symbols defined in the loaded application.
Debugger Engine Commands Debugger Commands Example: DEFINE test = 1 ... UNDEF test When the test variable is no longer needed in a command program, it can be undefined and removed from the list of symbols. After UNDEF test, the test variable can no longer be used without (re)defining it. NOTE See also examples of the DEFINE command. Examples: The value of an existing symbol can be changed by applying the DEFINE command again. In this case, the previous value is replaced and lost.
Debugger Engine Commands Debugger Commands application fiboCount 0x800 (2048) counter 0x802 (2050) _startupData 0x84D (2125) Fibonacci 0x867 (2151) main 0x896 (2198) Init 0x810 (2064) _Startup 0x83D (2109) in>DEFINE counter = 1 in>LS User Symbols: // there is one user symbol: counter counter 0x1 (1) Application Symbols: // symbols of the loaded application fiboCount 0x800 (2048) counter 0x802 (2050) _startupData 0x84D (2125) Fibonacci 0x867 (2151) main 0x896 (2198) Init 0x810 (2064)
Debugger Engine Commands Debugger Commands UNFOLD In the Source component, the UNFOLD command is used to display the contents of folded source text blocks, for example, source text that has been collapsed at program block level. All text is unfolded once or (*) completely, until no more folded parts are found. Usage UNFOLD [*] Where * means unfolding completely, otherwise unfolding only one level. Components Source component.
Debugger Engine Commands Debugger Commands UPDATERATE In the Data component and Memory component, the UPDATERATE command is used to set the data refresh update rate. This command only has an effect if the Data or Memory component to which it applies is set in Periodical Mode. Usage UPDATERATE rate where rate is a constant number matching a quantity of time in tenths of a second, between 1 and 600 tenth of second (0.1 to 60 seconds). Components • Data and Memory component.
Debugger Engine Commands Debugger Commands Procedure 6.0.10 Register 6.0.14 Memory 6.0.19 Data 6.0.27 Data 6.0.27 Simulator Target 6.0.17 Command Line 6.0.16 In the Command Line component window, Debugger engine and components versions are displayed. WAIT The WAIT command pauses command file execution for a time in tenths of second or pauses until the target is halted when the option “;s” is set. When no parameter is specified, it pauses for 50 tenths of a second (5 seconds).
Debugger Engine Commands Debugger Commands Example: WAIT 100 T ... Pauses for 10 seconds before executing the T Trace instruction. WB The WB command sets a specified block of memory to a specified list of byte values. When the range is wider than the list of byte values, the list of byte values is repeated as many times as necessary to fill the memory block. When the range is not an integer, a multiple of the length of the list and the last copy of the list is truncated accordingly.
Debugger Engine Commands Debugger Commands WHILE The WHILE command allows you to execute a sequence of commands as long as a certain condition is true. The WHILE command may be nested. This command can be stopped by pressing the Esc key. Usage WHILE condition Where condition is defined as in “C” language definition. Components Debugger engine. Example: DEFINE jump = 0 ... WHILE jump < 20 DEFINE jump = jump + 1 ENDWHILE T ...
Debugger Engine Commands Debugger Commands Usage WL range list range: is an address range constant that defines the block of memory to be set to the longword values in the list. list: is a list of longword values to be stored in the block of memory. Components Debugger engine. Example: in>WL 0x2000 0x0FFFFF0F This command fills up memory starting at address 0x2000 with the 0x0FFFFF0F longword value, and modifies the addresses 0x2000 to 0x2003.
Debugger Engine Commands Debugger Commands ZOOM In the Data component, the ZOOM command is used to display the member fields of structures by ‘diving’ into the structure. In contrast to the UNFOLD command, where member fields are not expanded in place. The display of the member fields replaces the previous view. The ZOOM out command is used to return to the nesting level indicated by the given identifier. NOTE Addresses are not needed to zoom out. Simply type “ZOOM out”.
Book VIII - Environment Variables Book VIII Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment. 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.
Book VIII Contents 840 Microcontrollers Debugger Manual
35 Debugger Engine Environment Variables This chapter describes the environment variables that the Debugger uses. Other tools, such as the Linker, also use some of these environment variables. For more information about other tools, see their respective manuals. Topics include: • Debugger Environment • Local Configuration File (usually project.
Debugger Engine Environment Variables Debugger Environment Debugger Environment Various parameters of the Debugger may be set using environment variables. The syntax is always the same: Parameter = KeyName "=" ParamDef. NOTE Do not use blanks in the definition of an environment variable. For example: GENPATH=C:\INSTALL\LIB;D:\PROJECTS\TESTS;/usr/local/lib;/ home/me/my_project The Debugger parameters may be defined in several ways: • Using system environment variables supported by your operating system.
Debugger Engine Environment Variables Debugger Environment • If the tool is launched using a File Manager/Explorer, the current directory is the location of the executable launched. • If the tool is launched using an Icon on the Desktop, the current directory is the one specified and associated with the Icon. • If the tool is launched by dragging a file on the icon of the executable under Windows 2000, the desktop is the current directory.
Debugger Engine Environment Variables Local Configuration File (usually project.ini) Local Configuration File (usually project.ini) The Debugger does not change the default.env file. Its content is read only. All configuration properties are stored in the configuration file. The same configuration file can be used by different applications. The shell uses the configuration file with the name project.ini in the current directory only. That is why this name is also suggested to be used with the Debugger.
Debugger Engine Environment Variables Local Configuration File (usually project.ini) Default Layout Configuration (PROJECT.INI) The default layout activated when starting the Debugger is defined in the PROJECT.INI file located in the project directory, as shown in Listing 35.1. All default layout-related parameters are stored in section [DEFAULTS]. Listing 35.1 Example Content of PROJECT.
Debugger Engine Environment Variables Local Configuration File (usually project.ini) Example: Window5=Memory 50 60 50 30 Window number 5 is a Memory component, its starting position is at: 50% from main window width, 60% from main window height. Its width is 50% from main window width and its height 30% from main window height. Other Parameters • It is possible to load a previously saved layout from a file by inserting the following line in your PROJECT.
Debugger Engine Environment Variables Local Configuration File (usually project.ini) • The toolbar, status bar, heading line, title bar and small border can be specified in the default section: – The toolbar can be shown or hidden with the following syntax: Toolbar = (0 | 1) If 1 is specified, the toolbar is shown, otherwise the toolbar is hidden.
Debugger Engine Environment Variables Local Configuration File (usually project.ini) Select HI-WAVE section to retrieve value from: • if an entry Windows0 or Target can be retrieved from section [HI-WAVE] then: use [HI-WAVE] • else if an entry Windows0 or Target can be retrieved from section [DEFAULTS] then: use [DEFAULTS] • else: use [HI-WAVE] The environment variables are loaded from the default.env file: • If an entry Layout=lll exists, the layout file lll.hwl is loaded and executed.
Debugger Engine Environment Variables Local Configuration File (usually project.ini) NOTE When using WinEdit, do not set the system environment variable Defaultdir. If you do and this variable does not contain the project directory given in WinEdit’s project configuration, files might not be put where you expect them. Line Continuation It is possible to specify an environment variable in an environment file (default.env/ .
Debugger Engine Environment Variables Environment Variables Environment Variables The remainder of this section is devoted to describing each of the environment variables available for the Debugger. The options are listed in alphabetical order and each is divided into several sections described in Table 35.1. Table 35.1 Environment Variable Details Topic Description Tools Lists of other tools that are using this variable Synonym Fore some environment variables a synonym also exists.
Debugger Engine Environment Variables Environment Variables Arguments : Paths separated by semicolons, without spaces. Description When this environment variable is defined, the SmartLinker stores the absolute files it produces in the first directory specified. If ABSPATH is not set, the generated absolute files are stored in the directory in which the parameter file was found. Example: ABSPATH=\sources\bin;..\..
Debugger Engine Environment Variables Environment Variables Example: DEFAULTDIR=C:\INSTALL\PROJECT See also: The Current Directory Global Initialization File (MCUTOOLS.INI - PC Only) ENVIRONMENT=: Environment File Specification Tools Compiler, Linker, Decoder, Librarian, Maker, Burner, Debugger. Synonym HIENVIRONMENT Syntax "ENVIRONMENT=" . Arguments : file name with path specification, without spaces Default None. Description This variable has to be specified at the system level.
Debugger Engine Environment Variables Environment Variables GENPATH: #include “File” Path Tools Compiler, Linker, Decoder, Burner, Debugger. Synonym HIPATH Syntax "GENPATH=" {}. Arguments : Paths separated by semicolons, without spaces. Default Current directory Description If a header file is included with double quotes, the Debugger searches in the current directory, then in the directories given by GENPATH and finally in the directories given by LIBRARYPATH: ‘include ’ Path.
Debugger Engine Environment Variables Environment Variables LIBRARYPATH: ‘include ’ Path Tools Compiler, ELF tools (Burner, Linker, Decoder) Synonym LIBPATH Syntax "LIBRARYPATH=" {}. Arguments : Paths separated by semicolons, without spaces.
Debugger Engine Environment Variables Environment Variables OBJPATH: Object File Path Tools Compiler, Linker, Decoder, Burner, Debugger. Synonym None. Syntax "OBJPATH=" . Default Current directory Arguments : Path without spaces. Description If a tool looks for an object file (for example, the Linker), then it first checks for an object file specified by this environment variable, then in GENPATH: #include “File” Path and finally in HIPATH.
Debugger Engine Environment Variables Environment Variables Arguments : Directory to be used for temporary files. Default None. Description If a temporary file has to be created, normally the ANSI function tmpnam() is used. This library function stores the temporary files created in the directory specified by this environment variable. If the variable is empty or does not exist, the current directory is used. Check this variable if you get an error message “Cannot create temporary file”.
Debugger Engine Environment Variables Search Order for Source Files NO, OFF: The environment variable LIBRARYPATH: ‘include ’ Path is not used. Default ON Description This environment variable allows a flexible usage of the LIBRARYPATH: ‘include ’ Path environment variable, because LIBRARYPATH: ‘include ’ Path may be used by other software (for example, version management PVCS).
Debugger Engine Environment Variables Debugger Files In the Debugger for Object Files (HILOADER) 1. Path coded in the absolute file (.abs) 2. Abs File directory 3. Project file directory (where .pjt or .ini file is located) 4. Path defined in the OBJPATH environment variable 5. Paths defined in the GENPATH environment variable (from left to right) Debugger Files The Debugger comes with several program, application, configuration files and examples.
Debugger Engine Environment Variables Debugger Files Table 35.2 Debugger File Extensions (continued) File Extension Description *.DLL 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. The process then executes functions in the DLL. The DLL of the Debugger is provided for supported library and extended functions.
Debugger Engine Environment Variables Debugger Files Table 35.2 Debugger File Extensions (continued) 860 File Extension Description Project.Ini Debugger Project Initialization File *.REC Recorder File *.REG Register Entries files, for example, mcu081e.reg *.SIM CPU Awareness file, for example, st7.sim *.SX S-Record file, for example, fibo.sx *.TXT General Text Information file. *:TGT Target File for the Debugger, for example, xtend-g3.tgt *.
36 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.
Connection-Specific Environment Variables Connection-Specific Environment Variables 862 Microcontrollers Debugger Manual
Book IX - Debugger Legacy Book IX Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger, to use all its functions and help you understand how to use the environment.
Book IX Contents 864 Microcontrollers Debugger Manual
37 Legacy PEDebug Target Interface The PEDebug Target Interface has become “Legacy” and has been replaced by specific Debugger Connections. The Target Interface term has been replaced by the term Connection.
Legacy PEDebug Target Interface Connection Selection or Change Always Available within IDE Connection Selection or Change Always Available within IDE The CW08v5.x IDE featured a new menu option in the Project menu. The Change MCU/ Connection option opens the Device and Connection dialog box, where you can change the currently selected project connection.
38 Legacy Target Interfaces Removed 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 867
Legacy Target Interfaces Removed 868 Microcontrollers Debugger Manual
39 HC(S)08 Full-Chip Simulator Components No Longer Supported List of HC(S)08 FCS Components No Longer Supported The following components can be opened in the debugger layout within the Open Window Component dialog box, or with the OPEN command in the Command window. However, these components are only operational with the Legacy “Freescale HC(S)08 Instruction Set Simulator”, (formerly Sim.tgt target interface).
HC(S)08 Full-Chip Simulator Components No Longer Supported List of HC(S)08 FCS Components No Longer Supported • Testterm • Timer • Wagon • Winlift 870 Microcontrollers Debugger Manual
Index A A command 742 A icon 506 About Box 52 About menu entry 51 About Option 399 About option 500, 572, 682 .
Hardware 517 Marking 115 Multiple selection 161 Permanent 157 Position 164 Temporary 157, 165 with Register Condition 168 Breakpoint with Register Condition 167 BS command 759 Bus State Analyzer (BSA) Arming 426 Cables 404 Defining events 421 Selecting record mode 424 Viewing data 426 Bus trace 481, 493, 501, 504, 674, 682 Bus Trace menu entry 578 Byte menu entry 94 C -C Option 31 Cache size menu entry 625 Call Chain 104 CALL command 761 CANCLR Command 290 CANIN command 290 CANOUT command 291 Capture 526 C
RECORD 813 REPEAT 799, 813 RESET 814 RESTART 814 RETURN 815 RS 815 S 816 SAVE 817 SAVEBP 817 SET 818 WHILE 799 Communication 673, 681 USB 408 COMPLEMENT DATA Component 749 Memory Component 751 Register Component 746 Complex breakpoint 505 Component Assembly 64, 202, 203 Associated Menus 52 Command Line 69 Connection 62 Coverage 73 CPU 61 DA-C 76 Data 79, 202, 203, 205 Framework 26 Inspector 133 IO_Led 595 LED 597 Main Menu 52 Memory 90, 212 Module 102 Phone 598 Pop Up Menu 53 Procedure 104 Profiler 106 Reco
D DA-C Configure file types 221 Configuring 219 Configuring tools 226 Database directory 221 Debugger Interface 230 Debugger name 234 IDE 219 Library path 222 Link Component 76 Ndapi.
FIND 783 FINDPROC 784 FOCUS 785 FOLD 786 FONT 786 FOR 787 FPRINTF 788 FRAMES 788 G 789 GO 789 GOTO 790 GOTOIF 791 GRAPHICS 791 HELP 792 IF 792 INSPECTOROUTPUT 793 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 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 SLIN
Decimalmode 151 Default IP address 412 DEFAULT.ENV 842, 851, 852, 856 default.
Defining 421 Record modes 424 EXECUTE command 781 Execute menu entry 625 EXIT command 782 Exit menu entry 35 Expert mode 512, 518 Expert triggers 518 Explorer 843 Expression Command File 81 Expression Editor 80 F FCS ADC Module Option 258 ADC User Commands 259 Clock Generation Module Commands 261 Clock Generation Module Option 260 External Interrupt Module 268 High Resolution PWM (HRP) module 262 High Resolution PWM Commands 263 HRP Commands 263 Input/Output (I/O) Ports Module 265 Input/Output Ports Comman
Find Procedure dialog box 123 Find Procedure menu entry 121 FINDPROC command 784 Flash 674, 682 Commands 710 Disabling 705 Enabling 705 Loading 708 Module 703 Operations 705 Option 481 Protecting 705 Select 703 Unprotecting 705 Unselect 703 FLASH command 710 Flash module Selecting 705 FLASH SELECT 703, 706 FLASH UNSELECT 703, 706 Flexis connections 22 Flexis devices 22 FLEXlm 26 Float menu entry 113 FOCUS command 785 Fold All Text menu entry 124 FOLD command 786 Fold menu entry 124 Folding 118 Mark 118 Fold
Display 206 display 82 Values and types 79 GO command 789 Go to Frame 536 Go to Frame menu entry 131 Go to Line dialog box 122 Go to Line menu entry 120, 122 GOTO command 790 GOTOCYCLE Command 264, 307 GOTOIF command 791 Graphic bar 73, 106 Graphical 534 Graphical display 534 Graphical menu entry 131 GRAPHICS command 791 Graphics menu entry 74, 107 Grid Color menu entry 145 Grid Mode menu entry 145 Grid Size menu entry 145 H Halt menu entry 42 Halt when fifo is full 528 Hardware Components 403 Setup 405 Ha
Reset to Normal Mode 481 Select derivative 481 Select Derivative dialog box 483 Set Connection dialog box 479 Setup 480 Show Status 481 Show Status dialog box 485 Technical considerations 477 Trigger Module settings 481 Unsecure 481 Wizard Connection selection 478 HCS08 P&E Multilink/Cyclone Pro Connection 467 HCS08 Serial Monitor 503, 524 CodeWarrior IDE and serial monitor connection 487 Connection menu options 492 Derivative Selection dialog box 490, 495 First Steps from within existing project 489 First
Connection Manager Window - Advanced Settings Tab 384 Connection Manager Window Connect to Target Tab 382 Connection Manager Window STATUS Area 387 Connection Menu Added Menu Options 390 Connection Procedure 382 Cycle Power Up/Down Button 387 Device Class Description 393 Expert Mode Programmer Window 392 MON08 Cable Connection Communications Type 385 Power Up/Down Buttons 386 Remove a Manually Configured Interface 383 Set Connection Dialog Box 382 Start Expert Mode Programmer Option 391 Target MCU Security
LED instrument attributes 150 Left menu entry 144 LF command 795 LIBPATH 856 LIBRARYPATH 854 Line Continuation 849 Load a connection 44 Load Application menu entry 35 LOAD command 796 Load I/Os menu entry 578 Load Layout menu entry 143 Load menu entry 44, 578 LOADCODE command 797 Loading an Application 202 Loading error 708 Loading problems 708 LOADSYMBOLS command 798 Local menu entry 82 Local variable Display 82 Displaying 205 Values and types 79 Locked menu entry 85 Locked mode 82 LOG command 798 Low Disp
16-Pin Header Signals tab Status Area 340 Advanced Options Dialog Box 343 Cable Connection Communications Type 336 Connection Manager Window 16-Bit Header Signals Tab 339 Advanced Settings tab 335 Connect Target Tab 333 Connection Menu Options, Additional 342 Connection View Register Files Menu Option 345 Device Class Description 346 Expert Mode Programmer Window 344 Interface Connection 333 Interface debugger connection 333 Interface Selection Dialog Box 334 Limitations 379 Power Cycle Control 338 Power Up
O Object Info Bar 53 OBJPATH 855 Oct menu entry 84, 95, 113, 207 Octal 207 Octal format 207 OPEN command 808 Open Component menu entry 48 Open Configuration menu entry 35 Open File menu entry 625 Open Memory Block 583 Open Source File menu entry 120 Options Autosize menu entry 51 Component Menu menu entry 51 Pointer As Array 82 Setup 480 Options group 200 Options menu entry 82 OSEK Kernel Awareness 190 OSEK ORTI 191 OSEK RTK Inspector 193 OSPARAM.
Protect DBG FIFO content from unexpected reads 532 PTRARRAY command 811 Pulse Width 152 PVCS 857 R R command 256, 345, 360, 378, 392, 434, 473, 558 R/W Access 529 RAM 379 RD command 812 Read 529 Read access 510 Read Access trigger type 514 Read/Write access 510 Read/Write Access trigger type 514 READACCESS markpoint type 513 READWRITEACCESS markpoint type 513 Real Time Kernel Awareness 185 Real Time Kernels 185 Real-time Embedded application 25 .
First Steps Using Stationery Wizard 562 MCU Configuration dialog box 564 Reset to normal mode 565 Select derivative 564 Select derivative dialog box 566 Set Connection dialog box 563 Setup dialog box 565 Show Status 565 Show Status dialog box 566 Technical considerations 561 Wizard Connection Selection 562 RS08 P&E Multilink/Cyclone Pro Connection 553 Run menu 41, 42, 43 Run To Cursor menu entry 67, 120 S S command 816 Save and Restore on load option 509, 513 SAVE command 817 Save Configuration menu entry
SMEM command 821 SMOD command 821 SofTec ColdFire About 682 Bus Trace 682 CodeWarrior IDE and SofTec ColdFire connection 677 Communication 681 Communication Settings dialog box 684 Connection menu options 681 Debugging Memory Map 681 First Steps from within existing project 679 First Steps using Stationery Wizard 678 Flash 682 Select Derivative 681 Set Connection dialog box 679 Set Derivative dialog box 680, 685 Setup 681 SofTec ColdFire Setup dialog box 682 Target Connection dialog box 680, 683 Technical c
Start recording after trigger hit and halt when fifo is full 527 Start/Continue menu entry 42 Starting an Application 202 Startup 844 Startup command file 46 Static text attributes 153 Statistics Resetting 107 Status bar 33 DBG support 515 Menu entry 38 Status register bits 111 Step In 203 Assembly Instruction 205 Source Instruction 204 Step Out 203 Function Call 204 Step Out menu entry 42 Step Over 203, 204 Step Over menu entry 42 STEPINTO command 824 STEPOUT command 825 STEPOVER command 826 Stimulation Me
Configuration 199 Default Layout Configuration 845 Demo Version Limitations 26 Drag and Drop 55 Engine 25 Layout 846 Project 846 project.
Counting 176, 184 Definition 157 Deleting 178, 184 Read 174, 182 Read, Write 158 Read/Write 175, 183 Write 175 Watchpoints 505, 510 WB command 835 WHILE command 799, 836 Width 146 Window components 61 Window menu 50, 51 Window Menu entries 51 Windows 842 Command File 45 WinEdit 842, 843 WL command 836 .WND files 61 .
Microcontrollers Debugger Manual 891
Microcontrollers Debugger Manual