REJ10J1608-0100 M16C PC4701 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 1 1.1 Real-Time RAM Monitor Function...............................................................................................1 1.1.1 RAM Monitor Area ............................................................................................................1 1.1.2 Sampling Period ................................................................................................................2 1.1.3 Related Windows ....................................................
5.1.5 Clock Tab .........................................................................................................................43 5.1.6 Script Tab.........................................................................................................................44 5.2 Setting of the Communication Interface....................................................................................45 5.2.1 Setting of the USB Interface ....................................................................
.5.1 Extended Menus ..............................................................................................................97 7.6 S/W Break Point Setting Window ..............................................................................................98 7.6.1 Command Button.............................................................................................................99 7.6.2 Setting and Deleting a Break Points from Editor(Source) Window............................100 7.
7.14.3 Display the Ready Queue Status ................................................................................191 7.14.4 Display the Timeout Queue Status.............................................................................192 7.14.5 Display the Event Flag Status ....................................................................................194 7.14.6 Display the Semaphore Status....................................................................................196 7.14.
.2 Writing Expressions..................................................................................................................248 9.2.1 Constants .......................................................................................................................248 9.2.2 Symbols and labels ........................................................................................................249 9.2.3 Macro Variables..............................................................................
12.2.1 Stack area used by the emulator ................................................................................268 12.2.2 Interrupt stack pointer when resetting the target program .....................................268 12.2.3 Option of C Compiler/Assembler/Linker ....................................................................268 12.2.4 Target MCU HOLD terminal......................................................................................268 12.2.5 Hardware Event .......................
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 PC4701 emulator system contains a 1-Kbyte RAM monitor area (which cannot be divided into smaller areas). This debugger supports the real time RAM monitor function which allows you to reference the memory data without sacrificing real time performance during execution of the target program. 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 Protect Break This function causes the target program to stop upon detecting a data write to the ROM area or an access to an unused area (read/write or instruction execution). Protect Break is a function to detect a write of data to the ROM area and an access (read, write, command execution) to an unused area and stop the target program. 1.2.3.1 Protect Attribute You can specify the following attributes in byte. • Access Disable • Read Only • R/W Enable 1.2.3.
1.3 Real-Time Trace Function This function records a target program execution history. Up to 32K cycles of execution history can be recorded. This record allows inspecting the bus information, executed instructions, and source program execution path for each cycle. The real-time trace function records the execution history of the target program. The execution history is referred to in the tracing window. The execution history can be referred to in the following mode.
1 Features 1.3.2 Trace Condition Setting The following designations are available as trace events: • Address designation - Instruction fetch - Memory access - Bit access • External trigger designation (eight events) • Interruption The number of events that can be specified are six events of all.
1.4 Time Measurement Function The time measurement function allows you to measure the maximum, minimum, and average execution times and measurement counts of a specified zone. With this debugger, time can be measured up to four points simultaneously. 1.4.1 The Measurement Condition The measurement condition of the zone time can specify the following in each measurement zone.
1 Features 1.5 Coverage Function Coverage Measurement is a function to record the addresses executed (accessed) by the target program (C0 coverage). After stopping execution of the target program, you can understand which addresses are not executed yet. By using the coverage measurement function in the test process, you can check for missing test items. 1.5.1 Coverage Measurement Area The coverage measurement area is any continuous 256 KB area starting from the 64 KB boundary.
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. The debugger for 740 can't show the status of the realtime OS. 1.7 GUI Input/Output Function This function simulates the user target system's key input panel (buttons) and output panel on a window.
2 About the Emulator PC4701 2. About the Emulator PC4701 The PC4701 emulator system is a generic term used for the 8/16-bit MCU emulators. It can be used in combination with the emulation pod for the PC4701 to debug application programs for each MCU. 2.1 Communication methods The supported communication methods vary with the type of emulator used.
3. Before starting the debugger 3.1 Communication method by emulator The supported communication methods are as follows. (The supported communication methods vary with the type of emulator used. ) USB, LAN, LPT, Proprietary parallel, Serial 3.1.1 USB Interface Supported only when using the PC4701U emulator. • Compliant with USB Standard 1.1. • Connections via USB hub are not supported.
3 Before starting the debugger 3.1.4 Proprietary Parallel Interface Supported only when using the PC4701HS emulator. • The host computer must have a dedicated interface board, the PCA4202G02, incorporated in it (only the ISA bus is supported). The necessary cable is included with the emulator. • A device driver must separately be set. 3.1.4.1 Serial Interface Supported only when using the PC4701M/HS emulator. • This communication uses the host computer's serial interface.
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 1 Before the emulator can be connected in a LAN, the IP address, etc. must first be registered in the emulator. For the emulator in default settings, the utility "setip.exe" included with the debugger may be used to set the IP address, etc. in the emulator. 3.3.2.1 Setting of the LAN Interface using the SETIP.EXE The utility "SETIP" 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.
3.3.3 LAN communication 2 Please exexute registry setting program (Sack.exe) before starting the debugger. It is necessary for LAN communication with emulators to set the following registry. OS Key Data Windows XP/2000 HKEY_LOCAL_MACHINE¥S YSTEM¥CurrentControlSet¥ Services¥Tcpip¥Parameters¥ SackOpts 0(REG_DWORD) You can clear the registry with executing the program "UnSack.exe". The above programs are installed in the directory where this debugger is installed. ATTENTION Make sure Sack.exe and UnSack.
3 Before starting the debugger 3.3.4 Proprietary parallel communication If you are using this debugger in a combination of the parallel I/F, you need to specify the start address of I/O addresses (7 bytes) to the device driver for PCA4202G02, (The I/O address for PCA4202G02 is set to 100h initially.) You can set this setting with setPca4202.exe included with this debugger. The above programs are installed in the directory where this debugger is installed.
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. 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. The following dialog box is displayed. 1. 2. 3. 4.
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. If the corresponding MCU file is not contained in the debugger/emulation pod, you must create a new MCU file. To do this, see the following: "5.
5 Setup the Debugger 5.1.1.3 Executing Self-Check Specify this option to execute self-check* on the emulator when the debugger starts up. Be sure to select the above check box only when you want to perform self-check at startup.
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 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.
5.1.2.3 Specify whether to display the instruction format specifier Specify whether to display the instruction format specifier in the disassembled display. The debugger for 740 doesn't support this function. Select the above check box when you display the instruction format specifier. This specification can only be set or changed when you start the debugger. 5.1.2.
5 Setup the Debugger 5.1.3 F/W and Work Area Tab The specified content becomes effective when the next being start. In this tab, only the debugger for M16C/R8C exists. 5.1.3.1 Select the Firmware File Usually, click the Default radio button in the F/W group. Click the Select radio button when you have to download firmware different from the one described in the MCU file. The F/W Name list box is enabled only when you click the Select radio button. 5.1.3.
5.1.4 Memory Extension Mode Tab This tab enabled only when the MCU tab in the Init dialog is used to specify the MCU file of the microcomputer (M16C/62 group) which supports the memory space expansion function. The specified data remains effective for the next start. In this tab, only the debugger for M16C/R8C exists. 5.1.4.1 Select the Memory Space Extension Mode Select the memory space extension mode. • • • When you use a normal mode, Please click the "Normal" radio button.
5 Setup the Debugger ATTENTION The functions may be restricted depending on the type of memory space expansion mode. Extension Mode 1 • When the memory space expansion area is displayed in the dis-assemble mode in the Program window or the Source window, the displayed data may be different from what you would expect through the operation accompanying redrawing of the window, such as up/down scroll, during execution of the target program.
Extension Mode 2 • The memory reference commands are added, which reference the internal ROM in the bank duplicated area in the dump format (see the table below). A memory reference command with the bank specification is added. The memory reference/the change to the bank repetition area must use the following commands.
5 Setup the Debugger 5.1.5 Clock Tab The specified content becomes effective when the next being start. 5.1.5.1 Specify the Target Clock Change the setting by synchronizing with the clock used by the target microcomputer. (Internal is set by default.) (The debugger for 740 does not have designation of Sub clock.) Select Internal to set the internal clock, and External to set the external clock. 5.1.5.2 Attempt to access memory during WAIT/STOP mode The debugger for 740 does not have this setting.
5.1.6 Script Tab The specified content becomes effective when the next being start. 5.1.6.1 Automatically Execute the Script Commands To automatically execute the script command at start of Debugger, click the "Refer" button to specify the script file to be executed. By clicking the "Refer" button, the File Selection dialog is opened. The specified script file is displayed in the "Init File:" field.
5 Setup the Debugger 5.2 Setting of the Communication Interface 5.2.1 Setting of the USB Interface USB communication uses the personal computer's USB interface. It is compliant with USB 1.1. USB communication can only be used on the PC4701U emulator. Before USB communication can be performed, the computer must have a dedicated device driver installed in it. For details on how to install USB device drivers, see "3.3.1.1Install of USB device driver.
5.2.2 Setting of the LPT Interface LPT communication uses a parallel interface (printer interface) of the personal computer. LPT communication can only be used on the PC4701U/M emulator. To set the LPT communication, click the "LPT" radio button of the MCU tab in the Init dialog. The setting looks like the figure below. Specify the mode for data transfers in the Type field. • The LPT interface has four modes for data transfers, Nibble, Byte, ECP, and EPP.
5 Setup the Debugger 5.2.3 Setting of the LAN Interface LAN communication uses a LAN interface of the personal computer. Before using LAN, you must register the emulator IP address, port number and subnet mask to the emulator itself (Otherwise, LAN is not available). Then, set LAN communication. LAN communication can only be used on the PC4701U/HS emulator. It is necessary for LAN communication with emulators to set the registry. For details, see "3.3 Setting before emulator starts ". 5.2.3.
5.2.3.2 Setting of the LAN Interface To set the LAN communication, click the "LAN" radio button of the MCU tab in the Init dialog. The setting looks like the figure below. Specify the IP address of the connected emulator in the IP address field. Specify the IP address, in bytes, in decimal. 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.4 Setting of the Parallel Interface Special parallel communication uses a special parallel interface board PCA4202G02 (option), which is inserted in the extension slot (ISA bus) of the personal computer. Special parallel communication can only be used on the PC4701HS emulator. To set the parallel communication, click the "Parallel" radio button of the MCU tab in the Init dialog. The setting looks like the figure below. Specify the I/O address in the I/O Address field.
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 Contents Status Emulation Memory Specify the processor mode. Specify the emulation memory area.
5 Setup the Debugger 5.3.1.1.1. Select the Processor Mode Specify the processor mode for the target system. Either the following can be specified. • Single-chip Mode Single-chip Mode • Memory Expansion Memory Expansion Mode • Microprocessor Microprocessor Mode 5.3.1.1.2. Inspecting the MCU status Clicking this tab displays the status of each MCU pin. It allows to check whether the MCU pin status matches the processor mode to be set.
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. (Example: If the specified bank is "F0," then the debug monitor uses a 64-Kbyte area beginning with address F000000h.) • • The bank specified here cannot have its contents referenced or set.
5 Setup the Debugger Follow the procedure described below. Bank (Set bank address) Length (Specify size of area) Map (Specify area map) • • • • Specify the bank address of the debug target area to be allocated in hexadecimal. If specified as C0, C00000h is the start address of the debug target area. Specify the size of the debug target area (256 bytes or 1 Mbytes).
5.4 Setup the Debugger for M16C/R8C 5.4.1 Map Command The memory map information must be altered to suit the target microcomputer's memory space by Map command. Area SFR Internal RAM Internal ROM External ROM Mapping External Internal Internal External Note Memory Expansion Mode, Microprocessor Mode Note • • The emulator temporarily uses the area from FFCh to FFFFh as a stack. Set this area as Internal.
5 Setup the Debugger 5.5 Setup the Debugger for 740 5.5.1 Map Command The memory map information must be altered to suit the target microcomputer's memory space by Map command. Area SFR RAM Internal ROM External ROM Mapping External External Internal External Note Memory Expansion Mode, Microprocessor Mode • Internal Enables the emulator's internal resources. The internal ROM area must be set for Internal because it is always emulated with the emulator's internal resources.
5.6 Method of making MCU file 5.6.1 Method of making MCU file (the M16C/R8C Debugger) The following content is sequentially described in the MCU file. Specify the MCU name to the file name, and specify "mcu" to the file extension. 1. Start address of SFR area 2. End address of SFR area 3. Start address of internal RAM area 4. End address of internal RAM area 5. Start address of ROM area 6. End address of ROM area 7. File name of the Firmware *1 8.
5 Setup the Debugger 5.6.2 Method of making MCU file (the 740 Debugger) The following content is sequentially described in the MCU file. Please describe information on 1-4 referring to the data book on MCU used. 1. Number of stack page selection bit 2. Address of CPU mode register 3. End address of stack*1 4. Address of reset vector 5. POD number*2 6. Firmware name 7. MCU Information No.*3 *1End address of stack Specify the last address of the area to be used as the stack.
ATTENTION For a new MCU, new POD number, new firmware name and new MCU information number may be used. 5.6.2.
Tutorial 59
(Blank Page) 60
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. If the downloaded program is the program generated by the assembler package for 740 family, you can not watch variables in C watch window. 6.2.9.
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. If the downloaded program is the program generated by the assembler package for 740 family, you can not watch variables in C watch window. 6.2.12.1 Displaying Local Variables For example, we will examine the local variables in the tutorial function, which declares three local variables: i, j, and p_sam. Select [C Watch] from the [Symbol] submenu of the [View] menu.
6 Tutorial 6.2.13 Step13 : Stack Trace Function The debugger uses the information on the stack to display the names of functions in the sequence of calls that led to the function to which the program counter is currently pointing. The debugger for 740 doesn't support the stack trace function. 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.
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 81
(Blank Page) 82
7 Windows/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. • • • • This system provides a 1Kbytes of RAM monitor area, which can be placed at any continuous addresses.
7 Windows/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.
7 Windows/Dialogs 7.1.2 Setting the RAM monitor area Choose the popup menu [RAM Monitor Area...] in the RAM monitor window. The Set RRAM Area dialog box shown below will appear. The start address of the currently set RAM monitor area and the range of the RAM monitor area are displayed in the Start and the Area fields of this dialog box. (No values can be entered in the Size field.) Use this dialog box to change the position of the RAM monitor area. • Specify the RAM monitor area by its start address.
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 Windows/Dialogs 7.2.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Add... Add Bit... Remove Remove All Set... Radix Refresh Layout RAM Monitor Function 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.
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.
7 Windows/Dialogs 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 "----".
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 Windows/Dialogs 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.
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 Windows/Dialogs 7.4.2 Refer to the Source Line/the Executed Address It is possible to refer in the Editor(Source) Window or Memory Window. 7.4.2.1 Refer in the Editor(Source) Window In the Editor(Source) window, a display of Coverage Measurement is set to "Disable" by default. To enable the display, check the [Coverage] check box in the dialog box opened by choosing the main menu - [Edit] -> [Define Column Format]. The column for a coverage measurement display is displayed on all Editor (Source) windows.
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 Windows/Dialogs 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 Open... Run Step Close Save... Clear On... Off On... Off Function 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).
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 Windows/Dialogs 7.6.1 Command Button The buttons on this window has the following meanings. Button Load... Save... Help Add Refer... Close Delete Delete All Enable All Enable Disable All Disable View Function 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.
7.6.2 Setting and Deleting a Break Points from Editor(Source) Window The area which can be set in the software breakpoint is different according to the product. Please refer to "12.1.2Area where software breakpoint can be set" for details. You can set break points in the Editor(Source) Window. To do so, double-click the break point setting area ("S/W breakpoints" column) for the line in which you want to set the break. (A red marker is displayed on the line to which the break point was set.
7 Windows/Dialogs 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. - The debugger for M32C Memory Access, Bit Access, External Trigger (* Can be substituted by memory access.
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.
7 Windows/Dialogs • When FETCH is selected Breaks for the instruction fetch. (The debugger for M32C not support. When using these products, use memory access instead.) • When DATA ACCESS is selected Breaks for the memory access.
• When BIT SYMBOL is selected Breaks for the bit access. • When INTERRUPT is selected Breaks for the interrupt occurrence or termination. (The debugger for M32C not support.
7 Windows/Dialogs • When TRIGGER is selected Breaks for the status of signal input from external trace cable.
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. • When AND (Same Time) is selected In the event specification area, the event used can be specified.
7 Windows/Dialogs 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.
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 Windows/Dialogs 7.7.5.2 Instruction Fetch of Specified Address Area(In) Set as below.
7.7.5.3 Instruction Fetch of Specified Address Area(Out) Set as below.
7 Windows/Dialogs 7.7.5.4 Entering/exiting to specified function Set as below.
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 Windows/Dialogs 7.7.6.1.1. Writing/Reading a Specified Address Set as below.
Example) Writing byte length data 32h to even address 400h 114
7 Windows/Dialogs Example) Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width.
(16 bits bus width) 116
7 Windows/Dialogs Example) Writing word length data 1234h to even address 400h Contents of settings vary with each product and bus width. (8 bits bus width) Please specify "And" of the 1st point and the 2nd point for a combination condition.
2nd point 118
7 Windows/Dialogs (16 bits bus width) 119
Example) Writing data 10h - 3Fh to even address 400h 120
7 Windows/Dialogs 7.7.6.1.2. Reading/writing data to the specified address range Set as below.
7.7.6.1.3. Reading/writing data to addresses outside the specified range Set as below.
7 Windows/Dialogs 7.7.6.2 Memory Access(The debugger for M16C/R8C) 7.7.6.2.1. Writing/Reading a Specified Address Set as below.
Example) Writing byte length data 32h to even address 400h 124
7 Windows/Dialogs Example) Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width.
(16 bits bus width) 126
7 Windows/Dialogs Example) Writing word length data 1234h to even address 400h 127
Example) Writing data 10h - 3Fh to even address 400h 128
7 Windows/Dialogs 7.7.6.2.2. Reading/writing data to the specified address range Set as below.
7.7.6.2.3. Reading/writing data to addresses outside the specified range Set as below.
7 Windows/Dialogs 7.7.6.3 Memory Access(The debugger for 740) The debugger For 740, a write of word length data to the even address cannot be detected, either. 7.7.6.3.1. Writing/Reading a Specified Address Set as below.
Example) Writing byte length data 32h to even address 400h 132
7 Windows/Dialogs Example) Writing data 10h - 3Fh to even address 400h 133
7.7.6.3.2. Reading/writing data to the specified address range Set as below.
7 Windows/Dialogs 7.7.6.3.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.
7 Windows/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.
7 Windows/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.).
7 Windows/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.
7 Windows/Dialogs 7.7.10.2 Select AND(Same Time) Change the Combination group to "AND (Same Time)". Next, check (turn on) an event in the event specification area that you want to use. No pass counts can be specified (fixed to 1). 7.7.10.3 Select State Transition Change the Combination group to "State Transition". 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.
7 Windows/Dialogs 7.7.11 Specify the Process ID By specifying a task name (task number), it is possible to enable only the events that occurred in the specified task. 7.7.11.1 Specify the Task Only the events from a specified task can be detected. Events from other than a specified task can also be detected. 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. Three types of protect break attributes are provided as below: - Access Disable (read/write disabled, display in red) - Read Only (write disabled, display in yellow) - R/W Enable (read/write enabled, display in sky blue) The protect break area is a 256 KB continuous area starting from the 64 KB boundary.
7 Windows/Dialogs 7.9 Trace Point Setting Window The Trace Point Setting window is used to set trace points. • • • The events listed below can be specified as trace events. If the contents of events are altered, they are marked by an asterisk (*) on the title bar. The asterisks (*) are not displayed after setting up the emulator. - The debugger for M32C Memory Access, Bit Access, Trigger (* Can be substituted by memory access.
7.9.1 Specify the Trace Event To set events, double-click to select the event you want to set from the event setting area of the Trace Point Setting Window. This opens the dialog box shown below. Following events can be set by specifying Event Type in this dialog box. • When FETCH is selected Traces for the instruction fetch. (The debugger for M32C not support. When using these products, use memory access instead.
7 Windows/Dialogs • When DATA ACCESS is selected Traces for the memory access. • When BIT SYMBOL is selected Traces for the bit access.
• When INTERRUPT is selected Traces for the interrupt occurrence or termination. (The debugger for M32C not support.) • When TRIGGER is selected Traces for the status of signal input from external trace cable.
7 Windows/Dialogs 7.9.2 Specify the Combinatorial Condition To specify a combinatorial condition, specify the desired condition from the combinatorial condition specification area. • When AND or OR is selected In the event specification area, the event used and a pass count for that event can be specified. To lter the pass count, while the event to alter is being selected, click the pass count value of that event.
• 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.9.
7 Windows/Dialogs 7.9.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.
7.9.7 Specify the Events (Instruction Fetch) How to set events for fetch is same as the way for H/W Break Point Setting Window. For detail about the setting, refer to "7.7.5 Specify the Events (Instruction Fetch) " 7.9.8 Specify the Events (Memory Access) How to set events for memory access is same as the way for H/W Break Point Setting Window. For detail about the setting, refer to "7.7.6 Specify the Events (Memory Access) " 7.9.
7 Windows/Dialogs 7.9.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.
• 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.
7 Windows/Dialogs 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.
• For condition 7, choose the Mode shown below and set the Start event.
7 Windows/Dialogs 7.10 Time Measurement Window The Time Measurement window displays the minimum/maximum/average execution time and measurement count at any measurement point. The execution time of up to 4 measurement points can be measured simultaneously. You can specify the event for the measurement condition in the same manner as when specifying events in the Trace Point Setting Window. • If the contents of events are altered, they are marked by an asterisk (*) on the title bar.
7.10.1 Specify the Time Measurement Event The events listed below can be specified as measurement events. • The debugger for M32C Memory Access, Bit Access, External Trigger (* Can be substituted by memory access.
7 Windows/Dialogs • When FETCH is selected Measures for the instruction fetch. (The debugger for M32C not support. When using these products, use memory access instead.) • When DATA ACCESS is selected Measures for the memory access.
• When BIT SYMBOL is selected Measures for the bit access. • When INTERRUPT is selected Measures for the interrupt occurrence or termination. (The debugger for M32C not support.
7 Windows/Dialogs • When TRIGGER is selected Measures for the status of signal input from external trace cable.
7.10.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 Windows/Dialogs 7.10.4 Specify the Events (Instruction Fetch) How to set events for fetch is same as the way for H/W Break Point Setting Window. For detail about the setting, refer to "7.7.5 Specify the Events (Instruction Fetch) " 7.10.5 Specify the Events (Memory Access) How to set events for memory access is same as the way for H/W Break Point Setting Window. For detail about the setting, refer to "7.7.6 Specify the Events (Memory Access) " 7.10.
7.10.9 Set the Measurement Condition For the debugger, the following measurement conditions can be specified. • Measure the execution time between the events. • Measure a period at which intervals events occur. • Measure the time at which events are established. By specifying a function name, it is possible to measure the execution time of that function. Up to four measurement intervals can be specified.
7 Windows/Dialogs 7.10.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.10.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.
7.10.9.4 Measure the execution time of the specified function (1) Measure the execution time of the specified function. In this mode, the function top address is automatically registered to the measurement start event, and the function end address to the measurement end address. The measurement result contains the execution time of other function called within the specified function. Specify the following in the Measurement Condition Designation dialog.
7 Windows/Dialogs 7.10.9.5 Measure the execution time of the specified function (2) Measure the execution time of the specified function. In this mode, the function address range is automatically registered to the measurement start event. The measurement result does not contain the execution time of other function called within the specified function. Specify the following in the Measurement Condition Designation dialog.
7.11 Trace Window The Trace Window is used to display the results of real-time trace measurement. • Bus mode This mode allows you to inspect cycle-by-cycle bus information. The display content depends on the MCU and simulator system used. In addition to bus information, this mode allows disassemble, source line or data access information to be displayed in combination. • Disassemble mode This mode allows you to inspect the executed instructions.
7 Windows/Dialogs 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.11.6 Display of bus information on the M32C Debugger" - Refer to "7.11.
7.11.2 Configuration of Disassemble Mode When disassemble mode is selected while bus mode is unselected, trace information is displayed in disassemble mode. Disassemble mode is configured as shown below. 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 Windows/Dialogs 7.11.3 Configuration of Data Access Mode When data access mode is selected while bus mode and disassemble mode are unselected, trace information is displayed in data access mode. Data access mode is configured as shown below. 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.
7.11.4 Configuration of Source Mode When only source mode is selected, trace information is displayed in source mode. Source mode is configured as shown below. 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 Windows/Dialogs 7.11.5 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu BUS DIS SRC DATA View Time Cycle... Address... Source... Absolute Time Differences Trace Relative Time Forward Backward Step Come Stop Restart Layout... Copy Save... Load... Toolbar display Customize toolbar... Allow Docking Hide Function Display the information of BUS mode. Display the information of Disassemble mode. Display the information of Source mode.
7.11.6 Display of bus information on the M32C Debugger From left to right, the contents are as follows: • Address • The status of the address bus • Data The status of the data bus • 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 Windows/Dialogs Representation CPU OPC CPU 0 CPU 0 CPU 0 CPU 1 CPU 1 CPU 1 CPU 1 CPU 2 CPU 2 CPU 2 CPU 3 CPU 3 DMA DMAT • • • • OPR 1 2 3 0 1 2 3 0 1 2 0 1 - Status Operation code size Operand size 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) B-T Shows the level of the external break trigger (the EXTIN7 pin of the external trace signal
7.11.7 Display of bus information on the M16C/R8C Debugger From left to right, the contents are as follows: • Address The status of the address bus • Data The status of the data bus • 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 Windows/Dialogs • • • • • Display format Status CB RB QC CW RW No change Operation code read (bytes) Operand read (bytes) Instruction queue buffer clear Operation code read (words) Operand read (words) QN Shows the number of bytes stored in the instruction queue buffer in the range 0 to 4. B-T Shows the level of the external break trigger (the EXTIN7 pin of the external trace signal input cable). High level = "1", Low level = "0".
7.11.8 Display of bus information on the 740 Debugger From left to right, the contents are as follows: • Address The status of the address bus • Data The status of the data bus • Sync This signal is output when fetching an instruction op-code. When an op-code is being fetched, this signal indicates a logic 1.This Sync value is sometimes displayed as '(1)'.In this case, it denotes a dummy Sync meaning that the instruction on the line is not actually executed.
7 Windows/Dialogs 7.12 Data Trace Window The Data Trace Window is used to analyze the results of real-time trace measurements and graphically show data access information. It operates in conjunction with Trace Window. • • • In the data reference area, you can inspect memory values at the point of a cycle currently in interest or the values of registered C variables. In the access history reference area, you can see the history of accesses to registered addresses in chart form.
7.12.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. Display in Decimal.
7 Windows/Dialogs 7.13 GUI I/O Window The GUI I/O window allows you for port input by creating a user target system key input panel (button) in the window and clicking the created button. And this window also allows you to implement the user target system output panel in the window. • • • 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).
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 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. Create a new LED item.
7 Windows/Dialogs 7.14 MR Window Use the MR Window to display the status of the realtime OS. The debugger for 740 doesn't support this function. You can only use the MR Window when you have downloaded a program that uses the realtime OS (if the downloaded program does not use the MR, nothing is displayed in the MR Window when it is opened.) • • • • • • You can open the MR window as many as the number of display modes .
7.14.1.1 Extended Menus This window has the following popup menus that can be brought up by right-clicking in the window. Menu Mode Context... Layout Refresh RAM Monitor Function Displays Task status. Displays Ready status. Displays Timeout status. Displays Event Flag status. Displays Semaphore status. Displays Mailbox status. Displays Data Queue status. Displays Cyclic Handler status. Displays Alarm Handler status. Displays Memory Pool status. Displays Message Buffer status. Displays Port status.
7 Windows/Dialogs 7.14.2 Display the Task Status In the MR window, select Popup Menu - [Mode] -> [Task]. By double-clicking any line, the information on the task context is displayed in the Context dialog. For details on the Context dialog, see "7.14.12 Display the Task Context" The following data is displayed in the status bar. 7.14.2.1 Display the Task Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.
• • *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 due to dly_tsk (s
7 Windows/Dialogs 7.14.2.2 Display the Task Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the tasks defined in the configuration are listed in the order of ID number. The function of each item is as described below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.
• *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 state DORMANT state Sl
7 Windows/Dialogs • *2Display 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.14.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.14.3.1 Display the Ready Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.
7.14.4 Display the Timeout Queue Status In the MR window, select Popup Menu - [Mode] -> [Timeout Queue]. 7.14.4.1 Display the Timeout Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) The function of each item is as described below. Tasks waiting at present are displayed in the descending order of timeout value. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents Value ID(name) Shows the timeout value of each task Shows the ID No.
7 Windows/Dialogs 7.14.4.2 Display the Timeout Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) The function of each item is as described below. Tasks waiting at present are displayed in the descending order of timeout value. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Contents Tmout ID(Name) Shows the timeout value (ms) of each task Shows the ID No.
7.14.5 Display the Event Flag Status In the MR window, select Popup Menu - [Mode] -> [Event Flag]. 7.14.5.1 Display the Event Flag Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the event flags defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents ID flg_ptn flagQ ID No. of event flag Bit pattern of each event flag Task ID Nos.
7 Windows/Dialogs • 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 t
7.14.6 Display the Semaphore Status In the MR window, select Popup Menu - [Mode] -> [Semaphore]. 7.14.6.1 Display the Semaphore Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the SEMs defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents ID Def_cnt Count semQ ID No.
7 Windows/Dialogs • 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.
7.14.7 Display the Mailbox Status In the MR window, select Popup Menu - [Mode] -> [Mailbox]. 7.14.7.1 Display the Mailbox Status (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the mail boxes defined in the configuration are listed in the order of ID number. The function of each item is listed below. (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 Windows/Dialogs 7.14.7.2 Display the Mailbox Status (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the mail boxes defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Contents ID Mbxatr Mailbox Queue (Wait) Mailbox Queue (Message) ID No. of mailbox Attribute of each mailbox ID No.
7.14.8 Display the Data Queue Status In the MR window, select Popup Menu - [Mode] -> [Data Queue]. 7.14.8.1 Display the Data Queue Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the data queues defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Contents ID Dtqatr Dtcnt Dtqsz Data Queue (Wait) ID No.
7 Windows/Dialogs • • 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.
7.14.9 Display the Cycle Handler Status In the MR window, select Popup Menu - [Mode] -> [Cyclic Handler]. 7.14.9.1 Display the Cycle Handler Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the cycle handlers defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Item Contents ID StaAddr (name) interval count Status ID No.
7 Windows/Dialogs 7.14.9.2 Display the Cycle Handler Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the cycle handlers defined in the configuration are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Contents ID Name Cycphs Cyctim Tmout ID No.
7.14.10 Display the Alarm Handler Status In the MR window, select Popup Menu - [Mode] -> [Alarm Handler]. When the realtime OS is MRxx conformed to uITRON specifications V.3.0, the following data is displayed in the status bar. 7.14.10.1 Display the Alarm Handler Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) Of all the cycle start handlers defined in the configuration, only those which are not started yet at present are listed in the ascending order of start time.
7 Windows/Dialogs 7.14.11 Display the Memory Pool Status In the MR window, select Popup Menu - [Mode] -> [Memory Pool]. 7.14.11.1 Display the Memory Pool Status(When the realtime OS is MRxx conformed to uITRON specifications V.3.0.) All the memory pools defined in the configuration are listed in the order of ID number. (The fixed length data comes first, and the optional length data comes after the fixed length data.) The function of each item is listed below.
7.14.11.2 Display the Memory Pool Status(When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) All the memory pools are listed in the order of ID number. The function of each item is listed below. (When the realtime OS is MRxx conformed to uITRON specifications V.4.0.) Item Contents ID Mplatr Mpladr Mplsz Blkcnt Fblkcnt Memory Pool Queue ID No.
7 Windows/Dialogs 7.14.12 Display the Task Context 7.14.12.1 Display the Task Context In the MR window, select Popup Menu - [Context...]. The Context dialog box is opened. The Context dialog box is used to reference/specify the context information of the specified task. You can also open the Context dialog box by double-clicking the data display area in the task state display mode . Enter the task ID number in the Task ID field and click the View button (or press the Enter key).
7.14.12.2 Change the task context Enter the task ID number in the Task ID field in the Context dialog and click the Set button. The Set Context dialog is opened. The Set Context dialog is used to set the specified context register value of the specified task. Specify the register to be changed in the Register field list box and enter the value to be set in the "Value:" field.
7 Windows/Dialogs 7.15 MR Trace Window The MR Trace window measures the task execution history of a program using the real time OS and displays the result graphically. The debugger for 740 doesn't support this function. In addition to the task execution history, a history of various other operations each are traced and displayed, including interrupt processing, task state transition, and system call issuance.
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 Windows/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 Start Marker End Marker Indicator Adjust Expand Reduce Trace Stop Trace Restart Search... Trace Range Value... Color... Init Order... Toolbar display Customize toolbar... Allow Docking Hide After Break Function Move the start marker in the display area. Move the end marker in the display area. Move the indicator in the display area.
7.15.2 Refer the Execution History of Task(MRxx Window) You can reference the task execution history in the MR Trace window. You can reference the execution history statistical processing result in the MR Analyze window. These windows are available for a target program using our real time OS (MRxx). 7.15.2.1 Select the Trace Range To measure the task execution history, the real time trace function is used.
7 Windows/Dialogs 7.15.2.4 Refer the Execution History of Task You can reference the task execution transition in the MR Trace window. By moving the mouse to any information displayed in the window, the following window is opened, showing the detailed information.
7.15.2.4.1. Search the History of System Call Issue Click the "Search" button in the tool bar. The Search dialog is opened. (Or, select Menu - [Search ...].) Specify the search condition. With the function code (R0: Function Code) and error code (R0: Error Code), you can specify multiple values (OR condition). Other items are searched based on the AND condition. Then, specify the search direction.
7 Windows/Dialogs 7.15.2.4.2. Change the display magnification Click the "Expand" button or "Reduce" button in the tool bar. (Or, select Menu - [Expand] or [Reduce].) The display is expanded or reduced using the left corner of the graph area as the radix point. By default, the display is expanded or reduced with display scale of 1.5. 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 ...].
7.15.2.4.4. Change the task display order Drag the task/interrupt routine to be moved (the left portion of the graph) to the destination. To initialize the display order, select Menu - [Init Order]. 7.15.2.4.5. Display the specific task only Click the task/interrupt routine to be hidden (the left portion of the graph). Every time you click, the setting is switched between "Display" and "Hide". 7.15.2.4.6. Change the display color Select Menu - [Color...]. The Color dialog is opened.
7 Windows/Dialogs 7.15.2.5 Measure the Execution Time of Task You can measure the execution time between the markers by changing the positions of start marker and end marker in the MR Trace window. Drag the start marker position and end marker position. The time interval between the markers is displayed in the status bar.
7.16 MR Analyze Window The MR Analyze window displays the result of the measurement data statistically analyzed within the range specified by the start marker and the end marker in the MR Trace window. The debugger for 740 doesn't support this function. The MR Analyze window supports three display mode as below: • 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 Windows/Dialogs 7.16.2 Configuration of Ready State Duration Display Mode The ready state time display mode by task is used to display the results generated from statistical process of the time required from execution ready to transition to execution by task. The statistical result is displayed within the range specified by the start marker and end marker in the MR Trace window.
7.16.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.16.
7 Windows/Dialogs 7.16.5.2 Refer the Ready Queue Time Click the Ready->Run button in the tool bar. (Or, select Menu - [Rdy -> Run].) The time required from execution ready state to transition to execution state by task is processed statistically and displayed. The data displayed is the statistical results of the range specified with the start marker and end marker in the MR Trace window.
7.16.5.3.1. Extract the Issuance History Click the "Pick Up" button in the tool bar. (Or, select Menu - [Pick Up System Call...].) The dialog shown below is opened. Specify the search condition of the system call to be extracted and displayed. Extract the issuance history of the system call which meets the specified condition and display it.
7 Windows/Dialogs 7.17 MR Task Pause Window The MR Task Pause Window realizes the task pause function of the real time OS (MR308/MR30). The debugger for 740 doesn't support this function. You can pause and unpause the specified task from this window. The window can be used only when the program containing the system of the MR308/MR30 for the task pause functions and system clock timer is downloaded. The MR30 task pause function is supported with MR30 V.3.00 or later.
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.17.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 Windows/Dialogs 7.17.3 Pause the Specified Task Use the MR Task Pause window. To open the MR Task Pause window, select Menu - [View] -> [RTOS] -> [MR Task Pause]. 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.
7.17.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. The Come-pause button and Pause button are enabled.
7 Windows/Dialogs 7.17.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.
7.17.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 Windows/Dialogs 7.17.3.4 Display Program Contents of Certain Task in Task Source Display Area Click the ID field of (name) field in the task pause display area of the ask line to be displayed. If the target task is paused, the task Pause position (context PC position) is displayed. If the target task is in a state other than Pause, the task start address is displayed. You can also use the View button and View menu to display any position.
7.18 Task Trace Window The Task Trace window measures the task execution history of a program using the real time OS and display it graphically. This window is available even when a target program using an OS other than our real time OS (MRxx) is downloaded. 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").
7 Windows/Dialogs 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.
7.18.2 Refer the Execution History of Task(Taskxx Window) You can reference the task execution history in the Task Trace window. You can reference the execution history statistical processing result in the Task Analyze window. These windows are also available for a target program using an OS other than our real time OS (MRxx). 7.18.2.
7 Windows/Dialogs 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.18.2.1.2.
7.18.2.2 Refer the Execution History of Task You can reference task trace transition in the Task Trace window. By moving the mouse to the information displayed in the window, a window of the following example is opened, showing the detailed information. 7.18.2.2.1. 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 Windows/Dialogs 7.18.2.2.2. Change the grid line display interval Select [Value ...] from popup menu by right-clicking on the window. The Value dialog is opened. Specify the time interval in the display. 7.18.2.2.3. Change the task display order Select [Color ...] from popup menu by right-clicking on the window. The Color dialog is opened. Click the button corresponding to the desired item. The Color Setting dialog is opened. Change the display color in the dialog.
7.18.2.3 Measure the Execution Time of Task By changing the start marker position and end marker position in the Task Trace window, you can measure the execution time between the markers. Drag the start marker position and end marker position. The time interval between the markers is displayed in the status bar.
7 Windows/Dialogs 7.19 Task Analyze Window The Task Analyze window displays the result of the measurement data statistically analyzed within the range specified by the start marker and the end marker in the Task Trace window. The Task Analyze window displays the CPU occupation state. The Task Analyze window functions together with the Task Trace window. This window is available even when a target program using an OS other than our real time OS (MRxx) is downloaded.
7.19.2 Analyze the Execution History of Task You can reference the execution history statistical processing in the Task Analyze window. This window shows the CPU occupation time and ratio by task. The Task Analyze window functions together with the Task Trace window. If the Task Trace window is not open, or the Task Trace window does not show any data, the Task Analyze window will not function.
8 Table of Script Commands 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.
8.1.3 Register Operation Commands Command Name Short Name Contents Register R Checks and sets a register value 8.1.
8 Table of Script Commands 8.1.7 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.8 Real-time Trace Commands Command Name TracePoint TraceData* TraceList* Short Name TP TD TL Contents Sets and checks a trace points Realtime trace data display Displays disassembled realtime trace data 8.1.
8.1.12 Map Commands Command Name Short Name Contents Map* - Checks and sets mapping data 8.1.13 Clock Command Command Name Short Name Contents Clock CLK Checks and changes the clock 8.1.14 WatchDog Timer Commands Command Name Short Name Contents WatchDogTimer* WDT Sets and checks the usage condition of the watchdog timer 8.1.
8 Table of Script Commands 8.
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* Where* PT R RET RETI SEC MB ML MW SB SBC SBCA SBD SBDA SBE SBEA
9 Writing 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.
9 Writing 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.
9 Writing 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.2.2 Priority levels of labels and symbols The conversion of values to labels or symbols, and vice versa, is subject to the following levels of priority: • Conversion of address values 1. Local labels 2. Global labels 3. Local symbols 4. Global symbols 5. Local labels outside scope 6. Local symbols outside scope • 1. 2. 3. 4. 5. 6. Conversion of data values Local symbols Global symbols Local labels Global labels Local symbols outside scope Local labels outside scope • 1. 2. 3.
9 Writing Script Files 9.2.4 Register variables Register variables are used for using the values of registers in an expression. Precede the name of the register with '%' to use it as a register variable. Use the following format. (The debugger for 740 can use '_' instead of '%'.
9.2.7 Character constants The specified character or character string is converted into ASCII code and processed as a constant. • Enclose characters in single quote marks. • Enclose character strings in double quote marks. • The character string must consist of one or two characters (16 bits max.). If more than two characters are specified, the last two characters of the string are processed. For example, "ABCD" would be processed as "CD", or value 4344h. 9.2.
10 C/C++ Expressions 10. C/C++ Expressions 10.1 Writing C/C++ Expressions You can use C/C++ expressions consisting of the tokens shown below for registering C watchpoints and for specifying the values to be assigned to C watchpoints.
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 C/C++ Expressions 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.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.
10 C/C++ Expressions 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.
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 C/C++ Expressions 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.2.
10 C/C++ Expressions 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 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. 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.1.2.3 The debugger for 740 Only the ROM area memory-mapped in the area set as Internal can be designated for software breakpoint. You cannot set software breakpoint in ROM areas memory-mapped in the SFR area, RAM area or other areas set as External. 12.1.3 Get or set C variables • • • • • • • • • • • • • • • If a variable is declared with the same name as the type definition name declared by typedef, you cannot reference that variable. Values cannot be changed for register variables.
12 Attention 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.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. If this happens, you must take either of the countermeasures listed below: - Connect the personal computer to the emulator in any mode other than the ECP mode.
12 Attention 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.
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 Attention 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.3 Attention of the M16C/R8C Debugger 12.3.1 Map of stack area used by the emulator The M16C/60,M16C/20 series emulators use a stack area of 4 bytes from 0FFFCh to 0FFFFh that is accessed at power-on reset. The emulator cannot start up normally unless these 4 bytes of memory can be accessed for read/write.
12 Attention 12.3.5 Hardware Event • • • • If you specify word-length (2-byte length) data from an odd address as an event in the following data accesses, the event is not detected. Also, even when any other bit of the address that contains a specified bit is accessed during bit access, the event may become effective. - Hardware Break Event - Real-time Trace Event - Time Measurement Event To detect a byte access to an odd address in 8 bit bus width, specify the compare data to HI-BYTE.
12.3.8 Memory Space Expansion • • C watch window, Memory window, and other debugging windows can not show correct values, when it shows the expanded area of the memory space expansion fuction. Debugging windows does not consider the bank register. In MODE2 of memory space expansion, the area bank7 is always set the map as EXTERNAL. Please refer to the "5.1.4 Memory Extension Mode Tab". 12.3.9 Watch dog timer You can not debug the program using Watch dog timer. While debugging, please do not start WDT.
12 Attention 12.4 Attention of the 740 Debugger 12.4.1 Setting of Memory Map The map attributes immediately after the emulator has started up are External for 0h-3FFFh and Internal for 4000h-FFFFh. The memory map information must be altered to suit the target microcomputer's memory space. It is similar in the case of the microcomputer that inside ROM area begins from the 4000h past. Please refer to "5.5 Setup the Debugger for 740" for details. 12.4.
12.4.7 About the single-step execution and the program break function in the internal RAM area of the mcu When debugging with the emulation pod M38000L2-FPD, single-step execution and program break function in the internal RAM area are not available. When debugging the program transferred to the internal RAM area, please use the free-run execution and the trace function. 12.4.8 Debugging in the 16-Timer functions The microcomputer (38B5 group etc.
12 Attention 12.5 Option of C Compiler/Assembler/Linker We do not evaluate other settings, so we can not recommend to append other options. 12.5.1 When Using NCxx When -O, -OR or -OS option is specified at compilation, the source line information may not be generated normally due to optimization, causing step execution to be operated abnormally. To avoid this problem, specify -ONBSD (or -Ono_Break_source_debug) option together with -O, -OR or OS option. 12.5.
12.5.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 Attention 12.5.4 When Using the IAR C Compiler (ICC) 12.5.4.1 Specify the Option Please compile according to the following procedures and link. • At compilation Specify the "-r" option. • Before linking Open the linker's option definition file (extension .xcl) to be read when linking and add "-FIEEE695" and "-y" options. The designation of "-y" option varies depending on the product.
12.5.5 When Using the TASKING C Compiler (EDE) Please specify the project setting by following process. 1. 2. 3. Select menu - [EDE]->[C Compiler Option]->[Project Options...]. The "M16C C Compiler Options [Project Name]" dialog opens. Please set as follows by this dialog. - Optimeze Tab Please specify "No optimization" by Optimization level. - Debug Tab Please check only ""Enable generation of any debug information(including type checkeing)"" and "Genarate symbolic debug information".
12 Attention 12.5.7 When Using the IAR EC++ 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 "elf/dwarf" as "Output Format".
[MEMO] 280
M16C PC4701 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 PC4701 Emulator Debugger V.1.