IAR C-SPY® Hardware Debugger Systems User Guide for Renesas E8/E8a and E10A-USB Emulators CSE8E10-2
COPYRIGHT NOTICE © Copyright 1996–2008 IAR Systems AB. No part of this document may be reproduced without the prior written consent of IAR Systems AB. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such a license. DISCLAIMER The information in this document is subject to change without notice and does not represent a commitment on any part of IAR Systems.
Contents Tables ........................................................................................................................ v Figures .................................................................................................................... vii Preface ..................................................................................................................... ix Who should read this guide ................................................................
Code breakpoints ................................................................................ 20 The Execution Address Breakpoint dialog box ................................. 20 The Software breakpoint dialog box .................................................. 21 The Break Condition dialog box ........................................................ 22 The Breakpoint Usage dialog box ...................................................... 23 C-SPY use of breakpoints ...................................
Tables 1: Typographic conventions used in this guide ........................................................... x 2: Naming conventions used in this guide ................................................................. xi 3: Driver differences .................................................................................................... 1 4: The E8/E8a emulator mode options ........................................................................ 5 5: The E10A-USB emulator mode options .............
IAR C-SPY® Hardware Debugger Systems vi User Guide CSE8E10-2
Figures 1: Emulator communication overview ........................................................................ 3 2: The Emulator Setting dialog box for the E8a emulator .......................................... 5 3: The Firmware Location page for the E8/E8a emulator ........................................... 7 4: The Connecting dialog box ..................................................................................... 7 5: The Power Supply dialog box for the E8/E8a emulator .....................
IAR C-SPY® Hardware Debugger Systems viii User Guide CSE8E10-2
Preface Welcome to the IAR C-SPY® Hardware Debugger Systems User Guide for Renesas E8/E8a and E10A-USB Emulators. The purpose of this guide is to provide you with detailed reference information that can help you use the features in the IAR C-SPY® Hardware Debugger Systems. Who should read this guide You should read this guide if you want to get the most out of the features in the C-SPY hardware debugger systems.
What this guide contains What this guide contains Below is a brief outline and summary of the chapters in this guide. ● Introduction to C-SPY® hardware debugger systems introduces you to the available C-SPY drivers to be used for the target board. The chapter briefly shows the difference in functionality provided by the different C-SPY drivers. ● Hardware-specific debugging describes the additional options, menus, and features provided by these debugger systems.
Preface Style Used for parameter A placeholder for an actual value used as a parameter, for example filename.h where filename represents the name of the file. [option] An optional part of a command. {option} A mandatory part of a command. a|b|c Alternatives in a command. bold Names of menus, menu commands, buttons, and dialog boxes that appear on the screen. italic • A cross-reference within this guide or to another guide. • Emphasis.
Document conventions IAR C-SPY® Hardware Debugger Systems xii User Guide CSE8E10-2
Introduction to C-SPY® hardware debugger systems This chapter introduces you to the C-SPY drivers and to how they differ from the C-SPY Simulator. The C-SPY emulator drivers C-SPY consists of both a general part which provides a basic set of C-SPY features, and a driver. The C-SPY driver is the part that provides communication with and control of the target system.
Installing the C-SPY emulator drivers Feature Simulator E8/E8a Emulator E10A-USB Emulator Code coverage x -- -- Data coverage x -- -- 2 Profiling x x Trace x -- Start/Stop -- x 3 x2 --- Table 3: Driver differences (Continued) 1 For detailed information about available breakpoints, see Available breakpoints, page 19. 2 Cycle counter statistics are not available. 3 Start/Stop is not available for all drivers. General descriptions of the different drivers follow.
Introduction to C-SPY® hardware debugger systems The C-SPY emulator driver communicates with the emulator via the USB driver. The emulator communicates with the emulator interface on the microcontroller. Host computer C-SPY Debugger C-SPY emulator driver USB driver USB connection Emulator Flat cable CPU FLASH RAM Target board Figure 1: Emulator communication overview For further information, refer to the Renesas documentation supplied with the emulator.
Connecting to the target board, E8/E8a 2 Attach the USB cable and connect the E10A-USB emulator to your host computer, and start the setup program found at \install_dir\external\OCD\Platform\ E10A-USB\cpu_family\cpu_name\SetupTool\E1setup.exe. If you are asked to locate a sys file, this can be found on the CD that is supplied with the emulator. 3 A dialog box with information about device and firmware version is displayed.
Introduction to C-SPY® hardware debugger systems 3 Build the project if it has not been built and choose Project>Debug to start C-SPY. 4 The Emulator Setting dialog box is displayed. Figure 2: The Emulator Setting dialog box for the E8a emulator Select your MCU group and device from the drop-down lists.
Connecting to the target board, E8/E8a E8/E8a Emulator option Description Debugging of CPU rewrite Erases the flash memory data for the MCUs and simultaneously mode writes the E8/E8a emulator program, when starting the debugger. Select this setting when debugging the program which rewrites the CPU. Note: In this mode, it is not possible to set PC breakpoints or to change the contents of the flash memory. Execute the user program Executes your application when you stop the debugger.
Introduction to C-SPY® hardware debugger systems Note: Make sure that your application is not downloaded to the firmware location. Figure 3: The Firmware Location page for the E8/E8a emulator If this dialog box is not displayed, skip this step. Click OK in the Emulator Setting dialog box to save your settings. 6 The Connecting dialog box is displayed and the emulator connection is started.
Connecting to the target board, E8/E8a 7 If a dialog box asks you to confirm that the target board is supplied with power, select the check box and the correct voltage. Figure 5: The Power Supply dialog box for the E8/E8a emulator If this dialog box is not displayed, skip this step. Note: Before you connect the target board to a power supply, check the power specifications and that there are no short circuits. Incorrect operation might damage the board and the emulator.
Introduction to C-SPY® hardware debugger systems to save time. For information on how to set this behavior in C-SPY, see the option Do not show this dialog box again, page 6. If you set this option, the connection to the hardware is maintained and the initialization is not repeated. This option is mirrored in the menu command Show Emulator Setting, see the The Emulator menu, page 17.
Connecting to the target board, E10A-USB 5 The Connecting dialog box is displayed and the emulator connection is started. Figure 8: The Connecting dialog box 6 If you are asked to update the emulator firmware, click OK and see Programming the E10A-USB firmware, page 3. 7 If a dialog box asks you to confirm that the target board is supplied with power, select the check box and the correct voltage.
Introduction to C-SPY® hardware debugger systems 8 If the System Clock dialog box is displayed, specify the system clock frequency. Figure 10: The System Clock dialog box for the E10A-USB emulator If this dialog box is not displayed, skip this step. 9 If the ID Code dialog box is displayed, enter the hexadecimal ID security code for the flash memory. For some devices, the flash memory contents are erased if the ID code does not match.
Getting started RUNNING THE DEMO PROGRAM 1 To use an example application, choose Help>Startup Screen and click Example workspaces. In the Example Applications dialog box that appears, choose the specific evaluation board or starter kit that you are using. The examples listed below are supplied with IAR Embedded Workbench for H8. Figure 12: Example application Click Open. 2 In the dialog box that appears, choose a destination folder for your project location. Click Select to confirm your choice.
Introduction to C-SPY® hardware debugger systems 7 Choose Execute>Go or click the Go button to start the program. Click the Stop button to stop execution.
Getting started IAR C-SPY® Hardware Debugger Systems 14 User Guide CSE8E10-2
Hardware-specific debugging This chapter describes the additional options, menus, and features provided by the C-SPY® hardware debugger systems. The chapter contains the following sections: ● Debugger options for debugging using hardware systems ● Target-dependent settings ● Using breakpoints ● Resolving problems.
Debugger options for debugging using hardware systems ● The Download page, page 16 ● The Extra Options page, page 17. 4 When you have set all the required options, click OK in the Options dialog box. THE SETUP PAGE There are no driver-specific options to be set before the debugging starts. Refer to the user documentation supplied with the target system for information about the required settings.
Hardware-specific debugging Note: It is important that the image that resides in target memory is linked consistently with how you use C-SPY for debugging. For example, you might first link your application using an output format without debug information, such as Intel-hex, and then load the application separately from C-SPY.
Using breakpoints These commands are available on the emulator menu: Menu command Description Breakpoint Usage Displays the Breakpoint Usage dialog box, see the The Breakpoint Usage dialog box, page 23. Show Emulator Setting1 Displays the Emulator Setting dialog box, see the Maintaining the connection to the hardware, page 8. Start/Stop Function Setting1 Lets you execute specified routines of your application immediately before starting and immediately after halting the application execution.
Hardware-specific debugging For information about the various methods for setting breakpoints, the facilities for monitoring breakpoints, and the various breakpoint consumers, see the chapter Using breakpoints, page 18 in this guide. AVAILABLE BREAKPOINTS Using the C-SPY drivers for hardware debugger systems you can set code breakpoints and for some drivers you can also set data breakpoints. Code breakpoints are implemented as software breakpoints or hardware breakpoints.
Using breakpoints CODE BREAKPOINTS If you set a code breakpoint, a default breakpoint will be set. If your driver supports hardware breakpoints, the debugger will first use any available hardware breakpoints before using software breakpoints. THE EXECUTION ADDRESS BREAKPOINT DIALOG BOX To set a hardware breakpoint, right-click in the Breakpoints window and choose New Breakpoint>Address on the context menu.
Hardware-specific debugging Conditions You can specify simple and complex conditions. Conditions Description Expression A valid expression conforming to the C-SPY expression syntax. Condition true The breakpoint is triggered if the value of the expression is true. Condition changed The breakpoint is triggered if the value of the expression has changed since it was last evaluated. Skip count The number of times that the breakpoint must be fulfilled before a break occurs (integer).
Using breakpoints Break At Specify the location of the breakpoint in the Break At text box. Alternatively, click the Edit browse button to open the Enter Location dialog box; see the IAR Embedded Workbench® IDE User Guide. Action You can optionally connect an action to a breakpoint. Specify an expression, for instance a C-SPY macro function, which is evaluated when the breakpoint is triggered and the condition is true. Conditions You can specify simple and complex conditions.
Hardware-specific debugging The Break Condition dialog box appears. Figure 18: The Break Condition dialog box Press the Edit button to specify the break conditions. Refer to the user documentation supplied with the target system for information about the break condition settings. THE BREAKPOINT USAGE DIALOG BOX The Breakpoint Usage dialog box—available from the driver-specific menu—lists all active breakpoints.
Resolving problems For more information, see the IAR Embedded Workbench® IDE User Guide. C-SPY USE OF BREAKPOINTS When you set a breakpoint, C-SPY sets a breakpoint for internal use. To do this, the breakpoints in the emulator are used. The fact that C-SPY uses breakpoints is normally not a problem. However, one exception is C-SPY profiling, which requires many breakpoints.
Hardware-specific debugging ● Check that you are using correct linker command file. If you are using the IAR Embedded Workbench, the linker command file is automatically selected based on your choice of device: ● Choose Project>Options ● Select the General Options category ● Click the Target tab ● Choose the appropriate device from the Device drop-down menu.
Resolving problems IAR C-SPY® Hardware Debugger Systems 26 User Guide CSE8E10-2
Index Index A Action (Execution Address Breakpoints dialog box) . . . . . 20 Action (Software Breakpoints dialog box) . . . . . . . . . . . . . 22 address breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 assumptions, programming experience . . . . . . . . . . . . . . . . ix B bold style, in this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi break condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Break Condition dialog box . . .
E K Emulator options Debugging of CPU rewrite mode (E8/E8a) . . . . . . . . . . . 6 Do not show this dialog box again (E8/E8a) . . . . . . . . . . 6 Erase Flash and Connect (E8/E8a) . . . . . . . . . . . . . . . . . . 5 Execute the user program after ending the debugger (E8/E8a). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 E10A-USB Emulator (E10A-USB) . . . . . . . . . . . . . . . . . 9 Keep Flash and Connect (E8/E8a) . . . . . . . . . . . . . . . . . .
Index Suppress download (C-SPY option) . . . . . . . . . . . . . . . . . . 16 System Clock dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . 11 T terminology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x tools icon, in this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi typographic conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . x V Verify download (C-SPY option) . . . . . . . . . . . . . . . . . . . .