Page 1
REJ10J1766-0100 SuperH Family E10A-USB Multi-core Emulator User’s Manual Renesas Microcomputer Development Environment System SuperH™ Family E10A-USB HS0005KCU04HE Rev.1.00 Revision Date: Nov. 26, 2007...
Page 3
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
Renesas sales company. Such use includes, but is not limited to, use in life support systems. Buyers of this emulator product must notify the relevant Renesas sales offices before planning to use the product in such applications.
Renesas, upon inspection, shall determine to be defective in material and/or workmanship. The foregoing shall constitute the sole remedy for any breach of Renesas’ warranty. See the Renesas warranty booklet for details on the warranty period. This warranty extends only to you, the original Purchaser.
Page 7
This user's manual and emulator product are copyrighted and all rights are reserved by Renesas. No part of this user's manual, all or part, may be reproduced or duplicated in any form, in hard-copy or machine-readable form, by any means available without Renesas’ prior written consent.
Page 8
SAFETY PAGE READ FIRST • READ this user's manual before using this emulator product. • KEEP the user's manual handy for future reference. Do not attempt to use the emulator product until you fully understand its mechanism. DEFINITION OF SIGNAL WORDS This is the safety alert symbol.
Page 9
WARNING Observe the precautions listed below. 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 USER PROGRAM will be LOST. 1. Do not repair or remodel the emulator product by yourself for electric shock prevention and quality assurance.
Page 10
Warnings on Emulator Usage Be sure to read and understand the warnings below before using this emulator. Note that these are the main warnings, not the complete list. WARNING 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 11
Introduction The High-performance Embedded Workshop is a powerful development environment for embedded applications targeted at Renesas microcontrollers. The main features are: • A configurable build engine that allows you to set-up compiler, assembler and linker options via an easy to use interface.
About This Manual This manual describes preparation before using the emulator, emulator functions, debugging functions specific to the emulator, tutorial, and emulator's hardware and software specifications. Refer to the High-performance Embedded Workshop User's Manual for details on the information on the basic usage of the High-performance Embedded Workshop, customization of the environment, build functions, and debugging functions common to each High-performance Embedded Workshop product.
So be sure to carry out the user registration. For more information about user registration, send an email to the following address. regist_tool@renesas.com Rev. 1.00 Nov. 26, 2007 Page iii of x REJ10J1766-0100...
Page 14
Rev. 1.00 Nov. 26, 2007 Page iv of x REJ10J1766-0100...
Method for Activating High-performance Embedded Workshop........55 4.1.1 Creating the New Workspace (Toolchain Not Used)........... 56 4.1.2 Creating the New Workspace (Toolchain Used) ..........60 4.1.3 Selecting an Existing Workspace................. 65 Setting at Emulator Activation..................67 4.2.1 Setting at Emulator Activation................67 4.2.2 Downloading a Program ..................
6.23 What Next? ........................207 Section 7 Maintenance and Guarantee..............209 User Registration ......................209 Maintenance........................209 Guarantee .......................... 209 Repair Provisions ......................210 7.4.1 Repair with Extra-Charge ..................210 7.4.2 Replacement with Extra-Charge ................210 7.4.3 Expiration of the Repair Period ................210 7.4.4 Transportation Fees at Sending Your Product for Repair ........
Page 20
Rev. 1.00 Nov. 26, 2007 Page x of x REJ10J1766-0100...
C/C++ programming languages or assembly language for Renesas microcomputers. Its aim is to provide a powerful yet intuitive way of accessing, observing and modifying the debugging platform on which the application is running.
Page 22
Section 1 Overview The emulator provides the following features: • Excellent cost-performance emulator Compactness and connection to the USB are implemented. • Realtime emulation Realtime emulation of the user system is enabled at the maximum operating frequency of the CPU. •...
Section 1 Overview Warnings CAUTION 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 after unpacking the emulator. 2.
Section 1 Overview Environmental Conditions CAUTION 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 Specifications Temperature...
Check that all of the components are present when unpacking the product. For details on the emulator components, refer to section 1.1 in the additional document, Supplementary Information on Using the SHxxxx. If all of the components are not present, contact your nearest Renesas sales office or contact center (csc@renesas.com).
Section 2 Emulator Functions Section 2 Emulator Functions This section describes the emulator functions. They differ according to the device supported by the emulator. For the usage of each function, refer to section 6, Tutorial. Overview Table 2.1 gives a functional overview of the emulator. For details on the functions of each product, refer to the online help.
Page 28
Section 2 Emulator Functions Table 2.1 Emulator Functions Item Function • User program execution Executes a program with the operating frequency within a function range guaranteed by devices. • Reset emulation • Step functions: Single step (one step: one instruction) Source-level step (one step: one-line source) Step over (a break did not occur in a subroutine) Step out (when the PC points to a location within a...
Page 29
The following directory contains [SHxxxx.io] (xxxx means the name of emulator device group.): <High-performance Embedded Workshop folder>: \Tools\Renesas\DebugComp\Platform\E10A-USBM\xxxx\IOFiles The specific functions of the emulator are described in the next section. Rev. 1.00 Nov. 26, 2007 Page 9 of 230 REJ10J1766-0100...
Section 2 Emulator Functions Trace Functions The emulator has two trace functions. 2.2.1 Internal Trace Function The branch source and branch destination addresses, mnemonics, operands, and source lines are displayed. This function uses the trace buffer built into the device. Notes: 1.
Page 31
Section 2 Emulator Functions Software trace When a specific instruction is executed, the PC value at execution and the contents of one general register are acquired by trace. Describe the Trace(x) function (x is a variable name) to be compiled and linked beforehand. For details, refer to the SHC/C++ compiler manual. When the load module is loaded on the emulator and a valid software trace function is executed, the PC value that has executed the Trace(x) function, the variable for x, and the source lines are displayed.
Page 32
Section 2 Emulator Functions (3) Trace display contents When the program breaks, the following trace results are displayed in the [Trace] window. • PTR: The trace-buffer pointer (+0 from the last instruction to have been executed) • IP: Indicates the number of cycles that have elapsed since the latest trace information was gathered.
Page 33
Section 2 Emulator Functions The following items will be displayed, according to the device to be debugged. For specifications of the individual products, refer to the additional document, Supplementary Information on Using the SHxxxx, or the online help. • PTR: The trace-buffer pointer (+0 from the last instruction to have been executed) •...
Section 2 Emulator Functions Table 2.4 [Trace Window] Display Contents Trace Type Type Column BUS Column R/W Column Address Column Data Column Branch trace BRANCH No display No display Branch source No display address DESTINATION No display No display Branch destination No display address Memory-...
Section 2 Emulator Functions (5) Changes the trace settings during user program execution. In some devices to be debugged, trace settings can be changed during user program execution. For details on the specifications of each product, refer to the online help. Break Function The emulator has the following three break functions.
Section 2 Emulator Functions This function is hereafter called the performance measurement function or PA1. Note: Items to be measured differ according to the product and some products do not support this function. For details on the specifications of each product, refer to the online help. Memory Access Functions The emulator has the following memory access functions.
Page 37
Section 2 Emulator Functions (5) Displaying the variable contents The variable contents specified in the user program are displayed. (6) Monitoring function In some devices to be debugged, memory contents can be monitored during user program execution. For details on the specifications of each product, refer to the online help. (7) Other memory operation functions Other functions are as follows: •...
Section 2 Emulator Functions memory. Therefore, an operation such as memory write or BREAKPOINT should be set only for the RAM area and the internal flash memory. When the memory area can be read by the MMU, do not perform memory write, BREAKPOINT setting, or downloading.
Section 3 Preparation before Use Section 3 Preparation before Use Emulator Preparation Unpack the emulator and prepare it for use as follows: WARNING 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.
Section 4 Preparations for Debugging 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 41
Section 3 Preparation before Use The names of each section of the emulator are explained next. Emulator Top View: Figure 3.3 Emulator Top View (a) E10A-USB Multi logo plate: A black plate is dedicated for the emulator is provided to be easily distinguished from other E-series emulators.
Page 42
Section 4 Preparations for Debugging (e) Core switch LED Marked ‘3’. When this LED is lit, the E10A-USB Multi switches the micro computer to be controled. (f) UVCC LED Marked ‘4’. When this LED is lit, the E10A-USB Multi is supplied the UVCC .
Page 43
Section 3 Preparation before Use Emulator User-side View: Figure 3.5 Emulator User-side View User-side connector: A user system interface cable is connected. Rev. 1.00 Nov. 26, 2007 Page 23 of 230 REJ10J1766-0100...
Page 44
Section 4 Preparations for Debugging Emulator Bottom View: MODEL : HS0005KCU04H SERIAL No. : 00001A This device complies with Part 15 of the FCC Rules. Operation is subject to the follow ing two conditions: (1) This device may not cause harmful interference, and (2) This device must accept any interference received, including interference that may cause undesired operation.
Section 3 Preparation before Use CD-R The root directory of the CD-R contains a setup program for installing the emulator’s software. The folders contain the files and programs listed below. Table 3.1 Contents of the CD-R Directories Directory Name Contents Description ®...
Section 4 Preparations for Debugging 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.
Page 47
Section 3 Preparation before Use 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. Host comuputer E10A-USB Multi emulator USB cable (1.5 m) Figure 3.7 System Configuration when Connecting the Emulator to the Host Computer Rev.
Section 4 Preparations for Debugging 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.
Page 49
Section 3 Preparation before Use (1) The connector must be installed to the user system. Table 3.2 shows the recommended connector for the emulator. Table 3.2 Recommended H-UDI Port Connector Connector Type Number Manufacturer Specifications 14-pin connector 2514-6002 Minnesota Mining & 14-pin straight type Manufacturing Ltd.
Page 50
Section 4 Preparations for Debugging User Interface Cable User System H-UDI Port Connector Figure 3.9 Connecting the User System Interface Cable to the User System when the 38-pin Type Connector is Used User system interface cable Pin 1 User system H-UDI port connector Figure 3.10 Connecting the User System Interface Cable to the User System when the 14-pin Type Connector is Used...
Page 51
Section 3 Preparation before Use CAUTION Note that the pin number assignments of the connector differ from those of the connector manufacturer. Notes: Connection of the signals differs depending on the package. For details, refer to the MPU’s pin assignments. The range of communication that the emulator operates at is different depending on the MPU used.
Page 52
Section 4 Preparations for Debugging H-UDI SHxxxx port H-UDI JTAG port Boundary scan loop User system TDI: Test data input TDO: Test data output TAP: Test access port Figure 3.11 User System Example Rev. 1.00 Nov. 26, 2007 Page 32 of 230 REJ10J1766-0100...
Section 3 Preparation before Use Connecting System Ground WARNING 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.
Section 4 Preparations for Debugging Interface Circuits in the Emulator Figures 3.13 and 3.14 show interface circuits in the emulator. Use them as a reference to determine the value of the pull-up resistance. Note: The 74LVC2G125 and 74LVC2T45 operate at VCC (1.8 to 5.0 V) from the H-UDI port connector.
Section 3 Preparation before Use Setting up the Emulator Set up the emulator’s firmware using the following procedures. The emulator will be set up for the first device group to be started. Note: Only one device group can be set up after the initial purchase of the emulator To use the emulator for another device group after set up, purchase the license tool to add a device group.
Section 4 Preparations for Debugging 3.10 System Check When the software is executed, use the procedure below to check that the emulator is connected correctly. Here, use the workspace for a tutorial provided on the product. Refer to section 4, Preparations for Debugging, for the other activating method to create a new project or use an existing workspace.
Page 59
Section 3 Preparation before Use When the [Open workspace] dialog box is opened, specify the following directory: <Drive where the OS has been installed>:\WorkSpace\Tutorial\E10A-USBM\SH2A- DUAL\SH2A-DUAL\Tutorial_SH2A-DUAL\CPU0 After the directory has been specified, select the following file and click the [Open] button. Figure 3.16 [Open The Workspace] Dialog Box Rev.
Page 60
Section 4 Preparations for Debugging 6. The [Select Emulator mode] dialog box is displayed. Figure 3.17 [Select Emulator mode] Dialog Box Select <name of the device in use>_CPU0 from the [Device] drop-down list box. The following item is selected in the [Mode] group box. ⎯...
Page 61
Section 3 Preparation before Use Figure 3.18 [Connecting] Dialog Box 8. The dialog box shown in figure 3.19 is displayed if no product groups have been installed in the emulator at the time of purchase or if the SHxxxx license has been installed in the emulator but the emulator firmware has been set up for a different device group.
Page 62
Section 4 Preparations for Debugging Figure 3.20 Dialog Box to Confirm Updating of the SHxxxx Emulator Firmware CAUTION The USB cable must not be disconnected until writing is complete. Early disconnection may damage the emulator. 9. The dialog box shown in figure 3.21 is displayed. Figure 3.21 Dialog Box of the RESET Signal Input Request Message 10.
Page 63
Section 3 Preparation before Use Figure 3.22 [Can not find /RESET signal] Dialog Box When the [Ignore] button is clicked, the emulator issues a reset in the CPU for initiation. However, this method is unavailable for some products. For details, refer to section 2.2, Specific Functions for the Emulator when Using the SHxxxx, in the additional document, Supplementary Information on Using the SHxxxx.
Page 64
Section 4 Preparations for Debugging 15. The [Welcome!] dialog box is displayed. Figure 3.24 [Welcome!] Dialog box To use a workspace for the tutorial, select the [Browse to another project workspace] radio button and click the [OK] button. When the [Open workspace] dialog box is opened, specify the following directory: <Drive where the OS has been installed>:\WorkSpace\Tutorial\E10A-USBM\SH2A- DUAL\SH2A-DUAL\Tutorial_SH2A-DUAL\CPU0 Rev.
Page 65
Section 3 Preparation before Use After specifying the directory, select the following file and click on the [Open] button Figure 3.25 [Open the workspace] Dialog box (16) The [Select Emulator mode] dialog box is displayed. Figure 3.26 [Select Emulator mode] Dialog box Select <name of the device in use>_CPU1 from the [Device] drop-down list box.
Page 66
Section 4 Preparations for Debugging The following item is selected in the [Mode] group box. ⎯ E10A-USB Multi Emulator ⎯ The E10A-USB Multi Emulator is activated for the selected device. Debugging of programs can proceed. (17) [Connecting] dialog box is displayed, and the emulator connection will be started up. Figure 3.27 [Connecting] Dialog box If the ″Connected″...
Page 67
Section 3 Preparation before Use Figure 3.28 [Output] Window Notes: If the emulator is not initiated, the following dialog boxes shown in figures 3.29 through 3.35 will be displayed. (a) If the following dialog box is displayed and the method 11 above is unavailable, the power of the user system may not be input or the RESET signal may not be input to the device.
Page 68
Section 4 Preparations for Debugging Figure 3.30 [Check the connection] Dialog Box (c) If the following dialog box is displayed, the emulator’s firmware may not be set up correctly. Set up the firmware of the device group that is used for the license tool. Figure 3.31 [The product currently connected] Dialog Box (d) If the following dialog box is displayed, the device may not correctly operate.
Page 69
Section 3 Preparation before Use Figure 3.33 [INVALID ASERAM FIRMWARE!] Dialog Box Figure 3.34 [Error JTAG boot] Dialog Box (e) The following dialog box is displayed when the MCU cannot communicate with the emulator. The MCU may not operate correctly; check the MCU settings. Figure 3.35 [Boot Failed!] Dialog Box Rev.
Section 4 Preparations for Debugging 2. If an incorrect driver has been selected, the following dialog box will appear. Figure 3.36 [Unable to restore the previous driver settings] Dialog Box 3. If the emulator is not activated due to other reasons, a message box corresponding to the status is displayed.
Page 71
Section 3 Preparation before Use Figure 3.37 [Welcome!] Dialog Box The [Tools Administration] dialog box is opened. Figure 3.38 [Tools Administration] Dialog Box Rev. 1.00 Nov. 26, 2007 Page 51 of 230 REJ10J1766-0100...
Page 72
Section 4 Preparations for Debugging 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.39 Highlighting the Product to be Uninstalled Click the [Unregister] button.
Page 73
Section 3 Preparation before Use Click the [Uninstaller…] button in the [Tools Administration] dialog box to open the [Uninstall HEW Tool] dialog box. Figure 3.41 [Uninstall HEW Tool] Dialog Box Rev. 1.00 Nov. 26, 2007 Page 53 of 230 REJ10J1766-0100...
Page 74
Section 4 Preparations for Debugging Click the [Start] button to list the installed components. Figure 3.42 Highlighting the Product to be Uninstalled Highlight the product name to be uninstalled and click the [Uninstall] button. This is the end of uninstallation. CAUTION A shared file may be detected while the program is being removed.
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 [High-performance Embedded Workshop] from [Renesas] -> [High-performance Embedded Workshop] of [Programs] in the [Start] menu.
Section 4 Preparations for Debugging The following describes how to activate the High-performance Embedded Workshop when selecting [Create a new project workspace] without any toolchain, [Create a new project workspace] with a toolchain, and [Browse to another project workspace]. The [Open a recent project workspace] radio button is used to omit the operation for specifying the workspace file when [Browse to another project workspace] is selected.
Page 77
Section 4 Preparations for Debugging 2. The Project Generator is started. In this section, we omit description of the settings for the toolchain. If you have not purchased the toolchain, the following dialog box is displayed. Figure 4.3 [New Project Workspace] Dialog Box [Workspace Name] edit box: Enter the new workspace name.
Page 78
Section 4 Preparations for Debugging 3. Make the required setting for the toolchain. When the setting has been completed, the following dialog box is displayed. Figure 4.4 [Setting the Target System for Debugging] Dialog Box Check the target emulator and click the [Next] button. Rev.
Page 79
Section 4 Preparations for Debugging 4. Set the configuration file name. The configuration file saves the state of High-performance Embedded Workshop except for the emulator. 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.
Section 4 Preparations for Debugging 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. Figure 4.6 [Welcome!] Dialog Box Rev.
Page 81
Section 4 Preparations for Debugging 2. The Project Generator is started. If you have purchased the toolchain, the following dialog box is displayed. Figure 4.7 [New Project Workspace] Dialog Box [Workspace Name] edit box: Enter the new workspace name. Here, for example, enter ‘test’.
Page 82
Section 4 Preparations for Debugging 3. Make the required setting for the toolchain. When the setting has been completed, the following dialog box is displayed. Figure 4.8 [New Project –7/9– Setting the Target System for Debugging] Dialog Box Check the target emulator and click the [Next] button. Mark other products as required. Rev.
Page 83
Section 4 Preparations for Debugging 4. Set the configuration file name. The configuration file saves the state of High-performance Embedded Workshop except for the emulator. Figure 4.9 [New Project –8/9– Setting the Debugger Options] Dialog Box This is the end of the emulator setting. Exit the Project Generator according to the instructions on the screen.
Page 84
Section 4 Preparations for Debugging (a) Connecting the emulator after the setting at emulator activation Select [Debug settings] from the [Debug] menu to open the [Debug Settings] dialog box. It is possible to register the download module or the command chain that is automatically executed at activation.
Section 4 Preparations for Debugging Debugger Options] dialog box. The setting for using the emulator has been registered in this session file. After selected, the emulator is automatically connected. 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.
Page 86
Section 4 Preparations for Debugging Figure 4.12 [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. When the saved state information of the selected workspace includes connection to the emulator, the emulator will automatically be connected.
Section 4 Preparations for Debugging Setting at 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.
Page 88
Section 4 Preparations for Debugging Figure 4.14 [Debug Settings] Dialog Box ([Options] Page) The command chain that is automatically executed at the specified timing is registered. The following four timings can be specified: • At connecting the emulator • Immediately after reset •...
Section 4 Preparations for Debugging 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.15 Download Menu of the [Workspace] Window ([Projects]) Notes: 1.
Section 4 Preparations for Debugging Debug Sessions The High-performance Embedded Workshop stores all of your builder options into a configuration. In a similar way, the High-performance Embedded Workshop stores your debugger options in a session. The debugging platforms, the programs to be downloaded, and each debugging platform’s options can be stored in a session.
Section 4 Preparations for Debugging • From the dialog box 1. Select [Debug -> Debug Sessions…]. This will open the [Debug Sessions] dialog box (figure 4.17). Figure 4.17 [Debug Sessions] Dialog Box 2. Select the session you want to use from the [Current session] drop-down list. 3.
Page 92
Section 4 Preparations for Debugging 5. Click the [OK] button to close the [Debug Sessions] dialog box. 6. This creates a file with the name entered in step 4. If a file with this name already exists, an error is displayed. Figure 4.18 [Add new session] Dialog Box •...
Page 93
Section 4 Preparations for Debugging • To remove a session 1. Select [Debug -> Debug Sessions…] to display the [Debug Sessions] dialog box (figure 4.17). 2. Select the session you would like to remove. 3. Click the [Remove] button. Note that the current session cannot be removed. 4.
Section 4 Preparations for Debugging 4. Specify the location to save the new file. 5. If you want to export the session file to another location, leave the [Maintain link] check box unchecked. If you would like the High-performance Embedded Workshop to use this location instead of the current session location, check the [Maintain link] check box.
Section 4 Preparations for Debugging Connecting the Emulator Select either of the following two ways to connect the emulator: (a) Connecting the emulator after the setting at emulator activation Select [Debug settings] from the [Debug] menu to open the [Debug Settings] dialog box. It is possible to register the download module or the command chain that is automatically executed at activation.
Section 4 Preparations for Debugging In the list box that is circled in figure 4.21, select the session file name including the character string that has been set in the [Target name] text box in figure 4.9, [New Project –8/9– Setting the Debugger Options] dialog box.
Section 4 Preparations for Debugging Ending the Emulator When using the toolchain, the emulator can be exited by using the following two methods: • Canceling the connection of the emulator being activated • Exiting the High-performance Embedded Workshop (1) Canceling the connection of the emulator being activated Select [Disconnect] from the [Debug] menu or click the [Disconnect] toolbar button ( (2) Exiting the High-performance Embedded Workshop Select [Exit] from the [File] menu.
Section 5 Debugging Section 5 Debugging This section describes the debugging operations and their related windows and dialog boxes. Setting the Environment for Emulation 5.1.1 Opening the [Configuration] Dialog Box Selecting [Setup -> Emulator -> System…] or clicking the [Emulator System] toolbar button ( opens the [Configuration] dialog box.
Page 100
Section 5 Debugging Figure 5.1 [Configuration] Dialog Box ([General] Page) Items that can be displayed in the sheet are listed below. Rev. 1.00 Nov. 26, 2007 Page 80 of 230 REJ10J1766-0100...
Page 101
Section 5 Debugging [Mode] Displays the MPU name. [Emulation mode] Selects the emulation mode at user program execution. Select Normal to perform normal emulation. Select No break to disable PC breakpoint or break condition settings during emulation. [Step option] Sets the step interrupt option. Disable interrupts during single step execution: Disables interrupts during step execution.
Page 102
Section 5 Debugging [Flash memory synchronization] 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 103
Section 5 Debugging Sleep: Specifies transitions to sleep mode. [Synchronization options] Specify the operation of synchronized execution. Execution is synchronized. When this condition is modified, all of the PC break points will be erased. Step: Stepping is synchronized. When this condition is modified, all of the PC break points will be erased.
Section 5 Debugging When the break is occurred in either of CPU0 or CPU1, the other emulator will also break. Note: The items that can be set in this dialog box vary according to the emulator in use. For details, refer to the online help. 5.1.3 Downloading to the Flash Memory Sets the emulator operation conditions for downloading the external flash memory.
Page 106
Section 5 Debugging Items that can be displayed in the sheet are listed below. [Loading flash memory] Sets Enable for flash memory downloading. At Enable, when the flash memory is downloaded on the High-performance Embedded Workshop, the write module is always called. Disable: Not download to the flash memory Enable: Download to the flash memory [Erasing flash memory]...
Page 107
Section 5 Debugging 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, the source file may not be automatically found.
Page 108
Section 5 Debugging Figure 5.3 [Source] Window In this window, the following items are shown on the left as line information. The first column (Source address column): Address information The second column (Event column): Event information (break condition) The third column (S/W breakpoint column): PC, bookmark, and breakpoint information Source address column When a program is downloaded, an address for the current source file is displayed on the Source address column.
Page 109
Section 5 Debugging Figure 5.4 Popup Menu Note: The contents of the Event column are erased when conditions other than the address condition are added to each channel by using the [Edit] menu or in the [Event] window. S/W breakpoint column S/W breakpoint column displays the following items: : A bookmark is set.
Section 5 Debugging Figure 5.5 [Global Editor Column States] Dialog Box To switch off a column in one source file 1. Open the source file which contains the column you want to remove and click the [Edit] menu. 2. Click the [Columns] menu item to display a cascaded menu item. The columns are displayed in this popup menu.
Section 5 Debugging Figure 5.6 [Disassembly] Window 5.2.4 Modifying the Assembly-Language Code You can modify the assembly-language code by double-clicking on the instruction that you want to change. The [Assembler] dialog box will be opened. Figure 5.7 [Assembler] Dialog Box The address, machine code, and disassembled instruction are displayed.
Section 5 Debugging [Editor] window will not be changed. This is the same even if the source file contains assembly codes. 5.2.5 Viewing a Specific Address When you are viewing your program in the [Disassembly] window, you may want to look at another area of your program's code.
Section 5 Debugging Displaying Memory Contents in Realtime Use the [Monitor] window to monitor the memory contents during user program execution. These settings will not be common to the High-performance Embedded Workshops for CPU0 and CPU1. That is, each High-performance Embedded Workshop has its own settings. Note: This function is not supported in some devices to be debugged.
Page 114
Section 5 Debugging Figure 5.9 [Monitor Setting] Dialog Box [Name]: Decides the name of the monitor window. [Options]: Sets monitor conditions. [Address]: Sets the start address for monitoring. [Size]: Sets the range for monitoring. [Access]: Sets the access size to be displayed in the monitor window. Rev.
Page 115
Section 5 Debugging [Auto-Refresh at rate]: Sets the interval for acquisition by monitoring. [Reading the Initial Value]: Selects reading of the values in the monitored area when the monitor window is opened. [Color]: Sets the method to update monitoring and the attribute of colors. [Change Indicator]: Selects how to display the values that have changed during monitoring (available when [Reading the Initial Value] has...
Section 5 Debugging Figure 5.10 [Monitor] Window During user program execution, the display is updated according to the setting value of the auto- update interval. Note: Select [Refresh] from the popup menu when data is not displayed correctly after changing the address or content of memory.
Section 5 Debugging 5.3.5 Monitoring Variables Using the [Watch] window refers to the value of any variables. When the address of the variable registered in the [Watch] window exists within the monitoring range that has been set by the Monitor function, the value of the variable can be updated and displayed.
Section 5 Debugging 5.3.7 Managing the [Monitor] Window Selecting [Display -> CPU -> Monitor -> Windows Select…] displays the [Windows Select] dialog box. In this window, the current monitoring condition is checked and the new monitoring condition is added, edited, and deleted in succession. Selecting multiple monitoring conditions enables a temporary stop of update, hiding, and deletion.
Section 5 Debugging Viewing the Current Status Choose [View -> CPU -> Status] or click the [View Status] toolbar button ( ) to open the [Status] window and see the current status of the debugging platform. Figure 5.13 [Status] Window The [Status] window has three sheets: •...
Section 5 Debugging Using the Event Points The emulator has the event point function that performs breaking, tracing, and execution time measurement by specifying more complex conditions along with the PC breakpoints standard for the High-performance Embedded Workshop. 5.5.1 PC Breakpoints When the instruction of the specified address is fetched, the user program is stopped.
Section 5 Debugging 5.5.3 Opening the [Event] Window Select [View -> Code -> Eventpoints] or click the [Eventpoints] toolbar button ( ) to open the [Event] window. The [Event] window has the following two sheets: [Breakpoint] sheet: Displays the settings made for PC breakpoints. It is also possible to set, modify, and cancel PC breakpoints.
Section 5 Debugging [Action] Operation of the emulator when a break condition is satisfied Break: Breaks program execution Notes: PC breakpoints can only be set when all of synchronized execution, synchronized stepping, and synchronized breaks have been selected. Do not set PC breakpoints at the same address in the High-performance Embedded Workshops for CPU0 and CPU1.
Section 5 Debugging 5.5.10 Delete All Removes all breakpoints. 5.5.11 Go to Source Only enabled when one breakpoint is selected. Opens the [Source] window at the address of the breakpoint. 5.5.12 [Breakpoint] Dialog Box Figure 5.15 [Breakpoint] Dialog Box This dialog box specifies break conditions. A breakpoint address to be set is specified in the [Value] edit box.
Section 5 Debugging When [Value] is selected, if an overloaded function or class name including a member function is specified in address, the [Select Function] dialog box opens. Clicking the [OK] button sets the break conditions. Clicking the [Cancel] button closes this dialog box without setting the break conditions.
Page 125
Section 5 Debugging When a breakpoint is double-clicked in this window, the [Event condition] dialog box is opened and break conditions can be modified. For details on the [Event condition] dialog box, refer to the on-line help for each product. A popup menu containing the following options is available by right-clicking within the window.
Section 5 Debugging 5.5.20 Sequential Conditions Sets the sequential condition of the break channel. 5.5.21 Editing Break Conditions Handlings for settings other than PC breakpoints and break conditions are common. The following describes examples of such handling. 5.5.22 Modifying Break Conditions Select a break condition to be modified, and choose [Edit...] from the popup menu to open the dialog box for the event, which allows the user to modify the break conditions.
Section 5 Debugging 5.5.27 Viewing the Source Line for Break Conditions Select a break condition and choose [Go to Source] from the popup menu to open the [Source] or [Disassembly] window at the address of the break condition. The [Go to Source] menu is only available when one break condition that has the corresponding source file is selected.
Page 128
Section 5 Debugging [IP] The amount of acquired trace information [CPU ID] Type of the CPU core: CPU0: Trace is made for CPU0 CPU1: Trace is made for CPU1 [Master] Master device that generated the event. CPU: CPU0 was the master. DMA: The DMAC was the master.
Page 129
Section 5 Debugging [Size] Display the size of access: BYTE: Byte WORD: Word LONG: Longword [Instruction] Instruction mnemonic [Time stamp] Time stamp, in cycles of Bφ [Source] The C/C++ or assembly-language source program [Label] Label information Selecting the [Set…] menu in the popup menu of the [Trace] window displays the [Acquisition] dialog box.
Page 130
Section 5 Debugging [Master] Master device that generated the event: CPU: CPU0 was the master [Type] Type of the trace information: BRANCH: Branch source DESTINATION: Branch destination MEMORY: Memory access S_TRACE: Executed Trace(x) function LOST: Lost trace information (only in the realtime mode) CPU-WAIT: CPU was waiting for the output of the trace information (only in the non-realtime mode) [Branch Type]...
Section 5 Debugging Note: Since the displayed contents differ depending on the product, refer to each product’s online help. Some MPUs supported may not have the AUD trace function. It is possible to hide any column not necessary in the [Trace] window. Selecting a column you want to hide from the popup menu displayed by clicking the right-hand mouse button on the header column hides that column.
Page 132
Section 5 Debugging (1) [Trace mode] page Sets trace acquisition conditions. Figure 5.19 [Acquisition] Dialog Box ([Trace mode] Page) This dialog box specifies the methods and conditions for the acquisition of trace information. Rev. 1.00 Nov. 26, 2007 Page 112 of 230 REJ10J1766-0100...
Page 133
Section 5 Debugging The following items can be set: [Trace mode]: Set the trace mode conditions [Trace Type]: Selects the type of trace function. [I-Trace]: The internal trace function is used. [AUD function]: The AUD trace function is used. Rev. 1.00 Nov. 26, 2007 Page 113 of 230 REJ10J1766-0100...
Page 134
Section 5 Debugging • [Trace mode] page for internal trace ([I-trace] selected) Figure 5.20 [Acquisition] Dialog Box (when I-trace has been selected) Rev. 1.00 Nov. 26, 2007 Page 114 of 230 REJ10J1766-0100...
Page 135
Section 5 Debugging This dialog box is used to specify conditions for the acquisition of trace information. When [I-Trace] has been selected: [I-Trace mode]: Set the bus and other conditions for acquisition of the internal trace. [Channel 1] : Set the trace acquisition conditions for channel 1. The same conditions cannot be set for channels 1 and 2.
Page 136
Section 5 Debugging [I-Bus, CPU0] : Trace information is acquired with I-bus access by CPU0 as a condition. [F-Bus, CPU0] : Trace information is acquired with F-bus access by CPU0 as a condition. [M-Bus & Branch, CPU1] : Trace information is acquired with M-bus access and branching by CPU1 as conditions.
Page 137
Section 5 Debugging [Trace continue] : Keep acquiring trace information. The earliest contents of the trace buffer are overwritten. [Trace stop] : Stop trace acquisition. [Break (CPU0)] : Break CPU0. [Break (CPU1)] : Break CPU1. [Break (CPU0, CPU1)] : Break CPU0 and CPU1. Rev.
Page 138
Section 5 Debugging • [Trace mode] page for internal trace ([AUD function] selected) Figure 5.21 [Acquisition] Dialog Box (when AUD function has been selected) Rev. 1.00 Nov. 26, 2007 Page 118 of 230 REJ10J1766-0100...
Page 139
Section 5 Debugging When [AUD function] has been selected [AUD mode1] : Selection of realtime or non-realtime trace acquisition [Realtime trace] : When a next branch is encountered while trace can be replaced by the latest trace information to be acquired. Thus, while the user program is executed in realtime, the acquisition of some trace information might not be possible.
Page 140
Section 5 Debugging the CPU identifier (CPU ID) is CPU1. [DMAC] : Display the trace information for which the CPU identifier (CPU ID) is DMA. Rev. 1.00 Nov. 26, 2007 Page 120 of 230 REJ10J1766-0100...
Page 142
Section 5 Debugging The settings of either the AUD trace (CPU0) or the AUD trace (CPU1) Select the AUD trace conditions from the [Trace Settings] when the AUD function is selected. [Branch trace] : Trace information is acquired by the branch source and the branch destination as conditions.
Page 143
Section 5 Debugging on writing. [Read/Write] : Trace information is acquired on reading and writing. [Start address] : Sets an address range for the tracing of data access. The start address is set here. [End address] : Sets an address range for the tracing of data access.
Section 5 Debugging 5.6.4 Searching for a Trace Record Use the [Trace Find] dialog box to search for a trace record. To open this dialog box, choose [Find...] from the popup menu. These settings are not common to the High-performance Embedded Workshops for CPU0 and CPU1.
Page 145
Section 5 Debugging (1) [General] page Set the range for searching. Figure 5.23 [Trace Find] Dialog Box ([General] Page) [Trace search range]: Sets the range for searching. [No]: Searches for information that does not match the conditions set in other pages when this box is checked. [Upper search]: Searches upwards when this box is checked.
Page 146
Section 5 Debugging (2) [Address] page Set address condition. Figure 5.24 [Trace Find] Dialog Box ([Address] Page) [Don't care]: Detects no address when this box is checked. [Setting]: Detects the specified address. [Value]: Enter the address value (not available when [Don’t care] has been checked).
Page 147
Section 5 Debugging (3) [Data] page Set a data condition. Figure 5.25 [Trace Find] Dialog Box ([Data] Page) [Don't care]: Detects no data when this box is checked. [Setting]: Detects the specified data. [Value]: Enter the data value (not available when [Don’t care] has been checked). Rev.
Page 148
Section 5 Debugging (4) [R/W] page Select the type of access cycles. Figure 5.26 [Trace Find] Dialog Box ([R/W] Page) [Don't care]: Detects no read/write condition when this box is checked. [Setting]: Detects the specified read/write condition. [String]: Select a read/write condition (not available when [Don’t care] has been checked).
Page 149
Section 5 Debugging (5) [Type] page Select the type of Trace information. Figure 5.27 [Trace Find] Dialog Box ([Type] Page) [Don't care]: Detects no type condition when this box is checked. [Setting]: Detects the specified type condition. [String]: Select a type condition (not available when [Don’t care] has been checked).
Page 150
Section 5 Debugging (6) [Size] page Select a unit of access. Figure 5.28 [Trace Find] Dialog Box ([Size] Page) [Don't care]: Detects no size condition when this box is checked. [Setting]: Detects the specified size condition. [String]: Select a size condition (not available when [Don’t care] has been checked).
Section 5 Debugging 5.6.5 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.
Section 5 Debugging 5.6.9 Temporarily Stopping Trace Acquisition To temporarily stop trace acquisition during execution of the user program, select [Halt] from the popup menu. This stops trace acquisition and updates the trace display. Use this method to check the trace information without stopping execution of the user program. 5.6.10 Extracting Records from the Acquired Information Use the filtering function to extract the records you need from the acquired trace information.
Page 153
Section 5 Debugging Set filtering conditions and then press the [OK] button. This starts filtering according to the conditions. Clicking the [Cancel] button closes the [Trace Filter] dialog box, which holds the settings at the time when the dialog box was opened. In filtering, only the trace information that satisfies one or more filtering conditions set in the above pages will be displayed in the [Trace] window.
Page 154
Section 5 Debugging [Start PTR]: Enters a PTR value to start filtering. [End PTR]: Enters a PTR value to end filtering. Note: Along with setting the range for filtering, PTR values to start and end filtering can be set in the [Start PTR] and [End PTR] options, respectively. (2) [Address] page Set an address condition.
Page 155
Section 5 Debugging Note: Along with setting the address range, the start and end of the address range can be set in the [From] and [To] options, respectively. (3) [Data] page Set a data condition. Figure 5.31 [Trace Filter] Dialog Box ([Data] Page) [Don't care]: Detects no data when this box is checked.
Page 156
Section 5 Debugging (4) [R/W] page Select the type of access cycles. Figure 5.32 [Trace Filter] Dialog Box ([R/W] Page) [Don't care]: Detects no read/write condition when this box is checked. [Setting]: Detects the specified read/write condition. READ: Detects read cycles when this box is checked (not available when [Don’t care] has been checked).
Page 157
Section 5 Debugging (5) [Type] page Select the type of Trace information. The selection is not available when a time stamp is acquired. Figure 5.33 [Trace Filter] Dialog Box ([Type] Page) [Don't care]: Detects no type condition when this box is checked. [Setting]: Detects the specified type condition (not available when [Don’t care] has been checked).
Page 158
Section 5 Debugging (6) [Size] page Select a unit of the access. Figure 5.34 [Trace Filter] Dialog Box ([Bus] Page) [Don't care]: Detects no size condition when this box is checked. [Setting]: Detects the specified size condition (not available when [Don’t care] has been checked).
Section 5 Debugging 5.6.11 Analyzing Statistical Information Choose [Statistic…] from the popup menu to open the [Statistic] dialog box and analyze statistical information under the specified conditions. Figure 5.35 [Statistic] Dialog Box [Statistic Analysis]: Setting required for analysis of statistical information. [Default]: Sets a single input value or character string.
Page 160
Section 5 Debugging [End]: Specify the end value if a range has been set (only available when [Range] has been selected). [Set]: Adds a new condition to the current one. [New]: Creates a new condition. [Result] button: Obtains the result of statistical information analysis. [Clear]: Initializes the settings.
Section 5 Debugging 5.6.12 Extracting Function Calls from the Acquired Trace Information To extract function calls from the acquired trace information, select [Function Call…] from the popup menu. The [Function Call Display] dialog box will be displayed. Figure 5.36 [Function Call Display] Dialog Box [Setting]: Selects whether or not to extract function calls.
Section 5 Debugging Analyzing Performance Use the performance analysis function to measure execution performance. The performance analysis function does not affect the realtime operation because it measures execution performance in the specified range by using the on-chip circuit for performance measurement. These settings are not common to the High-performance Embedded Workshops for CPU0 and CPU1.
Section 5 Debugging Figure 5.38 [Performance Analysis] Window It is possible to hide any column not necessary in the [Performance Analysis] window. Selecting a column you want to hide from the popup menu displayed by clicking the right-hand mouse button on the header column hides that column.
Workshop applications cannot be nested (no slave High-performance Embedded Workshop can initiate another slave High-performance Embedded Workshop). When selecting [Renesas High-performance Embedded Workshop] -> [High-performance Embedded Workshop] from [Programs] in the [Start] menu to initiate another High-performance Embedded Workshop, two emulators can be used separately for debugging.
Click the [OK] button. The following dialog box will appear. Figure 5.40 [Driver Details] Dialog Box (1) Select [Renesas E-Series USB Driver] from the [Driver] drop-down list box and open the [Channel] drop-down list box. Channel information for two emulators is displayed in the [Channel] drop-down list box as shown in figure 5.41.
Page 166
Select [<no driver selected>] in the [Driver] drop-down list box and disconnect one emulator from the USB connector. After that, select [Renesas E-Series USB Driver] in the [Driver] drop-down list box. Only information on the USB connector that the emulator is connected to is displayed in the [Channel] drop-down list box.
Section 6 Tutorial Section 6 Tutorial Introduction This section describes the main functions of the emulator by using a tutorial program. Explanations where something else is not stated apply to operations of the High-performance Embedded Workshop for CPU1. The tutorial program is written in C++ and runs through the High-performance Embedded Workshops for CPU0 and CPU1 to sort ten random data items into ascending or descending order.
Section 6 Tutorial Running the High-performance Embedded Workshop To run the High-performance Embedded Workshop for the CPU0 and CPU1, refer to section 3.10, System Check. Setting up the Emulator The clocks which are used for data communications must be set up on the emulator before the program is downloaded.
Section 6 Tutorial Setting the [Configuration] Dialog Box • Select [Emulator] then [Systems…] from the [Setup] menu in the High-performance Embedded Workshop for CPU1 to set a communication clock. The [Configuration] dialog box is displayed. Figure 6.1 [Configuration] Dialog Box •...
Section 6 Tutorial Checking the Operation of the Target Memory for Downloading Check that the destination memory area for downloading is operating correctly. When the destination memory is SDRAM or DRAM, a register in the bus controller of the MPU must be set before downloading.
Page 171
Section 6 Tutorial Figure 6.3 [Memory] Window • 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.
Section 6 Tutorial Downloading the Tutorial Program 6.6.1 Downloading the Tutorial Program Download the object program to be debugged. To proceed with source-level debugging with the High-performance Embedded Workshop for CPU0 or the High-performance Embedded Workshop for CPU1, download the debugging information file for the corresponding CPU.
Section 6 Tutorial 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.cpp] under [C++ source file] in the High-performance Embedded Workshop for CPU1. Rev. 1.00 Nov. 26, 2007 Page 153 of 230 REJ10J1766-0100...
Page 174
Section 6 Tutorial Figure 6.5 [Editor] Window (Displaying the Source Program) Select a font and size that are legible from the [Format…] option in the [Setup] menu if necessary. Initially the [Editor] window shows the start of the user program, but the user can use the scroll bar to scroll through the user program and look at the other statements.
Section 6 Tutorial Setting a PC Breakpoint A PC breakpoint is a simple debugging function. The [Editor] 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 176
Section 6 Tutorial Figure 6.6 [Editor] Window (Setting a PC Breakpoint) The symbol • will appear on the line containing the sort function. This shows that a PC breakpoint has been set. Note: The PC breakpoint cannot be set in the ROM area. Rev.
Section 6 Tutorial 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 in the High-performance Embedded Workshop for CPU0 and CPU1. The [Register] window is displayed. Figure 6.7 [Register] Window Rev.
Page 178
Section 6 Tutorial • 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 H’00000800 in this tutorial program, and click the [OK] button.
Section 6 Tutorial Executing the Program Execute the program as described in the following: • Since the [Go] check box under [Synchronization options] in the [Configuration] dialog box is enabled, execute the program by selecting [Go] from the [Debug] menu of the High- performance Embedded Workshop for CPU1, and then selecting [Go] from the [Debug] menu or selecting the [Go] button on the toolbar of the High-performance Embedded Workshop for CPU0.
Page 181
Section 6 Tutorial 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. Figure 6.12 [Status] Window Note: The items that can be displayed in this window differ according to the product.
Section 6 Tutorial 6.10 Reviewing Breakpoints The user can see all the breakpoints set in the program in the [Event] window. • Select [Eventpoints] from the [Code] submenu of the [View] menu of the High-performance Embedded Workshop for CPU1. The [Event] window is displayed. Select the [Breakpoint] sheet.
Section 6 Tutorial 6.11 Referring to Symbols The [Label] window can be used to display the information on symbols in modules. Select [Label] from the [Symbol] submenu of the [View] menu of the High-performance Embedded Workshop for CPU1. The [Label] window is displayed so that the user can refer to the addresses of symbols in modules.
Section 6 Tutorial 6.12 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: •...
Section 6 Tutorial 6.13 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 186
Section 6 Tutorial The user can also add variables to the [Watch] window by specifying those 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 p_sam. Figure 6.19 [Add Watch] Dialog Box •...
Page 187
Section 6 Tutorial The user can click mark ‘+’ at the left side of array a in the [Watch] window to watch all the elements. Figure 6.21 [Watch] Window (Displaying Array Elements) Rev. 1.00 Nov. 26, 2007 Page 167 of 230 REJ10J1766-0100...
Section 6 Tutorial 6.14 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.
Section 6 Tutorial 6.15 Stepping Through a Program The High-performance Embedded Workshop provides a range of step menu commands that allow efficient program debugging. Table 6.1 Step Option Menu Description Command Step In Executes each statement, including statements within functions. Step Over Executes a function call in a single step.
Page 190
Section 6 Tutorial Figure 6.24 [Editor] Window (Step In) • The highlighted line moves to the first statement of the sort function in the [Editor] window in the High-performance Embedded Workshop for CPU1. Rev. 1.00 Nov. 26, 2007 Page 170 of 230 REJ10J1766-0100...
Section 6 Tutorial 6.15.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 in the High-performance Embedded Workshop for CPU1, or click the [Step Out] button on the toolbar.
Page 192
Section 6 Tutorial Figure 6.26 [High-performance Embedded Workshop] Window (Step Out) The data of variable a displayed in the [Watch] window is sorted in ascending order. Rev. 1.00 Nov. 26, 2007 Page 172 of 230 REJ10J1766-0100...
Section 6 Tutorial 6.15.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. • Move to the change function following the procedures described in section 6.15.1, Executing [Step In] Command.
Section 6 Tutorial 6.16 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 in the High-performance Embedded Workshop for CPU1, or the [Go] button on the toolbar.
Page 196
Section 6 Tutorial 6.17 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 [Event condition] sheet. An overview and setting of the break function are described below.
Page 197
Section 6 Tutorial • Click the [Event] window with the right-hand mouse button and select [Add…] from the popup menu. • Enter H'00101060 in the [Address] edit box. When using the MCU with flash memory, enter H'00101060 in the [Address] edit box. Figure 6.32 [Breakpoint] Dialog Box Note: This dialog box differs according to the product.
Page 198
Section 6 Tutorial The PC breakpoint that has been set is displayed in the [Event] window. Figure 6.33 [Event] Window (PC Breakpoint Setting) Note: The items that can be displayed in this window differ according to the product. For the items that can be displayed, refer to the online help.
Page 199
Section 6 Tutorial The program runs, and stops at the set PC breakpoint. Figure 6.34 [Editor] Window at Execution Stop (PC Break) Rev. 1.00 Nov. 26, 2007 Page 179 of 230 REJ10J1766-0100...
Section 6 Tutorial The [Status] window displays the following contents. Figure 6.35 Displayed Contents of the [Status] Window (PC Break) Note: The items that can be displayed in this window differ according to the product. For the items that can be displayed, refer to the online help. 6.18 Hardware Break Function A method is given below in which the address bus condition is set under Ch1 (IA_OA_DT_CT) as...
Page 201
Section 6 Tutorial • Select a line of Ch1 (IA_OA_DT_CT) in the [Event] window. When highlighted, double-click this line. Figure 6.36 [High-performance Embedded Workshop] Window ([Ch1 (IA_OA_DT_CT]) • The [Ch1 (IA_OA_DT_CT) ] dialog box is displayed. • Clear the [Don't care] check box in the [Address] page. •...
Page 202
Section 6 Tutorial Figure 6.37 [Address] Page ([Ch1 (IA_OA_DT_CT)] Dialog Box) Note: The items that can be set in this dialog box differ according to the product. For details on the settings for each product, refer to the online help. Rev.
Page 203
Section 6 Tutorial • Click the [OK] button. • The first point display in the State line changes from Disable to Enable. • The first point display in the Condition line changes from None to Address = H’00101050 (tutorial.cpp/45) pc Core Select: CPU1 Break (CPU1). •...
Page 205
Section 6 Tutorial The [Status] window displays the following contents. Figure 6.39 Displayed Contents of the [Status] Window ([Ch1 (IA_OA_DT_CT] ) Note: The items that can be displayed in this window differ according to the product. For the items that can be displayed, refer to the online help. Rev.
Section 6 Tutorial 6.18.1 Setting the Sequential Break Condition The emulator has sequential break functions. Set hardware break conditions as follows: Ch1 (IA_OA_DT_CT): A break condition is satisfied immediately after address H'00101050 is accessed. Ch2 (IA_OA_DT_CT): A break condition is satisfied immediately after address H'00101042 is accessed.
Page 207
Section 6 Tutorial When the setting is completed, the [Event] window will be as shown in figure 6.41. Figure 6.41 [Event condition] Page Soon after set the [Combination action (Sequential or PtoP)], Ch1 (IA_OA_CT) or Ch2 (IA_OA_DT) will be invalid. Select Ch1 (IA_OA_CT) or Ch2 (IA_OA_DT) individually, and click the [Event] window with the right-hand mouse button and select [Enable].
Page 208
Section 6 Tutorial The program runs and then stops at the condition specified under Ch1(IA_OA_DT_CT). Figure 6.42 [Editor] Window at Execution Stop (Sequential Break) Rev. 1.00 Nov. 26, 2007 Page 188 of 230 REJ10J1766-0100...
Page 209
Section 6 Tutorial The [Status] window displays the following contents. Figure 6.43 Displayed Contents of the [Status] Window (Sequential Break) Note: The items that can be displayed in this window differ according to the product. For the items that can be displayed, refer to the online help. •...
Page 210
Section 6 Tutorial 6.19 Trace Functions The emulator has two branch-instruction trace functions. • Internal Trace Function Refer to section 5.6, Viewing the Trace Information, to see the setting and displayed contents. • AUD Trace Function This is the large-capacity trace function that is enabled when the AUD pin is connected to the emulator.
Section 6 Tutorial Note: The items that can be set in this dialog box differ according to the product. For details on the settings for each product, refer to the online help. Run the program as shown in the example of section 6.18, Hardware Break Function. The trace results are displayed in the [Trace] window after the program execution is completed.
Page 214
Section 6 Tutorial Note: This dialog box cannot be used in a product that does not support the AUD trace function. The items that can be set in this window differ according to the product. For details on the settings for each product, refer to the online help. The following table shows the options.
Page 215
Section 6 Tutorial (2) Displaying the trace result • Run the program as shown in the example of section 6.18, Hardware Break Function. The trace results are displayed in the [Trace] window after the program execution is completed. Figure 6.47 [Trace] Window (Example) Rev.
Page 216
Section 6 Tutorial 6.20 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 Elf/Dwarf2-type debugging information is loaded.
Page 217
Section 6 Tutorial • Set the same program counter and stack pointer values (PC = H’00000800 and R15 = H’FFF90000) as were set in section 6.8, Setting Registers (again, use the [Register] windows in the High-performance Embedded Workshops for CPU0 and CPU1). After that, click on the [Go] buttons in the High-performance Embedded Workshops for CPU0 and CPU1.
Section 6 Tutorial 6.21 Performance Measurement Function The emulator has performance measurement functions. • Performance measurement function This function applies a counter in the MPU to measure the number of times various events have occurred and cycle count. A start and end condition for counting can be set. Various items that can be measured differ according to the supported MPU.
Page 219
Section 6 Tutorial • The [Performance Analysis] window will be displayed. • Place the mouse cursor anywhere within this window, click the right-hand mouse button, and then select [Set] from the popup menu. The [Performance Analysis] dialog box will open. The events to be measured and measuring conditions can be set in this dialog box.
Section 6 Tutorial 6.22 Download Function to the Flash Memory Area The emulator enables downloading to the external flash memory area. This function requires a program for programming the flash memory (hereinafter referred to as a write module), a program for erasing the flash memory (hereinafter referred to as an erase module), and the RAM area for downloading and executing these modules.
Page 221
Section 6 Tutorial Table 6.2 Module Interface Module Name Argument Return Value Write module R4(L): Write address R0(L): End code Normal end = 0, R7(L): Verify option Abnormal end = other than 0, 0 = no verify, Verify error = BT 1 = verify R5(L): Access size 0x4220 = byte,...
Page 222
Section 6 Tutorial • Flash memory download method For downloading to the flash memory, set the items on the [Loading flash memory] page in the [Configuration] dialog box, which is opened from [System…], then [Emulator] from the [Setup] menu. Figure 6.52 [Loading flash memory] Page Rev.
Page 223
Section 6 Tutorial Table 6.3 shows the options for the [Loading flash memory] page. Table 6.3 [Loading flash memory] Page Options Option Description [Loading flash memory] Sets Enable for flash memory downloading. radio button When Enable is selected, and [File load] is selected from the [File] menu for downloading, the write module is always called.
Page 224
The following is an example of downloading to the flash memory manufactured by Intel Corporation (type number: G28F640J5-150) that has been mounted on Renesas' SH7751 CPU board (type number: HS7751STC01H). A sample is provided in the \Fmtool folder in the installation destination folder.
Page 225
Section 6 Tutorial SHxxxx Flash memory (32 Mbytes) A2-A24 FIA bus buffer A0-A22 FPGA CE1,2 FIA bus buffer D0-D7 D0-D31 FD bus buffer D8-D15 8-15 D0-D7 D8-D15 16-23 D0-D7 D8-D15 24-31 D0-D7 D8-D15 Figure 6.53 Flash Memory Wiring Table 6.5 Sample Program Specifications Item Contents RAM area to be used...
Page 226
Section 6 Tutorial Figure 6.54 [Loading flash memory] Page Notes: 1. When the data has already been written in the flash memory, be sure to select [Enable] for [Erasing flash memory]. If [Disable] is selected, a verify error occurs. 2. When [Erasing flash memory] is selected, it takes about one minute to erase the flash memory (in this example).
Section 6 Tutorial 6.23 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.
Section 7 Maintenance and Guarantee Section 7 Maintenance and Guarantee This section describes maintenance, guarantee, repair provisions, and how to request for repair of the emulator. User Registration When you purchase our product, be sure to register as a user. For user registration, refer to the section of ‘User Registration’...
Section 7 Maintenance and Guarantee Repair Provisions 7.4.1 Repair with Extra-Charge The products elapsed more than one year after purchase can be repaired with extra-charge. 7.4.2 Replacement with Extra-Charge If your product's fault falls in any of the following categories, the fault will be corrected by replacing the entire product instead of repair, or you will be advised to purchase new one, depending on the severity of the fault.
Section 7 Maintenance and Guarantee How to Make a Request for Repair If your product is found faulty, follow the procedure below to send your product for repair. Fill in the Repair Request Sheet included with this product, then send it along with this product for repair to your local distributor.
Page 232
Section 7 Maintenance and Guarantee Rev. 1.00 Nov. 26, 2007 Page 212 of 230 REJ10J1766-0100...
In addition to above, refer to FAQs on the emulator and High-performance Embedded Workshop on the Renesas web site (www.renesas.com). Rev. 1.00 Nov. 26, 2007 Page 213 of 230...
Page 234
Appendix A Troubleshooting Rev. 1.00 Nov. 26, 2007 Page 214 of 230 REJ10J1766-0100...
Appendix B Menus Appendix B Menus Table B.1 shows GUI menus. Table B.1 GUI Menus Toolbar Menu Option Shortcut Button Remarks View Disassembly Ctrl + D Opens the [Disassembly] window. Command Line Ctrl + L Opens the [Command Line] window. TCL toolkit Shift + Opens the [Console] window.
Page 236
Appendix B Menus Table B.1 GUI Menus (cont) Toolbar Menu Option Shortcut Button Remarks View Code Eventpoints Ctrl + E Opens the [Event] window. (cont) Trace Ctrl + T Opens the [Trace] window. Stack Trace Ctrl + K Opens the [Stack Trace] window. Gra- Image…...
Page 237
Appendix B Menus Table B.1 GUI Menus (cont) Toolbar Menu Option Shortcut Button Remarks Debug Debug Sessions… Opens the [Debug Sessions] dialog box to list, add, or remove the debug session. Debug Settings… Opens the [Debug Settings] dialog box to set the debugging conditions or download modules.
Page 238
Appendix B Menus Table B.1 GUI Menus (cont) Toolbar Menu Option Shortcut Button Remarks Debug Step Auto Steps only one source line when (cont) Mode the [Source] window is active. When the [Disassembly] window is active, stepping is executed in a unit of assembly instructions.
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. Rev. 1.00 Nov. 26, 2007 Page 219 of 230 REJ10J1766-0100...
Page 240
Appendix C Command-Line Functions Rev. 1.00 Nov. 26, 2007 Page 220 of 230 REJ10J1766-0100...
Appendix D Notes on High-performance Embedded Workshop Appendix D Notes on High-performance Embedded Workshop 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.
Page 242
The current directory may be altered by file specifications in commands. It is recommended to use absolute paths are recommended to be used to specify the files in a command file so that the current directory alteration is not affected. Example: FILE_LOAD C:\Hew3\Tools\Renesas\DebugComp\Platform \E10A-USBM\Tutorial\Tutorial\Debug_SHxxxx_E10A-USBM_ SYSTEM\tutorial.abs 7. Memory Save During User Program Execution Do not execute memory save or verifying during user program execution.
Page 243
Appendix D Notes on High-performance Embedded Workshop 9. 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. 10.
Page 244
Appendix D Notes on High-performance Embedded Workshop 15. Memory Access during User Program Execution When a memory is accessed from the memory window, etc. during user program execution, the user program is resumed after it has stopped in the emulator to access the memory. Therefore, realtime emulation cannot be performed.
Appendix E Diagnostic Test Procedure Appendix E Diagnostic Test Procedure For the diagnostic test procedure using the emulator test program, refer to the test program manual for the emulator (file name: E10A-USBM TME.PDF) in the CD-R Rev. 1.00 Nov. 26, 2007 Page 225 of 230 REJ10J1766-0100...
Page 246
Appendix E Diagnostic Test Procedure Rev. 1.00 Nov. 26, 2007 Page 226 of 230 REJ10J1766-0100...
Appendix F Repair Request Sheet Appendix F Repair Request Sheet Thank you for purchasing the E10A-USB Multi emulator (HS0005KCU04). In the event of a malfunction, fill in the repair request sheet on the following pages and send it to your distributor. Rev.
Page 248
Appendix F Repair Request Sheet Repair Request Sheet To Distributor Your company name: Person in charge: Tel.: Item Symptom 1. Date and time when the Month/Day/Year {at system initiation, in system operation} malfunction occurred *Circle either of items in the braces { }. 2.
Page 249
Appendix F Repair Request Sheet Item Symptom 4. Settings when the malfunction (1) MCU: Type number: occurred (2) Operating frequency: 5. Failure phenomenon 6. Error in debugging 7. Error in the diagnostic program 8. The High-performance Embedded Content of the error message Workshop does not link-up with the emulator.
Page 250
Appendix F Repair Request Sheet Rev. 1.00 Nov. 26, 2007 Page 230 of 230 REJ10J1766-0100...