REJ10J1607-0100 M16C R8C PC7501 Emulator Debugger V.1.03 User's Manual Renesas Microcomputer Development Environment System Rev.1.00 Jul.
Notes regarding these materials 1. This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use. Renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of Renesas or any third party with respect to the information in this document. 2.
Overview The High-performance Embedded Workshop is a Graphical User Interface intended to ease the development and debugging of applications written in 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. This help explains the function as a "debugger" of High-performance Embedded Workshop.
Active X, Microsoft, MS-DOS, Visual Basic, Visual C++, Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. IBM and AT are registered trademarks of International Business Machines Corporation. Intel and Pentium are registered trademarks of Intel Corporation. Adobe and Acrobat are registered trademarks of Adobe Systems Incorporated.
Setup of Debugger 1 1. Features 3 1.1 Real-Time RAM Monitor Function...............................................................................................3 1.1.1 RAM Monitor Function .....................................................................................................3 1.1.2 Sampling Period ................................................................................................................4 1.1.3 Related Windows .......................................................
5.2.2 Setting of the LAN Interface...........................................................................................43 5.2.3 Setting of the LPT Interface ...........................................................................................45 5.3 Setup the Debugger for M32C ....................................................................................................46 5.3.1 Emem Dialog.......................................................................................................
.7.8 Specify the Events (Interrupt) ......................................................................................132 7.7.9 Specify the Events (External Trigger Signal) ..............................................................134 7.7.10 Specify the Event Combination Condition .................................................................136 7.7.11 Specify the Process ID .................................................................................................139 7.8 Protect Window ..
7.15.11 Display the Memory Pool Status ..............................................................................200 7.15.12 Display the Task Context..........................................................................................202 7.16 MR Trace Window...................................................................................................................204 7.16.1 Extended Menus ........................................................................................................
.2.7 Character constants ......................................................................................................247 9.2.8 Operators .......................................................................................................................247 10. C/C++ Expressions 248 10.1 Writing C/C++ Expressions ....................................................................................................248 10.1.1 Immediate Values.....................................................
12.2.5 Hardware Event ..........................................................................................................264 12.2.6 CPU rewrite .................................................................................................................264 12.2.7 MR STK script command ............................................................................................265 12.3 Attention of the M16C/R8C Debugger ...............................................................................
Setup of Debugger 1
(Blank Page) 2
1 Features 1. 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 PC7501 emulator system has 4 Kbytes of RAM monitor area which can be located in any contiguous address location or in 16 separate blocks comprised of 256 bytes each. 1.1.
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. (Sampling cycle depends on the following environments.
1 Features 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. You can also disable/enable a software breakpoint temporarily. You can specify up to 64 software breakpoints.
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.
1 Features 1.2.3 About Protect Breaks Function 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. 1.2.3.1 Protect Attribute You can specify the following attributes in 256-bytes units(256-bytes boundary). • Access Disable • Read Only • Write Only • R/W Enable 1.2.3.2 Access Protect Area The entire memory space (16 Mbytes) is made a protected area.
1.2.4 About Address Interrupt Breaks Function This function stops the target program immediately before executing an instruction at a specified address. This function is realized by using the MCU's address match interrupt. The address interrupt break function can only be used when the address match interrupt is not used in the user application. The count of breakpoints depends on the connected MCU.
1 Features 1.3 Real-Time Trace Function This function records a target program execution history. Up to 256K 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. The execution history can be referred to in the following mode.
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 eight events of all.
1 Features 1.4 Time Measurement Function This function records the addresses executed (accessed) by the target program (C0 coverage). This function helps to keep track of unexecuted addresses after the program has stopped running. Use of this coverage measurement function in the test process makes it possible to keep track of the test items that have been omitted.
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 Features 1.6 Real-Time OS Debugging Function This function debugs the realtime OS-dependent parts of the target program that uses the realtime OS. This function helps to show the status of the realtime OS and inspect a task execution history, etc. 1.7 GUI Input/Output Function This function simulates the user target system's key input panel (buttons) and output panel on a window. Buttons can be used for the input panel, and labels (strings) and LEDs can be used for the output panel.
2. About the Emulator PC7501 The PC7501 emulator has full bus trace and is available for in-circuit emulation in system designed around the M16C Platform of processors. This compact unit is capable of emulation up to 66MHz (i.e., available at over 20MHz). When combined with an emulation probe suitable for the target MCU, it helps to configure an emulator system matched to each MCU used. 2.1 Communication method The supported communication methods are as follows.
3 Before starting the debugger 3. Before starting the debugger 3.1 Communication method by emulator The supported communication methods are as follows. USB, LAN, LPT 3.1.1 USB Interface • • • • Compliant with USB Standard 1.1. Connections via USB hub are not supported. By connecting the host computer and the emulator with USB cable, it is possible to install the supported device drivers using a wizard. The necessary cable is included with the emulator. 3.1.2 LAN Interface • • • • The IP address, etc.
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. • You have setup the debugger for the first time. • You have upgraded emulator debugger. Press the system reset switch within two seconds after powering up the PC4701 to establish the maintenance mode.
3 Before starting the debugger 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.
3.3.2 LAN communication 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" included with this debugger may be used to set the IP address, etc. in the emulator while in default settings.
3 Before starting the debugger 5. 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. (Enter that number when starting the debugger.
4. 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. A workspace can be thought of as a container of projects and, similarly, a project can be thought of as a container of project files.
4 Preparation before Use 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. • [Open a recent project workspace] radio button: Uses an existing workspace and displays the history of the opened workspace.
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. The following dialog box is displayed. 1. 2. 3. 4. Select the target CPU family In the [CPU family] combo box, select the target CPU family.
4 Preparation before Use 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. The contents of a setting change with C/C++ compiler packages of use.
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. 1. 2. 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. Check the box against the target platform.
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. If it is not necessary to change, please click the [next] button as it is.
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. This is the end of the emulator settings. Exit the Project Generator following the instructions on the screen.
4 Preparation before Use 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. (It can work even if the tool chain is not installed.) 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. Creation of a new workspace is started.
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. 1. 2. 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. Check the box against the target platform. (And choose other target as required.
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. If it is not necessary to change, please click the [next] button as it is. This is the end of the emulator settings. Exit the Project Generator following the instructions on the screen.
4.2.2.4 Step4 : Registering the Load modules to be downloaded Finally, register the load module file to be used. Select [Debug Settings...] from the [Debug] menu to open the [Debug Settings] dialog box. 1. 2. Select the product name to be connected in the [Target] drop-down list box. Select the format of the load module to be downloaded in the [Default Debug Format] drop-down list box.
4 Preparation before Use 3. 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. - Enter the full path and filename of the download module in the [Filename] edit box.
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. The session file has information about the target selected when a project was created. In the circled list box in the following tool bars, select the session name including the character string of the target to connect.
5 Setup the Debugger 5. 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. The tabs available on this dialog box vary with each product used. For details, click the desired tab name shown in the table below.
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. • The specified MCU file is displayed in the MCU area of the MCU tab. 5.1.1.2 Setting of the Communication Interface The displayed data varies depending on the specified communication interface.
5 Setup the Debugger Select the check box to close the Init dialog box. After connecting to the emulator and confirming the firmware, the debugger will immediately start self-check on the emulator. (Self-check takes about 30 seconds to 1 minute.) If an error is found in this self-check, the debugger displays the content of the error and is finished. When the self-check terminated normally, the dialog box shown below is displayed. When you click OK, the debugger starts up directly in that state.
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. 5.1.1.6 Choosing to use or not to use CPU rewrite mode Specify whether or not you want to use CPU rewrite mode. (By default, CPU rewrite mode is unused.
5 Setup the Debugger 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...]. 5.1.2.2 Specify the Storing of Debugging Information There are two methods for storing debugging information: on-memory and on-demand.
Notes • • If the load module size is large, the on-memory method may be inefficient because it requires a very large amount of time for downloading. In such a case, select the on-demand method. In the on-demand method, a folder in which to store a reusable temporary file is created in the folder that contains the downloaded load module. This folder is named after the load module name by the word "~INDEX_" to it. If the load module name is "sample.abs", for example, the folder name is "~INDEX_sample".
5 Setup the Debugger 5.1.3 Emulator Tab 5.1.3.1 Specify the Target Clock Change the setting by synchronizing with the clock used by the target microcomputer. (Internal is set by default.) Select Internal to set the internal clock, and External to set the external clock. The specified content becomes effective when the next being start.
Note * The accuracy of the clock frequency is plus or minus 5%. We recommend that final evaluation be made after installing the resonator or oscillator module whose frequency is matched to the actually used Internal clock. 5.1.3.2 Selecting event output/trigger input cable Select the input/output direction of cable for the PC7501's event output/trigger input. • • To enter external triggers from the cable, select "Input from External Trigger." To output events to the cable, select "Output Events.
5 Setup the Debugger 5.1.4 Script Tab The specified content becomes effective when the next being start. 5.1.4.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" button, the File Selection dialog is opened. The specified script file is displayed in the "Init File:" field.
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. Before USB communication can be performed, the computer must have a dedicated device driver installed in it. For details on how to install USB device drivers, see "3.3.1.1 Install of USB device driver." For connection by USB communication, click the "USB" radio button on the MCU tab.
5 Setup the Debugger 5.2.2 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. 5.2.2.1 Setting the IP Address and Subnet Mask Start the debugger using other communication method. After it gets started, select Menu [Setup]->[Emulator]->[ System...] to open the Init dialog.
5.2.2.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. Delimit each 4 bytes with a period. The port No. is the ID No. for the communication process of the server (emulator) on the LAN (TCP/IP).
5 Setup the Debugger 5.2.3 Setting of the LPT Interface LPT communication uses a parallel interface (printer interface) of the personal computer. 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. Specify the mode for data transfers in the Type field. • The LPT interface has four modes for data transfers, Nibble, Byte, ECP, and EPP. Their modes are documented in the IEEE-1284 standard.
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. Tab Name Status Emulation Memory Flash Clear Contents Specify the processor mode. Specify the emulation memory area. Specify whether or not to clear the contents of the MCU's internal flash ROM.
5 Setup the Debugger 5.3.1.1 Status Tab The specified content becomes effective when the next being start. 5.3.1.1.1. Select the Processor Mode Specify the processor mode for the target system. Either the following can be specified.
5.3.1.2 Emulation Memory Tab The specified content becomes effective when the next being start. 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.
5 Setup the Debugger 5.3.1.2.3. Emulation memory allocation for an extended area When memory extension or microprocessor mode is selected, emulation memory can be allocated to the extended area to be debugged (in up to four areas). Here, allocate memory for the debug target area and specify its mapping information. Follow the procedure described below.
The setting of the emulation memory area varies depending on the specified processor mode. • Single-chip Mode You do not need to specify the area to be assigned as the emulation memory. The internal ROM area is automatically mapped into the emulation memory. The address range of the automatically mapped area is displayed in the Internal ROM Area: field.
5 Setup the Debugger 5.4 Setup the Debugger for M16C/R8C 5.4.1 MCU Setting Dialog In the MCU Setting dialog box, setting information on the user target. The MCU Setting 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. Tab Name MCU MAP Flash Clear Contents Specify the MCU's processor mode, debug options, etc. Set memory areas into which emulation memory is mapped.
5.4.1.1 MCU Tab The specified content becomes effective when the next being start. 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 Mode Memory Expansion Mode • Microprocessor Mode Microprocessor Mode Also, you need to specify the following information according to the processor mode you've selected .
5 Setup the Debugger 5.4.1.1.1. 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. "NC" means that the value is indeterminate. 5.4.1.1.2. Setting the Debug Option Click this check box if you do not want the program to be downloaded into the MCU's internal flash ROM.
5.4.1.2.1. Emulation memory allocation Set the memory area in 4 KB units into which you want the emulation memory to be mapped. Four of such memory areas can be set. The emulation memory is mapped into the areas marked "Internal." The unselected areas and the areas which have nothing specified are allocated to external areas. Note that MAP settings are effective for only the areas CS3*, CS2*, CS1*, and CS0*. The SFR, internal ROM, and internal RAM areas are automatically mapped. 5.4.1.
Tutorial 55
(Blank Page) 56
6 Tutorial 6. 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...].
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. To setup the debugger in this dialog box, refer to "5 Setup the Debugger ".
6 Tutorial 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. It is recommended that a program for checking the memory be created. 6.2.2.
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. • The Debugger for M16C/R8C or M32C Select [Download module] from [Tutorial.x30] under [Download modules].
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.
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. The red symbol will appear on the line containing the sort function call.
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 toolbar.
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. Please refer to "11 Display the Cause of the Program Stoppage " about the notation of a break factor.
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.
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. Double-click the register line to be changed. The dialog is opened. Enter the value to be changed.
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. And click the [ASM Watch] window with the right-hand mouse button and select [Add...
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. 6.2.9.1 Watching Variables For example, set a watch on the long-type array a declared at the beginning of the program, by using the following procedure: Click the left of displayed array a in the [Editor(Source)] window to position the cursor, and select [Add C Watch...] with the right-hand mouse button.
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. The [C Watch] window will now also show the int-type variable i.
6.2.10 Step10 : Stepping Through a Program This debugger provides a range of step menu commands that allow efficient program debugging. 1. Step In Executes each statement, including statements within functions(subroutines). 2. Step Out Steps out of a function(subroutine), and stops at the statement following the statement in the program that called the function(subroutine). 3. Step Over Executes a function(subroutine) call in a single step. 4. Step...
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. The PC cursor slips out of a sort function, and moves to the position before a change function. Note It takes time to execute this function.
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 on the toolbar. [Debug] menu, or click the [Step Over] button The PC cursor moves to the next position of a change function.
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. The program goes into an endless loop. To force a break in execution, select [Halt Program] from the [Debug] menu or the [Halt] button on the toolbar.
6.2.12 Step12 : Displaying Local Variables The user can display local variables in a function using the [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. Select [C Watch] from the [Symbol] submenu of the [View] menu. The [C Watch] window is displayed.
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. 6.2.13.1 Reference the function call status Double-click the [S/W Breakpoints] column in the sort function and set a software breakpoint. To executes the user program from the reset vector address, select [Reset Go] from the [Debug] menu, on the toolbar.
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.
Reference 77
(Blank Page) 78
7Windows/Dialogs 7. Windows/Dialogs The window of this debugger is shown below. When the window name is clicked, the reference is displayed.
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. The displayed contents are updated at given intervals (by default, every 100 ms) while running the target program.
7Windows/Dialogs 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. If the data in the RAM monitor area are displayed in lengths other than the byte, it is possible that the data will have different memory access attributes in byte units.
7.1.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function RAM Monitor Area... Sampling Period... Clear Up Set RAM monitor base address. Set RAM monitor sampling period. Clear access attribute. Moves display position to the immediately preceding RAM monitor area (smaller address) Moves display position to the immediately following RAM monitor area (larger address) Display from specified address. Specify scroll range.
7Windows/Dialogs 7.1.2 Setting the RAM monitor area Choose the popup menu [RAM Monitor Area...] in the RAM monitor window. The RAM monitor area setup window shown below will appear. The currently set RAM monitor areas are listed in this window. Use this window to add, delete or change RAM monitor areas. • Specify a RAM monitor area by its start address and size (the latter by a number of blocks.) • The start address can be specified in 0x100 byte units.
7.1.2.1 Changing the RAM Monitor Area The start address and the size of the RAM monitor area can be changed. • Changing from a dialog box Select the RAM monitor area you want to change from a list of RAM monitor areas and double-click on it. The Set RRAM Area dialog box shown below will appear. Specify the start address and the size (by a number of blocks) of the RAM monitor area in the Start and the Size fields of this dialog box.
7Windows/Dialogs 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. • • • • • • The addresses to be registered are called the "watchpoints.
7.2.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Add... Add Bit... Remove Remove All Set... Radix Add watchpoint. Add bit-lebel watchpoint. Remove the selected watchpoint. Remove all watchpoints. Set new data to selected watchpoint. Display in Binary. Display in Decimal. Display in Hexadecimal. Refresh memory data. Switch display or non-display of Address area. Switch display or non-display of Size area.
7Windows/Dialogs 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.
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. It is displayed as "----". If that C/C++ language expression can be calculated correctly at the second time, it becomes an effective C watch point.
7Windows/Dialogs 7.3.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Add... Remove Remove All Initialize Set New Value... Radix Add C watchpoint. Remove the selected C watchpoint. Remove all C watchpoints. Reevaluates the selected C watchpoint. Set new data to selected C watchpoint. Display in Hexadecimal. Display in Binary. Display in Default Radix. Change radix (toggle). Set initial radix. Refresh memory data.
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; and the Editor window in which you can check execution/non-execution by source line.
7Windows/Dialogs 7.4.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Select source file... Auto Refresh Refresh Clear Base... File Select a source file for checking the coverage. Refresh coverage measurement result automatically. Refresh coverage measurement result. Clear coverage measurement result . Change coverage base address. Save coverage measurement result to file. Load coverage measurement result from file.
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] -> [Define Column Format]. The column for a coverage measurement display is displayed on all Editor (Source) windows.
7Windows/Dialogs 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. • • • • The Script Window has a view buffer that stores the results of executing the last 1000 lines.
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 View Log Record Copy Paste Cut Delete Undo Toolbar display Customize toolbar... Allow Docking Hide Function Open... Run Step Close Save... Clear On... Off On... Off Open script file. Run script file. One step execution of script file. Close script file. Save view buffer to file. Clear view buffer. Open log file and start recording (start output to file).
7Windows/Dialogs 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). You can continue to set software breakpoints until you click the "Close" button to close the S/W Break Point Setting Window.
7.6.1 Command Button The buttons on this window has the following meanings. Button Function Load... Save... Help Add Refer... Close Delete Delete All Enable All Enable Disable All Disable View Load setting information from a file in which it was saved. Save the contents set in the window to a file. Display the help of this window. Add the break point. Open file selection dialog box. Close the window. Remove the selected break point. Remove all break points. Enable the selected break points.
7Windows/Dialogs 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.2 Area 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" column) for the line in which you want to set the break.
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. Fetch, Memory Access, Bit Access, Interrupt, External Trigger • • • Events at up to eight points can be used.
7Windows/Dialogs 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.
• When FETCH is selected Breaks for the instruction fetch. • When DATA ACCESS is selected Breaks for the memory access.
7Windows/Dialogs • When BIT SYMBOL is selected Breaks for the bit access. • When INTERRUPT is selected Breaks for the interrupt occurrence or termination.
• When TRIGGER is selected Breaks for the status of signal input from external trace cable.
7Windows/Dialogs 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.
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. Button Reset Save... Load... Set Close Function Discards the contents being displayed in the window and loads contents from the emulator in which they were set. Saves the contents set in the window to a file.
7Windows/Dialogs 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.
7.7.5.2 Instruction Fetch of Specified Address Area(In) Set as below.
7Windows/Dialogs 7.7.5.3 Instruction Fetch of Specified Address Area(Out) Set as below.
7.7.5.4 Entering/exiting to specified function Set as below.
7Windows/Dialogs 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.
7.7.6.1.1. Writing/Reading a Specified Address Set as below.
7Windows/Dialogs Example) Writing byte length data 32h to even address 400h 111
Example) Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width.
7Windows/Dialogs (16 bits bus width) 113
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.
7Windows/Dialogs 2nd point 115
(16 bits bus width) 116
7Windows/Dialogs Example) Writing data 10h - 3Fh to even address 400h 117
7.7.6.1.2. Reading/writing data to the specified address range Set as below.
7Windows/Dialogs 7.7.6.1.3. Reading/writing data to addresses outside the specified range Set as below.
7.7.6.2 Memory Access(The debugger for M16C/R8C) ATTENTION It is not detected that data access to the odd addresses in word-size access. 7.7.6.2.1. Writing/Reading a Specified Address Set as below.
7Windows/Dialogs Example) Writing byte length data 32h to even address 400h 121
Example) Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width.
7Windows/Dialogs (16 bits bus width) 123
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.
7Windows/Dialogs 2nd point 125
(16 bits bus width) 126
7Windows/Dialogs Example) Writing data 10h - 3Fh to even address 400h 127
7.7.6.2.2. Reading/writing data to the specified address range Set as below.
7Windows/Dialogs 7.7.6.2.3. Reading/writing data to addresses outside the specified range Set as below.
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. 7.7.7.1 Writing/Reading a Specified Bit Set as below.
7Windows/Dialogs 7.7.7.1.1. Writing/Reading a Specified Bit Symbol Set as below.
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.
7Windows/Dialogs 7.7.8.2 Interrupt Termination Set as below.
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. Rising/falling edges are detected from the signal on the external trace signal input cable included with the emulator (A combination of eight signals is possible.).
7Windows/Dialogs Example) Fall of EXT1(brown) signal 7.7.9.2 Combination of rise/fall edges Set as below.
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.
7Windows/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". The Detail... button included in the Combination group becomes useful, so click that button. This opens the State Setting window.
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.
7Windows/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. Check the Enable check box included in the PID group of the event setting window. When this check box is checked, the Detail... button to the right of it is enabled. Click the Detail...
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.
7Windows/Dialogs 7.9 Address Interrupt Break Point Setting Window The Address Interrupt Break Point Setting window allows you to set address interrupt break points. This function stops the target program immediately before executing an instruction at a specified address. This function is realized by using the MCU's address match interrupt. So that the address interrupt break function can only be used when the address match interrupt is not used in the user application.
7.9.1 Command Button The buttons on this window has the following meanings. Button Function Load... Save... Help Add Refer... Close Delete Delete All Enable All Enable Disable All Disable View Load setting information from a file in which it was saved. Save the contents set in the window to a file. Display the help of this window. Add the break point. Open file selection dialog box. Close the window. Remove the selected break point. Remove all break points. Enable the selected break points.
7Windows/Dialogs 7.9.2 Setting and Deleting a Break Points from Editor(Source) Window The address interrupt break function can only be used when the address match interrupt is not used in the user application. For details, refer to "1.2.4 About Address Interrupt Breaks Function" You can set break points in the Editor(Source) Window. To do so, double-click the break point setting area ("Address Match Interrupt Break" column) for the line in which you want to set the break.
7.10 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. Fetch, Memory Access, Bit Access, Interrupt, Trigger • • Events at up to eight points can be used.
7Windows/Dialogs 7.10.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. • When FETCH is selected Traces for the instruction fetch.
• When DATA ACCESS is selected Traces for the memory access. • When BIT SYMBOL is selected Traces for the bit access.
7Windows/Dialogs • When INTERRUPT is selected Traces for the interrupt occurrence or termination. • When TRIGGER is selected Traces for the status of signal input from external trace cable.
7.10.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. • When AND (Same Time) is selected In the event specification area, the event used can be specified.
7Windows/Dialogs • 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. A time-out time in each state can also be specified. 7.10.
7.10.5 Specify the Trace Write Condition Conditions for cycles to be written to trace memory can be specified. Total Pick up Exclude Writes all cycles. Writes only the cycles where specified condition holds true. Writes only the cycles where specified condition does not hold true. Also, following three write modes are supported.
7Windows/Dialogs 7.10.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.10.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. For detail about the setting, refer to "7.7.6 Specify the Events (Memory Access) " 7.10.
7.10.14 Specify the write condition Trace data write conditions can be specified. You can specify the following write conditions: 1. Write conditions unlimited (default) 2. Cycles from the start event established to the end event established 3. Only cycles where the start event is established 4. Cycles from the start event established to the start event unestablished 5. Other than cycles from the start event established to the end event established 6.
7Windows/Dialogs • 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.
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.
7Windows/Dialogs • For condition 7, choose the Mode shown below and set the Start event.
7.11 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. • If the contents of events are altered, they are marked by an asterisk (*) on the title bar.
7Windows/Dialogs 7.11.1 Specify the Time Measurement Event The events listed below can be specified as measurement events. Fetch, Memory Access, Bit Access, Interrupt, External Trigger To set events, double-click to select the event you want to set from the event setting area of the Time Measurement Window. This opens the dialog box shown below. Following events can be set by specifying Event Type in this dialog box.
• When FETCH is selected Measures for the instruction fetch. • When DATA ACCESS is selected Measures for the memory access.
7Windows/Dialogs • When BIT SYMBOL is selected Measures for the bit access. • When INTERRUPT is selected Measures for the interrupt occurrence or termination.
• When TRIGGER is selected Measures for the status of signal input from external trace cable.
7Windows/Dialogs 7.11.2 Time Measurement Condition For the time measurement conditions, the following can be specified for each measurement interval. Measures the time in an interval from where the start event is established till where the end event is established. Measures the time from where an event is established till where the next event is established. Measures the time from where an event is established till where the event is not established. Measures the execution time of functions.
7.11.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.11.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. For detail about the setting, refer to "7.7.6 Specify the Events (Memory Access)" 7.11.
7Windows/Dialogs 7.11.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. Up to four measurement intervals can be specified.
7.11.9.2 Measure the event occurrence cycle 1. 2. Set the measurement event (measurement start event only). Specify the following in the Measurement Condition Designation dialog. 7.11.9.3 Measure the event establishment time 1. 2. Set the measurement event (measurement start event only). Specify the following in the Measurement Condition Designation dialog.
7Windows/Dialogs 7.11.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. Specify the following in the Measurement Condition Designation dialog.
7.11.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. Specify the following in the Measurement Condition Designation dialog.
7Windows/Dialogs 7.12 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. • Disassemble mode This mode allows you to inspect the executed instructions.
1. Cycle display area: Shows trace cycles. Double-click here to bring up a dialog box to change the displayed cycle. 2. Label display area: Shows labels corresponding to address bus information. Double-click here to bring up a dialog box to search for addresses. 3. Bus information display area: The content displayed here differs depending on the MCU or simulator system used. - Refer to "7.12.6 Display of bus information on the M32C Debugger" - Refer to "7.12.
7Windows/Dialogs 7.12.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. 1. 2. 3. 4. Address display area: Shows addresses corresponding to instructions. Double-click here to bring up a dialog box to search for addresses. Object code display area: Shows the object codes of instructions. Label display area: Shows labels corresponding to instruction addresses.
7.12.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. 1. Data access display area: Shows data access information. If the information displayed here is "000400 1234 W," for example, it means that data "1234H" was written to the address 000400H in 2-byte width. Other display areas are the same as in bus mode.
7Windows/Dialogs 7.12.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. 1. 2. 3. 4. 5. 6. 7. 8. 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. Double-click here to bring up a dialog box to search for addresses.
7.12.5 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function BUS DIS SRC DATA View Display the information of BUS mode. Display the information of Disassemble mode. Display the information of Source mode. Display the information of Data access mode. Changes the displayed position by specifying a cycle. Changes the displayed position by searching an address. Display a selected source file.
7Windows/Dialogs 7.12.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 • BUS The width of the external data bus ("8b" for an 8-bit data bus, and "16b" for a 16-bit data bus) • BIU This shows the status between the BIU (bus interface unit) and memory, and BIU and I/O.
• • • • • Representation CPU OPC OPR Status Operation code size CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU DMA DMAT 1 2 3 0 1 2 3 0 1 2 0 1 - No accessing 0byte 1byte 0byte 2bytes 0byte 3bytes 1byte 0byte 1byte 1byte 1byte 2bytes 1byte 3bytes 2bytes 0byte 2bytes 1byte 2bytes 2bytes 3bytes 0byte 3bytes 1byte DMA accessing DMA accessing(terminal count) 0 0 0 1 1 1 1 2 2 2 3 3 - Operand size QN Shows the number of bytes stored in the instruction queue buffer in the range 0 to 8.
7Windows/Dialogs 7.12.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 • BUS The width of the external data bus ("8b" for an 8-bit data bus, and "16b" for a 16-bit data bus) • BIU This shows the status between the BIU (bus interface unit) and memory, and BIU and I/O.
7.13 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. In the access history reference area, you can see the history of accesses to registered addresses in chart form.
7Windows/Dialogs 7.13.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Analyze Trace Data Set Cycle... Sync with Trace Window Data Length 1byte 2bytes 4bytes Radix Hex Dec Address... Add C Watch Remove C Watch Hide Type Name Add... Remove Analyze the realtime-trace data. Specify the display cycle. Synchronize with Trace Window. Display in 1Byte unit. Display in 2Byte unit. Display in 4Byte unit. Display in Hexadecimal.
7.14 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. • • • You can arrange the following parts on the window. - Label (character string) Displays/erases a character string specified by the user when any value is written to the specified address (bit).
7Windows/Dialogs 7.14.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Select Item Delete Copy Paste Create Button Create Label Create LED Create Text Display grid Save... Load... Sampling Period... Toolbar display Customize toolbar... Allow Docking Hide Select an I/O item. Delete the selected I/O item. Copy the selected I/O item. Paste the copied I/O item. Create a new button item. Create a new label item.
7.15 MR Window Use the MR Window to display the status of the realtime OS. 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.) • • • • • • You can open the MR window as many as the number of display modes . By clicking the desired button, the MR window display mode changes and the display data also changes.
7Windows/Dialogs 7.15.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Mode Context... Layout Refresh RAM Monitor Function Task Ready Queue Timeout Queue Event Flag Semaphore Mailbox Data Queue Cyclic Handler Alarm Handler Memory Pool Message Buffer Port Mailbox(with Priority) Displays Task status. Displays Ready status. Displays Timeout status. Displays Event Flag status. Displays Semaphore status. Displays Mailbox status.
7.15.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.15.12 Display the Task Context" The following data is displayed in the status bar. 7.15.2.1 Display the Task Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the tasks defined in the configuration are listed in the order of ID number.
7Windows/Dialogs • • *1Task Status Display Status RUN RDY SUS DMT 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 RUNNING state READY state SUSPENDED state DORMANT state Sleeping state Sleeping state (suspended) Sleeping state with time-out Sleeping state with time-out (suspended) Delayed state due to dly_tsk Delayed state
7.15.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.
7Windows/Dialogs • *1Task Status Display Status RUN RDY SUS DMT 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 RUNNING state READY state SUSPENDED stat
• *2 Display the Wait Cancellation Condition of Event Flag Wfmode Status TWF_ANDW TWF_ORW Waits for all bits set in the wait bit pattern to be set (AND wait) Waits for any one bit set in the wait bit pattern to be set (OR wait) 7.15.3 Display the Ready Queue Status In the MR window, select Popup Menu - [Mode] -> [Ready Queue]. The following data is displayed in the status bar. 7.15.3.1 Display the Ready Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.
7Windows/Dialogs 7.15.4 Display the Timeout Queue Status In the MR window, select Popup Menu - [Mode] -> [Timeout Queue]. 7.15.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. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.
7.15.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 Contents Tmout ID(Name) Shows the timeout value (ms) of each task Shows the ID No.
7Windows/Dialogs 7.15.5 Display the Event Flag Status In the MR window, select Popup Menu - [Mode] -> [Event Flag]. 7.15.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. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents ID flg_ptn flagQ ID No.
• The following are displayed in the Flgatr area: TA_TFIFO TA_TPRI TA_WSGL TA_WMUL TA_CLR • Task wait queue is in FIFO order Task wait queue is in task priority order Only one task is allowed to be in the waiting state for the eventflag Multiple tasks are allowed to be in the waiting state for the eventflag Eventflag's bit pattern is cleared when a task is released from the waiting state for that eventflag When a task connected to the event flag queue is in the state of waiting with timeout enabled (wai
7Windows/Dialogs 7.15.6 Display the Semaphore Status In the MR window, select Popup Menu - [Mode] -> [Semaphore]. 7.15.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. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents ID Def_cnt Count semQ ID No.
• The following are displayed in the Sematr area: TA_TFIFO TA_TPRI • Task wait queue is in FIFO order Task wait queue is in task priority order 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.
7Windows/Dialogs 7.15.7 Display the Mailbox Status In the MR window, select Popup Menu - [Mode] -> [Mailbox]. 7.15.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. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents ID Msg_cnt MAXmsg Wait Queue(Message) ID No.
7.15.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 Contents ID Mbxatr Mailbox Queue (Wait) Mailbox Queue (Message) ID No. of mailbox Attribute of each mailbox ID No.
7Windows/Dialogs 7.15.8 Display the Data Queue Status In the MR window, select Popup Menu - [Mode] -> [Data Queue]. 7.15.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. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Contents ID Dtqatr Dtcnt Dtqsz Data Queue (Wait) ID No.
• • 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.
7Windows/Dialogs 7.15.9 Display the Cycle Handler Status In the MR window, select Popup Menu - [Mode] -> [Cyclic Handler]. 7.15.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. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents ID StaAddr (name) interval count Status ID No.
7.15.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 Contents ID Name Cycphs Cyctim Tmout ID No.
7Windows/Dialogs 7.15.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.15.10.1 Display the Alarm Handler Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.
7.15.11 Display the Memory Pool Status In the MR window, select Popup Menu - [Mode] -> [Memory Pool]. 7.15.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.
7Windows/Dialogs 7.15.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 Contents ID Mplatr Mpladr Mplsz Blkcnt Fblkcnt Memory Pool Queue ID No.
7.15.12 Display the Task Context 7.15.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 . Enter the task ID number in the Task ID field and click the View button (or press the Enter key).
7Windows/Dialogs 7.15.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:" field.
7.16 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. 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. This window is available only when a target program which uses our real time OS (MRxx) is downloaded. For MR30 • For MR30, this window is available for V. 2.
7Windows/Dialogs 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.
7.16.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Start Marker End Marker Indicator Adjust Move the start marker in the display area. Move the end marker in the display area. Move the indicator in the display area. Adjust range of start and end marker to full width of display area Adjust. Expand scale factor of display. Reduce scale factor of display. Stop measuring. Restarts measuring. Search for history of system calls.
7Windows/Dialogs 7.16.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.16.2.1 Select the Trace Range To measure the task execution history, the real time trace function is used.
7.16.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.
7Windows/Dialogs 7.16.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). Other items are searched based on the AND condition. Then, specify the search direction.
7.16.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. The display scale appears in the "Scale:*" field in the status bar. The default expansion/reduction scale is 1.5. To change the scale, select Menu - [Value ...]. The Value dialog is opened.
7Windows/Dialogs 7.16.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.16.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" and "Hide". 7.16.2.4.6. Change the display color Select Menu - [Color...].
7.16.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. Note [Definition of time value in the MR Trace window] The time value in the MR Trace window indicates the execution elapsed time which sets the program execution start point to 0 in all the cases.
7Windows/Dialogs 7.17 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 MR Analyze window supports three display mode as below: • CPU occupation state by interrupt/task • Ready time by task • List of system call issuance histories (You can extract and display the history based on the specific condition.
7.17.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.
7Windows/Dialogs 7.17.4 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Run Time Rdy->Run System Call Pick Up System Call... Toolbar display Customize toolbar... Allow Docking Hide CPU occupancy status display mode. Ready state duration display mode. System call history display mode. Extract specified system calls display mode. Display toolbar. Open toolbar customize dialog box. Allow window docking. Hide window. 7.17.
7.17.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.
7Windows/Dialogs 7.17.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. Extract the issuance history of the system call which meets the specified condition and display it.
7.18 MR Task Pause Window The MR Task Pause Window realizes the task pause function of the real time OS (MR308/MR30). 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. The MR30 task pause function is supported with MR30 V.3.00 or later. Previously installed target programs cannot be used with this window.
7Windows/Dialogs 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. 7.18.2 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Function Task Pause Come-pause Display Mode Layout Unpause Source/Function... Address...
7.18.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]. 1. 2. 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. If the selected task is in a state other than "Pause", the Pause button is enabled. Click the Pause button. The task selected at this timing is paused.
7Windows/Dialogs 7.18.3.1 Pause Task Being Executed at a Specified Position 1. 2. 3. 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). Click the line to be paused in the task source display area.
7.18.3.2 Pause After a Paused Task is Executed up to Specified Position 1. 2. 3. 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). Click the line to be paused in the task source display area.
7Windows/Dialogs 7.18.3.3 Turn Pause of Certain Task Off 1. 2. 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. The Unpause button is enabled (if the task is paused). Click the Unpause button. The selected task is released from the PAUSE state.
7.18.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. You can also use the View button and View menu to display any position.
7Windows/Dialogs 7.19 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. The content of each item is as follows. Items Contents ID (name) Indicates a task ID number. Indicates an interrupt routine name, task name, idle processing (display "idle"), and unknown name(displayed "unknown").
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. The interval time width of the displayed grid lines appears in the "Grid" area of the status bar.
7Windows/Dialogs 7.19.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). 7.19.2.
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. • The PID information storage area is allocated to an area accessed with 16-bit bus width. 7.19.2.1.2. Select the Trace Range The real time trace function is used for task execution history measurement.
7Windows/Dialogs 7.19.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.19.2.2.1. Change the display magnification Click the Expand button or Reduce button in the tool bar. (Or, select [Expand] or [Reduce] from popup menu by right-clicking on the window.
7.19.2.3 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.19.2.4 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. The Color Setting dialog is opened. Change the display color in the dialog.
7Windows/Dialogs 7.19.2.5 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.
7.20 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. This window is available even when a target program using an OS other than our real time OS (MRxx) is downloaded.
7Windows/Dialogs 7.20.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.
8. 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.
8Table of Script Commands 8.1.3 Register Operation Commands Command Name Short Name Contents Register R Checks and sets a register value 8.1.
8.1.7 Address Interrupt Break Setting Commands Command Name Short Name Contents ADdressInterruptBreak ADIB Sets and checks the address interrupt break 8.1.8 Hardware Break Setting Commands Command Name Short Name Contents HardwareBreak Protect BreakMode HB PT BM Sets and checks a hardware break Sets and checks protect breaks Sets and checks hardware break mode 8.1.
8Table of Script Commands 8.1.12 Program Display Commands Command Name Short Name Contents Func Up* Down* Where* Path AddPath File - Checks function names and displays the contents of functions Displays the calling function Displays a called function Displays a function call status Sets and checks the search path Adds the search path Checks a filename and displays the contents of that file 8.1.13 Map Commands Command Name Short Name Contents Map* - Checks and sets mapping data 8.1.
8.1.18 Utility Commands Command Name Short Name Contents Radix Alias UnAlias UnAliasAll Version Date Echo CD VER - Sets and checks the radix for numerical input Specifies and checks command alias definitions Cancels the alias defined for a command Cancels all aliases defined for commands Displays the version No.
8Table of Script Commands 8.
OverStepInstruaction Path Pause Print Protect Radix Register Reload Reset Return ReturnInstruction Scope Script Section Set SetMemoryByte SetMemoryLword* SetMemoryWord* Sleep SoftwareBreak SoftwareBreakClear SoftwareBreakClearAll SoftwareBreakDisable SoftwareBreakDisableAll SoftwareBreakEnable SoftwareBreakEnableAll Status Step StepInstruction Stop Symbol Time TraceData* TraceList* TracePoint UnAlias UnAliasAll Up* UploadHex UploadMot* Version Wait WatchDogTimer* OI PT R RET RETI SEC MB ML MW SB SBC SBCA S
9Writing Script Files 9. 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: • Script commands • Assign statements • Conditional statements (if, else, endi) Program execution branches to the statement(s) to be executed according to the result of the conditional expression.
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. %macro-variable = expression • • • • You can use alphanumerics and the underscore (_) in macro variable names. However , you cannot use a numeric to start a macro variable name.
9Writing Script Files 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). You can nest while statements up to 32 levels.
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 • Symbols and labels • Macro variables • Register variables • Memory variables • Line Nos. • Character constants • Operators 9.2.1 Constants You can use binary, octal, decimal, or hexadecimals.
9Writing Script Files 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. However, do not start with a numeric. • Symbols and labels can consist of up to 255 characters. • Uppercase and lowercase letters are unique.
9.2.3 Macro Variables Macro variables are defined by assign statements in the script file. See Section "9.1.2 Assign Statement " in the Reference part for details. Precede variables with '%' for use as macro variables. • You can specify alphanumerics and/or the underbar (_) in the variable name following the percent sign (%). However , do not star t the names with a numeric. • You cannot use the names of registers as variable names. • Uppercase and lowercase letters are differentiated in variable names.
9Writing Script Files 9.2.6 Line Nos. These are source file line Nos. The format for line Nos. is as follows: #line_no #line_no."source file name" • • • • • Specify line Nos. in decimal. You can only specify line Nos. in which software breaks can be set. You cannot specify lines in which no assembler instructions have been generated, including comment lines and blank lines. If you omit the name of the source file, the line Nos. apply to the source file displayed in active Editor(Source) Window.
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.
10 C/C++ Expressions 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. The following shows the order of priority in which they are evaluated.
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" for checking the members of structures and unions using the dot operator.
10 C/C++ Expressions 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; int T::*mp = &T::member; In this case, t_cls.*mp and tp_cls->*mp can correctly reference the variable of pointer-to-member type. Note • Note that the expression *mp cannot considered as the variable of pointer-to-member type.
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. Notes • You cannot cast to struct or union types or the pointers to those types. 10.1.14 Variable Name Variable names that begin with English alphabets as required under C/C++ conventions can be used. The maximum number of characters for variable name is 255.
10 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 • • When the result (value) of calculation has been defined, its name is displayed.
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].
10 C/C++ Expressions 10.2.
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 = (all Radices) 10.2.9 Syntax Errors • When the calculated expression contains a syntax error, it is displayed as follows: () str*(p = (all Radices) (where str*(p is the syntax error) 10.2.
11 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.
12. Attention 12.1 Common Attention 12.1.1 File operation on Windows 1. 2. 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. You must allocate a drive. 12.1.
12 Attention 12.1.2.2 The debugger for M16C/R8C The area which can be set for software breakpoint varies depending on the processor mode. Processor Mode Single Chip Memory Expansion Micro Processor Can be set area Internal RAM area Internal ROM area Internal RAM area Internal ROM area Emulation memory (Only the Internal area) Internal RAM area Emulation memory (Only the Internal area) ATTENTION During target program execution, a software break cannot be set as an internal ROM area. 12.1.
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. You can not use function names for C/C++ expression No script commands (e.g., breakin and func) can be used in which function names are specified for arguments.
12 Attention 12.1.9 Restriction of LPT port 1. 2. 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.
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. Then re-download the program. 12.1.
12 Attention 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. Remember that the interrupt stack pointer (ISP) is set to 0000h on a unit at the production stage. 12.2.
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.
12 Attention 12.2.7 MR STK script command • The MR STK BASE command automatically sets the area where the stack consumption can be measured. The area set by this command is range of 256KB including the start address of the system stack. If you want to set other area, please use not the MR STK BASE script command but the CoVerage BASE script command.
12.3 Attention of the M16C/R8C Debugger 12.3.1 Connection to the emulator After setting of MCU by MCU Setting dialog, it takes 10-30 seconds to start up debugger. After setting of MCU, please wait for the moment. 12.3.2 Map of stack area used by the emulator The emulator uses the interrupt stack area as its work area (20 bytes). When debugging, allocate a sufficient interrupt stack area consisting of the regularly used size plus 20 bytes. 12.3.
12 Attention 12.3.7 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 In PID settings, always be sure to specify an even address for the Address area.
12.3.
12 Attention 12.3.10 CPU rewrite • • Please don't rewrite the last block. If you did, emulator gets out of control. When you enabled CPU rewrite mode, you can not use the debug functions below: - Setting software break points to the internal flash ROM - COME execution to the internal flash ROM • You can not use the functions below to the CPU rewrite control program (from setting CPU rewrite mode select bit to clearing it).
12.4 Option of C Compiler/Assembler/Linker We do not evaluate other settings, so we can not recommend to append other options. 12.4.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. To avoid this problem, specify -ONBSD (or -Ono_Break_source_debug) option together with -O, -OR or OS option. 12.4.
12 Attention 12.4.3 When Using the IAR C Compiler (EW) Please specify the project setting by following process. 1. 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" area, check the "Other" option, and select the "ieee-695" as "Output Format".
12.4.4 When Using the IAR C Compiler (ICC) 12.4.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" and "-y" options. The designation of "-y" option varies depending on the product.
12 Attention 12.4.5 When Using the TASKING C Compiler (CM) 12.4.5.1 Specify the Option Please specify "-g" and "- O0" options when compiling. In the options other than the above-mentioned, the operation check is not done. Please acknowledge that the options other than the above-mentioned cannot be recommended. 12.4.5.2 Command Execution Examples The following shows examples of entering commands. >CM16 -g -O0 file1.c 12.4.
[MEMO] 274
M16C R8C PC7501 Emulator Debugger V.1.03 User's Manual Publication Date: Jul. 01, 2007 Rev.1.00 Published by: Sales Strategic Planning Div. Renesas Technology Corp. Edited by: Microcomputer Tool Development Department Renesas Solutions Corp. © 2007. Renesas Technology Corp. and Renesas Solutions Corp., All rights reserved. Printed in Japan.
M16C R8C PC7501 Emulator Debugger V.1.