Renesas Emulator System E8 User Manual
Renesas Emulator System E8 User Manual

Renesas Emulator System E8 User Manual

Renesas emulator system user's manual
Table of Contents

Advertisement

Quick Links

To our customers,
st
On April 1
, 2010, NEC Electronics Corporation merged with Renesas Technology
Corporation, and Renesas Electronics Corporation took over all the business of both
companies. Therefore, although the old company name remains in this document, it is a valid
Renesas Electronics document. We appreciate your understanding.
Issued by: Renesas Electronics Corporation (http://www.renesas.com)
Send any inquiries to http://www.renesas.com/inquiry.
Old Company Name in Catalogs and Other Documents
Renesas Electronics website:
http://www.renesas.com
st
April 1
, 2010
Renesas Electronics Corporation

Advertisement

Table of Contents
loading

Summary of Contents for Renesas Emulator System E8

  • Page 1 On April 1 , 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all the business of both companies. Therefore, although the old company name remains in this document, it is a valid Renesas Electronics document. We appreciate your understanding.
  • Page 2 Renesas Electronics. Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as “Specific”...
  • Page 3 E8 Emulator User’s Manual R0E000080KCE00E Renesas Microcomputer Development Environment System Rev.10.00 2007.08 www.renesas-electoronics.com...
  • Page 4 Please be sure to implement safety measures to guard against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other applicable measures.
  • Page 5 This manual describes the followings - E8 Emulator functions - Preparation before use - Debugger functions - Tutorial - Appendix: (Components of the E8 Emulator, Notes on High-performance Embedded Workshop, and Diagnostic Test Procedure) This manual does not intend to explain how to write C/C++ or assembly language programs, how to use any particular operating system or how best to tailor code for the individual devices.
  • Page 6 Document Conventions This manual uses the following typographic conventions: Table 1 Typographic Conventions Convention [Menu->Menu Option] FILENAME.C “enter this string” Key + Key (The “how to” symbol) Bold text with ‘->’ is used to indicate menu options (for example, [File->Save As...]). Uppercase names are used to indicate filenames.
  • Page 7: Read First

    The emulator herein does not include the customer’s user system and host machine. Purpose of use of the emulator: This emulator is a device to support the development of a system that uses the Renesas MCUs. It provides support for system development in both software and hardware.
  • Page 8 Usage restrictions: This emulator has been developed as a means of supporting system development by users. Therefore, do not use it as a device used for equipment-embedded applications. Also, do not use it for developing the systems or equipment used for the following purposes either: (1) Transportation and vehicular (2) Medical (equipment where human life is concerned) (3) Aerospace...
  • Page 9: Precautions For Safety

    Precautions for Safety READ FIRST Before using this product, be sure to read the user’s manual (this user's manual) carefully. Keep this user’s manual, and refer to this when you have questions about this product.
  • Page 10 DEFINITION OF SIGNAL WORDS Be sure to read and understand the warnings below before using this emulator. Note that these are the main warnings, not the complete list. This is the safety alert symbol. It is used to alert you to potential personal injury hazards.
  • Page 11 1. Do not repair or remodel the emulator product by yourself for electric shock prevention and quality assurance. 2. Always switch OFF the host computer and user system before connecting or disconnecting any CABLES or PARTS. Failure to do so will result in a FIRE HAZARD and will damage the user system and the emulator product or will result in PERSONAL INJURY.
  • Page 13: Table Of Contents

    Contents Section 1 Overview... 1 Warnings ...3 Environmental Conditions ...4 Components ...5 Section 2 E8 Emulator Functions ... 7 2.1 Overview...7 2.2 Trace Functions...9 2.3 Break Functions ...10 2.4 Memory Access Functions...11 2.5 Stack Trace Function ...12 2.6 Online Help...12 Section 3 Preparation before Use...
  • Page 14 5.1.1 Opening the [Configuration] Dialog Box ... 71 5.1.2 [General] Page ... 72 Downloading a Program ... 74 5.2.1 Downloading a Program ... 74 5.2.2 Viewing the Source Code ... 75 Stopping Your Program ... 78 5.3.1 Address Interrupt Breakpoints ... 78 Using the Event Points...
  • Page 15 5.6 Using the Start/Stop Function...89 5.6.1 Opening the [Start/Stop Function Setting] Dialog Box...89 5.6.2 Specifying the Routine to be Executed ...89 5.6.3 Restrictions on the Start/Stop Function...91 Section 6 Tutorial... 93 6.1 Introduction...93 6.2 Running the High-performance Embedded Workshop...94 6.3 Setting up the E8 Emulator ...94 6.4 Setting the [Configuration] Dialog Box...95 6.5 Checking the Operation of RAM ...97 6.6 Downloading the Tutorial Program ...99...
  • Page 16 E.1. System Setup to Execute the Check Program ... 143 E.2. Executing the Check Program... 143 When an Error Occurs... 145...
  • Page 19: Contents

    C/C++ programming language and assembly language for Renesas microcomputers. Its aim is to provide a powerful yet intuitive way of accessing, observing and modifying the debugging platform in which the application is running.
  • Page 20 The emulator has three activation modes: (1) A mode in which the emulator program is started after it has been downloaded to the target device: This mode is used when there is no emulator program in the flash memory of the target device. (2) A mode in which the emulator program is started without downloading it to the target device: This mode is used when there is an emulator program in the flash memory of the target device.
  • Page 21: Warnings

    Warnings READ the following warnings before using the emulator product. Incorrect operation will damage the user system and the emulator product. The USER PROGRAM will be LOST. (1) Check all components against the component list provided at the side of the component box after unpacking the emulator.
  • Page 22: Environmental Conditions

    Environmental Conditions Observe the conditions listed in tables 1.1 and 1.2 when using the emulator. Failure to do so will cause illegal operation in the user system, the emulator product, and the user program. Table 1.1 Environmental Conditions Item Temperature Operating: +10°C to +35°C Storage: Humidity...
  • Page 23: Components

    Components Check all the components unpacking. For details on the E8 emulator components, refer to the component list provided at the side of the component box. If the components are not complete, contact our E-mail address for user registration or refer to the web site.
  • Page 25: Section 2 E8 Emulator Functions

    Section 2 E8 Emulator Functions This section describes the emulator functions. They differ according to the device supported by the emulator. 2.1 Overview Table 2.1 gives a functional overview of the emulator. Table 2.1 Emulator Functions Item User program execution function Reset function Trace function...
  • Page 26 Table 2.1 Emulator Functions (cont) Item Memory access function General/control register access function Internal I/O register access function Source-level debugging function Command line function Help function The specific functions of the emulator are described in the next section. • Downloading to RAM •...
  • Page 27: Trace Functions

    2.2 Trace Functions The branch source addresses, mnemonics, operands, and source lines are displayed. Since this function uses the trace buffer built into the device, a realtime trace can be acquired. Note: The MCUs which have no trace function cannot use this function.
  • Page 28: Break Functions

    2.3 Break Functions The E8 emulator has the following four break functions. (1) Hardware break function H8 R8C series Uses a break controller incorporated in the device. The access address, instruction fetch address, data, or bus cycle condition can be set. This function can also be set from the refer to section 5.3.1 Address Interrupt Breakpoints.
  • Page 29: Memory Access Functions

    2.4 Memory Access Functions The emulator has the following memory access functions. (1) Memory read/write function [Memory] window: The memory contents are displayed in the window. Only the amount specified when the [Memory] window is opened can be read. If the memory is written in the [Memory] window, a read in the range displayed in the [Memory] window will occur for updating the window.
  • Page 30: Stack Trace Function

    (6) Other memory operation functions Other functions are as follows: • Memory fill • Memory copy • Memory save • Memory verify • Memory search • Internal I/O display • Displaying label and variable names and their contents Notes: 1. Memory access during user program execution: When memory is accessed from the memory window, etc.
  • Page 31: Section 3 Preparation Before Use

    Section 3 Preparation before Use 3.1 Emulator Preparation Unpack the emulator and prepare it for use as follows: READ the reference sections shaded in Figure 3.1 before using the emulator product. Incorrect operation will damage the user system and the emulator product. The USER PROGRAM will be LOST.
  • Page 33: Emulator Hardware Configuration

    3.2 Emulator Hardware Configuration As shown in Figure 3.2, the emulator consists of an emulator, a USB cable, and a user system interface cable. The emulator is connected to the host computer via USB 1.1, and also to the USB port conforming to USB 2.0.
  • Page 34 The names of each section of the emulator are explained next. Emulator Upper-side Panel: (a) E8 logo plate: (b) Sliding switch cover: A cover to protect a switch for setting the emulator, which is closed (c) ACTION LED: (d) Host connector: (e) User connector: Note: Even if the LED is not lit when the emulator is connected to the host computer, the USB is not malfunctioned.
  • Page 35 Emulator Host-side Panel: Host-side connector: Emulator User-side Panel: User-side connector: Figure 3.4 Emulator Host-side Panel A USB connector for the host computer. Be sure to connect the provided USB cable. Figure 3.5 Emulator User-side Panel A user system interface cable is connected.
  • Page 36 Emulator Bottom Panel: (a) Seal for product management: The serial number, revision, and safety standard, etc. of the Figure 3.6 Emulator Bottom Panel emulator are written to. The contents differ depending on the time when you purchased the product.
  • Page 37: Emulator Software Configuration

    3.3 Emulator Software Configuration The following item is included with the emulator debugger when it is purchased: • E8 Emulator Debugger: R0E000080KCE00SR (CD) 3.3.1 CD Install the software as instructed by the displayed messages by inserting the included CD into the CD-ROM drive.
  • Page 38: Installing Emulator's Debugger

    3.4 Installing Emulator’s Debugger When the CD is inserted in the host computer’s CD drive, execute Setup.exe from the root directory of the CD.
  • Page 39: Connecting The Emulator To The Host Computer

    3.5 Connecting the Emulator to the Host Computer This section describes how to connect the emulator to the host computer. For the position of each connector of the emulator, refer to section 3.2, Emulator Hardware Configuration. Notes: 1. When [Add New Hardware Wizard] is displayed, select the [Search for the best driver for your device.
  • Page 40 The emulator is connected to the host computer via the USB 1.1, and also to the USB port conforming to USB 2.0. Figure 3.7 shows the system configuration. Figure 3.7 System Configuration when Connecting the Emulator to the Host Computer...
  • Page 41: Connecting The Emulator To The User System

    3.6 Connecting the Emulator to the User System Use the procedure below to connect the emulator to the user system with the user system interface cable, or to disconnect them when moving the emulator or the user system. 1. Check that the host computer is turned off or the emulator is not connected to the host computer with the USB cable.
  • Page 42 (2) The pin assignments of the connector are shown in section 2 in the additional documents, Notes on Connecting the xxxxx. Figure 3.9 Connecting the User System Interface Cable to the User System Notes: To connect the signals output from the connector, refer to the MCU pin alignment. To remove the user system interface cable from the user system, pull the tab on the connector upward.
  • Page 43: Connecting System Ground

    3.7 Connecting System Ground Separate the frame ground from the signal ground at the user system. Failure to do so will result in a FIRE HAZARD and will damage the user system and the emulator product or will result in PERSONAL INJURY. The emulator's signal ground is connected to the user system's signal ground.
  • Page 44: System Check

    2. Connect the user system interface cable to the connector of the emulator. 3. Connect the user system interface cable to the connector in the user system. 4. Select [Renesas] -> [High-performance Embedded Workshop] -> [High-performance Embedded Workshop] from [Programs] in the [Start] menu of Windows 5.
  • Page 45 When the [Open workspace] dialog box is opened, specify the following directory: <OS installation directory> \WorkSpace\Tutorial\E8\xxxx\Tutorial After the directory has been specified, select the following file and click the [Open] button. Figure 3.12 [Open Workspace] Dialog Box Note: The directory for a tutorial differs depending on the device. M32C Drive where the OS has been installed: \WorkSpace\Tutorial\E8\M32C\Tutorial...
  • Page 46 6. The [Select Emulator mode] dialog box is displayed. Figure 3.13 [Emulator Setting] Dialog Box Select the device name in use from the [MCU Group] drop-down list box. Note: The [MCU Group] drop-down list box is not displayed in the H8/Tiny or H8/Super Low Power series.
  • Page 47 ⎯ Program Flash This mode is used when the emulator is used as a flash memory programmer. It cannot be used for debugging programs. Register the load module in the workspace to download it. Note: It is necessary to input the ID code of the flash memory by the target device. For details, refer to the additional document, Notes on Connecting the xxxxx.
  • Page 48 The [Connecting] dialog box is displayed and the emulator connection is started. Figure 3.14 [Connecting] Dialog Box 8. When the version of the E8 firmware downloaded into the emulator is old, the message box shown in Figure 3.15 will be displayed. Figure 3.15 Dialog Box for confirming the E8 firmware download Note: When [OK] button is clicked, it starts downloading the E8 firmware.
  • Page 49 9. When [Power supply is carried out. (MAX 300mA)] is not checked, the dialog box shown in Figure 3.17 will be displayed. Figure 3.16 Dialog Box of the Power-on Request Message 10. The dialog box for confirming the power supply status of the user system will be displayed. When [Power supply is carried out.
  • Page 50 11. When [Power supply is carried out. (MAX 300mA)] is not checked, power on the user system and click the [OK] button. 12. When "Connected" is displayed in the [Output] window of the High-performance Embedded Workshop, the emulator initiation is completed Figure 3.18 High-performance Embedded Workshop Window Note: When the user program has already been downloaded to the flash memory, source-level debugging cannot be executed because there is no debugging information on the user...
  • Page 51 Notes: 1. If the user system interface cable is disconnected from the connector on the user system, the following dialog box will appear. Figure 3.19 [Connector disconnected] Dialog Box 2. If the emulator is not properly initialized, one of the dialog boxes shown in figures 3.20 through 3.24 will appear.
  • Page 52 (c) The following dialog box is displayed when an incorrect ID code has been input. For the H8/Tiny, H8/ Super Low Power, R8C/10, 11, 12 and 13, if an ID code does not match, the flash memory will be completely erased. (d) The following dialog box is displayed when the MCU cannot communicate with the emulator.
  • Page 53: Uninstalling The Emulator's Debugger

    3.9 Uninstalling the Emulator’s Debugger Follow this procedure to remove the installed emulator’s debugger from the user’s host computer. As the installed product is known by the High-performance Embedded Workshop, uninstall the product on the High-performance Embedded Workshop screen. 1. Activate the High-performance Embedded Workshop. 2.
  • Page 54 Click the [+] mark at the left of [Debugger Components] in the [Registered components] list box to list the installed components. Then, highlight the product name to be uninstalled. Figure 3.27 Highlighting the Product to be Uninstalled Click the [Unregister] button. After the following message box is displayed, click the [Yes] button.
  • Page 55 Figure 3.29 [Uninstall HEW Tool] Dialog Box Click the [Start] button to list the installed components. Figure 3.30 Highlighting the Product to be Uninstalled...
  • Page 56 Highlight the product name to be uninstalled and click the [Uninstall] button. This is the end of uninstallation. A shared file may be detected while the program is being removed. If another product may be using the shared file, do not remove the file.
  • Page 57: Section 4 Preparations For Debugging

    To activate the High-performance Embedded Workshop, follow the procedure listed below. 1. Connect the emulator to the host computer and the user system, then turn on the user system. 2. Select [Renesas] -> [High-performance Embedded Workshop] -> [High-performance Embedded Workshop] from [Programs] in the [Start] menu of Windows 3.
  • Page 58: Creating The New Workspace (Toolchain Not Used)

    4.1.1 Creating the New Workspace (Toolchain Not Used) 1. In the [Welcome!] dialog box that is displayed when the High-performance Embedded Workshop is activated, select [Create a new project workspace] radio button and click the [OK] button. 2. The Project Generator is started. This section omits the description on the setting for the toolchain.
  • Page 59 Figure 4.3 [New Project Workspace] Dialog Box [Workspace Name] edit box: Enter the new workspace name. Here, enter ‘test’. [Project Name] edit box: [CPU family] drop-down list box: Select the target CPU family. [Tool chain] drop-down list box: Here, select [None]. Other list boxes are used for setting the toolchain;...
  • Page 60 3. The following dialog box is displayed. Figure 4.4 [Setting the Target System for Debugging] Dialog Box Select the target system for debugging and click the [Next] button. [Target system for debugging] M32C E8 SYSTEM: M16C E8 SYSTEM: R8C E8 SYSTEM: H8 Tiny/Super Low Power E8 SYSTEM 300H: H8 Tiny/Super Low Power E8 SYSTEM 300L: 4.
  • Page 61 Figure 4.5 [Setting the Debugger Options] Dialog Box This is the end of the emulator setting. Click the [Finish] button to exit the Project Generator. The High-performance Embedded Workshop is activated. 5. After the High-performance Embedded Workshop has been activated, the emulator is automatically connected.
  • Page 62: Creating The New Workspace (Toolchain Used)

    4.1.2 Creating the New Workspace (Toolchain Used) 1. In the [Welcome!] dialog box that is displayed when the High-performance Embedded Workshop is activated, select [Create a new project workspace] radio button and click the [OK] button. 2. The Project Generator is started. If you have purchased the toolchain, the following dialog box is displayed.
  • Page 63 Figure 4.7 [New Project Workspace] Dialog Box...
  • Page 64 [Workspace Name] edit box: [Project Name] edit box: [CPU family] drop-down list box: Select the target CPU family. [Tool chain] drop-down list box: [Project type] list box: Enter the new workspace name. Here, enter ‘test’. Enter the project name. When the project name is the same as the workspace name, it needs not be entered.
  • Page 65 3. Make the required setting for the toolchain. Figure 4.8 [New Project-1/6-Select Target CPU. Toolchain version] Dialog Box Select your toolchain version, CPU series and click the [Next] button.
  • Page 66 4. Make the required settings for the RTOS. Figure 4.9 [New Project-2/6-Select RTOS] Dialog Box Select the RTOS you use, type of startup file and click the [Next] button. Note: In the H8/Tiny or H8/Super Low Power series this dialog box will not be displayed.
  • Page 67 5. Make the required settings for the heap area etc. Figure 4.10 [New Project-3/6-Setting the Contents of Files to be Generated] Dialog Box Set the heap size etc. and click the [Next] button. Note: In the H8/Tiny, H8/ Super Low Power series, the content of the dialog box will differ.
  • Page 68 6. Make the required setting for the stack area. Figure 4.11 [New Project-4/6-Setting the Stack Area] Dialog Box Set the stack size and click the [Next] button.
  • Page 69 7. When the tool chain settings have been completed, the following dialog box is displayed. Figure 4.12 [New Project-5/6-Setting the Target System for Debugging] Dialog Box Select the target system for debugging and click the [Next] button. [Target system for debugging] M32C E8 SYSTEM: M16C E8 SYSTEM: R8C E8 SYSTEM:...
  • Page 70 Set a configuration file name. The configuration file saves the settings of the High-performance Embedded Workshop except for the emulator. Figure 4.13 [New Project-6/7-Setting the Debugger Options] Dialog Box...
  • Page 71 9. Finally, confirm the file name you create. Figure 4.14 [New Project-7/7-Changing the File Names to be Created] Dialog Box The files which will be generated by the High-performance Embedded Workshop are displayed If you want to change the file name, select and click it then enter the new name. This is the end of the emulator settings.
  • Page 72 10. After the High-performance Embedded Workshop has been activated, connect the emulator. However, it is not needed to connect the emulator immediately after the High-performance Embedded Workshop has been activated. To connect the emulator, use one of the methods (a) and (b) below. For operation during connection, refer to section 3.8, System Check.
  • Page 73 (b) Connecting the emulator without the setting at emulator activation The emulator can be easily connected by switching the session file that the setting for the emulator use has been registered. In the list box that is circled in Figure 4.15, select the session file name including the character string that has been set in the [Target name] text box in Figure 4.13, [New Project-6/7-Setting the Debugger Options] dialog box.
  • Page 74: Selecting An Existing Workspace

    4.1.3 Selecting an Existing Workspace 1. In the [Welcome!] dialog box that is displayed when the High-performance Embedded Workshop is activated, select [Browse to another project workspace] radio button and click the [OK] button. Figure 4.16 [Welcome!] Dialog Box...
  • Page 75 2. The [Open Workspace] dialog box is displayed. Select a directory in which you have created a workspace. After that, select the workspace file (.hws) and press the [Open] button. Figure 4.17 [Open Workspace] Dialog Box 3. This activates the High-performance Embedded Workshop and recovers the state of the selected workspace at the time it was saved.
  • Page 76: Setting At E8 Emulator Activation

    Setting at E8 Emulator Activation 4.2.1 Setting at Emulator Activation When the emulator is activated, the command chain can be automatically executed. It is also possible to register multiple load modules to be downloaded. The registered load modules are displayed on the workspace window. 1.
  • Page 77 Figure 4.19 [Debug Settings] Dialog Box ([Options] Page) The command chain that is automatically e xecuted at the specified timing is registered. The following three timings can be specified: • At connecting the emulator • Immediately before downloading • Immediately after downloading Specify the timing for executing the command chain in the [Command batch file load timing] drop-down list box.
  • Page 78: Downloading A Program

    4.2.2 Downloading a Program A download module is added under [Download modules] in the [Workspace] window. Open the load module of [Download modules] in the [Workspace] window by clicking the right- hand mouse button and select [Download module] to start downloading the module. Figure 4.20 Download Menu of the [Workspace] Window ([Projects]) Notes: 1.
  • Page 79: Setting The Writing Flash Memory Mode

    4.2.3 Setting the Writing Flash Memory Mode The following describes the procedures when the emulator is used as the programming tool. The load module to be downloaded to the new workspace is registered and programmed. (a) Select the new project workspace. Figure 4.21 [New Project Workspace] Dialog Box...
  • Page 80 (b) Select the target MCU and click the [Next] button. Figure 4.22 [Setting the Target System for Debugging] Dialog Box...
  • Page 81 (c) Set a configuration file name and click the [Finish] button. Figure 4.23 [Setting he Debugger Options] Dialog Box...
  • Page 82 (d) The [Emulator Setting] dialog box is displayed. Figure 4.24 [Select Emulator mode] Dialog Box Select the [Program Flash] mode. When the [Power Target from Emulator. (MAX 300mA)] check box is selected, power will be supplied to the user system up to 300 mA. Then select 3.3 V or 5.0 V according to the power voltage of the user system.
  • Page 83 (e) When [Power supply is carried out. (MAX 300mA)] is not checked, the dialog box shown in Figure 4.25 will be displayed. Figure 4.25 Dialog Box of Power-on request message When [Power supply is carried out. (MAX 300mA)] is not checked, turn on the power to the user system.
  • Page 84 (g) Select [Debug Setting…] from the [Debug] menu. Figure 4.27 High-performance Embedded Workshop Window...
  • Page 85 (h) Select the target MCU and then the download module with the [Add…] button. Figure 4.28 [Debug Setting] Dialog Box ([Target] Page) (i) The download file is displayed on [Project Files]. Figure 4.29 [Workspace] Window ([Project Files])
  • Page 86 (j) Select and download the file with the right-hand mouse button. Figure 4.30 Download Menu of the [Workspace] Window ([Project Files]) (k) The dialog box for sum checking is displayed and writing is completed. Figure 4.31 Message for Completion of Flash Memory Writing...
  • Page 87 (l) When the following dialog box is displayed, close and restart or exit the workspace. Figure 4.32 Message for Restarting or Exiting Writing Flash Memory Mod...
  • Page 89: Section 5 Debugging

    This section describes the debugging operations and their related windows and dialog boxes. For details on the common functions of the High-performance Embedded Workshop products, refer to the High-performance Embedded Workshop User’s Manual. Setting the Environment for Emulation 5.1.1 Opening the [Configuration] Dialog Box Selecting [Setup ->...
  • Page 90: General] Page

    5.1.2 [General] Page Sets the emulator operation conditions. Figure 5.1 [Configuration] Dialog Box ([General] Page) Items that can be displayed in the sheet are listed below. [Device] combo box [Emulation mode] combo box [User interface clock] combo box Displays the MCU name. Selects the emulation mode at user program execution.
  • Page 91 [Flash memory synchronization] combo box Notes: 1. These dialog boxes differ depending on products. For details, refer to the online help. Selects whether or not the contents of the flash memory are acquired by the emulator when the user program is stopped or the position where the PC break is set is put back as the original code.
  • Page 92: Downloading A Program

    Downloading a Program This section describes how to download a program and view it as source code or assembly- language mnemonics. Note: After a break has been detected, the High-performance Embedded Workshop displays the location of the program counter (PC). In most cases, for example if an Elf/Dwarf2-based project is moved from its original path (at the build), the source file may not be automatically found.
  • Page 93: Viewing The Source Code

    5.2.2 Viewing the Source Code Select a source file name in the [Workspace] window and click [Open] in the popup menu to make the High-performance Embedded Workshop display the source file in the editor. It is also possible to display your source files by double-clicking on their names in the [Workspace] window. Figure 5.2 [Source] Window...
  • Page 94 In this window, the following items are shown on the left as line information. The first column (Line Number column) Line number The second column (Source address column): Address information The third column (Event column): Event information (break condition) The fourth column (S/W Breakpoints column): PC, bookmark, and breakpoint information The right window that shows the source is called as the [Source] window.
  • Page 95 To switch off a column in all source files 1. Click the right-hand mouse button on the [Source] window or select the [Edit] menu. 2. Click the [Define Column Format…] menu item. 3. The [Global Editor Column States] dialog box is displayed. 4.
  • Page 96: Stopping Your Program

    Stopping Your Program This section describes how you can halt execution of your application's code. This section describes how to stop the program by setting an address match breakpoints at specific locations in your code. 5.3.1 Address Interrupt Breakpoints When you are trying to debug your program you will want to be able to stop the program running when it reaches a specific point or points in your code.
  • Page 97: Using The Event Points

    Using the Event Points The emulator has the event point function that performs breaking by specifying higher-level conditions along with the PC breakpoints standard for the High-performance Embedded Workshop. 5.4.1 PC Breakpoints When the instruction of the specified address is fetched, the user program is stopped. Up to 255 points can be set.
  • Page 98: Add

    This window displays and sets the breakpoints. Items that can be displayed in the sheet are listed below. [Type] Breakpoint [State] Whether the breakpoint is enabled or disabled [Condition] An address that the breakpoint is set Address = Program counter (Corresponding file name, line, and symbol name) [Action] Operation of the emulator when a break condition is satisfied Break: Halts execution...
  • Page 99: Go To Source

    5.4.11 Go to Source Only enabled when one breakpoint is selected. Opens the [Source] window at the address of the breakpoint. 5.4.12 [Set Break] Dialog Box This dialog box specifies break conditions. A breakpoint address to be set is specified in the [Address] edit box. Up to 255 breakpoints can be specified.
  • Page 100: Setting Break Conditions

    Notes on Setting the [Set Break] Dialog Box 1. When an odd address is set for the H8/Tiny and H8/ Super Low Power series, the address is rounded down to an even address. 2. A Breakpoint is accomplished by replacing instructions. Accordingly, it can be set only to the flash memory or RAM area.
  • Page 101: Edit

    Notes on Setting the Break Condition: 1. When [Go to cursor], [Step In], [Step Over], or [Step Out] is selected, the settings of Break Condition 1 are disabled. 2. Setting of Break Condition 1 is disabled when an instruction to which a BREAKPOINT has been set is executed.
  • Page 102: Disable

    5.4.16 Disable Disables the selected break channel(s). When a break channel is disabled, a break will not occur even if specified conditions have been satisfied. 5.4.17 Delete Initializes the condition of the selected break channel. To retain the details of the break channel but not have it cause a break when its conditions are met, use the Disable option (see section 5.4.16, Disable).
  • Page 103: Deleting Break Conditions

    5.4.25 Deleting Break Conditions Select a break condition and choose [Delete] from the popup menu to remove the selected break condition. To retain the break condition but not have it cause an event when its conditions are met, use the [Disable] option (see section 5.4.24, Disabling Break Conditions). 5.4.26 Deleting All Break Conditions Choose [Delete All] from the popup menu to remove all break conditions.
  • Page 104 The [Address] group box sets address bus conditions. Option [Don’t care] check box [Address] radio button [Only program fetched address after] radio button [Address] edit box [Mask] edit box The contents of an option that can be will change depending on the radio button selected. Option [Address] radio button [Only program fetched address after]...
  • Page 105: Viewing The Trace Information

    Viewing the Trace Information For the description on the trace function, refer to section 2.2, Trace Functions. Note: The R8C/Tiny series MCUs do not have trace functions. 5.5.1 Opening the [Trace] Window To open the [Trace] window, choose [View -> Code -> Trace] or click the [Trace] toolbar button 5.5.2 Acquiring Trace Information The acquired trace information is displayed in the [Trace] window.
  • Page 106: Clearing The Trace Information

    5.5.3 Clearing the Trace Information When [Clear] is selected from the popup menu, the trace buffer that stores the trace information becomes empty. If several [Trace] windows are open, all [Trace] windows will be cleared as they all access the same buffer. 5.5.4 Saving the Trace Information in a File Select [Save...] from the popup menu to open the [Save As] file dialog box, which allows the user...
  • Page 107: Using The Start/Stop Function

    5.6 Using the Start/Stop Function The emulator executes the specified routine of the user program immediately before starting and immediately after halting program execution. This function is used to control the user system in synchronization with execution and halting of the user program. Note: The start/stop function is not supported in the H8/Tiny or H8/Super Low Power series, or the R8C/10, R8C/11, R8C/12, or R8C/13 group.
  • Page 108 If no specified routine is executed immediately before starting user program execution, do not select the [The specified routine is executed immediately before execution of the user’s program.] check box. When the [The specified routine is executed immediately after the stop of the user’s program.] check box is selected, the routine specified in the [starting address] combo box, which is below this check box, is executed immediately after halting user program execution.
  • Page 109: Restrictions On The Start/Stop Function

    5.6.3 Restrictions on the Start/Stop Function The start/stop function has the following restrictions. • Do not change the SFR used by the firmware. • When the watchdog timer is used, refresh the watchdog timer in the specified routine. • Do not set any breakpoints in the specified routine. •...
  • Page 111: Section 6 Tutorial

    6.1 Introduction This section describes the main functions of the emulator by using a tutorial program. The tutorial program is based on the C program that sorts ten random data items in ascending or descending order. The tutorial program performs the following actions: •...
  • Page 112: Running The High-Performance Embedded Workshop

    6.2 Running the High-performance Embedded Workshop To run the High-performance Embedded Workshop, refer to section 3.8, System Check. 6.3 Setting up the E8 Emulator This section describes the basic settings of the emulator.
  • Page 113: Setting The [Configuration] Dialog Box

    6.4 Setting the [Configuration] Dialog Box • Select [Emulator] then [Systems…] from the [Setup] menu for the basic settings of the emulator. The [Configuration] dialog box is displayed. Figure 6.1 [Configuration] Dialog Box Note: The items that can be set in this dialog box differ depending on the product. For the settings for each product, refer to the online help.
  • Page 114 Set options as follows: Table 6.1 [General] Page Options Option Device Emulation mode User interface clock Flash memory synchronization Click the [OK] button to set a configuration. Select a device you use Normal (normal execution, default) According to the system clock frequency, the maximum user interface clock is automatically set.
  • Page 115: Checking The Operation Of Ram

    6.5 Checking the Operation of RAM Check that RAM is operating correctly. Display and edit the contents of the memory in the [Memory] window to check that the memory is operating correctly. Note: The memory can be installed on the board in some microcomputers. In this case, however, the above way of checking the operation of memory may be inadequate.
  • Page 116 • Placing the mouse cursor on a point in the display of data in the [Memory] window and double-clicking allows the values at that point to be changed. Data can also be directly edited around the current position of the text cursor. Figure 6.3 [Memory] Window...
  • Page 117: Downloading The Tutorial Program

    6.6 Downloading the Tutorial Program 6.6.1 Downloading the Tutorial Program Download the object program to be debugged. In this emulator, it is enabled to download the program and set the PC breakpoint in the internal flash memory area. For the method to set the PC breakpoint, refer to section 6.16.1, PC Break Function.
  • Page 118: Displaying The Source Program

    6.6.2 Displaying the Source Program The High-performance Embedded Workshop allows the user to debug a user program at the source level. • Double-click [tutorial.c] under [C source file]. Figure 6.5 [Source] Window (Displaying the Source Program) Select the [Display] option from the [Setup] menu to set a font and size that are legible, if necessary.
  • Page 119: Setting A Pc Breakpoint

    6.7 Setting a PC Breakpoint A PC breakpoint is a simple debugging function. The [Source] window provides a very simple way of setting a PC breakpoint at any point in a program. For example, to set a PC breakpoint at the sort function call: •...
  • Page 120: Setting Registers

    6.8 Setting Registers Set values of the program counter and the stack pointer before executing the program. • Select [Registers] from the [CPU] submenu of the [View] menu. The [Register] window is displayed. Figure 6.7 [Register] Window...
  • Page 121 To change the value of the program counter (PC), double-click the value area in the [Register] window with the mouse. The following dialog box is then displayed, and the value can be changed. Set the program counter to 0E612 in this tutorial program, and click the [OK] button.
  • Page 122: Executing The Program

    6.9 Executing the Program Execute the program as described in the following: • To execute the program, select [Go] from the [Debug] menu, or click the [Go] button on the toolbar. When the program execution is started, ‘**RUNNING’ is displayed on the status bar. The program will be executed up to the breakpoint that has been set, and an arrow will be displayed in the [S/W Breakpoints] column to show the position that the program has halted, with the message [BREAKPOINT] in the status bar.
  • Page 123 Figure 6.10 [Source] Window (Break State)
  • Page 124 The user can see the cause of the break that occurred last time in the [Status] window. • Select [Status] from the [CPU] submenu of the [View] menu. After the [Status] window is displayed, open the [Platform] sheet, and check the Status of Cause of last break. Note: The items that can be set in this window differ depending on the product.
  • Page 125: Reviewing Breakpoints

    6.10 Reviewing Breakpoints The user can see all the breakpoints set in the program in the [Eventpoint] window. • Select [Eventpoints] from the [Code] submenu of the [View] menu. The [Eventpoint] window is displayed. Select the [Breakpoint] sheet. The popup menu, opened by clicking the [Eventpoint] window with the right-hand mouse button, allows the user to set or change breakpoints, define new breakpoints, and delete, enable, or disable breakpoints.
  • Page 126: Viewing Memory

    6.11 Viewing Memory When the label name is specified, the user can view the memory contents that the label has been registered in the [Memory] window. For example, to view the memory contents corresponding to _main in word size: • Select [Memory …] from the [CPU] submenu of the [View] menu, enter _main in the [Display Address] edit box, enter 0000 and FFFF in the [Scroll Start Address] and [Scroll End Address] edit boxes, respectively.
  • Page 127: Watching Variables

    6.12 Watching Variables As the user steps through a program, it is possible to watch that the values of variables used in the user program are changed. For example, set a watch on the long-type array a declared at the beginning of the program, by using the following procedure: •...
  • Page 128 The user can also add a variable to the [Watch] window by specifying its name. • Click the [Watch] window with the right-hand mouse button and select [Add Watch…] from the popup menu. The following dialog box will be displayed. Enter variable i. Figure 6.17 [Add Watch] Dialog Box •...
  • Page 129 The user can click mark ‘+’ at the left side of array a in the [Watch] window to watch all the elements. Figure 6.19 [Watch] Window (Displaying Array Elements)
  • Page 130: Stepping Through A Program

    6.13 Stepping Through a Program The High-performance Embedded Workshop provides a range of step menu commands that allow efficient program debugging. Table 6.2 Step Option Menu Command Step In Executes each statement, including statements within functions. Step Over Executes a function call in a single step. Step Out Steps out of a function, and stops at the statement following the statement in the program that called the function.
  • Page 131: Executing [Step Out] Command

    6.13.2 Executing [Step Out] Command The [Step Out] command steps out of the called function and stops at the next statement of the calling statement in the main function. • To step out of the sort function, select [Step Out] from the [Debug] menu, or click the [Step Out] button on the toolbar.
  • Page 132: Executing [Step Over] Command

    6.13.3 Executing [Step Over] Command The [Step Over] command executes a function call as a single step and stops at the next statement of the main program. • To step through all statements in the change function at a single step, select [Step Over] from the [Debug] menu, or click the [Step Over] button on the toolbar.
  • Page 133: Forced Breaking Of Program Executions

    6.14 Forced Breaking of Program Executions The High-performance Embedded Workshop can force a break in the execution of a program. • Cancel all breaks. • To execute the remaining sections of the main function, select [Go] from the [Debug] menu or the [Go] button on the toolbar.
  • Page 134: Displaying Local Variables

    6.15 Displaying Local Variables The user can display local variables in a function using the [Locals] window. For example, we will examine the local variables in the main function, which declares four local variables: a, j, i, and p_sam. • Select [Locals] from the [Symbol] submenu of the [View] menu. The [Locals] window is displayed.
  • Page 135: Break Function

    6.16 Break Function The emulator has PC and hardware break functions. With the High-performance Embedded Workshop, a PC breakpoint can be set using the [Breakpoint] sheet of the [Event] window, and a hardware break condition can be set using the [Breakcondition] sheet. An overview and setting of the break function are described below.
  • Page 136 • Click the [Event] window with the right-hand mouse button and select [Add…] from the popup menu. • Enter H'0E1F2 in the [Address] edit box. Figure 6.30 [Set Break] Dialog Box • Click the [OK] button.
  • Page 137 The PC breakpoint that has been set is displayed in the [Eventpoint] window. Figure 6.31 [Eventpoint] Window (PC Breakpoint Setting) To stop the tutorial program at the PC breakpoint, the following procedure must be executed: • Close the [Eventpoint] window. •...
  • Page 138 The [Status] window displays the following contents. Figure 6.33 Displayed Contents of the [Status] Window (PC Break) Note: The items that can be set in this window differ depending on the product. For the settings for each product, refer to the online help.
  • Page 139: Hardware Break Function

    6.17 Hardware Break Function A method is given below in which the address bus condition is set under Break Condition 1 as hardware break conditions. • Select [Eventpoints] from the [Code] submenu of the [View] menu. The [Eventpoint] window is displayed. •...
  • Page 140 • The [Break condition 1] dialog box is displayed. • Clear the [Don't care] check box in the [Address] group box. • Select the [Only program fetched address after] radio button and enter H'0E1F2 as the value in the [Address] edit box. Figure 6.35 [condition] Page ([Break condition 1] Dialog Box) Click the [OK] button.
  • Page 141 The program runs and then stops at the condition specified under Break Condition 1. Figure 6.36 [Source] Window at Execution Stop (Break Condition 1) The [Status] window displays the following contents. Figure 6.37 Displayed Contents of the [Status] Window (Break Condition 1) Note: The items that can be set in this window differ depending on the product.
  • Page 142: Trace Functions

    6.18 Trace Functions The emulator has a branch-instruction trace function. The branch source addresses, mnemonics, operands, source lines, and labels are displayed for four branches. Note: The trace function uses the trace buffer housed in the device. Devices which have no trace function cannot use this function. 6.18.1 Displaying the Trace Window Select [Trace] from the [Code] submenu of the [View] menu.
  • Page 143: Stack Trace Function

    6.19 Stack Trace Function The emulator uses the information on the stack to display the names of functions in the sequence of calls that led to the function to which the program counter is currently pointing. Note: This function can be used only when the load module that has the IEEE695-type debugging information is loaded.
  • Page 144 • After the break in program execution, select [Stack Trace] from the [Code] submenu of the [View] menu to open the [Stack Trace] window. Figure 6.40 [Stack Trace] Window Figure 6.40 shows that the position of the program counter is currently at the selected line of the sort() function, and that the sort() function is called from the tutorial() function.
  • Page 145: What Next

    6.20 What Next? This tutorial has described the major features of the emulator and the use of the High-performance Embedded Workshop. Sophisticated debugging can be carried out by using the emulation functions that the emulator offers. This provides for effective investigation of hardware and software problems by accurately isolating and identifying the conditions under which such problems arise.
  • Page 147: Appendix A Components Of The E8 Emulator

    Appendix A Components of the E8 Emulator Table A.1 lists the components of the R8C E8 emulator. Table A.1 Components of the Emulator (R0E000080KCE00) Classi- Component fication Hard- E8 emulator ware (Model: R0E000080KCE00) User system interface cable USB cable Soft- E8 emulator setup program, ware E8 Emulator User’s Manual,...
  • Page 149: Appendix B Window Functions

    Appendix B Window Functions This section describes the window functions that can be used with the High-performance Embedded Workshop for E8 emulator. Here, the High-performance Embedded Workshop common functions are omitted, and only the emulation functions are described. Table B.1 Window Functions Menu Option View...
  • Page 150 Table B.1 Window Functions (cont) Menu Option Setup Radix Hexadecimal Decimal Octal Binary Emulator System… Debug Debug Sessions… Debug Settings… Reset CPU Reset Go Go To Cursor Set PC To Cursor Toolbar Shortcut Button Uses a hexadecimal for displaying a radix in which the numerical values will be displayed and entered by default.
  • Page 151 Table B.1 Window Functions (cont) Menu Option Run… Debug Display PC (cont) Step In Step Over Step Out Step… Step Auto Mode Assembly Source Halt Program Debug Initialize (cont) Connect Disconnect Save Memory… Verify Memory… Toolbar Shortcut Button Launches the [Run Program] dialog box allowing the user to enter the PC or PC breakpoint during executing the user...
  • Page 152 Table B.1 Window Functions (cont) Menu Option Download Modules Unload Modules Toolbar Shortcut Button Downloads the object program. Unloads the object program. Remarks...
  • Page 153: Appendix C Command-Line Functions

    Appendix C Command-Line Functions The emulator supports the commands that can be used in the command-line window. For details, refer to the online help.
  • Page 155: Appendix D Notes On High-Performance Embedded Workshop

    Appendix D Notes on High-performance Embedded 1. Note on Moving Source File Position after Creating Load Module When the source file is moved after creating the load module, the [Open] dialog box may be displayed to specify the source file during the debugging of the created load module. Select the corresponding source file and click the [Open] button.
  • Page 156 Example: FILE_LOAD C:\Hew3\Tools\Renesas\DebugComp\Platform\E8\ E8R8C\TutorialR8C\Tutorial\Debug_R8C_E8_SYSTEM\Tutorial.x30 7. Memory Save During User Program Execution Do not execute memory save or verifying during user program execution.
  • Page 157 10. Note on [Register] Window Operation During Program Execution The register value cannot be changed in the [Register] window during program execution. Even if the changed value is displayed, the register contents are not changed actually. 11 Using Register Contents Use the value contained in a CPU register by specifying the register name prefixed by the “#”...
  • Page 158 ⎯ MEMORY_FILL command The [Format] specification in the [Copy Memory] dialog box is ignored. Memory is copied in a byte unit. 17. Note on Using the [Run Program] Dialog Box When [Run...] is selected from the [Debug] menu to specify the stop address, there is the following note: ⎯...
  • Page 159 24 Usage with Other Products To install the SuperH™ RISC engine C/C++ compiler package or H8, H8/300 series C/C++ compiler package after installing the emulator debugger for High-performance Embedded Workshop, select [High-performance Embedded Workshop] as the component to be installed in [Select Components] during installation of the compiler package.
  • Page 161: Appendix E Diagnostic Hardware Program

    (2) Start up the host computer, and connect the E8 emulator to the USB connector of the host computer via the USB cable attached. Prior to this, the user interface cable must be disconnected. E.2. Executing the Check Program (1) Execute [Program]-[Renesas]-[High-performance Embedded Workshop]-[E8 Self Check Program]. Figure E.1 Starting Up the Check Program...
  • Page 162 (2) Click the ‘START’ button appeared on the window. This starts execution of the check program showing the message ‘RUNNING’. (3) The message ‘FAIL’ or ‘PASS’ will be displayed. ‘PASS’ indicates that the emulator is working correctly. Click the ‘QUIT’ button to exit the check program. Figure E.2 Running the Check Program Figure E.3 Quitting the Check Program...
  • Page 163 (3) Send a file ‘SCP_LOG.TXT’, which has been created in the folder where ‘E8SCP.EXE’ was executed, to our customer support center by e-mail. The e-mail address is written on the following website: Renesas Tool Homepage : http://www.renesas.com/fmwk.jsp?cnt=software_tools_landing.jsp&fp=/ products/tools/&site=I Figure E.4 ‘FAIL’ Message...
  • Page 165 Publication Date: Aug. 1, 2007 Sales Strategic Planning Div. Published by: Renesas Technology Corp. Microcomputer Tool Development Department Edited by: Renesas Solutions Corp. © 2007. Renesas Technology Corp. and Renesas Solutions Corp., All rights reserved. Printed in Japan. Rev.1.00 Rev.10.00...
  • Page 166 E8 Emulator User’s Manual R0E000080KCE00E 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan REJ10J0768-1000...

Table of Contents