Renesas Emulator Debugger M16C PC4701 User Manual
Renesas Emulator Debugger M16C PC4701 User Manual

Renesas Emulator Debugger M16C PC4701 User Manual

Emulator debugger v.1.03
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
Need help?

Need help?

Do you have a question about the Emulator Debugger M16C PC4701 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Renesas Emulator Debugger M16C PC4701

  • 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 M16C PC4701 Emulator Debugger V.1.03 User’s Manual Renesas Microcomputer Development Environment System Rev.1.00 2007.07...
  • 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 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 6 All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. For inquiries about the contents of this document or product, fill in the text file the installer generates in the following directory and email to your local distributor. ¥SUPPORT¥Product-name¥SUPPORT.TXT Renesas Tools Homepage http://www.renesas.com/en/tools...
  • Page 7: Table Of Contents

    Setup of Debugger 1. Features 1.1 Real-Time RAM Monitor Function...1 1.1.1 RAM Monitor Area ...1 1.1.2 Sampling Period ...2 1.1.3 Related Windows ...2 1.2 Break Functions...3 1.2.1 Software Breaks Function...3 1.2.2 Hardware Break ...4 1.2.3 Protect Break ...5 1.3 Real-Time Trace Function ...6 1.3.1 Trace Area...6 1.3.2 Trace Condition Setting ...7 1.3.3 Trace Data Write Condition ...7...
  • Page 8 5.1.5 Clock Tab ...43 5.1.6 Script Tab...44 5.2 Setting of the Communication Interface...45 5.2.1 Setting of the USB Interface ...45 5.2.2 Setting of the LPT Interface ...46 5.2.3 Setting of the LAN Interface...47 5.2.4 Setting of the Parallel Interface...49 5.2.5 Setting of the Serial Interface...49 5.3 Setup the Debugger for M32C ...50 5.3.1 Emem Dialog...50 5.4 Setup the Debugger for M16C/R8C...54...
  • Page 9 7.5.1 Extended Menus ...97 7.6 S/W Break Point Setting Window ...98 7.6.1 Command Button...99 7.6.2 Setting and Deleting a Break Points from Editor(Source) Window...100 7.7 H/W Break Point Setting Window...101 7.7.2 Specify the Combinatorial Condition...106 7.7.3 Specify the Process ID ...107 7.7.4 Command Button...107 7.7.5 Specify the Events (Instruction Fetch) ...108 7.7.6 Specify the Events (Memory Access) ...112...
  • Page 10 7.14.3 Display the Ready Queue Status ...191 7.14.4 Display the Timeout Queue Status...192 7.14.5 Display the Event Flag Status ...194 7.14.6 Display the Semaphore Status...196 7.14.7 Display the Mailbox Status...198 7.14.8 Display the Data Queue Status ...200 7.14.9 Display the Cycle Handler Status ...202 7.14.10 Display the Alarm Handler Status ...204 7.14.11 Display the Memory Pool Status ...205 7.14.12 Display the Task Context...207...
  • Page 11 9.2 Writing Expressions...248 9.2.1 Constants ...248 9.2.2 Symbols and labels ...249 9.2.3 Macro Variables...250 9.2.4 Register variables ...251 9.2.5 Memory variables ...251 9.2.6 Line Nos..251 9.2.7 Character constants ...252 9.2.8 Operators ...252 C/C++ Expressions 10.1 Writing C/C++ Expressions ...253 10.1.1 Immediate Values...253 10.1.2 Scope Resolution ...254 10.1.3 Mathematical Operators ...254...
  • Page 12 12.2.1 Stack area used by the emulator ...268 12.2.2 Interrupt stack pointer when resetting the target program ...268 12.2.3 Option of C Compiler/Assembler/Linker ...268 12.2.4 Target MCU HOLD terminal...268 12.2.5 Hardware Event ...269 12.2.6 Time Measurement Resource...269 12.2.7 CPU rewrite ...269 12.2.8 MR STK script command ...269 12.3 Attention of the M16C/R8C Debugger ...270 12.3.1 Map of stack area used by the emulator...270...
  • Page 13: Setup Of Debugger

    Setup of Debugger...
  • Page 14 (Blank Page)
  • Page 15: Features

    1 Features Features 1.1 Real-Time RAM Monitor Function This function allows you to inspect changes of memory contents without impairing the realtime capability of target program execution. The PC4701 emulator system contains a 1-Kbyte RAM monitor area (which cannot be divided into smaller areas).
  • Page 16: Sampling Period

    1.1.2 Sampling Period Sampling cycle means the display update interval. You can specify this function in any window which supports the RAM monitor. (The interval of 100 ms is set by default.) The actual sampling cycle may take longer time than the specified cycle depending on the operating environment.
  • Page 17: Break Functions

    1.2 Break Functions 1.2.1 Software Breaks Function Software Break breaks the target program before execution of the command at the specified address. This break point is called software breakpoint. The software breakpoint is set/reset in the Editor (Source) window or in the S/W Breakpoint Setting window.
  • Page 18: Hardware Break

    1.2.2 Hardware Break This function causes the target program to stop upon detecting a data read/write to memory, instruction execution, or the rising/falling edge of the input signal fed from an external trace cable. The contents of events that can be set vary with each target MCU. The following designations are available as break events: •...
  • Page 19: Protect Break

    1.2.3 Protect Break This function causes the target program to stop upon detecting a data write to the ROM area or an access to an unused area (read/write or instruction execution). Protect Break is a function to detect a write of data to the ROM area and an access (read, write, command execution) to an unused area and stop the target program.
  • Page 20: Real-Time Trace Function

    1.3 Real-Time Trace Function This function records a target program execution history. Up to 32K cycles of execution history can be recorded. This record allows inspecting the bus information, executed instructions, and source program execution path for each cycle. The real-time trace function records the execution history of the target program. The execution history is referred to in the tracing window.
  • Page 21: Trace Condition Setting

    1.3.2 Trace Condition Setting The following designations are available as trace events: • Address designation - Instruction fetch - Memory access - Bit access • External trigger designation (eight events) • Interruption The number of events that can be specified are six events of all. These break events can be combined as below: •...
  • Page 22: Time Measurement Function

    1.4 Time Measurement Function The time measurement function allows you to measure the maximum, minimum, and average execution times and measurement counts of a specified zone. With this debugger, time can be measured up to four points simultaneously. 1.4.1 The Measurement Condition The measurement condition of the zone time can specify the following in each measurement zone.
  • Page 23: Coverage Function

    1.5 Coverage Function Coverage Measurement is a function to record the addresses executed (accessed) by the target program (C0 coverage). After stopping execution of the target program, you can understand which addresses are not executed yet. By using the coverage measurement function in the test process, you can check for missing test items. 1.5.1 Coverage Measurement Area The coverage measurement area is any continuous 256 KB area starting from the 64 KB boundary.
  • Page 24: Real-Time Os Debugging Function

    1.6 Real-Time OS Debugging Function This function debugs the realtime OS-dependent parts of the target program that uses the realtime This function helps to show the status of the realtime OS and inspect a task execution history, etc. The debugger for 740 can't show the status of the realtime OS. 1.7 GUI Input/Output Function This function simulates the user target system's key input panel (buttons) and output panel on a window.
  • Page 25: About The Emulator Pc4701

    About the Emulator PC4701 The PC4701 emulator system is a generic term used for the 8/16-bit MCU emulators. It can be used in combination with the emulation pod for the PC4701 to debug application programs for each MCU. 2.1 Communication methods The supported communication methods vary with the type of emulator used.
  • Page 26: Before Starting The Debugger

    Before starting the debugger 3.1 Communication method by emulator The supported communication methods are as follows. (The supported communication methods vary with the type of emulator used. ) USB, LAN, LPT, Proprietary parallel, Serial 3.1.1 USB Interface Supported only when using the PC4701U emulator. •...
  • Page 27: Proprietary Parallel Interface

    3.1.4 Proprietary Parallel Interface Supported only when using the PC4701HS emulator. • The host computer must have a dedicated interface board, the PCA4202G02, incorporated in it (only the ISA bus is supported). The necessary cable is included with the emulator. •...
  • Page 28: Download Of Firmware

    3.2 Download of Firmware It is necessary to down-load the firmware which corresponds to connected Emulation Pod when the debugger is started to the emulator. • You have changed your emulation pod. • The firmware downloaded to the emulator is unknown one. •...
  • Page 29: Setting Before Emulator Starts

    3.3 Setting before emulator starts 3.3.1 USB communication Connection of USB devices is detected by Windows' Plug & Play function. The device driver needed for the connected USB device is automatically installed. 3.3.1.1 Install of USB device driver The USB devices connected are detected by Windows' Plug & Play function. The installation wizard for USB device drivers starts after the device had been detected.
  • Page 30: Lan Communication 1

    3.3.2 LAN communication 1 Before the emulator can be connected in a LAN, the IP address, etc. must first be registered in the emulator. For the emulator in default settings, the utility "setip.exe" included with the debugger may be used to set the IP address, etc. in the emulator. 3.3.2.1 Setting of the LAN Interface using the SETIP.EXE The utility "SETIP"...
  • Page 31 Click the Next button, and the dialog box shown below appears. Set the IP address, subnet mask, port number, and default gateway IP address. When using the emulator on the same network's same subnet mask, the default gateway IP address may be omitted. Use any 4-digit number to specify the port number.
  • Page 32: Lan Communication 2

    3.3.3 LAN communication 2 Please exexute registry setting program (Sack.exe) before starting the debugger. It is necessary for LAN communication with emulators to set the following registry. Windows XP/2000 HKEY_LOCAL_MACHINE¥S YSTEM¥CurrentControlSet¥ Services¥Tcpip¥Parameters¥ SackOpts You can clear the registry with executing the program "UnSack.exe". The above programs are installed in the directory where this debugger is installed.
  • Page 33: Proprietary Parallel Communication

    3.3.4 Proprietary parallel communication If you are using this debugger in a combination of the parallel I/F, you need to specify the start address of I/O addresses (7 bytes) to the device driver for PCA4202G02, (The I/O address for PCA4202G02 is set to 100h initially.) You can set this setting with setPca4202.exe included with this debugger.
  • Page 34: Preparation Before Use

    Preparation before Use Please run the High-performance Embedded Workshop and connect the emulator . In addition, in order to debug with this product, it is necessary to create a workspace. 4.1 Workspaces, Projects, and Files Just as a word processor allows you to create and modify documents, this product allows you to create and modify workspaces.
  • Page 35: Starting The High-Performance Embedded Workshop

    4.2 Starting the High-performance Embedded Workshop Activate the High-performance Embedded Workshop from [Programs] in the [Start] menu. The [Welcome!] dialog box is displayed. In this dialog box, A workspace is created or displayed. • [Create a new project workspace] radio button: Creates a new workspace.
  • Page 36: Creating A New Workspace (Toolchain Used)

    4.2.1 Creating a New Workspace (Toolchain Used) 4.2.1.1 Step1 : Creation of a new workspace In the [Welcome!] dialog box that is displayed when the High-performance Embedded Workshop is activated, select the [Create a new project workspace] radio button and click the [OK] button. Creation of a new workspace is started.
  • Page 37 4.2.1.2 Step2 : Setting for the Toolchain A wizard for the project creation starts. Here, the following contents are set. • toolchain • the setting for the real-time OS (when using) • the setting for the startup file, heap area, stack area, and so on Please set required information and click the [Next] button.
  • Page 38 4.2.1.3 Step 3: Selecting of the Target Platform Select the target system used for your debugging (emulator, simulator). When the setting for the toolchain has been completed, the following dialog box is displayed. Selecting of the Target type In the [Target type] list box, select the target CPU type. Selecting of the Target Platform In the [Targets] area, the target for the session file used when this debugger is activated must be selected here.
  • Page 39 4 Preparation before Use 4.2.1.4 Step4 : Setting the Configuration File Name Set the configuration file name for each of the all selected target. The configuration file saves the state of High-performance Embedded Workshop except for the target (emulator, simulator). The default name is already set.
  • Page 40 4.2.1.5 Step5 : The check of a created file name Finally, confirm the file name you create. 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.
  • Page 41: Creating A New Workspace (Toolchain Not Used)

    4.2.2 Creating a New Workspace (Toolchain Not Used) When debugging the existing load module file with this product, a workspace is created by this method. 4.2.2.1 Step1 : Creation of a new workspace In the [Welcome!] dialog box that is displayed when the High-performance Embedded Workshop is activated, select the [Create a new project workspace] radio button and click the [OK] button.
  • Page 42 4.2.2.2 Step 2: Selecting of the Target Platform Select the target system used for your debugging (emulator, simulator). A wizard starts and the following dialog box is displayed. Selecting of the Target type In the [Target type] list box, select the target CPU type. Selecting of the Target Platform In the [Targets] area, the target for the session file used when this debugger is activated must be selected here.
  • Page 43 4 Preparation before Use 4.2.2.3 Step3 : Setting the Configuration File Name Set the configuration file name for each of the all selected target. The configuration file saves the state of High-performance Embedded Workshop except for the target (emulator, simulator). The default name is already set.
  • Page 44 ELF/DWARF2 format file (When Using IAR toolchain) ELF/DWARF2 format file (When Using Tasking toolchain) ELF/DWARF2 format file (When Using KPIT toolchain) Intel Hex format file with Symbol format file (When Using Renesas toolchain “SRA74”) IEEE-695 format file (When Using Renesas toolchain "ICC740")
  • Page 45 Then register the corresponding download module in the [Download Modules] list box. A download module can be specified in the dialog opened with a [Add...] button. - Select the format of the download module in the [Format] edit box. Please refer to the upper table about the format name of a download module.
  • Page 46: Starting The Debugger

    4.3 Starting the Debugger The debugging can be started by connecting with an emulator. 4.3.1 Connecting the Emulator Connect the emulator by simply switching the session file to one in which the setting for the emulator use has been registered. The session file is created by default.
  • Page 47: Setup The Debugger

    5.1 Init Dialog The Init dialog box is provided for setting the items that need to be set when the debugger starts up. The contents set from this dialog box are also effective the next time the debugger starts. The data set in this dialog remains effective for the next start.
  • Page 48: Mcu Tab

    5.1.1 MCU Tab The specified content becomes effective when the next being start. 5.1.1.1 Specifying the MCU file Click the "Refer" button. The File Selection dialog is opened. Specify the corresponding MCU file. • An MCU file contains the information specific to the target MCU. •...
  • Page 49 5.1.1.3 Executing Self-Check Specify this option to execute self-check* on the emulator when the debugger starts up. Be sure to select the above check box only when you want to perform self-check at startup. Specify this option in the following cases: •...
  • Page 50 5.1.1.5 Using/unusing the watchdog timer Specify whether or not to use the watchdog timer. (By default, the watchdog timer is unused.) This specification exist for the M32C debugger only. When debugging the target system that uses a watchdog timer, select the check box shown above.
  • Page 51: Debugging Information Tab

    5.1.2 Debugging Information Tab The specified content becomes effective when the next being start. 5.1.2.1 display the compiler used and its object format Display the compiler used and its object file format. Please specify the compiler used and its object file format in the dialog opened by menu [Debug] -> [Debug Settings...].
  • Page 52 5.1.2.3 Specify whether to display the instruction format specifier Specify whether to display the instruction format specifier in the disassembled display. The debugger for 740 doesn't support this function. Select the above check box when you display the instruction format specifier. This specification can only be set or changed when you start the debugger.
  • Page 53: F/W And Work Area Tab

    5 Setup the Debugger 5.1.3 F/W and Work Area Tab The specified content becomes effective when the next being start. In this tab, only the debugger for M16C/R8C exists. 5.1.3.1 Select the Firmware File Usually, click the Default radio button in the F/W group. Click the Select radio button when you have to download firmware different from the one described in the MCU file.
  • Page 54: Memory Extension Mode Tab

    5.1.4 Memory Extension Mode Tab This tab enabled only when the MCU tab in the Init dialog is used to specify the MCU file of the microcomputer (M16C/62 group) which supports the memory space expansion function. The specified data remains effective for the next start. In this tab, only the debugger for M16C/R8C exists.
  • Page 55 ATTENTION The functions may be restricted depending on the type of memory space expansion mode. Extension Mode 1 • When the memory space expansion area is displayed in the dis-assemble mode in the Program window or the Source window, the displayed data may be different from what you would expect through the operation accompanying redrawing of the window, such as up/down scroll, during execution of the target program.
  • Page 56 Extension Mode 2 • The memory reference commands are added, which reference the internal ROM in the bank duplicated area in the dump format (see the table below). A memory reference command with the bank specification is added. The memory reference/the change to the bank repetition area must use the following commands.
  • Page 57: Clock Tab

    5 Setup the Debugger 5.1.5 Clock Tab The specified content becomes effective when the next being start. 5.1.5.1 Specify the Target Clock Change the setting by synchronizing with the clock used by the target microcomputer. (Internal is set by default.) (The debugger for 740 does not have designation of Sub clock.) Select Internal to set the internal clock, and External to set the external clock.
  • Page 58: Script Tab

    5.1.6 Script Tab The specified content becomes effective when the next being start. 5.1.6.1 Automatically Execute the Script Commands To automatically execute the script command at start of Debugger, click the "Refer" button to specify the script file to be executed. By clicking the "Refer"...
  • Page 59: Setting Of The Communication Interface

    5 Setup the Debugger 5.2 Setting of the Communication Interface 5.2.1 Setting of the USB Interface USB communication uses the personal computer's USB interface. It is compliant with USB 1.1. USB communication can only be used on the PC4701U emulator. Before USB communication can be performed, the computer must have a dedicated device driver installed in it.
  • Page 60: Setting Of The Lpt Interface

    5.2.2 Setting of the LPT Interface LPT communication uses a parallel interface (printer interface) of the personal computer. LPT communication can only be used on the PC4701U/M emulator. To set the LPT communication, click the "LPT" radio button of the MCU tab in the Init dialog. The setting looks like the figure below.
  • Page 61: Setting Of The Lan Interface

    5.2.3 Setting of the LAN Interface LAN communication uses a LAN interface of the personal computer. Before using LAN, you must register the emulator IP address, port number and subnet mask to the emulator itself (Otherwise, LAN is not available). Then, set LAN communication.
  • Page 62 5.2.3.2 Setting of the LAN Interface To set the LAN communication, click the "LAN" radio button of the MCU tab in the Init dialog. The setting looks like the figure below. Specify the IP address of the connected emulator in the IP address field. Specify the IP address, in bytes, in decimal.
  • Page 63: Setting Of The Parallel Interface

    5.2.4 Setting of the Parallel Interface Special parallel communication uses a special parallel interface board PCA4202G02 (option), which is inserted in the extension slot (ISA bus) of the personal computer. Special parallel communication can only be used on the PC4701HS emulator. To set the parallel communication, click the "Parallel"...
  • Page 64: Setup The Debugger For M32C

    5.3 Setup the Debugger for M32C 5.3.1 Emem Dialog In the Emem dialog box, setting information on the user target. The Emem dialog box opens after closing the Init dialog box. The tabs available on this dialog box vary with each product used. For details, click the desired tab name shown in the table below.
  • Page 65 5.3.1.1.1. Select the Processor Mode Specify the processor mode for the target system. Either the following can be specified. • Single-chip Mode Single-chip Mode • Memory Expansion Memory Expansion Mode • Microprocessor Microprocessor Mode 5.3.1.1.2. Inspecting the MCU status Clicking this tab displays the status of each MCU pin. It allows to check whether the MCU pin status matches the processor mode to be set.
  • Page 66 5.3.1.2.1. Debug monitor's bank address settings This product allocates a 64-Kbyte contiguous address area as the emulator's work area for use by the debug monitor. Specify any bank that the target system does not use. The debug monitor uses a 64-Kbyte area from the start address of the specified bank.
  • Page 67 Follow the procedure described below. Bank Specify the bank address of the debug target area to be allocated in (Set bank address) hexadecimal. If specified as C0, C00000h is the start address of the debug target area. Length Specify the size of the debug target area (256 bytes or 1 Mbytes). (Specify size of area) If Length is specified to be "256 bytes,"...
  • Page 68: Setup The Debugger For M16C/R8C

    5.4 Setup the Debugger for M16C/R8C 5.4.1 Map Command The memory map information must be altered to suit the target microcomputer's memory space by Map command. Area Mapping External Internal RAM Internal Internal ROM Internal External ROM External Note • The emulator temporarily uses the area from FFCh to FFFFh as a stack.
  • Page 69: Setup The Debugger For 740

    5.5 Setup the Debugger for 740 5.5.1 Map Command The memory map information must be altered to suit the target microcomputer's memory space by Map command. Area Mapping External External Internal ROM Internal External ROM External • Internal Enables the emulator's internal resources. The internal ROM area must be set for Internal because it is always emulated with the emulator's internal resources.
  • Page 70: Method Of Making Mcu File

    5.6 Method of making MCU file 5.6.1 Method of making MCU file (the M16C/R8C Debugger) The following content is sequentially described in the MCU file. Specify the MCU name to the file name, and specify "mcu" to the file extension. Start address of SFR area End address of SFR area Start address of internal RAM area...
  • Page 71: Method Of Making Mcu File (The 740 Debugger)

    5.6.2 Method of making MCU file (the 740 Debugger) The following content is sequentially described in the MCU file. Please describe information on 1-4 referring to the data book on MCU used. Number of stack page selection bit Address of CPU mode register End address of stack*1 Address of reset vector POD number*2...
  • Page 72 ATTENTION For a new MCU, new POD number, new firmware name and new MCU information number may be used. 5.6.2.1 Example FFFC M38000...
  • Page 73: Tutorial

    Tutorial...
  • Page 74 (Blank Page)
  • Page 75: Tutorial

    6.1 Introduction This section describes the main functions of this debugger by using a tutorial program. The tutorial programs are installed to the directory ¥WorkSpace¥Tutorial of the drive you installed High-performance Embedded Workshop. There are workspaces for each targets and each MCUs. Please select the corresponding one to your system, and open the workspace file (*.hws) from the menu [Open Workspace...].
  • Page 76: Usage

    6.2 Usage Please follow these instructions: 6.2.1 Step1 : Starting the Debugger 6.2.1.1 Preparation before Use To run the High-performance Embedded Workshop and connect the emulator, refer to "4 Preparation before Use ". 6.2.1.2 Setup the Debugger If it connects with an emulator, the dialog box for setting up a debugger will be displayed. Please set up the debugger in this dialog box.
  • Page 77: Step2 : Checking The Operation Of Ram

    6.2.2 Step2 : 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 78: Step3 : Downloading The Tutorial Program

    6.2.3 Step3 : Downloading the Tutorial Program 6.2.3.1 Downloading the Tutorial Program Download the object program to be debugged. The download file and the address to be downloaded will depends on the target mcu you uses. Please replace the screen image and addresses with corresponding one to your target mcu.
  • Page 79 6 Tutorial 6.2.3.2 Displaying the Source Program This debugger allows the user to debug a user program at the source level. Double-click [tutorial.c] under [C source file]. A [Editor(Source)] window opens and the contents of a "Tutorial.c" file are displayed. Select the [Format Views...] option from the [Setup] menu to set a font and size that are legible, if necessary.
  • Page 80: Step4 : Setting A Breakpoint

    6.2.4 Step4 : Setting a Breakpoint A software breakpoint is a basic debugging function. The [Editor(Source)] window provides a very simple way of setting a software breakpoint at any point in a program. 6.2.4.1 Setting a Software Breakpoint For example, to set a software breakpoint at the sort function call: Double-click the [S/W breakpoints] column on the line containing the sort function call.
  • Page 81: Step5 : Executing The Program

    6 Tutorial 6.2.5 Step5 : Executing the Program Execute the program as described in the following: 6.2.5.1 Resetting of CPU To reset the CPU, select [Reset CPU] from the [Debug] menu, or click the [Reset CPU] button on the toolbar. 6.2.5.2 Executing the Program To execute the program, select [Go] from the [Debug] menu, or click the [Go] button on the...
  • Page 82 6.2.5.3 Reviewing Cause of the Break The break factor is displayed in the [Output] window. The user can also 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.
  • Page 83: Step6 : Reviewing Breakpoints

    6 Tutorial 6.2.6 Step6 : Reviewing Breakpoints The user can see all the breakpoints set in the program in the [Breakpoints] dialog box. 6.2.6.1 Reviewing Breakpoints Push the key Ctrl+B, and the [Breakpoints] dialog box will be displayed. This window allows the user to delete, enable, or disable breakpoints.
  • Page 84: Step7 : Viewing Register

    6.2.7 Step7 : Viewing Register The user can see all registers/flags value in the [Register] window. 6.2.7.1 Viewing Register Select [Registers] from the [CPU] submenu of the [View] menu. The [Register] window is displayed. The figure below shows a Register window of the debugger for M16C/R8C. 6.2.7.2 Setting the Register Value You can change a register/flag value from this window.
  • Page 85: Step8 : Viewing Memory

    6 Tutorial 6.2.8 Step8 : Viewing Memory When the label name is specified, the user can view the memory contents that the label has been registered in the [ASM Watch] window. 6.2.8.1 Viewing Memory For example, to view the memory contents corresponding to __msize in word size: Select [ASM Watch] from the [Symbol] submenu of the [View] menu, open the [ASM Watch] window.
  • Page 86: Step9 : Watching Variables

    6.2.9 Step9 : 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. If the downloaded program is the program generated by the assembler package for 740 family, you can not watch variables in C watch window.
  • Page 87 6 Tutorial 6.2.9.2 Registering Variable The user can also add a variable to the [C Watch] window by specifying its name. Click the [C Watch] window with the right-hand mouse button and select [Add...] from the popup menu. The following dialog box will be displayed. Enter variable i. Click the [OK] button.
  • Page 88: Step10 : Stepping Through A Program

    6.2.10 Step10 : Stepping Through a Program This debugger provides a range of step menu commands that allow efficient program debugging. Step In Executes each statement, including statements within functions(subroutines). Step Out Steps out of a function(subroutine), and stops at the statement following the statement in the program that called the function(subroutine).
  • Page 89 6 Tutorial 6.2.10.2 Executing [Step Out] Command The [Step Out] command steps out of the called function(subroutine) 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 90 6.2.10.3 Executing [Step Over] Command The [Step Over] command executes a function(subroutine) 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 91: Step11 : Forced Breaking Of Program Executions

    6 Tutorial 6.2.11 Step11 : Forced Breaking of Program Executions This debugger can force a break in the execution of a program. 6.2.11.1 Forced Breaking of Program Executions 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 92: Step12 : Displaying Local Variables

    6.2.12 Step12 : Displaying Local Variables The user can display local variables in a function using the [C Watch] window. If the downloaded program is the program generated by the assembler package for 740 family, you can not watch variables in C watch window. 6.2.12.1 Displaying Local Variables For example, we will examine the local variables in the tutorial function, which declares three local variables: i, j, and p_sam.
  • Page 93: Step13 : Stack Trace Function

    6 Tutorial 6.2.13 Step13 : Stack Trace Function The debugger 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. The debugger for 740 doesn't support the stack trace function.
  • Page 94: What Next

    6.2.14 What Next? This tutorial has described the usage of this debugger. 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 95: Reference

    Reference...
  • Page 96 (Blank Page)
  • Page 97: Windows/Dialogs

    The window of this debugger is shown below. When the window name is clicked, the reference is displayed. Window Name RAM Monitor Window ASM Watch Window C Watch Window Coverage Wind w Script Window S/W Break Point Setting Window H/W Break Point Setting Window Protect Window Trace Point Setting Window Time Measurement Window...
  • Page 98: Ram Monitor Window

    7.1 RAM Monitor Window The RAM monitor window is a window in which changes of memory contents are displayed while running the target program. The relevant memory contents are displayed in dump form in the RAM monitor area by using the realtime RAM monitor function.
  • Page 99 ATTENTION • The RAM monitor window shows the data that have been accessed through the bus. Therefore, changes are not reflected in the displayed data unless they have been accessed via the target program as in the case where memory is rewritten directly from an external I/O. •...
  • Page 100: Extended Menus

    7.1.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu RAM Monitor Area... Sampling Period... Clear Down Address... Scroll Area... Data Length 1byte 2bytes 4bytes 8bytes Radix Single Dec Code ASCII SJIS...
  • Page 101: Setting The Ram Monitor Area

    7.1.2 Setting the RAM monitor area Choose the popup menu [RAM Monitor Area...] in the RAM monitor window. The Set RRAM Area dialog box shown below will appear. The start address of the currently set RAM monitor area and the range of the RAM monitor area are displayed in the Start and the Area fields of this dialog box.
  • Page 102: Asm Watch Window

    7.2 ASM Watch Window The ASM watch window is a window in which you can register specific addresses as watchpoints and inspect memory contents at those addresses. If a registered address resides within the RAM monitor area, the memory content at that address is updated at given intervals (by default, every 100 ms) during program execution.
  • Page 103: Extended Menus

    7.2.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Add... Add Bit... Remove Remove All Set... Radix Refresh Layout Address Area Size Area RAM Monitor Enable RAM Monitor Sampling Period...
  • Page 104: C Watch Window

    7.3 C Watch Window The C Watch Window displays C/C++ expressions and their values (results of calculations). The C/C++ expressions displayed in the C Watch Window are known as C watchpoints. The displays of the results of calculating the C watchpoints are updated each time a command is executed. When RAM monitor function is effective and the C watch points are within the RAM monitor area, the displayed values are updated during execution of the target program.
  • Page 105 ATTENTION • You cannot change the values of the C watch points listed below: - Register variables - C watch point which does not indicate an address(invalid C watch point) • If a C/C++ language expression cannot be calculated correctly (for example, when a C/C++ symbol has not been defined), it is registered as invalid C watch point.
  • Page 106: Extended Menus

    7.3.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Add... Remove Remove All Initialize Set New Value... Radix Default Toggle(All Variables) Set initial... Refresh Hide type name Show char* as string Zero suppress in Hex display Sort Sort by Name...
  • Page 107: Coverage Window

    7.4 Coverage Window The Coverage window allows you to reference the coverage measurement result of the functions of the target program downloaded. The coverage which can be measured is C0 coverage. Two types of windows are provided: the Coverage window in which you can check the start address/end address of the functions and coverage measurement results;...
  • Page 108: Extended Menus

    7.4.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Select source file... Auto Refresh Refresh Clear Base... File Save... Load... Layout Address Toolbar display Customize toolbar... Allow Docking Hide *:The debugger for 740 doesn't support, because the entire memory area is coverage area.
  • Page 109: Refer To The Source Line/The Executed Address

    7 Windows/Dialogs 7.4.2 Refer to the Source Line/the Executed Address It is possible to refer in the Editor(Source) Window or Memory Window. 7.4.2.1 Refer in the Editor(Source) Window In the Editor(Source) window, a display of Coverage Measurement is set to "Disable" by default. To enable the display, check the [Coverage] check box in the dialog box opened by choosing the main menu - [Edit] ->...
  • Page 110: Script Window

    7.5 Script Window The Script Window displays the execution of text -format script commands and the results of that execution. Script commands can be executed using a script file or interactively. You can also write script commands in the script file so that they are automatically executed. The results of script command execution can also be stored in a previously specified log file.
  • Page 111: Extended Menus

    7.5.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Script Open... Step Close View Save... Clear On... Record On... Copy Paste Delete Undo Toolbar display Customize toolbar... Allow Docking Hide Function Open script file.
  • Page 112: S/W Break Point Setting Window

    7.6 S/W Break Point Setting Window The S/W Break Point Setting window allows you to set software break points. Software breaks stop the execution of instructions immediately before the specified break point. • If you have set multiple software breakpoints, program execution stops when any one software break address is encountered (OR conditions).
  • Page 113: Command Button

    7.6.1 Command Button The buttons on this window has the following meanings. Button Function Load... Load setting information from a file in which it was saved. Save... Save the contents set in the window to a file. Help Display the help of this window. Add the break point.
  • Page 114: Setting And Deleting A Break Points From Editor(Source) Window

    7.6.2 Setting and Deleting a Break Points from Editor(Source) Window The area which can be set in the software breakpoint is different according to the product. Please refer to "12.1.2Area where software breakpoint can be set" for details. You can set break points in the Editor(Source) Window. To do so, double-click the break point setting area ("S/W breakpoints"...
  • Page 115: H/W Break Point Setting Window

    7.7 H/W Break Point Setting Window The H/W Breakpoint Setting window is used to set hardware breakpoints for the Emulators. • The events listed below can be specified as break events. If the contents of events are altered, they are marked by an asterisk (*) on the title bar. The asterisks (*) are not displayed after setting up the emulator.
  • Page 116 7.7.1.1 Specify the Break Event To set events, double-click to select the event you want to set from the event setting area of the H/W Break Point Setting Window. This opens the dialog box shown below. Following events can be set by specifying Event Type in this dialog box.
  • Page 117 • When FETCH is selected Breaks for the instruction fetch. (The debugger for M32C not support. When using these products, use memory access instead.) • When DATA ACCESS is selected Breaks for the memory access. 7 Windows/Dialogs...
  • Page 118 • When BIT SYMBOL is selected Breaks for the bit access. • When INTERRUPT is selected Breaks for the interrupt occurrence or termination. (The debugger for M32C not support.)
  • Page 119 7 Windows/Dialogs • When TRIGGER is selected Breaks for the status of signal input from external trace cable.
  • Page 120: Specify The Combinatorial Condition

    7.7.2 Specify the Combinatorial Condition To specify a combinatorial condition, specify the desired condition from the combinatorial condition specification area. • When AND or OR is selected In the event specification area, the event used and a pass count for that event can be specified. To alter the pass count, while the event to alter is being selected, click the pass count value of that event.
  • Page 121: Specify The Process Id

    7.7.3 Specify the Process ID By specifying a process ID, it is possible to detect only event establishment under specific conditions. Example: Enable only the event that occurs in a specific task when using the realtime OS. 7.7.4 Command Button The buttons on this window has the following meanings.
  • Page 122: Specify The Events (Instruction Fetch)

    7.7.5 Specify the Events (Instruction Fetch) To specify an instruction fetch event, change the event select dialog box's Event Type to "FETCH". The event is established when instruction is fetched from the specified address or any address in the specified address range. 7.7.5.1 Instruction Fetch of Specified Address Set as below.
  • Page 123 7 Windows/Dialogs 7.7.5.2 Instruction Fetch of Specified Address Area(In) Set as below. Example) Instruction fetch at address 80000h to 80FFFh...
  • Page 124 7.7.5.3 Instruction Fetch of Specified Address Area(Out) Set as below. Example) Instruction fetch at any address other than the range 80000h to 80FFFh...
  • Page 125 7 Windows/Dialogs 7.7.5.4 Entering/exiting to specified function Set as below. Example) Entering a break to function name "wait" Example) Exiting from function name "wait"...
  • Page 126: Specify The Events (Memory Access)

    7.7.6 Specify the Events (Memory Access) To specify a memory access event, change the event select dialog box's Event Type to "DATA ACCESS". The event is established when memory is accessed at the specified address or under conditions set for the specified address range. 7.7.6.1 Memory Access(The debugger for M32C) ATTENTION It is not detected that data access to the odd addresses in word-size access.
  • Page 127 7 Windows/Dialogs 7.7.6.1.1. Writing/Reading a Specified Address Set as below. Example) Writing to even address 400h...
  • Page 128 Example) Writing byte length data 32h to even address 400h...
  • Page 129 7 Windows/Dialogs Example) Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width. (8 bits bus width)
  • Page 130 (16 bits bus width)
  • Page 131 7 Windows/Dialogs Example) Writing word length data 1234h to even address 400h Contents of settings vary with each product and bus width. (8 bits bus width) Please specify "And" of the 1st point and the 2nd point for a combination condition. 1st point...
  • Page 132 2nd point...
  • Page 133 7 Windows/Dialogs (16 bits bus width)
  • Page 134 Example) Writing data 10h - 3Fh to even address 400h...
  • Page 135 7 Windows/Dialogs 7.7.6.1.2. Reading/writing data to the specified address range Set as below. Example) Writing data to addresses ranging from 400h to 40Fh...
  • Page 136 7.7.6.1.3. Reading/writing data to addresses outside the specified range Set as below. Example) Writing data to addresses below 7FFh...
  • Page 137 7 Windows/Dialogs 7.7.6.2 Memory Access(The debugger for M16C/R8C) 7.7.6.2.1. Writing/Reading a Specified Address Set as below. Example) Writing to even address 400h...
  • Page 138 Example) Writing byte length data 32h to even address 400h...
  • Page 139 7 Windows/Dialogs Example) Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width. (8 bits bus width)
  • Page 140 (16 bits bus width)
  • Page 141 7 Windows/Dialogs Example) Writing word length data 1234h to even address 400h...
  • Page 142 Example) Writing data 10h - 3Fh to even address 400h...
  • Page 143 7 Windows/Dialogs 7.7.6.2.2. Reading/writing data to the specified address range Set as below. Example) Writing data to addresses ranging from 400h to 40Fh...
  • Page 144 7.7.6.2.3. Reading/writing data to addresses outside the specified range Set as below. Example) Writing data to addresses below 7FFh...
  • Page 145 7 Windows/Dialogs 7.7.6.3 Memory Access(The debugger for 740) The debugger For 740, a write of word length data to the even address cannot be detected, either. 7.7.6.3.1. Writing/Reading a Specified Address Set as below. Example) Writing to even address 400h...
  • Page 146 Example) Writing byte length data 32h to even address 400h...
  • Page 147 7 Windows/Dialogs Example) Writing data 10h - 3Fh to even address 400h...
  • Page 148 7.7.6.3.2. Reading/writing data to the specified address range Set as below. Example) Writing data to addresses ranging from 400h to 40Fh...
  • Page 149 7 Windows/Dialogs 7.7.6.3.3. Reading/writing data to addresses outside the specified range Set as below. Example) Writing data to addresses below 7FFh...
  • Page 150: Specify The Events (Bit Access)

    7.7.7 Specify the Events (Bit Access) To specify a bit access event, change the event select dialog box's Event Type to "BIT SYMBOL". The event is established when the specified bit at the specified address or specified bit symbol is accessed under specified conditions.
  • Page 151 7 Windows/Dialogs 7.7.7.1.1. Writing/Reading a Specified Bit Symbol Set as below. Example) Writing "1" to bit symbol "bitsym"...
  • Page 152: Specify The Events (Interrupt)

    7.7.8 Specify the Events (Interrupt) To specify an interrupt event, change Event Type in the event select dialog box to "INTERRUPT". When an interrupt is generated or finished, the event is established. 7.7.8.1 Interrupt Occurrence Set as below.
  • Page 153 7 Windows/Dialogs 7.7.8.2 Interrupt Termination Set as below.
  • Page 154: Specify The Events (External Trigger Signal)

    7.7.9 Specify the Events (External Trigger Signal) To specify an event for external trigger signal, change Event Type in the event select dialog box to "TRIGGER". When the signal from the external trace signal input cable is in a specified state, the event is established.
  • Page 155 7 Windows/Dialogs Example) Fall of EXT1(brown) signal 7.7.9.2 Combination of rise/fall edges Set as below. Example) Rise of EXT0 (white)/EXT7 (purple) signal, fall of EXT1 (brown) signal...
  • Page 156: Specify The Event Combination Condition

    7.7.10 Specify the Event Combination Condition Use the Combination group of the event setting windows to specify the combinatorial conditions of events. The combination of two or more events can be used. One of the following combinatorial conditions can be selected. All of the specified events are established AND(Same Time) The specified events are established at th same time...
  • Page 157 7 Windows/Dialogs 7.7.10.2 Select AND(Same Time) Change the Combination group to "AND (Same Time)". Next, check (turn on) an event in the event specification area that you want to use. No pass counts can be specified (fixed to 1). 7.7.10.3 Select State Transition Change the Combination group to "State Transition".
  • Page 158 Sequential specification Use the buttons included in the Sequential group. Pass counts can be specified from the popup menu that appears when selecting an event. The contents set here are reflected in the state transition diagram. Example: Events A1, A2, and A3 that occur successively in that order are established...
  • Page 159: Specify The Process Id

    7 Windows/Dialogs 7.7.11 Specify the Process ID By specifying a task name (task number), it is possible to enable only the events that occurred in the specified task. 7.7.11.1 Specify the Task Only the events from a specified task can be detected. Events from other than a specified task can also be detected.
  • Page 160: Protect Window

    7.8 Protect Window The Protect window sets the protect break (memory protect) function of the emulator. • The protect break function is disabled at start of the debugger. • Three types of protect break attributes are provided as below: - Access Disable (read/write disabled, display in red) - Read Only (write disabled, display in yellow) - R/W Enable (read/write enabled, display in sky blue) •...
  • Page 161: Trace Point Setting Window

    7.9 Trace Point Setting Window The Trace Point Setting window is used to set trace points. • The events listed below can be specified as trace events. If the contents of events are altered, they are marked by an asterisk (*) on the title bar. The asterisks (*) are not displayed after setting up the emulator.
  • Page 162: Specify The Trace Event

    7.9.1 Specify the Trace Event To set events, double-click to select the event you want to set from the event setting area of the Trace Point Setting Window. This opens the dialog box shown below. Following events can be set by specifying Event Type in this dialog box. •...
  • Page 163 • When DATA ACCESS is selected Traces for the memory access. • When BIT SYMBOL is selected Traces for the bit access. 7 Windows/Dialogs...
  • Page 164 • When INTERRUPT is selected Traces for the interrupt occurrence or termination. (The debugger for M32C not support.) • When TRIGGER is selected Traces for the status of signal input from external trace cable.
  • Page 165: Specify The Combinatorial Condition

    7.9.2 Specify the Combinatorial Condition To specify a combinatorial condition, specify the desired condition from the combinatorial condition specification area. • When AND or OR is selected In the event specification area, the event used and a pass count for that event can be specified. To lter the pass count, while the event to alter is being selected, click the pass count value of that event.
  • Page 166: Specify The Process Id

    • When State Transition is selected Click the Details... button, and the dialog box shown below appears. Specification by a state transition diagram or Sequential specification can be used. If the content of any event is altered, it is marked with an asterisk (*) on the title bar. Once conditions are set in the emulator, asterisks are not displayed.
  • Page 167: Specify The Trace Write Condition

    7.9.5 Specify the Trace Write Condition Conditions for cycles to be written to trace memory can be specified. Total Writes all cycles. Pick up Writes only the cycles where specified condition holds true. Exclude Writes only the cycles where specified condition does not hold true. Also, following three write modes are supported.
  • Page 168: Specify The Events (Instruction Fetch)

    7.9.7 Specify the Events (Instruction Fetch) How to set events for fetch is same as the way for H/W Break Point Setting Window. For detail about the setting, refer to "7.7.5 Specify the Events (Instruction Fetch) " 7.9.8 Specify the Events (Memory Access) How to set events for memory access is same as the way for H/W Break Point Setting Window.
  • Page 169: Specify The Write Condition

    7.9.14 Specify the write condition Trace data write conditions can be specified. You can specify the following write conditions: Write conditions unlimited (default) Cycles from the start event established to the end event established Only cycles where the start event is established Cycles from the start event established to the start event unestablished Other than cycles from the start event established to the end event established Other than cycles where the start event is established...
  • Page 170 • For condition 3, choose the Mode shown below and set the Start event. • For condition 4, choose the Mode shown below and set the Start event.
  • Page 171 Similarly, when specifying conditions 5 to 7, choose "Exclude" and click the "Detail..." button to open the Realtime-trace Write Condition dialog box. • For condition 5, choose the Mode shown below and set the Start and End events. • For condition 6, choose the Mode shown below and set the Start event. 7 Windows/Dialogs...
  • Page 172 • For condition 7, choose the Mode shown below and set the Start event.
  • Page 173: Time Measurement Window

    7.10 Time Measurement Window The Time Measurement window displays the minimum/maximum/average execution time and measurement count at any measurement point. The execution time of up to 4 measurement points can be measured simultaneously. You can specify the event for the measurement condition in the same manner as when specifying events in the Trace Point Setting Window.
  • Page 174: Specify The Time Measurement Event

    7.10.1 Specify the Time Measurement Event The events listed below can be specified as measurement events. • The debugger for M32C Memory Access, Bit Access, External Trigger (* Can be substituted by memory access. (Access type = Read)) • The debugger for M16C/R8C Fetch, Memory Access, Bit Access, Interrupt, External Trigger •...
  • Page 175 • When FETCH is selected Measures for the instruction fetch. (The debugger for M32C not support. When using these products, use memory access instead.) • When DATA ACCESS is selected Measures for the memory access. 7 Windows/Dialogs...
  • Page 176 • When BIT SYMBOL is selected Measures for the bit access. • When INTERRUPT is selected Measures for the interrupt occurrence or termination. (The debugger for M32C not support.)
  • Page 177 7 Windows/Dialogs • When TRIGGER is selected Measures for the status of signal input from external trace cable.
  • Page 178: Time Measurement Condition

    7.10.2 Time Measurement Condition For the time measurement conditions, the following can be specified for each measurement interval. 7.10.3 Command Button The buttons on this window has the following meanings. Butto n Function Reset Discards the contents being displayed in the window and loads contents from the emulator in which they were set.
  • Page 179: Specify The Events (Instruction Fetch)

    7 Windows/Dialogs 7.10.4 Specify the Events (Instruction Fetch) How to set events for fetch is same as the way for H/W Break Point Setting Window. For detail about the setting, refer to "7.7.5 Specify the Events (Instruction Fetch) " 7.10.5 Specify the Events (Memory Access) How to set events for memory access is same as the way for H/W Break Point Setting Window.
  • Page 180: Set The Measurement Condition

    7.10.9 Set the Measurement Condition For the debugger, the following measurement conditions can be specified. • Measure the execution time between the events. • Measure a period at which intervals events occur. • Measure the time at which events are established. By specifying a function name, it is possible to measure the execution time of that function.
  • Page 181 7.10.9.2 Measure the event occurrence cycle Set the measurement event (measurement start event only). Specify the following in the Measurement Condition Designation dialog. 7.10.9.3 Measure the event establishment time Set the measurement event (measurement start event only). Specify the following in the Measurement Condition Designation dialog. 7 Windows/Dialogs...
  • Page 182 7.10.9.4 Measure the execution time of the specified function (1) Measure the execution time of the specified function. In this mode, the function top address is automatically registered to the measurement start event, and the function end address to the measurement end address. The measurement result contains the execution time of other function called within the specified function.
  • Page 183 7 Windows/Dialogs 7.10.9.5 Measure the execution time of the specified function (2) Measure the execution time of the specified function. In this mode, the function address range is automatically registered to the measurement start event. The measurement result does not contain the execution time of other function called within the specified function.
  • Page 184: Trace Window

    7.11 Trace Window The Trace Window is used to display the results of real-time trace measurement. • Bus mode This mode allows you to inspect cycle-by-cycle bus information. The display content depends on the MCU and simulator system used. In addition to bus information, this mode allows disassemble, source line or data access information to be displayed in combination.
  • Page 185 Cycle display area: Shows trace cycles. Double-click here to bring up a dialog box to change the displayed cycle. Label display area: Shows labels corresponding to address bus information. Double-click here to bring up a dialog box to search for addresses. Bus information display area: The content displayed here differs depending on the MCU or simulator system used.
  • Page 186: Configuration Of Disassemble Mode

    7.11.2 Configuration of Disassemble Mode When disassemble mode is selected while bus mode is unselected, trace information is displayed in disassemble mode. Disassemble mode is configured as shown below. Address display area: Shows addresses corresponding to instructions. Double-click here to bring up a dialog box to search for addresses.
  • Page 187: Configuration Of Data Access Mode

    7.11.3 Configuration of Data Access Mode When data access mode is selected while bus mode and disassemble mode are unselected, trace information is displayed in data access mode. Data access mode is configured as shown below. Data access display area: Shows data access information. If the information displayed here is "000400 1234 W,"...
  • Page 188: Configuration Of Source Mode

    7.11.4 Configuration of Source Mode When only source mode is selected, trace information is displayed in source mode. Source mode is configured as shown below. Line number display area: Shows the line number information of the displayed file. Double-click here to bring up a dialog box to change the displayed file. Address display area: Shows addresses corresponding to source lines.
  • Page 189: Extended Menus

    7.11.5 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu DATA View Cycle... Address... Source... Time Absolute Time Differences Relative Time Trace Forward Backward Step Come Stop Restart Layout... Copy Save...
  • Page 190: Display Of Bus Information On The M32C Debugger

    7.11.6 Display of bus information on the M32C Debugger From left to right, the contents are as follows: • Address • The status of the address bus • Data The status of the data bus • The width of the external data bus ("8b" for an 8-bit data bus, and "16b" for a 16-bit data bus) •...
  • Page 191 Representation DMAT • Shows the level of the external break trigger (the EXTIN7 pin of the external trace signal input cable). High level = "1", Low level = "0". • Shows the level of the external trace trigger (the EXTIN6 pin of the external trace signal input cable).
  • Page 192: Display Of Bus Information On The M16C/R8C Debugger

    7.11.7 Display of bus information on the M16C/R8C Debugger From left to right, the contents are as follows: • Address The status of the address bus • Data The status of the data bus • The width of the external data bus ("8b" for an 8-bit data bus, and "16b" for a 16-bit data bus) •...
  • Page 193 Display format • Shows the number of bytes stored in the instruction queue buffer in the range 0 to 4. • Shows the level of the external break trigger (the EXTIN7 pin of the external trace signal input cable). High level = "1", Low level = "0". •...
  • Page 194: Display Of Bus Information On The 740 Debugger

    7.11.8 Display of bus information on the 740 Debugger From left to right, the contents are as follows: • Address The status of the address bus • Data The status of the data bus • Sync This signal is output when fetching an instruction op-code. When an op-code is being fetched, this signal indicates a logic 1.This Sync value is sometimes displayed as '(1)'.In this case, it denotes a dummy Sync meaning that the instruction on the line is not actually executed.
  • Page 195: Data Trace Window

    7.12 Data Trace Window The Data Trace Window is used to analyze the results of real-time trace measurements and graphically show data access information. It operates in conjunction with Trace Window. • In the data reference area, you can inspect memory values at the point of a cycle currently in interest or the values of registered C variables.
  • Page 196: Extended Menus

    7.12.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Analyze Trace Data Set Cycle... Sync with Trace Window Data Length 1byte 2bytes 4bytes Radix Address... Add C Watch Remove C Watch Hide Type Name Add...
  • Page 197: Gui I/O Window

    7.13 GUI I/O Window The GUI I/O window allows you for port input by creating a user target system key input panel (button) in the window and clicking the created button. And this window also allows you to implement the user target system output panel in the window. •...
  • Page 198: Extended Menus

    7.13.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Select Item Delete Copy Paste Create Button Create Label Create LED Create Text Display grid Save... Load... Sampling Period... Toolbar display Customize toolbar...
  • Page 199: Mr Window

    7.14 MR Window Use the MR Window to display the status of the realtime OS. The debugger for 740 doesn't support this function. You can only use the MR Window when you have downloaded a program that uses the realtime OS (if the downloaded program does not use the MR, nothing is displayed in the MR Window when it is opened.) •...
  • Page 200 7.14.1.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Mode Task Ready Queue Timeout Queue Event Flag Semaphore Mailbox Data Queue Cyclic Handler Alarm Handler Memory Pool Message Buffer Port Mailbox(with Priority) Context...
  • Page 201: Display The Task Status

    7.14.2 Display the Task Status In the MR window, select Popup Menu - [Mode] -> [Task]. By double-clicking any line, the information on the task context is displayed in the Context dialog. For details on the Context dialog, see "7.14.12 Display the Task Context" The following data is displayed in the status bar.
  • Page 202 • *1Task Status Display Status RUNNING state READY state SUSPENDED state DORMANT state WAI(SLP) Sleeping state WAI(SLP)-SUS Sleeping state (suspended) WAI(SLP-TMO) Sleeping state with time-out WAI(SLP-TMO)-SUS Sleeping state with time-out (suspended) WAI(DLY) Delayed state due to dly_tsk WAI(DLY)-SUS Delayed state due to dly_tsk (suspended) WAI(FLG) Waiting state for an eventflag WAI(FLG)-SUS...
  • Page 203 7.14.2.2 Display the Task Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the tasks defined in the configuration are listed in the order of ID number. The function of each item is as described below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Items Name...
  • Page 204 • *1Task Status Display WAI(SLP) WAI(SLP)-SUS WAI(SLP-TMO) WAI(SLP-TMO)-SUS WAI(DLY) WAI(DLY)-SUS WAI(FLG) WAI(FLG)-SUS WAI(FLG-TMO) WAI(FLG-TMO)-SUS WAI(SEM) WAI(SEM)-SUS WAI(SEM-TMO) WAI(SEM-TMO)-SUS WAI(MBX) WAI(MBX)-SUS WAI(MBX-TMO) WAI(MBX-TMO)-SUS WAI(SDTQ) WAI(SDTQ)-SUS WAI(SDTQ-TMO) WAI(SDTQ-TMO)-SUS WAI(RDTQ) WAI(RDTQ)-SUS WAI(RDTQ-TMO) WAI(RDTQ-TMO)-SUS WAI(VSDTQ) WAI(VSDTQ)-SUS WAI(VSDTQ-TMO) WAI(VSDTQ-TMO)-SUS WAI(VRDTQ) WAI(VRDTQ)-SUS WAI(VRDTQ-TMO) WAI(VRDTQ-TMO)-SUS WAI(MPF) WAI(MPF)-SUS WAI(MPF-TMO) WAI(MPF-TMO)-SUS Status...
  • Page 205: Display The Ready Queue Status

    • *2Display the Wait Cancellation Condition of Event Flag Wfmode Status TWF_ANDW Waits for all bits set in the wait bit pattern to be set (AND wait) TWF_ORW Waits for any one bit set in the wait bit pattern to be set (OR wait) 7.14.3 Display the Ready Queue Status In the MR window, select Popup Menu - [Mode] ->...
  • Page 206: Display The Timeout Queue Status

    7.14.4 Display the Timeout Queue Status In the MR window, select Popup Menu - [Mode] -> [Timeout Queue]. 7.14.4.1 Display the Timeout Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) The function of each item is as described below. Tasks waiting at present are displayed in the descending order of timeout value.
  • Page 207 7.14.4.2 Display the Timeout Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) The function of each item is as described below. Tasks waiting at present are displayed in the descending order of timeout value. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Tmout...
  • Page 208: Display The Event Flag Status

    7.14.5 Display the Event Flag Status In the MR window, select Popup Menu - [Mode] -> [Event Flag]. 7.14.5.1 Display the Event Flag Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the event flags defined in the configuration are listed in the order of ID number. The function of each item is listed below.
  • Page 209 • The following are displayed in the Flgatr area: TA_TFIFO TA_TPRI TA_WSGL TA_WMUL TA_CLR • When a task connected to the event flag queue is in the state of waiting with timeout enabled (waiting in twai_flg), a string "[tmo]", which indicates a state of waiting with timeout enabled, is appended to a string displayed in the Flag Queue field.
  • Page 210: Display The Semaphore Status

    7.14.6 Display the Semaphore Status In the MR window, select Popup Menu - [Mode] -> [Semaphore]. 7.14.6.1 Display the Semaphore Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the SEMs defined in the configuration are listed in the order of ID number. The function of each item is listed below.
  • Page 211 • The following are displayed in the Sematr area: TA_TFIFO TA_TPRI • When a task connected to the SEM queue is in the state of waiting with timeout enabled (waiting in twai_sem), a string "[tmo]", which indicates a state of waiting with timeout enabled, is appended to a string displayed in the Semaphore Queue field.
  • Page 212: Display The Mailbox Status

    7.14.7 Display the Mailbox Status In the MR window, select Popup Menu - [Mode] -> [Mailbox]. 7.14.7.1 Display the Mailbox Status (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the mail boxes defined in the configuration are listed in the order of ID number. The function of each item is listed below.
  • Page 213 7.14.7.2 Display the Mailbox Status (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the mail boxes defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Mbxatr Mailbox Queue (Wait)
  • Page 214: Display The Data Queue Status

    7.14.8 Display the Data Queue Status In the MR window, select Popup Menu - [Mode] -> [Data Queue]. 7.14.8.1 Display the Data Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the data queues defined in the configuration are listed in the order of ID number. The function of each item is listed below.
  • Page 215 • The Data Queue (Wait) field displays a string "Send" if a task waiting for a message sending, and then displays the ID number and name of the task waiting for a message sending. Also, if a task waiting for a message receiving, displays a string "Receive" and then displays the ID number and name of the task waiting for a message receiving.
  • Page 216: Display The Cycle Handler Status

    7.14.9 Display the Cycle Handler Status In the MR window, select Popup Menu - [Mode] -> [Cyclic Handler]. 7.14.9.1 Display the Cycle Handler Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the cycle handlers defined in the configuration are listed in the order of ID number. The function of each item is listed below.
  • Page 217 7.14.9.2 Display the Cycle Handler Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the cycle handlers defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Name...
  • Page 218: Display The Alarm Handler Status

    7.14.10 Display the Alarm Handler Status In the MR window, select Popup Menu - [Mode] -> [Alarm Handler]. When the realtime OS is MRxx conformed to uITRON specifications V.3.0, the following data is displayed in the status bar. 7.14.10.1 Display the Alarm Handler Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Of all the cycle start handlers defined in the configuration, only those which are not started yet at present are listed in the ascending order of start time.
  • Page 219: Display The Memory Pool Status

    7.14.11 Display the Memory Pool Status In the MR window, select Popup Menu - [Mode] -> [Memory Pool]. 7.14.11.1 Display the Memory Pool Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the memory pools defined in the configuration are listed in the order of ID number. (The fixed length data comes first, and the optional length data comes after the fixed length data.) The function of each item is listed below.
  • Page 220 7.14.11.2 Display the Memory Pool Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the memory pools are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Mplatr Mpladr...
  • Page 221: Display The Task Context

    7.14.12 Display the Task Context 7.14.12.1 Display the Task Context In the MR window, select Popup Menu - [Context...]. The Context dialog box is opened. The Context dialog box is used to reference/specify the context information of the specified task. You can also open the Context dialog box by double-clicking the data display area in the task state display mode .
  • Page 222 7.14.12.2 Change the task context Enter the task ID number in the Task ID field in the Context dialog and click the Set button. The Set Context dialog is opened. The Set Context dialog is used to set the specified context register value of the specified task. Specify the register to be changed in the Register field list box and enter the value to be set in the "Value:"...
  • Page 223: Mr Trace Window

    7.15 MR Trace Window The MR Trace window measures the task execution history of a program using the real time OS and displays the result graphically. The debugger for 740 doesn't support this function. In addition to the task execution history, a history of various other operations each are traced and displayed, including interrupt processing, task state transition, and system call issuance.
  • Page 224 When moving the mouse to the information displayed in the window, the pop up window as below is opened, showing the detailed information. Interrupt handling or task execution history System call issue history Task state transition history Following information is displayed in the status bar. •...
  • Page 225: Extended Menus

    7.15.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Start Marker End Marker Indicator Adjust Expand Reduce Trace Stop Trace Restart Search... Trace Range After Break Value... Color... Init Order...
  • Page 226: Refer The Execution History Of Task(Mrxx Window)

    7.15.2 Refer the Execution History of Task(MRxx Window) You can reference the task execution history in the MR Trace window. You can reference the execution history statistical processing result in the MR Analyze window. These windows are available for a target program using our real time OS (MRxx). 7.15.2.1 Select the Trace Range To measure the task execution history, the real time trace function is used.
  • Page 227 7 Windows/Dialogs 7.15.2.4 Refer the Execution History of Task You can reference the task execution transition in the MR Trace window. By moving the mouse to any information displayed in the window, the following window is opened, showing the detailed information. Interrupt handling or task execution history System call issue history Task state transition history...
  • Page 228 7.15.2.4.1. Search the History of System Call Issue Click the "Search" button in the tool bar. The Search dialog is opened. (Or, select Menu - [Search ...].) Specify the search condition. With the function code (R0: Function Code) and error code (R0: Error Code), you can specify multiple values (OR condition).
  • Page 229 7.15.2.4.2. Change the display magnification Click the "Expand" button or "Reduce" button in the tool bar. (Or, select Menu - [Expand] or [Reduce].) The display is expanded or reduced using the left corner of the graph area as the radix point. By default, the display is expanded or reduced with display scale of 1.5.
  • Page 230 7.15.2.4.4. Change the task display order Drag the task/interrupt routine to be moved (the left portion of the graph) to the destination. To initialize the display order, select Menu - [Init Order]. 7.15.2.4.5. Display the specific task only Click the task/interrupt routine to be hidden (the left portion of the graph). Every time you click, the setting is switched between "Display"...
  • Page 231 7.15.2.5 Measure the Execution Time of Task You can measure the execution time between the markers by changing the positions of start marker and end marker in the MR Trace window. Drag the start marker position and end marker position. The time interval between the markers is displayed in the status bar.
  • Page 232: Mr Analyze Window

    7.16 MR Analyze Window The MR Analyze window displays the result of the measurement data statistically analyzed within the range specified by the start marker and the end marker in the MR Trace window. The debugger for 740 doesn't support this function. The MR Analyze window supports three display mode as below: •...
  • Page 233: Configuration Of Ready State Duration Display Mode

    7 Windows/Dialogs 7.16.2 Configuration of Ready State Duration Display Mode The ready state time display mode by task is used to display the results generated from statistical process of the time required from execution ready to transition to execution by task. The statistical result is displayed within the range specified by the start marker and end marker in the MR Trace window.
  • Page 234: Extended Menus

    7.16.4 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Run Time Rdy->Run System Call Pick Up System Call... Toolbar display Customize toolbar... Allow Docking Hide 7.16.5 Analyze the Execution History of Task You can reference the execution history statistical processing in the MR Analyze window.
  • Page 235 7 Windows/Dialogs 7.16.5.2 Refer the Ready Queue Time Click the Ready->Run button in the tool bar. (Or, select Menu - [Rdy -> Run].) The time required from execution ready state to transition to execution state by task is processed statistically and displayed. The data displayed is the statistical results of the range specified with the start marker and end marker in the MR Trace window.
  • Page 236 7.16.5.3.1. Extract the Issuance History Click the "Pick Up" button in the tool bar. (Or, select Menu - [Pick Up System Call...].) The dialog shown below is opened. Specify the search condition of the system call to be extracted and displayed.
  • Page 237: Mr Task Pause Window

    7.17 MR Task Pause Window The MR Task Pause Window realizes the task pause function of the real time OS (MR308/MR30). The debugger for 740 doesn't support this function. You can pause and unpause the specified task from this window. The window can be used only when the program containing the system of the MR308/MR30 for the task pause functions and system clock timer is downloaded.
  • Page 238: Extended Menus

    ATTENTION Task pause function uses the address match interrupt of the MCU. Don't use this function when the target program uses the address match interrupt. If you use PC7501 emulator, this function is not available when you use address match inturrpt break function.
  • Page 239: Pause The Specified Task

    7.17.3 Pause the Specified Task Use the MR Task Pause window. To open the MR Task Pause window, select Menu - [View] -> [RTOS] -> [MR Task Pause]. Click the ID field or (name) field in the task pause display field of the task line to be paused. After the target task is selected, the task ID number is displayed in the status bar.
  • Page 240 7.17.3.1 Pause Task Being Executed at a Specified Position Click the ID field or (name) field of the task pause display field of the task line to be paused. After the target task is selected the task ID number appears in the status bar. In the task source display area, the program starting from the task start address is displayed (if the program is in a state other than Pause).
  • Page 241 7.17.3.2 Pause After a Paused Task is Executed up to Specified Position Click the ID field or (name)field of the task pause display area of the target task. After the target task is selected, the task ID number is displayed in the status bar. In the task source display area, the program starting from the task's Pause position (context PC position) is displayed (if the program is in a state other than Pause).
  • Page 242 7.17.3.3 Turn Pause of Certain Task Off Click the ID field or (name) field in the task pause display area of the ask line to be released from the PAUSE state. After the target task is selected, the task ID number is displayed in the status bar.
  • Page 243 7 Windows/Dialogs 7.17.3.4 Display Program Contents of Certain Task in Task Source Display Area Click the ID field of (name) field in the task pause display area of the ask line to be displayed. If the target task is paused, the task Pause position (context PC position) is displayed. If the target task is in a state other than Pause, the task start address is displayed.
  • Page 244: Task Trace Window

    7.18 Task Trace Window The Task Trace window measures the task execution history of a program using the real time OS and display it graphically. This window is available even when a target program using an OS other than our real time OS (MRxx) is downloaded.
  • Page 245: Extended Menus

    The grid lines are displayed using the start marker as the radix point. The scale is displayed, using the time at which the start marker is positioned as 0, with the left (forward in time) set to "minus" and the right (backward in time) set to "plus". The grid lines allow you to roughly understand the interrupt occurrence cycle and process time.
  • Page 246: Refer The Execution History Of Task(Taskxx Window)

    7.18.2 Refer the Execution History of Task(Taskxx Window) You can reference the task execution history in the Task Trace window. You can reference the execution history statistical processing result in the Task Analyze window. These windows are also available for a target program using an OS other than our real time OS (MRxx).
  • Page 247 ATTENTION When specifying WORD in the access size when performing PID setting in the RTOS Information dialog, you must observe the following limits. (If these conditions are not met, the system does not operate normally.) • The PID information storage area is allocated to an even address. •...
  • Page 248 7.18.2.2 Refer the Execution History of Task You can reference task trace transition in the Task Trace window. By moving the mouse to the information displayed in the window, a window of the following example is opened, showing the detailed information. 7.18.2.2.1.
  • Page 249 7.18.2.2.2. Change the grid line display interval Select [Value ...] from popup menu by right-clicking on the window. The Value dialog is opened. Specify the time interval in the display. 7.18.2.2.3. Change the task display order Select [Color ...] from popup menu by right-clicking on the window. The Color dialog is opened. Click the button corresponding to the desired item.
  • Page 250 7.18.2.3 Measure the Execution Time of Task By changing the start marker position and end marker position in the Task Trace window, you can measure the execution time between the markers. Drag the start marker position and end marker position. The time interval between the markers is displayed in the status bar.
  • Page 251: Task Analyze Window

    7.19 Task Analyze Window The Task Analyze window displays the result of the measurement data statistically analyzed within the range specified by the start marker and the end marker in the Task Trace window. The Task Analyze window displays the CPU occupation state. The Task Analyze window functions together with the Task Trace window.
  • Page 252: Analyze The Execution History Of Task

    7.19.2 Analyze the Execution History of Task You can reference the execution history statistical processing in the Task Analyze window. This window shows the CPU occupation time and ratio by task. The Task Analyze window functions together with the Task Trace window. If the Task Trace window is not open, or the Task Trace window does not show any data, the Task Analyze window will not function.
  • Page 253: Table Of Script Commands

    The following script commands are prepared. The commands with yellow color displaying can be executed at run time. The command to which " " adheres behind is not supported according to the product. 8.1 Table of Script Commands (classified by function) 8.1.1 Execution Commands Command Name Short Name...
  • Page 254: Register Operation Commands

    8.1.3 Register Operation Commands Comman Name S ort Name Register 8.1.4 Memory Operation Commands Command Short Name DumpByte DumpWord* DumpLword* SetMemoryByte SetMemoryWord* SetMemoryLword* FillByte FillWord* FillLword* Move MoveWord* MOVEW 8.1.5 Assemble/Disassemble Commands Command Name S ort Name Assemble DisAsse ble Modu le Scope Sect n...
  • Page 255: Hardware Break Setting Commands

    8.1.7 Hardware Break Setting Commands Command Name Sho t Name Hardw areBrea Protect BreakMode 8.1.8 Real-time Trace Commands Command Name Sh t Name TracePoint TraceData* TraceList* 8.1.9 Coverage Measurement Commands Command Short Name Coverage 8.1.10 Script/Log File Commands Comm nd Name Short Name Scrip t Exit...
  • Page 256: Map Commands

    8.1.12 Map Commands Comm nd Name Short Name Map* 8.1.13 Clock Command Comm nd Name Shor Name Clock 8.1.14 WatchDog Timer Commands Command Name Short WatchDogTimer* 8.1.15 C Language Debugging Commands Command Name Short Name Print 8.1.16 Real-time OS Command Command Name Short Name 8.1.17 Utility Commands...
  • Page 257: Table Of Script Commands (Alphabetical Order)

    8.2 Table of Script Commands (alphabetical order) Command Name Short Name AddPath Alias Asse ble Bit* BreakAt BreakIn BreakMode Clock Coverage Date DisAss mble Down* DumpByte DumpLword * DumpWord* Echo Exe c Exit Express File FillByte FillLword* FillWord* Func GoBreakAt* GoFree GoProgramBrea * HardwareBreak...
  • Page 258 Path Pause Print Protec t Radix Register Reloa d Reset Return ReturnInstruction RETI Scope Script Sec ion SetMemoryByte SetMemoryLword * SetMemoryWord* Sleep SoftwareBreak SoftwareBreakClear SoftwareBreakClearAl l SBC A SoftwareBreakDisable SoftwareBreakDisable ll SBD A SoftwareBreakEnable SoftwareBreakEnableAll SBEA Stat s Step StepInstruction Stop Symbol Time...
  • Page 259: Writing Script Files

    This debugger allows you to run script files in a Script Window. The script file contains the controls necessary for automatically executing the script commands. 9.1 Structural Elements of a Script File You can include the following in script files: •...
  • Page 260: Script Command

    9.1.1 Script Command You can use the same script commands that you enter in the Script Window. You can also call script files from within other script files (nesting up to 10 levels). 9.1.2 Assign Statement Assign statement s define and initialize macro variables and assign values. The following shows the format to be used.
  • Page 261: Loop Statement(While,Endw) And Break Statement

    9.1.4 Loop Statement(while,endw) and Break Statement In loop statements, execution of a group of statements is repeated while the expression is true. The following shows the format to be used. while ( expression ) statement endw • If the expression is t rue, the group of statements is repeated. If false, the loop is exited (and the statement following the endw statement is executed).
  • Page 262: Writing Expressions

    9.2 Writing Expressions This debugger allows you to use expressions for specifying addresses, data, and number of passes, etc. The following shows example commands using expressions. >DumpByte TABLE1 >DumpByte TABLE1+20 You can use the following elements in expressions: • Constants •...
  • Page 263: Symbols And Labels

    9.2.2 Symbols and labels You can include symbols and labels defined in your target program, or symbols and labels defined using the Assemble command. • You can include alphanumerics, the underscore (_), period (.), and question mark (?) in symbols and labels.
  • Page 264: Macro Variables

    9.2.2.2 Priority levels of labels and symbols The conversion of values to labels or symbols, and vice versa, is subject to the following levels of priority: • Conversion of address values Local labels Global labels Local symbols Global symbols Local labels outside scope Local symbols outside scope •...
  • Page 265: Register Variables

    9.2.4 Register variables Register variables are used for using the values of registers in an expression. Precede the name of the register with '%' to use it as a register variable. Use the following format. (The debugger for 740 can use '_' instead of '%'.
  • Page 266: Character Constants

    9.2.7 Character constants The specified character or character string is converted into ASCII code and processed as a constant. • Enclose characters in single quote marks. • Enclose character strings in double quote marks. • The character string must consist of one or two characters (16 bits max.). If more than two characters are specified, the last two characters of the string are processed.
  • Page 267: C/C++ Expressions

    10. C/C++ Expressions 10.1 Writing C/C++ Expressions You can use C/C++ expressions consisting of the tokens shown below for registering C watchpoints and for specifying the values to be assigned to C watchpoints. Token Immediate values Scope Mathematical operators Pointers Reference Sign inversion Member reference using dot operator...
  • Page 268: Scope Resolution

    10.1.2 Scope Resolution The scope resolution operator :: is available as following. Global scope: ::valiable name ::x, ::val Class scope: class name::member name, class name::class name::member name, e.g. T::member, A::B::member 10.1.3 Mathematical Operators You can use the addition (+), subtraction (-), multiplication (*), and division (/) mathematical operators.
  • Page 269: Sign Inversion

    10.1.6 Sign Inversion Sign inversion is indicated by the minus sign (-). You can only specify "-immediate_value" or "-variable_name". No sign inversion is performed if you specify 2 (or any even number of) minus signs. Notes • There is no support currently for sign inversion of floating point numbers. 10.1.7 Member Reference Using Dot Operator You can only use "variable_name.member_name"...
  • Page 270: Pointers To Members

    10.1.9 Pointers to Members Pointers to members using the ".*" or "->*" operator can be refered only in the forms of variable name .* member name or variable name ->* member name. Example: class T { public: int member; class T t_cls; class T *pt_cls = &t_cls;...
  • Page 271: Casting To Typedef Types

    10.1.13 Casting to typedef Types You can use casting to typedef types (types other than the C basic types) and the pointer types to them. When casting to a pointer type, you can also use pointers to pointers and pointers to pointers to pointers, etc.
  • Page 272: Display Format Of C/C++ Expressions

    10.2 Display Format of C/C++ Expressions C/C++ expressions in the data display areas of the C Watch Windows are displayed as their type name, C/C++ expression (variable name), and result of calculation (value), as shown below. The following describes the display formats of the respective types. 10.2.1 Enumeration Types •...
  • Page 273: Pointer Types

    10.2.3 Pointer Types • When the result of calculation is a pointer type to other than a char* type, it is displayed in hexadecimal as follows: (unsigned int *) p = 0x1234(all Radices) • When the result of calculation is a char* type, you can select the display format of the string or a character in the C Watch window's menu [Display String].
  • Page 274: Array Types

    10.2.4 Array Types • When the result of calculation is an array type other than a char [ ] type, the starting address is displayed in hex as follows: (signed int [10]) z = 0x1234(all Radices)_ • When the result of calculation is a char [ ] type, it is displayed as follows: (unsigned char [10]) str = 0x1234 "Japan"(all Radices) If the string contains a non-printing code prior to the code to show the end of the string (0), it is displayed up to the non-printing character and the closing quote mark is not displayed.
  • Page 275: When No C Symbol Is Found

    10.2.8 When No C Symbol is Found If the calculated expression contained a C symbol that could not be found, it is displayed as follows: () x = <not active>(all Radices) 10.2.9 Syntax Errors • When the calculated expression contains a syntax error, it is displayed as follows: () str*(p = <syntax error>(all Radices) (where str*(p is the syntax error) 10.2.10 Structure and Union Types...
  • Page 276: Display The Cause Of The Program Stoppage

    11. Display the Cause of the Program Stoppage If the program is stoped by the debug function, the cause of the stoppage is displayed in the Output window or Status window ([Platform] sheet). The contents of a display and the meaning of "the cause of the stoppage" are as follows. Disp y Halt S/W break...
  • Page 277: Attention

    12.1 Common Attention 12.1.1 File operation on Windows File Name and Directory Name - Operation is not guaranteed if your directory names and filenames include kanji. - Use only one period in a filename. Specify the File and Directory - You cannot use "..." to specify two levels upper directories. - You cannot use a network pathname.
  • Page 278: Get Or Set C Variables

    12.1.2.3 The debugger for 740 Only the ROM area memory-mapped in the area set as Internal can be designated for software breakpoint. You cannot set software breakpoint in ROM areas memory-mapped in the SFR area, RAM area or other areas set as External. 12.1.3 Get or set C variables •...
  • Page 279: Function Name In C

    12.1.4 Function name in C++ • When you input the address using the function name in setting display address, setting break points, and so on, you can not specify the member function, operator function, and overloaded function, of a class. •...
  • Page 280: Restriction Of Lpt Port

    12.1.9 Restriction of LPT port The emulator uses a printer (parallel) port during LPT communications with personal computer. The IAR C compiler also uses this printer (parallel) port. When using the personal computer and the emulator during LPT communications, a problem arises that you cannot compile a program using the IAR C compiler.
  • Page 281: Notes For Coverage Function

    12.1.10 Notes for coverage function Coverage Measurement is a function to record the addresses accessed by the target program. These accessed addresses will flow to the microcomputer address bus. This may cause unexecuted addresses to be treated as executed addresses when calculating coverage. 12.1.11 Emulator reset switch If system reset of the emulator does not function normally, terminate the debugger, turn ON the emulator again, and restart the debugger.
  • Page 282: Attention Of The M32C Debugger

    12.2 Attention of the M32C Debugger 12.2.1 Stack area used by the emulator The emulator uses the interrupt stack area as a work area (20 bytes). Before starting debugging, be sure to reserve the user stack area + 20-byte area. 12.2.2 Interrupt stack pointer when resetting the target program The emulator sets the interrupt stack pointer (ISP) to 0500h when resetting the target program.
  • Page 283: Hardware Event

    12.2.5 Hardware Event • The debugger does not support a command fetch (Fetch) or an interrupt as a hardware event. • If you specify word-length (2-byte length) data from an odd address as an event in the following data accesses, the event is not detected. Also, even when any other bit of the address that contains a specified bit is accessed during bit access, the event may become effective.
  • Page 284: Attention Of The M16C/R8C Debugger

    12.3 Attention of the M16C/R8C Debugger 12.3.1 Map of stack area used by the emulator The M16C/60,M16C/20 series emulators use a stack area of 4 bytes from 0FFFCh to 0FFFFh that is accessed at power-on reset. The emulator cannot start up normally unless these 4 bytes of memory can be accessed for read/write. Therefore, if one of the following two conditions hold true, use the four bytes of 0FFFCh to 0FFFFh in INTERNAL setting until the emulator finishes setting the interrupt stack pointer (ISP) after a reset.
  • Page 285: Hardware Event

    12.3.5 Hardware Event • If you specify word-length (2-byte length) data from an odd address as an event in the following data accesses, the event is not detected. Also, even when any other bit of the address that contains a specified bit is accessed during bit access, the event may become effective. - Hardware Break Event - Real-time Trace Event - Time Measurement Event...
  • Page 286: Memory Space Expansion

    12.3.8 Memory Space Expansion • C watch window, Memory window, and other debugging windows can not show correct values, when it shows the expanded area of the memory space expansion fuction. Debugging windows does not consider the bank register. • In MODE2 of memory space expansion, the area bank7 is always set the map as EXTERNAL.
  • Page 287: Attention Of The 740 Debugger

    12.4 Attention of the 740 Debugger 12.4.1 Setting of Memory Map The map attributes immediately after the emulator has started up are External for 0h-3FFFh and Internal for 4000h-FFFFh. The memory map information must be altered to suit the target microcomputer's memory space.
  • Page 288: About The Single-Step Execution And The Program Break Function In The Internal Ram Area Of The Mcu

    12.4.7 About the single-step execution and the program break function in the internal RAM area of the mcu When debugging with the emulation pod M38000L2-FPD, single-step execution and program break function in the internal RAM area are not available. When debugging the program transferred to the internal RAM area, please use the free-run execution and the trace function.
  • Page 289: Option Of C Compiler/Assembler/Linker

    12.5 Option of C Compiler/Assembler/Linker We do not evaluate other settings, so we can not recommend to append other options. 12.5.1 When Using NCxx When -O, -OR or -OS option is specified at compilation, the source line information may not be generated normally due to optimization, causing step execution to be operated abnormally.
  • Page 290: When Using The Iar C Compiler (Ew)

    12.5.3 When Using the IAR C Compiler (EW) Please specify the project setting by following process. The Setting in the IAR Embedded Workbench When you select the menu [Project] -> [Options...], the dialog for "Options For Target " target"" will open. In this dialog, please select the "XLINK" as category, and set the project setting. - Output Tab In the "Format"...
  • Page 291: When Using The Iar C Compiler (Icc)

    12.5.4 When Using the IAR C Compiler (ICC) 12.5.4.1 Specify the Option Please compile according to the following procedures and link. • At compilation Specify the "-r" option. • Before linking Open the linker's option definition file (extension .xcl) to be read when linking and add "-FIEEE695"...
  • Page 292: When Using The Tasking C Compiler (Ede)

    12.5.5 When Using the TASKING C Compiler (EDE) Please specify the project setting by following process. Select menu - [EDE]->[C Compiler Option]->[Project Options...]. The "M16C C Compiler Options [Project Name]" dialog opens. Please set as follows by this dialog. - Optimeze Tab Please specify "No optimization"...
  • Page 293: When Using The Iar Ec++ Compiler (Ew)

    12.5.7 When Using the IAR EC++ Compiler (EW) Please specify the project setting by following process. The Setting in the IAR Embedded Workbench When you select the menu [Project] -> [Options...], the dialog for "Options For Target " target"" will open. In this dialog, please select the "XLINK" as category, and set the project setting. - Output Tab In the "Format"...
  • Page 294 [MEMO]...
  • Page 295 User's Manual Publication Date: Jul. 01, 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...
  • Page 296 M16C PC4701 Emulator Debugger V.1.03 User’s Manual 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan REJ10J1608-0100...

Table of Contents