Home

M16C R8C Compact Emulator Software User`s Manual

image

Contents

1. window Menu Function RAM Monitor Area Set RAM monitor base address Sampling Period Set RAM monitor sampling period Clear Clear access attribute Up Moves display position to the immediately preceding RAM monitor area smaller address Down Moves display position to the immediately following RAM monitor area larger address Address Display from specified address Scroll Area Specify scroll range Data Length lbyte Display in 1Byte unit 2bytes Display in 2Byte unit 4bytes Display in 4Byte unit 8bytes Display in 8Byte unit Radix Hex Display in Hexadecimal Dec Display in Decimal Single Dec Display in Signed Decimal Oct Display in Octdecimal Bin Display in Binary Code ASCII Display as ASCII character SJIS Display as SJIS character JIS Display as JIS character UNICODE Display as UNICODE character EUC Display as EUC character Float Display as Floating point Double Display as Double Floating point Layout Label Switch display or non display of Label area Register Switch display or non display of Register area Code Switch display or non display of Code area Column Set the number of columns displayed on one line Split Split window Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 70 7 Windows 7 1 2
2. Example Writing 1 to bit symbol bitsym Al Set Event Status Event Type BIT SYMBOL v Bit Gondition Access WRITE z Value fi v AGGESS WRITE ADDRESS 000400 CONDITION faddr 000400 data amp 0004 0004 ment 105 7 6 8 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 AND All of the specified events are established AND Same Time The specified events are established at the same time OR One of the specified events is established Pass counts number of times passed can be specified for each event 1 255 If the specified combinatorial condition is AND Same Time no pass counts can be set fixed to 1 7 6 9 Select AND OR Change the Combination group to AND to specify AND for the combinatorial condition or OR to specify OR for the combinatorial condition Next check turn on an event in the event specification area that you want to use and specify a pass count for that event To alter the pass count while the event to alter is being selected click the pass count value of that event Me HAV Break Points Setting CV Enable HW Break ADDRE CONDITION Al 000400 WRITE addr 000400 data 0032 A2 O
3. 491A global struct global array 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 00047C 00047D 00047E 00047F 000480 000481 000482 000483 000484 000486 0007E4 0007E4 0007E2 0007E2 0007E4 0007E2 000444 0007E2 0007E2 0007E2 0007E4 NNN7FE2 00 00 00 055 299 00 00 00 055 299 00 00 00 055 299 00 00 00 055 299 00 00 00 055 299 00 00 00 055 300 00 00 00 055 300 00 00 00 055 300 00 00 00 055 300 00 00 00 055 301 00 00 00 055 301 00 00 00 055 301 00 00 00 055 302 00 00 00 055 302 00 00 00 055 302 00 00 00 055 302 00 00 00 055 303 00 00 00 055 303 00 00 00 055 303 00 00 00 055 304 00 00 00 055 304 nnrnn NO N55 3N5 pe EEE EE JE BE EE EO EO Other display areas are the same as in bus mode In addition to data access information the window can display source line information in combination In this case the display will be similar to the one shown below Trace GLOBAL C 44 05012 global struct GLOBAL C 45 05007 05006 05001 05000 GLOBAL C 04995 04994 47 Ranee 32511 00000 Area Break File Cycle 05012 Address OFOODF Time Te Cycle Label Datadccess sept h m 5 ms global _struct m_ rene ft 000470 42 W 00 00 00 055 299 global struct m long
4. Flash ROM Block 040000 080000 060000 000000 0E0000 oFo000 OF8000 OF ADDO OFCOOD DAFFFF OBFFFF OCFFFF ODFFFF OEFFFF OFTFFF OFOFFF OFBFFF OF DFFF The checked blocks are over written not erased on download Glear All Select All Gear All af 5 4 2 1 Setting to clear the MCU s internal flash ROM Specify whether or not to clear the contents of the MCU s internal flash ROM when downloading the target program or data The MCU s internal flash ROM is displayed block by block in the list view The blocks whose check marks are turned on do not have their flash contents cleared when downloading The memory contents in places not overwritten by downloading remain intact The blocks whose check marks are turned off have their flash contents cleared when downloading Pressing the Select All button keeps all blocks from being cleared when downloading Pressing the Clear All button clears all blocks when downloading 41 Tutorial 44 6 Tutorial 6 Tutorial 6 1 Introduction This section describes the main functions of the emulator by using a tutorial program The tutorial program is based on the C program that sorts ten random data items in ascending or descending order The tutorial program performs the following actions The tutorial function generates random data to be sorted The sort function sorts the generated random data in ascending order The change fun
5. es After a setting click the OK button 19 4 3 2 2 Step2 Setting for the Toolchain A wizard for the project creation starts Toolchain version i Which GPU do you want to use for this project GPU Series If there is no GPU type to be selected select the GPU Type that a similar to hardware specification or select Other lt Back net gt Finish Cancel 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 Please refer to the manual attached to your C C compiler package about the details of the contents of a setting 20 4 Preparation before Use 4 3 2 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 i is sabes New Project 5 7 Setting the Target System for Debugging MM16C REC Compact Emulator MIM160 REC FoUSB UART MIM16G R8C PC7501 Emulator MIMISC REC Simulator External Debugeer Target type m 60 60 v Next gt Finish Cancel 1 Selecting of the Target type In the Target type list box select the target CPU type 2 Selecting of the Target Platform In the
6. 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 11111111 00 00 00 055 115 ymmawminwmennn Oooorco0 cjcooo 9irk OR WWWOW BNO a ko OG HEHE ke kepob gd 0F0084 OFr008 6 a 2 3 4 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 8 Bus information display area The content displayed here differs depending on the MCU or emulator system used Display of bus information on the M16C R8C Debugger 4 Time information display area Shows time information of trace measurement result One of the following three modes can be selected from the menu Absolute Time Shows an elapsed time from the time the program started running up to now in terms of absolute time default Differences Shows a differential time from the immediately preceding cycle Relative Time Shows a relative time from the selected cycle Note however that this mode changes to the absolute time display mode when the trace measurement result is updated 5 Acquired range of trace measurement result Shows the currently acquired range of trace measurement result 6 Trace measurement range Show
7. variable name element No or variable variable name element No or variable element No or variable etc Casting to Basic Types You can cast to C basic types char short int and long and cast to the pointer types to these basic types When casting to a pointer type you can also use pointers to pointers and pointers to pointers to pointers etc Note that if signed or unsigned is not specified the default values are as follows Basic type Default char unsigned short signed int signed long signed Notes Of the basic types of C casts to bool type wchar_t type and floating point type float or double cannot be used Casts to register variables cannot be used 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 146 10 C C Expressions Variable Names and Function Names Function names that begin with English alphabets as required under C conventions can be used In the case of C no function names can be used Character Constants You can use characters enclosed in single quote marks as character constants For example A b etc These character constants are converted to ASCII cod
8. 00FF AGGESS T ADDRESS 0 CONDITION Medd 000401 data amp 00FF 0032 mest 96 7 Windows 16 bits bus width 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range addr Address Address1 407 v wl Address2 000 Function Source File E Function v ACCESS WRITE ADDRESS 000401 CONDITION addr 000401 data amp F F00 3200 Cancel 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range data Data ht Data 1 3200 Data 2 IDO ccess WRITE zl 7 Mask FFOO 0401 CONDITION faddr 000401 data amp F F00 3200 Cancel 97 Example Writing word length data 1234h to even address 400h Contents of settings vary with each product and bus width 8 bits bus width Please specify And of the 1st point and the 2nd point for a combination condition 1st point Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range faddr Address1 v Address1 400 Jal Address o0040F zj I Function Source File zj Function ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 data amp 00FF 0034 mest Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range data Datal M
9. 7 6 6 3 Reading writing data to addresses outside the specified range Set as below Example Writing data to addresses below 7FFh l Set Event Status Event Type DATA ACCESS v Address Data Setting Range faddr lt ddress1 v Address1 FF v gl Address2 F DOSOF al Function Source File Function v ACCESS WRITE ADDRESS 0007FF CONDITION faddr lt 0007FF Cancel l Set Event Status Event Type DATA ACCESS v Address Data Setting Range Not Specify Data 1 0o00 Data 2 F 000 Access WRITE v I Mask 0000 ACCESS WRITE ADDRESS 0007FF CONDITION addr lt 0007FF Cancel 103 7 6 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 6 7 1 Writing Reading a Specified Bit Set as below Example Writing 0 to bit 2 at address 400h AT Set Event Status Event Type BIT SYMBOL v i 3 poo AA ip g Bit Symbol v Condition Access WRITE h Value 0 v ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 data amp 0004 0000 104 7 Windows 7 6 7 2 Writing Reading a Specified Bit Symbol Set as below
10. E Register variables m C watch point which does not indicate an address Gnvalid 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 lt not active gt If that C C language expression can be calculated correctly at the second time it becomes an effective C watch point The display settings of the Local File Local and Global tabs are not saved The contents of the Watch tab and those of newly added tabs are saved The RAM monitor obtains the data accessed through the bus Any change other than the access from the target program will not be reflected The variables which are changed in real time are global variables and file local variables only If the display data length of the RAM monitor area is not 1 byte the data s access attribute to the memory may varies in units of 1 byte In such a case that the access attribute is not unified within a set of data the data s access attribute cannot be displayed correctly In this case the background colors the access attribute color of the first byte of the data 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 Add C watchpoint Remove Remove the selected C watchpoint Initial
11. Edit gt Define Column Format The Address Match Interrupt Break column is erased from all Editor Source windows And select popup menu Columns gt Address Match Interrupt Break in the Editor Source window A column can be set up for each Editor Source windows 110 7 Windows 7 8 Trace Point Setting Window The Trace Point Setting window is used to set trace points Setting modification flag Setting the effective events Current event list ME Trace Points Setting addr 0F0042 Func Static FETCH addr OFO1A4 global float WRITE addr 000400 042C lt data lt O4FF 000000 FETCH addr 000000 000000 FETCH addr 000000 000000 FETCH addr 000000 Setting of trace area Setting of trace write condition Setting of combination condition Setting of Process ID The events listed below can be specified as trace events If the contents of events are altered they are marked by an asterisk on the title bar The asterisks are not displayed after setting up the emulator Fetch Memory Access Bit Access Events at up to two points can be used The H W Break Point Setting window and the Trace Point Setting windows use the same resource of the emulator Use the MCU tab in the Init dialog box in order to specify for which function the resources are used On this tab select the Enable the Trace Point Function check box Details These events can be c
12. Platform sheet The contents of a display and the meaning of the cause of the stoppage are as follows Display The cause of the stoppage Halt The stop by the Halt Program button menu S W break Software break Address match interrupt break Address interrupt break H W event Combination Hardware break logical combination AND or AND same time condition was met H W event Combination Ax Hardware break logical combination OR condition was met Ax The event number of which condition was met H W event State transition from xx Hardware break State Transition condition was met from xx previous state start statel state2 H W event State transition Timeout Hardware break State Transition Time Out condition was met H W event Access protect error Protect break Note To be able to show the cause of break or not depends on the connected target Some targets may always show Halt or show 151 12 Attention 12 1 Common Attention A common attention to the product are shown below File operation on Windows Area where software breakpoint can be set Get or set C variables Function name in C Debugging multi modules Syncronized debugging Compact Emulator reset switch 12 1 1 File operation on Windows The following points should be noted ake ew File Name and Directory Name Do not use directory names or filenames that incl
13. and Genarate symbolic debug information 2 Select menu EDE gt Linker Locator Options The M16C Linker Locator Options Project Namel dialog opens Please set as follows by this dialog Format Tab Please specify IEEE 695 for debuggers abs by Output Format 3 Build your program after the setting above In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 3 5 When Using the TASKING C Compiler CM 12 3 5 1 Specify the Option Please specify g and OO options when compiling In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 3 5 2 Command Execution Examples The following shows examples of entering commands gt CM16 g 00 filel c lt Enter gt 158 12 Attention 12 3 6 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 gt 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 Include Tab In the XCL File Name area specify y
14. dialog box is displayed Cancel Administration In this dialog box 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 Browse to another project workspace radio button Uses an existing workspace this radio button is used when the history of the opened workspace does not remain In the case of Selecting an Existing Workspace select Open a recent project workspace or Browse to another project workspace radio button and select the workspace file hws Please refer to the following about the method to create a new workspace 4 3 2 Creating a New Workspace Toolchain Used 4 3 3Creating a New Workspace Toolchain Not Used When debugging the existing load module file with this product a workspace is created by this method The method to create a new workspace depends on whether a toolchain is or is not in use Note that this product does not include a toolchain Use of a toolchain is available in an environment where the C C compiler package for the CPU which you are using has been installed For details on this refer to the manual attached to your C C compiler package 18 4 Preparation before Use 4 3 2 Creating a New Workspace Toolchain Used 4 3 2 1 Step1 Creation of a new workspace In th
15. Scope Sets and checks the effective local symbol scope Script Opens and executes a script file Section SEC Checks section information Set Set specified data in specified C variable expression SetMemoryByte MB Checks and changes memory contents in 1 byte units SetMemoryLword ML Checks and changes memory contents in 4 byte units SetMemory Word MW Checks and changes memory contents in 2 byte units Sleep Halts for user input until the specified time has elapsed SoftwareBreak SB Sets and checks software breaks SoftwareBreakClear SBC Clears software breaks SoftwareBreakClearAll SBCA Clears software breaks SoftwareBreakDisable SBD Disables software breakpoints SoftwareBreakDisableAll SBDA Disables all software breaks SoftwareBreakEnable SBE Enables software breakpoints SoftwareBreakEnableAll SBEA Enables all software breaks Status 3 Checks the operating status of the MCU Step S Step execution of source line StepInstruction SI Step execution of instructions Stop Stops program execution Symbol SYM Checks assembler symbols Time Sets the run time display and checks the current setting TraceData TD Realtime trace data display TraceList TL Displays disassembled realtime trace data TracePoint TP Sets and checks a trace points UnAlias Cancels the alias defined for a command UnAliasAll Cancels all aliases defined for commands Up Displays the calling function UploadHex UH Outputs data to an Intel HE
16. Shows the file name of the currently displayed source file 6 Referenced cycle Shows the currently referenced cycle 7 Referenced address Shows the address corresponding to the currently referenced cycle 8 Referenced time Shows the time information corresponding to the currently referenced cycle Other display areas are the same as in bus mode 127 7 9 5 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function BUS Display the information of BUS mode DIS Display the information of Disassemble mode SRC Display the information of Source mode DATA Display the information of Data access mode View Cycle Changes the displayed position by specifying a cycle Address Changes the displayed position by searching an address Source Display a selected source file Time Absolute Time Shows elapsed time from the time the program started running up to now in terms of absolute time Differences Shows a differential time from the immediately preceding displayed cycle Relative Time Shows a relative time from the currently selected cycle Trace Forward Changes the direction of search to forward direction Backward Changes the direction of search to reverse direction Step Searches in Step mode in the specified direction of search Come Searches in Come mode in the specified direction of search
17. 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 And click the Next button 21 4 3 2 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 New Project 6 7 Setting the Debugger Options Target name M16C REC PC7501 Emulator Configuration name Debue M16G R8C PC7501 Emulator Detail options Setting Modify The default name is already set If it is not necessary to change please click the next button as it is 22 4 Preparation before Use 4 3 2 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 New Project 7 7 Ghangine the File Names to be The following source files will be generated Samplelt c Main Proeram nert0 a30 Start up file sect30 inc Start up file ven gt Finish ance This is the end of the simulator settings Exit the Project Generator following the instructions on the screen 23 4 3 3 Creating a New Workspace Toolchain Not Use
18. Use the following format character string Write the statement after a semicolon You can include only spaces and tabs in front of the semicolon Lines with comment statements are ignored when the script file is executed 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 gt DumpByte TABLE1 gt 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 Constants You can use binary octal decimal or hexadecimals The prefix or suffix symbol attached to the numerical value indicates which radix is used The debugger for M32C and M16C R8C Hexadecimal Decimal Octal Binary Prefix 0x 0X None Suffix h H None 0 0 b B Examples 0xAB24 1234 12340 10010 AB24h 10010b You can only specify when the predetermined radix is hexadecimal If you are inputting a radix that matches the predetermined radix you can omit the symbol that indicates the radix excluding binary Use the RADIX command to set the predetermined value of a radix However in the cases shown below the radix is fixed regardless of what you specify in a RADIX command No of executions No of passes Typ
19. 156 192 3 1 Wh n Using NO EE EA E E dG cake E E E E E E E E EEO 156 12 3 2 When Using the IAR C Compiler EW cccccccccscccssssseecscsscsecsesscseceescseceescsecseseaeeaees 156 12 3 8 When Using the ITAR C Compiler ICO srernerarvrrrererverserervereevernenserervenserssvevesvevsevenne 157 12 3 4 When Using the TASKING C Compiler EDB rsvrrvorverorverrerervenserernenserevvenserevnenenne 158 12 3 5 When Using the TASKING C Compiler CM rrrrrerrrverrerervensererverserernenserervevserevsevenne 158 12 3 6 When Using the IAR EC Compiler EW rsrrrvrrverorverrererversererssrernenserersenseressevenne 159 iv Setup of Debugger 1 Features 1 Features This debugger has the following functions 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 compact emulator system has 1 Kbytes of RAM monitor area which can be located in any contiguous address location or in 4 separate blocks comprised of 256 bytes each 1 2 Break Functions Software Break This function causes the target program to stop immediately before executing the instruction at a specified address Up to 64 breakpoints can be set If multiple breakpoints are set the program breaks at one of the breakpoints that is reached Hardware Break This function causes the target program to stop upon detecting a data read write to memory
20. 18957 16953 18946 18943 18936 16929 16920 18916 16906 18904 18902 16898 18893 188689 16879 18875 18870 16865 18863 16859 16854 OFOBDS OFOBDC OFOBEO OFOBE4 OFOBE6 OFOC1C OFOCIE OFOC21 OFOC23 OFOC25 OFOC28 OFOCZ2A B 9Q0QG var x code Label Mnemonic 778BFDOA00 7DCA39 7DF2 F50600 7CF204 FDD40BOF 7SCO6D4E 7SC2C641 754F4004 754F3E04 FEO1 FD1COCOF ECSO 75B107 7121 7312 75B109 7101 A112 randam access rand 1 RO 10H FB 1H 3H FB F0161H 000AH 3H FB FOLALH _randam_ FOOSEH 04H rand FOBD4H 4E6DH RO 41C6H R2 0440H O43EH FOBE6H __i4mull FOC1CH R1 R3 7H SP R1 R2 R1 R1 R2 SH SP R1 RO R1 R1 R2 4 h m s ms us 00 00 00 054 427 00 00 00 054 427 00 00 00 054 427 00 00 00 054 428 00 00 00 054 428 00 00 00 054 428 00 00 00 054 429 00 00 00 054 429 00 00 00 054 430 00 00 00 054 430 00 00 00 054 430 00 00 00 054 430 00 00 00 054 431 00 00 00 054 431 00 00 00 054 431 00 00 00 054 432 00 00 00 054 432 00 00 00 054 432 00 00 00 054 433 00 00 00 054 433 00 00 00 054 433 00 00 00 054 433 l 1 Address display area Shows addresses corresponding to instructions Double click here to bring up a dialog box to search for addresses 2 Object code display area Shows the object codes of instructions 3 Label display area Shows labels corresponding to instruction addresses Double click here to
21. 6 00047D os W 00 00 00 055 299 00047E oo VW 00 00 00 055 299 00047F 06 W 00 00 00 055 299 000480 oo W 00 00 00 055 299 global_struct m struct m uchar 000481 00 Wj 00 00 00 055 300 000482 00 W 00 00 00 055 300 0x10 126 7 Windows 7 9 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 global char A global short 2 global_long 3 global_struct m char B global struct m short 5 OFODES global struct m long 6 OFOOEB global struct m struct m uchar 0x10 OFGOEF global struct m struct m ushort 0x20 GFGOFS global struct m struct m uint 0x30 OFOOFB for i Ds 5 EFP I OFO104 Zor J 0 JG Se J94 OFO10D global _array i 3 0 TT 1 2 3 4 1 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 2 Address display area Shows addresses corresponding to source lines Double click here to bring up a dialog box to search for addresses 8 Referenced cycle display area Shows the currently referenced cycle that is marked by gt gt Furthermore the addresses corresponding to source lines if any are marked by 4 Source display area Shows the content of the source file 5 File name
22. 7 6 4 1 Instruction Fetch of Specified Address Set as below Example Instruction fetch at address 80000h Al Set Event Status Event Type HAJA v Fetch Setting Range faddr Address1 v Address1 20000 Address2 Function Source File v Function v ACCESS FETCH ADDRESS 080000 CONDITION faddr 080000 87 7 6 4 2 Instruction Fetch of Specified Address Area In Set as below Example Instruction fetch at address 80000h to 80FFFh l Set Event Status Event Type HAJA v Fetch Setting Range Adderss1 lt addr lt Address2 v Addresst 80000 Address2 80FFF Function Source File v Function v ACCESS FETCH ADDRESS 080000 CONDITION 080000 lt addr lt O80F FF Cent 88 7 Windows 7 6 4 3 Instruction Fetch of Specified Address Area Out Set as below Example Instruction fetch at any address other than the range 80000h to 80FFFh 41 Set Event Status Event Type HAJLA v Fetch Setting Range addr lt Address1 Address2 lt addr v Addresst 80000 Address2 80FFF Function Source File v Function v ACCESS FETGH ADDRESS 080000 CONDITION faddr lt 080000 080FFF lt taddr Caen 89 7 6 4 4 Entering exiting to specified function Set as below Example Entering a
23. Add C Watch with the right hand mouse button The Watch tab of C watch window in which the variable is displayed opens wCWatch Tl Bs mx y lb 2 Der GE Watch Local File Local Global Name Value signed long 10 a O0x6C2 16838 The user can click mark at the left side of array a in the C Watch window to watch all the elements CWatch lod mx 16 2 De z Watch Local File Local Global Name Value signed long 10 a Ox6c2 16838 signed long a 0 16838 signed long fa 1 5758 signed long fa 2 10113 signed long a 3 17515 signed long fa 4 31051 signed long a 5 5627 signed long a 6 23010 signed long a 7 7419 signed long 8 16212 signed long a 9 4086 55 6 11 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 Add new watch point R Xx p Cancel Click the OK button The C Watch window will now also show the int type variable i 5 xi mx f OE 2 be S Watch Local File Local Global Name Value signed long 10 a 0x6C2 16838 signed int i 10 56 6 Tutorial 6 12 Step10 Stepping Through a Program This debugger provides a range of step menu com
24. Enter Command Command Input Area The Script Window has a view buffer that stores the results of executing the last 1000 lines The results of execution can therefore be stored in a file view file without specifying a log file When a script file is opened the command history area changes to become the script file display area and displays the contents of the script file When script files are nested the contents of the last opened script file are displayed The script file display area shows the line currently being executed in inverse vide When a script file is open you can invoke script commands from the command input area provided the script file is not being executed The Script Window can record the history of the executed commands to a file This function is not the same as the log function This function records not the result but only the executed commands so the saved files can be used as the script files TT 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 Script Open Open script file Run Run script file Step One step execution of script file Close Close script file View Save Save view buffer to file Clear Clear view buffer Log On Open log file and start recording start output to file Off Close log file and end recording stop output to file Re
25. F Displays the calling function Down Displays a called function Where Displays a function call status Path Sets and checks the search path AddPath R Adds the search path File Checks a filename and displays the contents of that file 134 8 Table of Script Commands 8 1 12 Clock Command Command Name Short Name Contents Clock CLK Checks and changes the clock 8 1 13 C Language Debugging Commands Command Name Short Name Contents Print Check value of specified C variable expression Set Set specified data in specified C variable expression 8 1 14 Real time OS Command Command Name Short Name Contents MR Displays status of realtime OS MRxx 8 1 15 Utility Commands Command Name Short Name Contents Radix Sets and checks the radix for numerical input Alias Specifies and checks command alias definitions UnAlias Cancels the alias defined for a command UnAliasAll Cancels all aliases defined for commands Version VER Displays the version No Date Displays the date Echo Displays messages CD Window open 135 8 2 Table of Script Commands alphabetical order 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
26. Nos These are source file line Nos The format for line Nos is as follows line_no line_no source file name Specify line Nos in decimal You can only specify line Nos in which software breaks can be set You cannot specify lines in which no assembler instructions have been generated including comment lines and blank lines If you omit the name of the source file the line Nos apply to the source file displayed in active Editor Source Window Include the file attribute in the name of the source file Do not include any spaces between the line No and name of the source file 142 9 Writing Script Files 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 Operators The table below lists the operators that you can use in expressions The priority of operators is indicated by the level level 1 being the highest and level 8 the lowest If two or more operators have the same level of priority they are evaluated in order from the left of the expression Operator Funct
27. Read accessed address Green Write accessed address Red Non accessed address White The background colors can be changed 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 If bytes in one data have a different access attribute as in this case those data are enclosed in parentheses when displayed in the window In that case the background color shows the access attribute of the first byte of the data 68 7 Windows 001B 0008 00D2 0000 007C 0000 0000 0000 0000 0000 0000 MOON 0000 0000 0000 0000 0000 0050 0000 The displayed access attributes are initialized by downloading the target program The interval time at which intervals the display is updated may be longer than the specified interval depending on the operating condition shown below m Host machine performance load condition E Communication interface m Window size memory display range or the number of windows displayed 69 7 1 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the
28. Setting Mod ity 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 simulator settings Exit the Project Generator following the instructions on the screen And the dialog for the setup of a debugger is also displayed at this time Details If preparation of an simulator is completed set up the debugger in this dialog box and connect with an simulator 26 4 Preparation before Use 4 3 3 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 Debug Settings Sessioni 6C_R8C_PC7501_Emulator z Target Options DoSample01 Tarest m 6C R8C PC7501 Emulator z Default Debug Format IEEE695_RENES AS v Download Modules Offset Address Formai D work HEW4 Samples M16C Sample01 x30 00000000 TEEESS FeV Pb 1 Select the product name to be connected in the Target drop down list box 2 Select the format of the load module to be downloaded in the Default Debug Format drop down list box Format Name Contents IEEE695 RENESAS IEEE 695 format file When Using NCxx IEEE695 IAR IEEE 695 format file When Using IAR cross tool IEEE695 TASKING IEEE 695 format file When Using Tasking cross tool ELF DWARF2 AR ELF DWARF2 format file When Using IAR cr
29. Setting the RAM monitor area Choose the popup menu RAM Monitor Area in the RAM monitor window The RAM monitor area setup window shown below will appear The currently set RAM monitor areas are listed in this window MRAM Monitor Area Setting Current Assigned Area Add FF 003000 003000 0030FF Remove All 2 8 blocks 2048 bytes are available lt 1 block 256 bytes Save Load Close Use this window to add delete or change RAM monitor areas Specify a RAM monitor area by its start address and size the latter by a number of blocks The start address can be specified in 0x100 byte units If you specify a non aligned address value it is rounded off to the nearest address value in 0x100 byte units before being set Specify the size of the RAM monitor area by a number of blocks For the Compact Emulator one block is 256 bytes in size Up to 4 blocks can be specified RAM monitor areas can be added until the total number of blocks used reaches 4 The number of blocks and the size that are currently available to use are displayed below the list 71 7 1 3 Changing the RAM Monitor Area The start address and the size of the RAM monitor area can be changed Changing from a dialog box Select the RAM monitor area you want to change from a list of RAM monitor areas and double click on it The Set RRAM Area dialog box shown below will appear Specify th
30. Stop Stops trace measurement in the middle and displays the measured content at the present point of time Restart Restarts trace measurement Layout Change layout of the corrent view Copy Copy selected lines Save Save trace data to file Load Load trace data from file Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 128 7 Windows 7 9 6 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 e BHE Indicates the status 0 or 1 of the BHE Byte High Enable signal If BHE 0 it means that the CPU is accessing an odd address e BIU This shows the status between the BIU bus interface unit and memory and BIU and I O Representation BIU status No access DMA Data access other than a CPU cause such as DMA INT Start of INTACK sequence IB Instruction code read due to CPU cause bytes DB data access due to CPU cause bytes IW Instruction code read due to CPU cause words DW data access due to CPU cause words e RW Shows the status of the data bus R for r ead W for wr it e for no access e
31. 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 Product Name y Option The debugger for M16C R8C ylmb At link Specify the linker s option definition file name using f option In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 12 3 3 2 Command Execution Examples The following shows examples of entering commands depending on the product The debugger for M16C R8C gt ICCM16C r filel c lt Enter gt gt ICCM16C r file2 c lt Enter gt gt XLINK o filename 695 f Inkml6c xcl filel file2 lt Enter gt The XCL file name varies depending on the product and memory model For details see the ICCxxxx manual 157 12 3 4 When Using the TASKING C Compiler EDE Please specify the project setting by following process 1 Select menu EDE gt C Compiler Option gt 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 Gncluding type checkeing
32. bring up a dialog box to search for addresses 4 Mnemonic display area Shows the mnemonics of instructions Other display areas are the same as in bus mode In addition to disassemble information the window can display source line or data access information in combination In this case the display will be similar to the one shown below V Baa var z Evy Range 32511 00000 Area Break File Cycle 19026 Address OF0161 Time 00 0000 054 423 Cycle Address Obj code Label Mnemonic Dataiccess h m s ms us a LOCAL C 42 for ire 05 i lt 102 i I 19026 OFO161 778BFD0400 CHP UW 0004H 3H FB 00 00 00 054 423 0007E3 09 R 0007E4 oo R i 19021 OFO166 7DCA39 JGE FO1a1H 00 00 00 054 423 LOCAL C 43 char localScope_char a 19019 0F0169 C661FF MOV B 61H 1H FB 00 00 00 054 423 LOCAL C 44 long localscope long 0 19017 OFO16C D90BF9 MOV W 0H 7H FB 0007E5 61 W 00 00 00 054 423 Slt OFO16F D90BFB MOV U HOH SH FB 0007DF oo 00 00 00 054 423 vi 125 7 9 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 Cycle 05012 05007 05006 05001 05000 04995 04994 04969 04984 04977 04972 04971 04964 04963 04957 04949 04939 04938 04935 04929 04924
33. can be displayed in the following display modes Bus mode This mode allows you to inspect cycle by cycle bus information The display content depends on the MCU and emulator 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 In addition to disassemble information this mode allows source line or data access information to be displayed in combination Data access mode This mode allows you to inspect the data read write cycles In addition to data access information this mode allows source line information to be displayed in combination Source mode This mode allows you to inspect the program execution path in the source program The measurement result is displayed when a trace measurement has finished When a trace measurement restarts the window display is cleared The range of a trace measurement can be altered in the Trace Point Setting Window For details about this window refer to Referencing the Trace Point Setting Window With default settings the trace information immediately before the program has stopped is recorded 123 7 9 1 Configuration of Bus Mode When bus mode is selected trace information is displayed in bus mode Bus mode is configured as shown below The display content in bus mode differs depending on the MCU or emulator system used
34. 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 Event Status PASS EVENT B1 B2 B3 B4 B5 B6 OODE0E When AND Same Time is selected In the event specification area the event used can be specified No pass counts can be specified Event Status PASS EVENT B1 B2 B3 B4 B5 B OODE0E 115 7 8 3 Specify the Trace Range For the compact emulator debugger 64K cycles equivalent of data can be recorded i Area About 32K 32K After 0 64K Full Break Stores the 64K cycles 64K to 0 cycles to the point at which the target program stops Before Stores the 64K cycles 64K to 1 cycles to the point at which the trace point is passed About Stores the 64K cycles 32K to 32K cycles either side of the trace point After Stores the 64K cycles 0 to 64K cycles of trace data after the trace point Full Stores the 64K cycles 64K to 0 cycles of trace data after the trace starts 116 7 Windows 7 8 4 Specify the Trace Write Condition Conditions for cycles to be written to trace memory can be specified Realtime trace Write Condition Setting Mode 1 Start Total Writes all cycles Pick up Writes only the cycles where specified condition holds true Exclude Writ
35. established Only cycles where the start event is established Cycles from the start event established to the start event unestablished Other than cycles from the start event established to the end event established Other than cycles where the start event is established Other than cycles from the start event established to the start event unestablished 11 2 About the Compact Emulator The compact emulator is a small emulator equipped with the debugging function needed for full scale development such as real time trace and a hardware break though it is a handy price and a small body 2 1 Communication method The supported communication methods are as follows I F Emulator Compact Emulator USB Support 2 2 Function table The supported functions are as follows Function CPE SW Break 64 points HW Break 2 points Address Interrupt Break 4 points Real Time Trace 64K Cycles RAM Monitor 1K bytes 256bytes x 4blocks area Time Measurement Go to Stop Depends on the target MCU used 12 3 Starting Setup of Debugger 3 Starting Setup of Debugger Before starting the debugger check the following contents 3 1 Communication method by emulator The supported communication methods are as follows The M30290T2 CPE is supporting USB as a communication interface 3 1 1 USB Interface The supported host computer OS is Windows Me 98 2000 XP USB co
36. functions Go G Program execution with breakpoints GoBreakAt GBA Run target program with software break point GoF ree GF Free run program execution GoProgramBreak GPB Run target program with software break point HardwareBreak HB Sets and checks a hardware break Label z Checks assembler labels Load L Downloads the target program LoadHex LH Downloads an Intel HEX format file LoadMot LM Downloads a Motorola S format file LoadSymbol LS Loads source line ASM symbol information Logoff 5 Stops the output of the screen display to a log file 136 8 Table of Script Commands Logon 3 Outputs the screen display to a log file Module MOD Displays modules names Move Moves memory blocks MoveWord MOVEW Moves memory blocksGn 2 byte units MR i Displays status of realtime OS MRxx OverStep O Overstep execution of source lines OverStepInstruaction OI Overstep execution of instructions Path E Sets and checks the search path Pause Waits for user input Print Check value of specified C variable expression Radix Sets and checks the radix for numerical input Register R Checks and sets a register value Reload Re downloads the target program Reset 5 Resets the target MCU Return RET Executes a source line return ReturnInstruction RETI Executes an instruction return
37. listed herein The information described here may contain technical inaccuracies or typographical errors Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage liability or other loss rising from these inaccuracies or errors Please also pay attention to information published by Renesas Technology Corporation and Renesas Solutions Corporation by various means including the Renesas home page http www renesas com When using any or all of the information contained in these materials including product data diagrams charts programs and algorithms please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage liability or other loss resulting from the information contained herein Renesas Technology semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake Please contact Renesas Technology Corporation Renesas Solutions Corporation or an authorized Renesas Technology product distributor when considering the use of a product contained herein for any specific purposes such as apparatus or systems for transportation vehicular medical aerospace nuclear or undersea repeater use The prior written approval of Renes
38. r none void tutorial void utorialM16C x30 5 6 Dependencies long a 10 fz P long j E sect30 inc fat 13 struct Sample sam init amp sam for i 0 i lt 10 i I j rand ifG lt 0 I JESS ig gt tutoriale Select the Format Views option from the Setup menu to set a font and size that are legible if necessary Initially the Editor Source window shows the start of the user program but the user can use the scroll bar to scroll through the user program and look at the other statements 48 6 Tutorial 6 6 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 6 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 s k tutorial c init amp sam for 0 i lt 10 itt I j rand if j lt 0 I jeg l ali I sort a chanze a sam s0 a 0 sam s1 a 1 sam s2 a 2 sam s3 a 3 sam s4 a 4 sam s5 a 5 sam s6 a 6 sam s7 a 7 sam s8 a 8 sam s9 a 9 The red symbol will appear on the line containing the sort function call This shows that a softwarebreak breakpoint has been set Next Step5 Executing the Program 49 6 7 Ste
39. starts up Self check refers to the function to check the emulator s internal circuit boards for memory condition etc Refer to the user s manual of your emulator for details about the self check function 5 3 1 4 Using unusing the address interrupt break function Specify whether or not to use the address interrupt break function IV Enable the Address Match Interrupt Break Function Touse the address interrupt break function default Select the check box shown above In this case the address interrupt break function is used by the emulator and cannot be used in the user program Not to use the address interrupt break function Deselect the check box shown above In this case the address interrupt break function can be used in the user program The contents set here are reflected at only startup time 5 3 1 5 Choosing to use or not to use CPU rewrite mode Specify whether or not you want to use CPU rewrite mode By default CPU rewrite mode is unused Debug the program using the CPU Rewrite Mode Select the above check box when you are debugging the target system that uses CPU rewrite mode 32 5 Setup the Debugger This specification can only be set or changed when you start the debugger Supplementary explanation When debugging in CPU rewrite mode is enabled the following limitations apply Address match breakpoints cannot be set No software breaks can be set in the internal ROM area The
40. syntax error Structure and Union Types When the result of calculation is a structure or union type the address is displayed in hex as follows Data v 0x1234 all Radices If as in structures and unions the C C expression consists of members a is displayed to the left of the type name tag name KA Je indicating structure or union E amp Catch Value T unsigned char str OxFOOOO 89 Y unsigned char str go v struct DATA pData 0x408 struct Answer ans Ox82B unsigned char ch 100 d signed int nID 3980 2 11 L Irr 1 a You can double click on lines indicated by a to see the members of that structure or union The changes to a while the members are displayed To return to the original display double click the line now indicated by the This function allows you to check the members of structures and unions Attention If a variable is declared with the same name as the type definition name declared by typedef you cannot reference that variable Register Variables When the result of calculation is a register variable register is displayed to the left of the type name as follows register signed int j 100 150 10 C C Expressions 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
41. the operation of memory may be inadequate It is recommended that a program for checking the memory be created 6 4 1 Checking the Operation of RAM Select Memory from the CPU submenu of the View menu and enter the RAM address Here enter H 400 in the Display Address edit boxes The Scroll Start Address and Scroll End Address editing box is left to a default setting By default the scroll range is set to Oh to the maximum address of MCU Display Address 7 z Scroll Start Address 000000 v Scroll End Address OFFFFF v ment Note The settings of the RAM area differ depending on the product For details refer to the hardware manual Click the OK button The Memory window is displayed and shows the specified memory area 46 6 Tutorial Address Label Register 000400 00 00 00 00 OO 00 00 00 00 OO 00 00 OO 00 OG OG 000410 DF D5 F6 OF 20 OA 00 00 20 OA 00 00 00 03 00 00 oe 000420 FE FE FE FF FF PE OFF FE FR FE PE FE PE FE FE PE seems 000430 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF aee 000440 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ud 000450 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF a 000480 FE FE FE FF FF FF FF FF FF FF FF FE AA SG 000470 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF s 000480 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF n 000430 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF aeee 000440 FF FF FF FF FF FF FF FF F
42. to safety when making your circuit designs with appropriate measures such as i placement of substitutive auxiliary circuits ii use of nonflammable material or iii prevention against any malfunction or mishap Notes regarding these materials These materials are intended as a reference to assist our customers in the selection of the Renesas Technology product best suited to the customer s application they do not convey any license under any intellectual property rights or any other rights belonging to Renesas Technology Corporation Renesas Solutions Corporation or a third party Renesas Technology Corporation and Renesas Solutions Corporation assume no responsibility for any damage or infringement of any third party s rights originating in the use of any product data diagrams charts programs algorithms or circuit application examples contained in these materials All information contained in these materials including product data diagrams charts programs and algorithms represents information on products at the time of publication of these materials and are subject to change by Renesas Technology Corporation and Renesas Solutions Corporation without notice due to product improvements or other reasons It is therefore recommended that customers contact Renesas Technology Corporation Renesas Solutions Corporation or an authorized Renesas Technology product distributor for the latest product information before purchasing a product
43. wn To specify condition 1 choose Total from the list box of the window s Write Condition item Write Condition Total v Detail To specify conditions 2 to 4 choose Pick Up and click the Detail button to open the Realtime trace Write Condition dialog box Write Condition Pick up v amp For condition 2 choose the Mode shown below and set the Start and End events Realtime trace Write Condition Setting Mode gt Start End Cancel 119 For condition 3 choose the Mode shown below and set the Start event Realtime trace Write Condition Cancel For condition 4 choose the Mode shown below and set the Start event Realtime trace Write Condition 120 7 Windows Similarly when specifying conditions 5 to 7 choose Exclude and click the Detail button to open the Realtime trace Write Condition dialog box Exclude v Fe Condition For condition 5 choose the Mode shown below and set the Start and End events Realtime trace Write Condition For condition 6 choose the Mode shown below and set the Start event Realtime trace Write Condition 121 For condition 7 choose the Mode shown below and set the Start event Realtime trace Write Condition Cancel 122 7 Windows 7 9 Trace Window The Trace Window is used to display the results of real time trace measurement The measurement result
44. CSOWA NCSC 7 Object Format IEEE 695 Please specify the compiler used and its object file format in the dialog opened by menu Debug gt Debug Settings 5 3 3 2 Specify the Storing of Debugging Information There are two methods for storing debugging information on memory and on demand Select one of these two methods The on memory method is selected by default To select the on demand method click the On Demand check box On memory method Debugging information is stored in the internal memory of your computer This method is suitable when the load module target program size is small On demand method Debugging information is stored in a reusable temporary file on the hard disk of your computer Because the stored debugging information is reused the next time you download the same load module it can be downloaded at high speed This method is suitable when the load module target program size is large Notes Ifthe load module size is large the on memory method may be inefficient because it requires a very large amount of time for downloading In such a case select the on demand method Inthe on demand method a folder in which to store a reusable temporary file is created in the folder that contains the downloaded load module This folder is named after the load module name by the word INDEX_ to it If the load module name is sample abs for example the folder name is INDEX_sample This folder i
45. F FF FF FF FF FF FF FF ae 000480 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF a 000400 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF a 000400 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ssseee x sl Placing the mouse cursor on a point in the display of data in the Memory window and double clicking allows the values at that point to be changed 6 5 Step3 Downloading the Tutorial Program 6 5 1 Downloading the Tutorial Program Download the object program to be debugged The Debugger for M16C R8C Select Download module from TutorialM16C x30 under Download modules dx E ra Tutor ialM16C B E TutorialM16G E ra Assembly source file nert0 a30 e a source file sorte 8 tutoriale 2 53 Download modules J utorialM16C x3 B 3 Dependencies Download module e sectal inc Download module fdebue data only E sorth UrAload module Configure View v Allow Docking Hide ite 47 6 5 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 x TutorialM16G TutorialM1 6C Assembly source file void main void nert0 a30 while 1 0 C source file tutorial L sorte tutoriale I
46. FO528 FETCH addr 0F0528 43 000000 FETCH addr 000000 A4 000000 FETCH addr 000000 A5 000000 FETCH addr 000000 AG 000000 FETCH addr 000000 OOOO8 Combination PID AND v Detail Enable Detail AND Save Load 3 Close AND Same Time OR 106 7 Windows 7 6 10 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 Me H W Break Points Setting M Enable HAW Break CONDITION 000400 addr 000400 data 0032 0F0528 addr 0F0528 000000 addr 000000 000000 addr 000000 000000 addr 000000 000000 faddr 000000 O 0 O O m 107 7 7 Address Interrupt Break Point Setting Window The Address Interrupt Break Point Setting window allows you to set address interrupt break points This function stops the target program immediately before executing an instruction at a specified address This function is realized by using the MCU s address match interrupt So that the address interrupt break function can only be used when the address match interrupt is not used in the user application Save Load Break Point Buttons Set Break Point Area E Address Interrupt Break P 0F0000 OFO0C2 36 GLOBAL C 0F012C 22 LOCAL C Display Break Point Operation Buttons to Break Poi
47. In the Project Name edit box enter the project name When the project name is the same as the workspace name it needs not be entered In the Directory edit box enter the directory name in which the workspace will be created Click the Browse button to select a directory es After a setting click the OK button 24 4 Preparation before Use 4 3 3 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 Setting the Tare tem for Debugging MMISG PC4701 Emulator MMIEC REC Compact Emulator MIMI6C REG FoUSB UART MIM16G REC PC7501 Emulator 1 Selecting of the Target type In the Target type list box select the target CPU type 2 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 And click the Next button 25 4 3 3 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 New Project ing the Debugger Options Target name M16C R amp C PC 7501 Emulator Configuration name Debue_M16C_R8C_PC7501_Emulator Detail options Hem
48. Local File Local Global Name Value a struct tag_S p 0x404 struct tag_S pS Ox404 signed int ni 1028 unsigned char cl 4 74 struct tag_S next 0x404 signed short global_short 1028 signed long global_long 67372036 signed int 5 5 slobal array Ox444 1028 signed int 5 global array 0 Ox444 1028 signed int 5 global array 1 0x454 1028 signed int 5 slobal array 2 Ox45E 1028 signed int 5 global array 3 0x468 1028 signed int 5 slobal array 4 0x472 1028 Variables can be inspected by scope local file local or global The display is automatically updated at the same time the PC value changes Variable values can be changed The display radix can be changed for each variable individually Any variable can be registered to the Watch tab so that it will be displayed at all times M The registered content is saved for each project separately m Iftwo or more of the C watch window are opened at the same time the registered The C watchpoints can be registered to separate destinations by adding Watch tabs Variables can be registered from another window or editor by a drag and drop operation The C watchpoints can be sorted by name or by address Values can be inspected in real time during program execution by using the RAM monitor function 75 ATTENTION You cannot change the values of the C watch points listed below M Bit field variables
49. MCU Specify the MCU s processor mode debug options etc Flash Clear Specify whether to clear the contents of the MCU s internal flash ROM To keep the MCU Setting dialog box closed next time the debugger is started check Next Hide at the bottom of the MCU Setting dialog box You can open the MCU Setting dialog using either one of the following methods After the debugger gets started select Menu Setup gt Emulator gt Target 38 5 Setup the Debugger 5 4 1 MCU Tab The specified content becomes effective when the next being start Single Chip Mode v 5 4 1 1 Select the Processor Mode Specify the processor mode for the target system Single Chip Mode v Either the following can be specified Single chip Mode Single chip Mode Also you need to specify the following information according to the processor mode you ve selected PM10 b0 of 000005H Specify whether you set the bit PM10 b0 of 000005H When you use your target system with the setting that PM10 is 1 check this option 39 5 4 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 m MOU Status NMI H HOLD RDY H CNYVss NG ETE SN NC means that the value is indeterminate 40 5 Setup the Debugger 5 4 2 Flash Clear Tab The specified content becomes effective when the next being start
50. RWT This signal shows the effective position in the bus cycle 0 when effective Address Data and BIU signals are valid when RWT is 0 e CPU This shows the signal between CPU and BIU Representation Status No accessing CB Opecode read bytes RB Operand read bytes QC Instruction queue buffer clear CW Opecode read words RW Operand read words 129 7 10 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 GUI IO Sample pni Tii Tii oii 7S Input Panel You can arrange the following parts on the window E Label character string Displays erases a character string specified by the user when any value is written to the specified address bit us LED Changes the display color of any area when any value is written to the specified address bit Substitution for LED ON Button A virtual port input can be executed at the time the button is pressed mE Text Display the text string You can also save the created panel in a file and reload it You can set up to 200 address points to the created part If different addresses are set to the individual parts you can arrange up to 200 parts 130 7 Windows 7 10 1 Extended Menus This window has the following window pop
51. Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers office
52. To our customers Old Company Name in Catalogs and Other Documents On April 1 2010 NEC Electronics Corporation merged with Renesas Technology Corporation and Renesas Electronics Corporation took over all the business of both companies Therefore although the old company name remains in this document it is a valid Renesas Electronics document We appreciate your understanding Renesas Electronics website http www renesas com April 1 2010 Renesas Electronics Corporation Issued by Renesas Electronics Corporation http www renesas com Send any inquiries to http www renesas com inquiry CENESAS 8 10 11 12 Notice All information included in this document is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is grant
53. X format file UploadMot UM Outputs data to a Motorola S format file Version VER Displays the version No Wait Waits for an event to occur before command input Where 3 Displays a function call status 137 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 Loop statements while endw A block of one or more statements is repeatedly executed according to the expression break statement Exits from the innermost loop Comment statements You can include comments in a script file The comment statements are ignored when the script commands are executed Specify only one statement on each line of the script file You cannot specify more than one statement on a line or write statements that span two or more lines Notes You cannot include comments on the same lines as script commands You can nest script files up to five levels You can nest if statements and while statements up to 32 levels If statements must be paired with endi statements and while statements with endw statements i
54. an R EAEE aR dte rikere TUE 135 8 1 13 C Language Debugging Commands ccccccccccecessesssceeececsessssececececeesessaceeeesesenensaaeees 135 8 1 14 Real time OS Command i lt 2 cceiicccceeeck ev csccs cde rE EE er EKE EE aiie 135 8 4 15 U tility Commands 3 csesesvedes ods cavnsheevescs3ds Ben ndeeveees ed hak Nle vases Pedhee hcaadeavessse cB eases sian 135 8 2 Table of Script Commands alphabetical order c cccccescsssessesesesesscseesesseesessecssesecaeessesseeses 136 ili 10 11 12 Writing Script Files 138 9 1 Structural Elements of a Script File ccccccccccccccssssssecececeesessseecececeesesesneceeceeceesesssaeeeesesenenaes 138 9 2 Writme Expr ssionssmusatvastms AA EAE kes E O EAE E EEEE 140 C C Expressions 144 10 1 Writing C C Expr ssiong neii ae E EE E e E A EE o sees ESS 144 10 2 Display Format of C C Expressions ccccccccccececsesssceseeececsessaaeceecceceesessececececsenestsseeeeeeeenes 147 Display the Cause of the Program Stoppage 151 Attention 152 12 1 Common Attention neeo nnee Grim keen beaten 152 12 1 1 File operation on Windows sronnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnensnsnnnsnnnnnenes 152 12 1 2 Area where software breakpoint can be Set ccccccccececsessceeececsesesssceeececeessaeeeeeeeeseses 152 12 1 3 Get or set C variablegssssvartesatsssdsnuresnusserkunssf esdiesier 153 12 1 4 Function name in C sororssonnvorsnnrnrrssnnrsrrssrsrs
55. arted check Next Hide at the bottom of the Init dialog You can open the Init dialog using either one of the following methods After the debugger gets started select Menu Setup gt Emulator gt System Start debugger while holding down the Ctrl key 5 2 MCU Setting Dialog Set the user target information in the MCU Setting dialog box Close the Init dialog box before you open the MCU Setting dialog box For details click the tab name on the table you are interested in Tab Name Contents MCU Specify the MCU s processor mode debug options etc Flash Clear Specify whether to clear the contents of the MCU s internal flash ROM If you do not want the MCU Setting dialog box to be displayed the next time you start the debugger select the check box Next Hide at the bottom of the MCU Setting dialog box You can open the MCU Setting dialog using either one of the following methods After the debugger gets started select Menu Setup gt Emulator gt Target 5 3 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 hit M16C RSC Compact Emulator MCU Debugging Information Emulator Script MCU M16C29 mcu Serial No 2 0290v 3 KMO19 v Self Che
56. as Technology Corporation and Renesas Solutions Corporation is necessary to reprint or reproduce in whole or in part these materials If these products or technologies are subject to the Japanese export control restrictions they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination Any diversion or reexport contrary to the export control laws and regulations of Japan and or the country of destination is prohibited Please contact Renesas Technology Corporation or Renesas Solutions Corporation for further details on these materials or the products contained therein For inquiries about the contents of this document or product fill in the text file the installer generates in the following directory and email to your local distributor SUPPORT Product name SUPPORT TXT Renesas Tools Homepage __hittp www renesas com en tools 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 Target System The Debugger operates on the compact emulator system Supp
57. asting cannot be performed on structure types union types or pointer types to structure or union types Character constants and literal character strings cannot contain escape sequences 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 Noscript commands e g breakin and func can be used in which function names are specified for arguments In address value specifying columns of dialog boxes no addresses can be specified using function names 12 1 5 Debugging multi modules If you register two or more absolute module file in one session you can download only one file in same time If you register one absolute module file and one or more machine language file in one session you can download all file in same time 12 1 6 Syncronized debugging Syncronized debugging function is not available 12 1 7 Compact Emulator reset switch If system reset of the compact emulator does not function normally terminate the debugger turn ON the compact emulator again and restart the debugger Then re download the program 153 12 2 Attention of the M16C R8C Debugger Attention of the M16C R8C Debugger are shown below Map of stack area used by the compact emulator Interrupt stack pointe
58. atically installed For details see 3 4 Install of USB device driver 15 3 4 Install of USB device driver The USB devices connected are detected by Windows Plug amp Play function The installation wizard for USB device drivers starts after the device had been detected The following shows the procedure for installing the USB device drivers 1 Connect the host computer and the emulator with USB cable 2 Set the emulator s communication interface switch to the USB position Then turn on the power to the emulator 3 The dialog box shown below appears Found New Hardware USB Device Installing Go on following the wizard and a dialog box for specifying the setup information file inf file is displayed Specify the musbdrv inf file stored in a location below the directory where this debugger is installed ATTENTION Before the USB device drivers can be installed the debugger you use must already be installed Install this debugger first USB communication can be used only in Windows Me 98 2000 XP and cannot be used in any other OSs When using Windows 2000 XP a user who install the USB device driver need administrator rights During installation a message may be output indicating that the device driver proper musbdrv sys cannot be found In this case specify the musbdrv sys which is stored in the same directory as is the musbdrv inf file 16 4 Preparation before Use 4 Preparation bef
59. break Item Status Connected to M16C R Cc PC7501 Emulator CPU Mi6c Run Status Ready Cause of last break S W break Run time count 00 h OO m OO sec 001 msec 991 usec Ae Memory Platform Events Please refer to 7 BENERI EEA SI BTA RODY EA about the notation of a break factor 51 6 8 Step6 Reviewing Breakpoints The user can see all the breakpoints set in the program in the S W Break Points window 6 8 1 Reviewing Breakpoints Select S W Break Points from the Break submenu of the View menu The S W Break Points window is displayed O S W Break Points Load Save Help C Filename a Peter Le CE S W Break Point Delete OFO26F L 37 D YMI6CYTutorialM16CYtutorialml6cYsourceftutorial c Delete AI Enable All Enable Disable All Disable View This window allows the user to set or change breakpoints define new breakpoints and delete enable or disable breakpoints 52 6 Tutorial 6 9 Step7 Viewing Register The user can see all registers flags value in the Register window 6 9 1 Viewing Register Select Registers from the CPU submenu of the View menu The Register window is displayed 0 BANK Register xj N Value 0024 OFroo 0000 0000 O6E6 0000 0718 06C2 0420 PC OFOZ26F SB 0400 INTB OFFDOO YOQ BO INP I 6 9 2 Setting the Register Value You can change a register flag value from thi
60. break to function name wait AT Set Event Status Event Type ligaen v Fetch Setting Range Adderss1 lt addr lt Address v Address wait r Address2 F0188 V Function Source File mainc X Function wait v ACCESS FETGH ADDRESS wait CONDITION 0F0172 lt addr lt OF 0188 90 7 Windows Example Exiting from function name wait AT Set Event Status Event Type HAJA v Fetch Setting Range Gddr lt Address1 Address2 lt addr v Addressl wait v Al Address2 W Function Source File main c v Function wait v ACCESS FETGH ADDRESS wait CONDITION faddr lt OF 0172 0F0188 lt faddr onee 91 7 6 5 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 The contents of settings varies depending on the product Please refer 7 6 6 Memory Access The debugger for M16C R8C 92 7 Windows 7 6 6 Memory Access The debugger for M16C R8C ATTENTION It is not detected that data access to the odd addresses in word size access 7 6 6 1 Writing Reading a Specified Address Set as below Example Writing to even address 400h 41 Set Event Status DATA ACCESS
61. by the following windows Editor Source Window Address Interrupt Break Point Setting Window You can double click the mouse to set reset the address interrupt breakpoint in the Editor Source window same as software breakpoints You can also switch to temporarily disable enable the address interrupt breakpoint in the Address Interrupt Break Point Setting Window 1 9 About Real time Trace Function 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 BUS mode This mode allows you to inspect cycle by cycle bus information The display content depends on the MCU and emulator 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 In addition to disassemble information this mode allows source line or data access information to be displayed in combination Data access mode This mode allows you to inspect the data read write cycles In addition to data access information this mode allows source line information to be displayed in combination Source mode This mode allows you to inspect the program execution path in the source program 1 9 1 Trace Area The 64K cycles execution history can be referred to wit
62. ck Debug Option IV Enable the Address Match Interrupt Break Function Debug the program using the GPU Rewrite Mode Enable the Trace Point Function OK Cancel Help Next Hide 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 Product Name The debugger for M16C R8C MCU exist Debugging Information exist Emulator exist Script exist To keep the Init dialog closed next time the debugger is started check Next Hide at the bottom of the Init dialog You can open the Init dialog using either one of the following methods After the debugger gets started select Menu Setup gt Emulator gt System Start Debugger while holding down the Ctrl key 30 5 Setup the Debugger 5 3 1 MCU Tab The specified content becomes effective when the next being start MCU M16C29 meu Refer Serial No 2 M30290 3KM019 Self Check Debug Option W Enable the Address Match Interrupt Break Function Debug the program using the GPU Rewrite Mode J Enable the Trace Point Function 5 3 1 1 Specifying the MCU file MCU M30626 MCU Refer 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 i
63. cking again in the break point setting area S W breakpoints column In the Editor Source window a display of S W breakpoints column is set to Enable by default To erase this column deselect the S W breakpoints check box in the dialog box opened by choosing the main menu Edit gt Define Column Format The S W breakpoints column is erased from all Editor Source windows And select popup menu Columns gt S W breakpoints in the Editor Source window A column can be set up for each Editor Source windows 81 7 6 H W Break Point Setting Window The H W Breakpoint Setting window is used to set hardware breakpoints for the Emulators Setting modification flag Selecting of effective events Current event list ME Hw Break Points Setting ADDRE ACCE CONDITION 000000 FETCH addr 000000 000000 FETCH addr 000000 000000 FETCH addr 000000 000000 FETCH addr 000000 000000 FETCH addr 000000 000000 FETCH addr 000000 r Setting of combination condition Setting of Process ID The events listed below can be specified as break events If the contents of events are altered they are marked by an asterisk on the title bar The asterisks are not displayed after setting up the emulator Fetch Memory Access Bit Access amp Events at up to two points can be used The H W Break Point Setting window and the Trace Point Setting windows use the same reso
64. command Come cannot be executed in the internal ROM area 5 3 1 6 Choosing to use or not to use the trace point setting function Specify whether or not you want to use the trace point setting function By default the trace point function is unused V Enable the Trace Point Function Select the above check box when you use the event of Compact emulator as a trace point This specification can only be set or changed when you start Debugger Supplementary explanation When the trace point setting function is enabled the following limitations apply Hardware break function cannot use 33 5 3 2 Setting of the USB Interface USB communication uses the personal computer s USB interface It is compliant with USB 1 1 5 3 2 1 Setting of the USB Interface 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 Install of USB device driver The currently USB connected emulators are listed in the Serial No area Select the serial No of the emulator you want to connect Serial No 2 0290v 3 KMO19 v 34 5 Setup the Debugger 5 3 3 Debugging Information Tab The specified content becomes effective when the next being download Compiler Object Format IEEE 695 On Demand 5 3 3 1 display the compiler used and its object format Display the compiler used and its object file format Compiler N
65. cord On Record the executed commands to a file Off Stop recording the executed commands Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 78 7 Windows 7 5 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 Save Load Break Point Buttons Set Break Point Area S W Break Points S W Break Point OFOO00 0F00C2 36 GLOBAL C OFO12C 22 LOCAL C Display Break Points Operation Buttons to Break Points Ifyou 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 You can clear enable or disable software breakpoints selected by clicking in the software breakpoint display area You can also enable and disable software breakpoints by double clicking on them Click on the Save button to save the software break points in the file To reload software break point settings from the saved file click the Load button If you load software break points from a file they are added to any existing break points 79 7 5 1 Command Button The buttons on this window has
66. ction then sorts the data in descending order Note After recompilation the addresses may differ from those given in this section 6 2 Usage Please follow these instructions Step1 Starting the Debugger Step2 Checking the Operation of RAM Step3 Downloading the Tutorial Program Step4 Setting a Breakpoint Step5 Executing the Program Step6 Reviewing Breakpoints Step7 Viewing Register Step8 Viewing Memory Step9 Watching Variables Step10 Stepping Through a Program Step11 Forced Breaking of Program Executions Step12 Displaying Local Variables Step13 Stack Trace Function 6 3 Step1 Starting the Debugger 6 3 1 Preparation before Use To run the High performance Embedded Workshop and connect the emulator refer to 1 7 BFR TAR DNV ETA LI BRITAR MV ERA 6 3 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 7 BENERI ECA TI Bis BRODY ETA After the setup of a debugger it will function as a debugger 6 4 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
67. d When debugging the existing load module file with this product a workspace is created by this method 4 3 3 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 New Project Works Projects cn eee eg Workspace Name gt gt Debugger only M166 PC7501 JOOSample01 gt gt Debugger only M160 Starterk Project Name gt Debugger only RBC E SYSTEM DOSample0 gt gt Debugger only R8C E8 SYSTEM Directory D work HEW4 Sa mples M16C DOSample01 Browse GPU family M16G ht Tool chain None e Properties roen 1 Select the target CPU family In the CPU family combo box select the target CPU family 2 Select the target toolchain In the Tool chain combo box select None In this case toolchain is not used When the toolchain has not been installed the fixed information is displayed in this combo box 3 Select the project type When the toolchain is not used it is displayed on a Project Type list box as Debugger only Target Name Select it When two or more project types are displayed please select one of them Specify the workspace name and project name In the Workspace Name edit box enter the new workspace name
68. d 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 WV Enable HW Break PASS E ADDRESS 1 Al 0000 O 1 0000 1 43 0000 OD 1 44 0000 O 1 45 0000 OC 1 46 0000 When AND Same Time is selected In the event specification area the event used can be specified No pass counts can be specified iV Enable HAW Break PASS E ADDRESS 1 t 0000 O 1 42 0000 1 43 0000 OD 1 44 0000 O 1 45 0000 OC 1 46 0000 7 6 3 Command Button The buttons on this window has the following meanings Button Function Reset Discards the contents being displayed in the window and loads contents from the emulator in which they were set Save Saves the contents set in the window to a file Load Loads event information from a file in which it was saved Set Sends the contents set in the window to the emulator Close Closes the window 86 7 Windows 7 6 4 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
69. e Data 1 0034 Data 2 pooo Access WRITE v vw Mask D0FF ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 data amp 00FF 0034 oee 98 7 Windows 2nd point 42 Set Event Status Event Type DATA ACCESS v Address Data Setting Range addr Address X Address1 400 v Bl Address2 Function Source File Function v ACCESS file ADDRESS 0004 CONDITION ne 000400 data amp 00FF 0012 Cancel 42 Set Event Status Event Type DATA ACCESS v Address Data Setting Range data Data ht Data 1 0012 Data 2 1000 Access WRITE v IV Mask OOFF ACCESS ie ADDRESS 0004 CONDITION n 000400 data amp 00FF 0012 Cancel 99 16 bits bus width 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range addr Address Address1 400 v wl Address2 000 Function Source File E Function v ACCESS file ADDRESS 0004 CONDITION ne 000400 data 1234 Cancel 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range data Datal ht Data 1 fi 234 Data 2 IDO Access WRITE zl M Mask FFFF CONDITION ane 000400 data 1234 Cancel 100 7 Windows Example Writing data 10h 3Fh to
70. e 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 New Project Workspace Projects Workspace Name Empty Application Sample01 t5 Import Makefile Project Name Library Sa mple01 Directory D work HEW4 Samples M16C Sample01 Browse GPU family m160 x Tool chain Renesas M160 Standard hd Properties seen 1 Select the target CPU family In the CPU family combo box select the target CPU family 2 Select the target toolchain In the Tool chain combo box select the target toolchain name when using the toolchain 3 Select the project type In the Project typel list box select the project type to be used In this case select Application Please refer to the manual attached to your C C compiler package about the details of the project type which can be chosen Specify the workspace name and project name In the Workspace Name edit box enter the new workspace name In the Project Name edit box enter the project name When the project name is the same as the workspace name it needs not be entered In the Directory edit box enter the directory name in which the workspace will be created Click the Browse button to select a directory
71. e Radix Address Hex Line No Dec 140 9 Writing Script Files 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 You cannot include the assembler as30 structured instructions pseudo instructions macro instructions operation code or reserved words SECTION BYTE switch if etc You cannot use strings that start with two periods for symbols or labels Product Name Notes The debugger for M32R The debugger for M32C The debugger for M16C R8C You cannot include the assembler structured instructions pseudo instructions macro instructions operation code or reserved words SECTION BYTE switch if etc You cannot use strings that start with two periods for symbols or labels Local label symbol and scope This debugger supports both global label symbols which can be referenced from the whole program area and local label symbols which can only be referenced within the file in which they are declared The effective range of local label symbols is known as the scope which is measured in units of object files The scope i
72. e and used as 1 byte immediate values Notes You cannot register character constants only as C watchpoints Character constants are valid only when used in a C C expression that specifies a C watchpoint and when specifying a value to be assigned character constants are processed in the same manner as immediate values Character String Literals You can use character strings enclosed in double quote marks as character string literals Examples are abcde I am a boy etc Notes Character string literals can only be placed on the right side of an assignment operator in an expression They can only be used when the left side of the assignment operator is a char array or a char pointer type In all other cases a syntax error results 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 Enumeration Types When the result value of calculation has been defined its name is displayed DATE date Sunday all Radices If the result value of calculation has not been defined it is displayed as follows DATE date 16 when Radix is in initial state DATE date 0x10 when Radix is hex DATE date 0000000000010000B when Radix is binary 147 Basic Types When th
73. e breaks BreakAt Sets a software breakpoint by specifying a line No BreakIn Sets a software breakpoint by specifying a function 8 1 7 Address Interrupt Break Setting Commands Command Name Short Name Contents ADdressInterruptBreak ADIB Sets and checks the address interrupt break 133 8 1 8 Hardware Break Setting Commands Command Name Short Name Contents HardwareBreak HB Sets and checks a hardware break BreakMode BM Sets and checks hardware break mode 8 1 9 Real time Trace Commands Command Name Short Name Contents TracePoint TP Sets and checks a trace points TraceData TD Realtime trace data display TraceList TL Displays disassembled realtime trace data 8 1 10 Script Log File Commands Command Name Short Name Contents Script S Opens and executes a script file Exit Exits the script file Wait Waits for an event to occur before command input Pause 3 Waits for user input Sleep Halts for user input until the specified time has elapsed Logon 3 Outputs the screen display to a log file Logoff g Stops the output of the screen display to a log file Exec Executes external application 8 1 11 Program Display Commands Command Name Short Name Contents Func 5 Checks function names and displays the contents of functions Up
74. e end of the string 0 it is displayed up to the non printing character and the closing quote mark is not displayed indicating pointer type Value unsigned char str OxFOOOO 89 struct DATA pData 0x408 struct DATA pData 0x408 signed int nID oO unsigned char str OxFO005 83 5 You can double click on lines indicated by a to see the members of that structure or union The changes to a while the members are displayed To return to the original display double click the line now indicated by the 148 10 C C Expressions Array Types 1 When the result of calculation is an array type other than a char type the starting address is displayed in hex as follows signed int 10 z 0x1234 all Radices 2 When the result of calculation is a char type it is displayed as follows unsigned char 10 str 0x1234 Japan all Radices If the string contains a non printing code prior to the code to show the end of the string 0 it is displayed up to the non printing character and the closing quote mark is not displayed unsigned char 10 str 0x1234 Jap all Radices Also if the string contains more than 80 characters the closing quote mark is not displayed When the C C expression is an array type as same as pointer type a is display to the left of the type name You can see the elements of the array by using this indicating for the de
75. e result of calculation is a basic type other than a char type or floating point type it is displayed as follows unsigned int i 65280 when Radix is in initial state OxFFOO when Radix is hex unsigned int i 1111111100000000B when Radix is binary When the result of calculation is a char type it is displayed as follows unsigned char c J when Radix is in initial state unsigned char c Ox4A when Radix is hex unsigned char c 10100100B when Radix is binary When the result of calculation is a floating point it is displayed as follows double d 8 207880399131839E 304 when Radix is in initial state double d 0x10203045060708 when Radix is hex double d 0000000010 1000B when Radix is binary anses indicates abbreviation unsigned int i 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 string types unsigned char str 0x1234 Japan all Radices character types unsigned char str 0x1234 74 J all Radices When the result of calculation is a char type it is displayed as follows unsigned char str 0x1234 Jap all Radices If the string contains a non printing code prior to the code to show th
76. e start address and the size by a number of blocks of the RAM monitor area in the Start and the Size fields of this dialog box Set RRAM Area z Size 4 blocks Area 000400 0007FF Cancel Changing directly in the window Select the RAM monitor area you want to change from a list of RAM monitor areas and click again in its Start display column or Size display column Specify a new start address or a new size with which you want to be changed in the ensuing edit box Press the Enter key to confirm what you ve entered or the Esc key to cancel v1 4 000400 I 000400 000400 000 Changing the address Changing the size 7 1 4 Adding RAM Monitor Areas Click the Add button The Set RRAM Area dialog box will appear Specify the start address and the size by a number of blocks of a new RAM monitor area in the Start and the Size fields of this dialog box 7 1 5 Deleting RAM Monitor Areas Select the RAM monitor area you want to delete from a list of RAM monitor areas and click the Removel button To delete all RAM monitor areas click the Remove All button 72 7 Windows 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 prog
77. ed 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 When specifying two or more software breakpoints the breakpoint combination is based on the OR logic Arrival to any one of breakpoints breaks the target program 1 6 1 Setting of software breakpoint The software breakpoint can be set by the following windows Editor Source Window S W Break Point Setting Window You can double click the mouse to set reset the software breakpoint in the Editor Source window You can also switch to temporarily disable enable the software breakpoint in the S W Breakpoint Setting window 1 6 2 Area where software breakpoint can be set The area which can be set for software breakpoint varies depending on the product For the areas available for software breakpoint see the following The Internal RAM area and Internal ROM area can be designated for software breakpoint ATTENTION During target program execution a software break cannot be set as an internal ROM area 1 7 About Hardware Breaks Function The following designations are available as break events Address designation M Instruction fetch E Memory access M Bit access External trigger designation Interruption The number of events that can be s
78. ed hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this document but
79. eecseseeesesneeeeseaes 62 Reference 7 Windows 67 7 1 RAM Monitor Window rorornnnrvrrrsnnrrrrssnnvsrsnnrrrsssnnrnrsssnnvsrsnnnnrssennrsrsssnnrsrssnnrsssssnnvsrsssnnesssnnrsssnnnsee 68 TA Extended Menusyuasaanselk driaoleardsadksvidakadedhuaskdkad sdaiviare 70 7 1 2 Setting the RAM monitor area mrerrronrrerrrrrrrrrensnvrrrnenrsrensnnrnrrensrnerennrnnsensseesennnnnsenssneren 71 7 1 8 Changing the RAM Monitor Area rerernvorrrrrorsrensnvrrrnerrrrenennrnrnenssrenennrnnnensseerennvnnsensnenen 72 7 1 4 Adding RAM Monitor Areas ccccccccccccesssssscecececsessnsscecececeesesnsaeseeeceesesssaeseesesesentsasaeeess 72 7 1 5 Deleting RAM Monitor Areas ccccccccccecessssssceeececsesessscecececeenenssseceesceesesssaeeeeeeeesennsasaeeees 72 ii 7 2 ASM Watch Window cccccccccsscccesssececseceeseesseeeceesaeeeceseeeeeeseeecsesaeeeceeeeesessaeeecsesaecsceeeeeeneaeeneaaes TAA Extended Menusi e E ETRE essens sedvane sd sde tende 7 3 C Watch Window eanorrrroonnvvrrrnnrrvrrennrrrrssnnvsrssnrsrsssnnrsrsssnnrsrsnnnsesssnnnsrsssnnvsrsnnrsssssnnrsrsssnsssrsnnssssnnnsee Til Extended Menus icc cciesiin a Senses Heb epedk dis baste oul ge a docs daa teas Oaa e ESEE TASCri pt AnaS O hy AAIE EE EE EEE E EE AOE EE E EAE AEE EEE AE AT T4 1 Extended Menus inresa n a e E E E E N 7 5 S W Break Point Setting Window 7 5 1 Command Button 7 5 2 Setting and Deleting a Break Points from Editor Source Window rervrrvrrrvr
80. eeenses 16 4 Preparation before Use 17 4 1 Preparation before Us uuusuualkamii mase eee 17 4 2 Workspaces Projects and Files rrrnnnnnanananananenenenenenanenenenenenenenenenenenenenenenenenenenenenenenenenenenennnnns 17 4 3 Starting the High performance Embedded Workshop cccccccsseessssesececeesenscesceeceesentsaeeeeees 18 4 3 1 Method for Activating High performance Embedded Workshop rrrrrrrrrvvrrrrnnvnrrrrnnrnrr 18 4 3 2 Creating a New Workspace Toolchain Used c cccccccsccssesssssesscsseescsscesessecesesscsseeseneees 19 4 3 3 Creating a New Workspace Toolchain Not Used cc cccccscssccssesssssesscsseesessecsessesesessens 24 4 4 Starting the Debugger eenean satel ca cevesovscdslecsddsvesuecsdaeessidduvenudectedsteesdeveetaaceeavasectesedee 28 A4 As1 Connecting the Emulatore kanenn n A A tai bee sada aes caw dae ad 28 4 4 2 Ending the Emulator 2 isis iiien aire E sesdcebdedescdeccseece 28 5 Setup the Debugger 29 5 1 Setup the Debugger for M16C R80C rvrnrrrrrnnnnnrnrnrnssrrnennrnrnenssersennrnrnenssnesennnnnnenssnenennnnrsennsnssenene 29 5 TJ Int Di logiskatarien AE abcde vee coca asa see chante oa Gobet de Souk atdet ante 29 52 MCU Setting Dialogs ck ict nose eeccbas lt oeas Pen e N AE 29 53 Init Dralogusskansstessttkdesvisteassakedamn astra eee 30 53 21 MCOU Tabsseaaadsnadka frakker Seen 31 5 3 2 Setting of the USB Interface rrmnmmnrrrrannnnrvrnsrrrrensnvrrrnerssrenannrnrrenssrerennrnnnenssee
81. efore a change function tutorial c j rand ifGi lt 0 J ali J sorta chanze a sam s0 a 0 sam sl a 1 sam s2 a 2 sam s3 a 3 sam s47 a 4 Note It takes time to execute this function When the calling source is clarified use Go To Cursor 58 6 Tutorial 6 12 3 Executing Step Over Command The Step Over command executes a function call as a single step and stops at the next statement of the main program To step through all statements in the change function at a single step select Step Over from the m Debug menu or click the Step Over button 0 on the toolbar The PC cursor moves to the next position of a change function tutorialc for t 0e b lt me AA j rand IFE lt 0 j j ali j sorta changea sam s0 a 0 sam sl a 1 sam s2 a 2 sam s3 a 3 sam s4 a 4 sam s5 a 5 sam sb a 6 sam s7 a 7 sam s8 a 8 sam s9 a 9 59 6 13 Step11 Forced Breaking of Program Executions This debugger can force a break in the execution of a program 6 13 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 1 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
82. equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under ce
83. es only the cycles where specified condition does not hold true Also following three write modes are supported frr Only cycles where specified event is established _ ML Cycles from where specified event is established to where specified event is not established 1 Cycles from where start event is established to where end event is established 117 7 8 5 Command Button The buttons on this window has the following meanings Button Function Reset Discards the contents being displayed in the window and loads contents from the emulator in which they were set Save Saves the contents set in the window to a file Load Loads event information from a file in which it was saved Set Sends the contents set in the window to the emulator Close Closes the window 118 7 Windows 7 8 6 Specify the write condition Trace data write conditions can be specified You can specify the following write conditions Write conditions unlimited default Cycles from the start event established to the end event established Only cycles where the start event is established Cycles from the start event established to the start event unestablished Other than cycles from the start event established to the end event established Other than cycles where the start event is established Other than cycles from the start event established to the start event unestablished NAP
84. eseesueeessesaeessneeaes 8 1 8 About Address Interrupt Breaks Function essronanororrrnrrrrrennnnrrrnsnrerensnnrrnnssnsrensnnrnnnsnnsrensnnrvenene 9 1 8 1 Setting and Deleting a Break Points rrrerrernnnnrorrrnrsrrrennnnrnrnsnrsrensnnrnnnenrsrensnnrnnnensseensnnnen 9 1 9 About Real time Trace Function ccccccccsssccesssececsesceccesssececssaeeeecseeeecsssuececsesaeeessueeeeseseeesseaees 10 T9 1 Tr c ALS username ee Ga res at 10 1 9 2 Trac Condition S ttinguuusksadejalkdensesnikkerikstnsmnedenansaiketi 11 1 9 3 Trace Data Write Conditions eieae a a E E e a 11 2 About the Compact Emulator 12 2 1 Communication Method ccccccccssssececsessececseeeecsssececseseeeecseeeecsesaeeecseseeeecsueeeesesaeeeesesaeeesneeensas 12 2 2 HORACE TON AUNT 1 0 Ke ESEE NE EE E EE E E E EEE E E E EEEE EER 12 3 Starting Setup of Debugger 13 3 1 Communication method by emulator ccccccccccecssssscecececsessssscecececsesessecesececeeneassseseeeceesensaaeeeeecs 13 3 1 1 USB Iiiterfaceuru steed tek Sesh eae ee SEG 13 3 2 Download Of Firmware pee a a sakket Oe eet 14 3 3 Setting before emulator Starts cccccccscssscccccecsessssscecececcecsesssaeceeececsessaseeecceceessasaeeeescsensaeeeeees 15 3 3 1 USB communication with the Emulator rrrororrnnrrrrronnrrrrssrvrrrrnrrrrrrnnrnrrrsrrrsrsnnrsrsrsnnnne 15 3 4 Install of USB device Ariver cccccecesccccessseceesssceceessececseseeeecsneeeecsesaeeecseasececseeecsesueeecsesaesses
85. even address 400h 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range Gddr Address1 v Address1 400 amp 5 Address2 JOU I Function Source File Function F ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 0010 lt data amp 00FF lt 003F oree 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Ranee Datat lt data lt Data v Data 1 fi 0 Data 2 BF Access WRITE v Mask fo0od ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 0010 lt data lt 008F oree 101 7 6 6 2 Reading writing data to the specified address range Set as below Example Writing data to addresses ranging from 400h to 40Fh Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Adderss1 lt faddr lt Address2 v Addresst 400 g address Fv mn Function Source File z Function z ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range Not Specify v Data 1 fi 00 Data 2 m Access WRITE v Mask 0000 ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F oee 102 7 Windows
86. get to connect After the session name is selected the dialog box for setting the debugger is displayed and the emulator will be connected Details 4 4 2 Ending the Emulator The emulator can be exited by using the following methods 1 Selecting the DefaultSession Select the DefaultSession in the list box that was used at the time of emulator connection 2 Exiting the High performance Embedded Workshop Select Exit from the File menu High performance Embedded Workshop will be ended The message box that asks whether to save a session will be displayed when an emulator is exited If necessary to save it click the Yes button If not necessary click the No button 28 5 Setup the Debugger 5 Setup the Debugger The contents of an setup of a debugger differ depending on the product 5 1 Setup the Debugger for M16C R8C 5 1 1 Init Dialog In the Init dialog box set up the contents listed below The Init dialog box appears when the debugger starts up Please click the tab name of the table about details Tab Name Contents MCU Specify the setting the MCU file Communication Interface and so on Debugging Information Specify the compiler used storing of debugging information ahead Emulator Specify the taget clock the direction of input and output of the cable Script Specify the operation when the debugger starts To keep the Init dialog closed next time the debugger is st
87. gned short int 154 12 Attention 12 2 5 Target MCU HOLD terminal When the target MCU HOLD terminal is set to LOW you cannot stop execution of the target program Set the HOLD terminal to High and try to stop the target program again Even if the HOLD terminal is set to LOW for a short period of time you may stop the target program with the HOLD terminal set to LOW If this happens try to stop the target program again 12 2 6 Hardware break function While running program the following operations are not performed execute BreakMode command open H W break point setting window 12 2 7 Hardware Event If you specify word length 2 byte length data from an odd address as an event in the following data accesses the event is not detected Also even when any other bit of the address that contains a specified bit is accessed during bit access the event may become effective Hardware Break Event Real time Trace Event 155 12 3 Options for compiler assembler and linker The information may not be downloaded debugged normally depending on the option designation of the compiler assembler and linker Please refer to the following for the option specification C When using NCxx When using the IAR C Compiler EW When using the IAR C Compiler ICC When using the TASKING C Compiler EDE When using the TASKING C Compiler CM C When using the IAR EC Compiler EW We do not evaluate other sett
88. h this debugger The trace area of the following 5 mode is being supported Break 64K cycles before target program stops Before 64K cycles before trace point About 32K cycles either side of trace point After 64K cycles after trace point e Full Until 64K cycles are written in the trace memory Start Trace Event Stop Event Break is set by default To refer the execution history before stopping the target program use Break designation of trace event is not required To refer the execution history at any position or to continue execution of the target program specify the trace event and change the trance range 10 1 Features 1 9 2 Trace Condition Setting The following designations are available as trace events Address designation M Instruction fetch E Memory access M Bit access External trigger designation eight events Interruption The number of events that can be specified are two events of all These break events can be combined as below Trace when all of the valid events are established AND condition Trace when all of the valid events are established at the same time And same time comdition Trace when one of the valid events is established OR condition 1 9 3 Trace Data Write Condition Trace data write conditions can be specified You can specify the following write conditions Write conditions unlimited default Cycles from the start event established to the end event
89. ics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics xtENESAS C 7 D me on lt D D M16C R8C Compact Emulator Software User s Manual Renesas Microcomputer Development Environment System R Electroni enesas Electronics Rev 1 00 2005 02 www renesas com 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 All other brand and product names are trademarks registered trademarks or service marks of their respective holders Keep safety first in your circuit designs Renesas Technology Corporation and Renesas Solutions Corporation put the maximum effort into making semiconductor products better and more reliable but there is always the possibility that trouble may occur with them Trouble with semiconductors may lead to personal injury fire or property damage Remember to give due consideration
90. ings so we can not recommend to append other options 12 3 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 3 2 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 gt 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 Include Tab In the XCL File Name area specify your XCL file ex Inkm16c xcl 2 Edit the XCL file Add the command line option y to your XCL file The designation of y option varies depending on the product Product Name y Option The debugger for M16C R8C ylmb 3 Build your program after the setting above In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 156 12 Attention 12 3 3 When Using the IAR C Compiler ICC 12 3 3 1 Specify the Option Please compile
91. 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 Specified hardware break events can be used in one of the following combinations Break when all specified break points are effected And Break when all specified break points are effected simultaneously And Same Time Break when any one of the specified break points is effected Or Address Interrupt Break This function stops the target program immediately before executing an instruction at a specified address This function is realized by using the MCU s address interrupt interrupt When debugging the MCU s address interrupt interrupt function deselect the Enable the Address Match Interrupt Break Function check box on the MCU tab of the Init dialog box That way the address interrupt break function is disabled 1 3 Real Time Trace Function This function records a target program execution history Up to 64K cycles of execution history can be recorded This record allows inspecting the bus information executed instructions and source program execution path for each cycle 1 4 GUI Input Output Function This function simulates the user target system s key input panel buttons and output panel on a window Buttons can be used for the input panel and labels strings and LEDs can be used for the output panel 1 Features 1 5 About RAM Monitor Fu
92. ion Priority level O Brackets level 1 Pye Monadic positive monadic negative monadic logical NOT level 2 Dyadic multiply dyadic divide level 3 ar Dyadic add dyadic subtract level 4 gt gt Right shift left shift level 5 amp Dyadic logical AND level 6 Dyadic logical OR dyadic exclusive OR level 7 lt lt gt gt Dyadic comparison level 8 143 10 C C Expressions 10 1 Writing C C Expressions You can use C C expressions consisting of the tokens shown below for registering C watchpoints and for specifying the values to be assigned to C watchpoints Token Example Immediate values 10 Ox0a 012 1 12 1 0E 3 Scope name classname member Mathematical operators ayy ah Pointers eR Reference amp Sign inversion Member reference using comma Object Member Member reference using arrow Pointer gt Member this gt Member Pointers to Members Object var Pointer gt var Parentheses 4 Arrays Array 2 DArrayl 2 3 Casting to basic types int char unsigned long Casting to typedef types DWORD ENUM Variable names and function names var i j func Character constants TAN b es Character string literals abcdef I am a boy Immediate Values You can use hexadecimals decimals octals as immediate values Values starting with Ox are processed as hexadecimals those with 0 as
93. ion of which the value is an integer between Oh and FFFFFFFFh to be assigned in a macro variable If you specify a negative number it is processed as twos complement You can use macro variables within the expression Always precede macro variables with the sign Conditional Statement In a conditional statement different statements are executed according to whether the condition is true or false The following shows the format to be used if expression statement 1 else statement 2 endi If the expression is t rue other than 0 statement 1 is executed If false 0 statement 2 is executed You can omit the else statement If omitted and the expression is false execution jumps to the line after the endi statement if statements can be nested up to 32 levels 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 Ifthe 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 Use the break statement to forcibly exit a while loop If while statements are nested break exits from the inner most loop 139 Comment statements You can include comments in a script file
94. isticated 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 63 Reference 66 7 Windows 7 Windows The window of this debugger is shown below Window Name View Menu RAM Monitor Window View gt CPU gt RamMonitor ASM Watch Window View gt Symbol gt ASMWatch C Watch Window View gt Symbol gt CWatch Script Window View gt Script S W Break Point Setting Window View gt Break gt S W Break Points H W Break Point Setting Window View gt Break gt H W Break Points Address Interrupt Break Point Setting View gt Break gt Address Interrupt Break Points Window Trace Point Setting Window View gt Trace gt Trace Points Trace Window View gt Trace gt Trace GUI I O Window View gt Graphic gt GUI 1 0 For the reference of the following windows refer to the help attached to a High performance Embedded Workshop main part Differences Window Map Window Command Line Window Workspace Window Output Window Disassembly Window Memory Window IO Window Status Window Register Window Image Window Waveform Window Stack Trace Window 7 1 RAM Monitor Window The RAM monitor window is a window in which changes of memory con
95. ize Reevaluates the selected C watchpoint Set New Value Set new data to selected C watchpoint Radix Hex Display in Hexadecimal Bin Display in Binary Default Display in Default Radix Toggle All Variables Change radix toggle Refresh Refresh memory data Hide type name Hide type names from variables Show char as string Selects whether to display char type as a string Sort Sort by Name Sort variables by its name Sort by Address Sort variables by its address RAM Monitor Enable RAM Monitor Switch enable or disable RAM moniter function Sampling Period Set RAM monitor sampling period Add New Tab Add new tab Remove Tab Remove the selected tab Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 76 7 Windows 7 4 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 Toolbar Script Ol x AEE ET BK Om Script Script File Name Log Log File Name gt assemble _main ADDRESS gt LABEL PROGRAM OFO042 main gt Execution Result Area assemble _main Command History Area
96. lt 130 T0 1 Bxt nded Menusursaasumsteaqed4uia eksen 131 Table of Script Commands 132 8 1 Tabl of Seript Commands nsvnaliiseennissssdvevseenedvteirreeviserenee vii bevteeeedrradsieede 132 8 1 1 Execution Commands sessen e res apene Hee es 132 8 1 2 File Operation Commands rrrrnnnnrvrnrrrrrrnannrnrrnnssrsrennnnrrrnssresensnnrrensnssrensnnrnnnsneseensnnnnnnene 132 8 1 3 Register Operation COMMANAS cccccccessesssececececeessscecececscsesssseceeeceesessaueceeeeseeentaaes 132 8 1 4 Memory Operation Commands c ccccccccssssssceseeececeessssecececccsesssseceeceeesesssaeceeeceeeentaaeas 133 8 1 5 Assemble Disassemble Command s ccccsccccssssesecssceceessececseaececseeeeesesaeeecsesaesessseeeenes 133 8 1 6 Software Break Setting Commandg rrrannrnrnnnssessannnnnnrnsernrensnnrnnnsnesrennnnrnnnsnrssensnnnnnnene 133 8 1 7 Address Interrupt Break Setting Commands ccccccccccceceesssceceeececsessueceeeceeeeseaaees 133 8 1 8 Hardware Break Setting Command ccccccccccccessesssceeececsesssseceeececsenenssseeeeseeesenseaeees 134 8 1 9 Real time Trace Command ccccsccccssssssecesssecesssssecseeesecsssaeceensusecseaaesesseseecssssnsecees 134 8 1 10 Seript Log File Command ccccccccccccessessscesececeecesssceceeeceesesssaeseceesesestsseeeeeeeeeensaaes 134 8 1 11 Program Display Commands ccccccccccessssssseseeeceeeessscececececsenssseseeececsesesaeeeeseeeeentaaees 134 8 1 12 Clock Command iseine
97. mands that allow efficient program debugging 1 Step In Executes each statement including statements within functions 2 Step Out Steps out of a function and stops at the statement following the statement in the program that called the function 3 Step Over Executes a function call in a single step 4 Step Steps the specified times repeatedly at a specified rate 6 12 1 Executing Step In Command The Step In command steps into the called function and stops at the first statement of the called function To step through the sort function select Step In from the Debug menu or click the Step In F button on the toolbar The PC cursor moves to the first statement of the sort function in the Editor Source window s t sort c p_sam gt s5 p_sam gt s p_sam gt s p_sam gt s8 p_sam gt s9 sort long a od long t int ls Jo ks gapi gap 5 while gap gt 0 fort k 0 k lt gap ktt fort i ktgap i lt 10 i itgap for j i gap j gt k j j gap i iftalj gt a jt zar t alj ali a j gap 57 6 12 2 Executing Step Out Command The Step Out command steps out of the called function and stops at the next statement of the calling statement in the main function To step out of the sort function select Step Out from the Debug menu or click the Step Out p button on the toolbar The PC cursor slips out of a sort function and moves to the position b
98. mmunication cannot be used in any other OS Compliant with USB Standard 1 1 Connections via USB hub are not supported By connecting the host computer and the emulator with USB cable it is possible to install the supported device drivers using a wizard The necessary cable is included with the emulator 13 3 2 Download of Firmware It is necessary to down load the firmware which corresponds to connected Compact Emulator when the debugger is started to the emulator 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 Compact Emulator to establish the maintenance mode This debugger searches the version of the firmware downloaded to the emulator at start Also when the firmware downloaded to the emulator is of old version a mode which drives this debugger to download firmware is set When this debugger gets started while the emulator is set in the mode which drives the debugger to download firmware forcedly the following dialog is opened at start Click the OK button to download the firmware You need to download new firmware to use this debugger Cancel 14 3 Starting Setup of Debugger 3 3 Setting before emulator starts 3 3 1 USB communication with the Emulator Connection of USB devices is detected by Windows Plug amp Play function The device driver needed for the connected USB device is autom
99. n each script file Expressions included in script files are evaluated as unsigned types Therefore operation cannot be guaranteed if you use negative values for comparison in if or while statements You can specify up to 4096 characters per line An error occurs if a line exceeds this number of characters When a script file containing illegal commands is automatically executed when you select Option gt Script gt Run from the Script Window menu after opening a script file or click the button in the Script Window execution of the script file continues even after the error is detected except when the script line itself cannot be read If an error is detected and the script file continues to be executed operation after detection of the error cannot be guaranteed Reliability cannot therefore be placed on the results of execution after an error has been detected 138 9 Writing Script Files 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 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 You can specify any express
100. n the MCU area of the MCU tab 5 3 1 2 Setting of the Communication Interface The displayed data varies depending on the specified communication interface The available communication interface varies depending on the products The following shows the setting for each communication interface 5 3 2 Setting of the USB Interface 31 5 3 1 3 Executing Self Check Specify this option to execute self check on the emulator when the debugger starts up Self Check Be sure to select the above check box only when you want to perform self check at startup Specify this option in the following cases When the firmware cannot be downloaded When although the firmware is successfully downloaded the debugger does not start When the MCU goes wild or something is wrong with the trace results and you want to check whether the emulator is operating normally Select the check box to close the Init dialog box After connecting to the emulator and confirming the firmware the debugger will immediately start self check on the emulator Self check takes about 30 seconds to 1 minute If an error is found in this self check the debugger displays the content of the error and is finished When the self check terminated normally the dialog box shown below is displayed When you click OK the debugger starts up directly in that state p dawr e j The self check succeeded This specification is effective only when the debugger
101. nction 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 5 1 RAM Monitor Area This debugger has 1 Kbytes of RAM monitor area which can be located in any contiguous address location or in 4 separate blocks comprised of 256 bytes each specified in a divide into 16 block 000000 continuous area 000000h OOOFFFh FFFFFFh FFFFFF H 1 5 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 Communication interface Number of the RAM Monitor windows displayed Size of the RAM Monitor window displayed Number of ASM watch points within the RAM monitor area of the ASM Watch window Number of C watch points within the RAM monitor area of the C Watch window 1 5 3 Related Windows The window where the function of the real time RAM monitor function can be used is shown below RAM Monitor Window ASM Watch Window C Watch Window 1 Features 1 6 About Software Breaks Function Software Break breaks the target program before execution of the command at the specifi
102. nts This window is available only when the address interrupt break function is used Use the MCU tab in the Init dialog box to specify whether or not to use the address interrupt break function On this tab select the Enable the Address Match Interrupt Break Function check box The number of address interrupt breakpoints that can be set varies with each product Breakpoints can be specified by Address or Filename Line No Ifyou have set multiple breakpoints program execution stops when any one break address is encountered OR conditions You can clear enable or disable breakpoints selected by clicking in the breakpoint display area You can also enable and disable breakpoints by double clicking on them Click on the Save button to save the software break points in the file To reload software break point settings from the saved file click the Load button Ifyou load breakpoints from a file they are added to any existing break points 108 7 Windows 7 7 1 Command Button The buttons on this window has the following meanings Button Function Load Load setting information from a file in which it was saved Save Save the contents set in the window to a file Help Display the help of this window Add Add the break point Refer Open file selection dialog box Close Close the window Delete Remove the selected break point Delete All Rem
103. octals and those without either prefix as decimals Floating point numbers can also be used to assign values to variables Notes You cannot register only immediate values as C watchpoints The immediate value is effective only when it is used in C C language expressions that specify C C watchpoints or when it is used to specify the value to be assigned to those expressions When using floating point numbers operation cannot be performed on an expression like 1 0 2 0 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 0 0 Notes There is no support currently for mathematical operators for floating point numbers 144 10 C C Expressions Pointers Pointers are indicated by the asterisk You can use pointer to pointers and pointer to pointer to pointers etc k ok Examples variable name variable name etc Notes Immediate values cannot be processed as pointers That is you cannot specify 0xE000 for example Reference References are indicated by the ampersand amp You can only specify amp variable name 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 No
104. ogram execution Status gt Checks the operating status of the MCU Step S Halts for user input until the specified time has elapsed StepInstruction SI Step execution of instructions OverStep O Overstep execution of source lines OverStepInstruaction OI Overstep execution of instructions Return RET Executes a source line return ReturnInstruction RETI Executes an instruction return Reset Resets the target MCU Time Sets the run time display and checks the current setting 8 1 2 File Operation Commands Command Name Short Name Contents Load L Downloads the target program LoadHex LH Downloads an Intel HEX format file LoadMot LM Downloads a Motorola S format file LoadSymbol LS Loads source line ASM symbol information Reload E Re downloads the target program UploadHex UH Outputs data to an Intel HEX format file UploadMot UM Outputs data to a Motorola S format file 8 1 3 Register Operation Commands Command Name Short Name Contents Register R Checks and sets a register value 132 8 Table of Script Commands 8 1 4 Memory Operation Commands Command Name Short Name Contents DumpByte DB Displays the contents of memory in 1 byte units Dump Word DW Displays the contents of memory in 2 byte units DumpLword DL Displays the contents of memory in 4 byte units SetMemoryByte MB Checks and changes mem
105. ombined in one of the following ways M Trace when all of the valid events are established AND condition E Trace when all of the valid events are established at the same time simultaneous AND condition m Trace when one of the valid events is established OR condition 111 7 8 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 Event name Specify the event type B1 Set Event Status Fetch Setting Range dd Addressl v Address1 main l Address2 pl Function Source File z Function v ACCESS FETCH ADDRESS main NDITION addr OFO02C Contents change with the setting of Event Type 112 7 Windows Following events can be set by specifying Event Type in this dialog box m When FETCH is selected Traces for the instruction fetch addr Address mx man d m When DATA ACCESS is selected Traces for the memory access Data lt data lt Data H oS oS Rw Ay FFFF 113 When BIT SYMBOL is selected Traces for the bit access 114 7 Windows 7 8 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
106. ore Use 4 1 Preparation before Use Please run the High performance Embedded Workshop and connect the emulator 4 3 Starting the High performance Embedded Workshop 4 4 Starting the Debugger In addition in order to debug with this product it is necessary to create a workspace 4 2 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 Thus each workspace contains one or more projects and each project contains one or more files iz workspace Workspaces allow you to group related projects together For example you may have an application that needs to be built for different processors or you may be developing an application and library at the same time Projects can also be linked hierarchically within a workspace which means that when one project is built all of its child projects are built first However workspaces on their own are not very useful we need to add a project to a workspace and then add files to that project before we can actually do anything 17 4 3 Starting the High performance Embedded Workshop 4 3 1 Method for Activating High performance Embedded Workshop Activate the High performance Embedded Workshop from Programs in the Start menu The Welcome
107. orted CPU This help explains the debugging function corresponding to the following CPUs M16C Tiny R8C Tiny Series Note In this help the information which depends on this CPU is described as for M16C R8C Setup of Debugger 1 Features 3 1 1 Real Time RAM Monitor Function ccccccccccccsssceceessececseeececseececeesececsesaeeecseeeesessaeeeesssaeeesneeees 3 1 2 Br ak Functonsiunsan kaste Bh deudeitehsaas a ved eaioatersaehacdeede Gages a niet saeco 3 1 3 Real Time Trace F nctioh erore ne eed be Bes oi E th cc Pelee Nees E ade evel ten eesti 3 1 4 GUL Input Output FUNCHOR as eel GS secdeaeseendeseds a ds Wiest eset BE 4 1 5 About RAM Monitor Function ccccccccccsssecesssccecesssececseccececseececsssaeeecsesaeeeceessesessueeessesseeeseaaees 5 1 5 1 RAM Monitor Areas v2 2 cccsvestetesraciivsseie ep a Hee inn aan aioe 5 1 5 2 Sampling Period eriep E EAN E EEEE ENE E EAN S ae EONS EEEE EENS 5 1 5 3 Related Windows e aea E a e aaa veie K iana 6 1 6 About Software Breaks Function ccccccccssccecssceceesseececseseeeecseeeecessaeeecsesaeeecsesaeeessaeeesseseeeeneaees 7 1 6 1 Setting of software breakpoint cccccccccccecsesssssscececececsesseseceeecseseeaeceecesesensaaeeeeeeeesensea 7 1 6 2 Area where software breakpoint can be set ccccccccccccessessscecececsessnssceeececeenesssaeeeeeceeeeeneea 7 1 7 About Hardware Breaks Function 0 ccccccccesssscecesssececcseeaececseeeeceeseeeecsesseeeceese
108. ory contents in 1 byte units SetMemory Word MW Checks and changes memory contents in 2 byte units SetMemoryLword ML Checks and changes memory contents in 4 byte units FillByte FB Fills a memory block with the specified data in 1 byte units FillWord FW Fills a memory block with the specified data in 2 byte units FillLword FL Fills a memory block with the specified data in 4 byte units Move Moves memory blocks MoveWord MOVEW Moves memory blocksGn 2 byte units 8 1 5 Assemble Disassemble Commands Command Name Short Name Contents Assemble A Line by line assembly DisAssemble DA Disassembles memory contents line by line Module MOD Displays modules names Scope Sets and checks the effective local symbol scope Section SEC Checks section information Bit Checks and sets bit symbols Symbol SYM Checks assembler symbols Label Checks assembler labels Express EXP Displays an assembler expression 8 1 6 Software Break Setting Commands Command Name Short Name Contents SoftwareBreak SB Sets and checks software breaks SoftwareBreakClear SBC Clears software breaks SoftwareBreakClearAll SBCA Clears all software breaks SoftwareBreakDisable SBD Disables software breakpoints SoftwareBreakDisableAll SBDA Disables all software breaks SoftwareBreakEnable SBE Enables software breakpoints SoftwareBreakEnableAll SBEA Enables all softwar
109. oss tool ELF DWARF2 TASKING ELF DWARF2 format file When Using Tasking cross tool 3 Then register the corresponding download module in the Download ne list box download module can be specified in the dialog opened with a Add button ost 03 Format IEEE695_ RENESAS ov Cancel Filename D HEW4 samples M16C demox30 gt Browse Access size hoo x Download debug information only Perform memory verify during download Download automatically on target connection amp Enter the offset at which to load the download module in the Offset edit box 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 Specifies the access size for the current download module in the Access size list box After that click the OK button 27 4 4 Starting the Debugger The debugging can be started by connecting with an emulator 4 4 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 tar
110. our XCL file ex Inkm32cf xcl 2 Edit the XCL file Add the command line option y to your XCL file The designation of y option varies depending on the product Product Name y Option The debugger for M16C R8C yspc 3 Build your program after the setting above In the options other than the above mentioned the operation check is not done Please acknowledge that the options other than the above mentioned cannot be recommended 159 memo 160 M16C R8C Compact Emulator Software User s Manual Publication Date Feb 01 2005 Rev 1 00 l Sales Strategic Planning Div Published py Renesas Technology Corp Microcomputer Tool Development Department Edited by Renesas Solutions Corp 2005 Renesas Technology Corp and Renesas Solutions Corp All rights reserved Printed in Japan M16C R8C Compact Emulator Software User s Manual ratENESAS Renesas Electronics Corporation 1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan REJ10J0879 0100Z
111. ove all break points Enable Enable the selected break points All Enable Enable all break points Disable Disable the selected break point All Disable Disable all break points View Shows the selected breakpoint positions in the Editor Source window 109 7 7 2 Setting and Deleting a Break Points from Editor Source Window The address interrupt break function can only be used when the address match interrupt is not used in the user application For details refer to 1 8 About Address Interrupt Breaks Function 7 7 2 1 Setting and Deleting a Break Point from Editor Source Window You can set break points in the Editor Source Window To do so double click the break point setting area Address Match Interrupt Break column for the line in which you want to set the break A blue marker is displayed on the line to which the break point was set while gap gt 0 Df for k 0 k lt gaps ktt fort i ktgap i lt 10 i itgap for j i gap j gt k j j gap i iftali gt alij zap t t ali ali alitgap aljtgap t 1 Double click You can delete the break point by double clicking again in the break point setting area Address Match Interrupt Break column In the Editor Source window a display of Address Match Interrupt Break column is set to Enable by default To erase this column deselect the Address Match Interrupt Break check box in the dialog box opened by choosing the main menu
112. p5 Executing the Program Execute the program as described in the following 6 7 1 Resetting of CPU By default CPU is not reset after downloading a program ET To reset the CPU select Reset CPU from the Debug menu or click the Reset CPU button on the toolbar 6 7 2 Executing the Program To execute the program select Gol from the Debug menu or click the Go button on the toolbar The program will be executed up to the breakpoint that has been set and an arrow will be displayed in the S W Breakpoints column to show the position that the program has halted Balal init amp sam for i 0 i lt 10 itt I j rand iffi lt 0 I tee ali j sorta changela sam sO a 0 sam sl al1 sam s2 a 2 sam s3 a 3 sam s4 a 4 sam s5 a 5 sam s6 a 6 sam s7 a 7 sam s8 a 8 sam s9 a 9 Note When the source file is displayed after a break a path of the source file may be inquired In this case please specify the location of a source file 50 6 Tutorial 6 7 3 Reviewing Cause of the Break The break factor is displayed in the Output window xj Connected T S W break Version Control 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
113. pecified are two events of all For the address designation method instruction fetch and memory access allow the range designation and logical condition designation in addition to the normal one address designation Moreover instruction fetch allows you to specify the function name Memory access allows you to specify the comparison data to read write data related to the specified address in the same manner as when setting the H W breakpoint It also allows mask designation to the comparison data These break events can be combined as below Trace when all of the valid events are established AND condition Trace when all of the valid events are established at the same time simultaneous AND condition Trace when one of the valid events is established OR condition 1 Features 1 8 About Address Interrupt Breaks Function This function stops the target program immediately before executing an instruction at a specified address This function is realized by using the MCU s address match interrupt The address interrupt break function can only be used when the address match interrupt is not used in the user application The count of breakpoints depends on the connected MCU Note The address interrupt break function can only be used when the Enable the Address Match Interrupt Break Function check box on the Init dialog box MCU tab is selected 1 8 1 Setting and Deleting a Break Points The address interrupt beakpoint can be set
114. r when resetting the target program Options for compiler assembler and linker TASKING C Compiler Target MCU HOLD terminal Hardware break function Hardware Event 12 2 1 Map of stack area used by the compact emulator The compact emulator uses the interrupt stack area as its work area 20 bytes When debugging allocate a sufficient interrupt stack area consisting of the regularly used size plus 20 bytes 12 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 3 Options for compiler assembler and linker The information may not be downloaded debugged normally depending on the option designation of the compiler assembler and linker Please refer to the following for the option specification C When using NCxx When using the IAR C Compiler EW When using the IAR C Compiler ICC When using the TASKING C Compiler EDE When using the TASKING C Compiler CM C When using the IAR EC Compiler EW We do not evaluate other settings so we can not recommend to append other options 12 2 4 TASKING C Compiler When you debug programs compiled by the TASKING C Compiler CCM16 the type of bit field is fixed on unsigned short int Because CCM16 outputs the debug information for the type of bit field as unsi
115. ram execution Toolbar 5 x Address Bit 080000 __RUNtsk 080655 _Buf Tsk 1 084620 Dbg_ent 0108C 4 Dbg_mode Address Bit No Data Length Data Expression Radix The addresses to be registered are called the watchpoints One of the following can be registered m Address can be specified using a symbol E Address Bit number E Bit symbol The registered watchpoints are saved in the debugger when the ASM watch window is closed and are automatically registered when the window is reopened If symbols or bit symbols are specified for the watchpoints the watchpoint addresses are recalculated when downloading the target program The invalid watchpoints are marked by lt not active gt when displayed on the screen The order in which the watchpoints are listed can be changed by a drag and drop operation The watchpoint expressions sizes radixes and datas can be changed by in place editing ATTENTION The RAM monitor obtains the data accessed through the bus Any change other than the access from the target program will not be reflected Ifthe display data length of the RAM monitor area is not 1 byte the data s access attribute to the memory may varies in units of 1 byte In such a case that the access attribute is not unified within a set of data the data s access attribute cannot be displayed correctly In this case the background colors the access attribute color of the fi
116. rnnnenssnesennnnnnrnsnnnsensnnnvnnsnsssensnnrsnnene 48 6 6 Step4 Setting a Breakpoint eerorroonnnnrnrnrnrreennnnnnnrrnnennerennnnnnnnrenerennnnnnnnsensnenennnnnneneseensnnnneseenen 49 6 6 1 Setting a Software Breakpoint ccccccccccccessessscecececsessssscecececsenesseseceesceesenssaeeeeceeesentaaees 49 6 7 Step5 Executing the Program c ccccccccccssssssccececsesscecececeesesssececccecsessaeeeeeceesesssasseeeeecsessasesees 50 627 1 Resetting Gf CPU sunessarktbea dekar alerede 50 6 7 2 Executing the Program cc ccccccceccecatdeccecevecncectucctecceievedescuccddeceesunsectuceneecgdeuedoscnentdeceeesncees 50 6 7 3 Reviewing Cause of the Break cccccccccccessssssceeececsessnseceeececeenenssseceeeceesenssaeeeeeeeeeeneaaees 51 6 8 Step6 Reviewing Breakpoints cccccccssssccccecsecsessscecececeesesssaeceeececsessaeeeecceceesesaseeeeeecseseaeeeees 52 6 8 1 Reviewing Breakpoints r rrrarararerevevevevevevevevevevenevevevevenevenevenenevevenenenenenensnesenenensnsnsnenen 52 6 9 Step7 Viewing Register cccssccccccccsessssscccececssssnscaececccsensnsaececccsesesaaeeesscsessssaaeaesscsceseaesececns 53 6 9 1 Viewing Register siere mienie rerne sen ae ek See SCP Gh arena ankes 53 6 9 2 Setting the Register Value rrrrrnnnrnrnrnrrrrrannnnrrrnsrrsrensnnrnnnenssnenennrnnnrnssnesennvnnsensssssensnnnsen 53 6 10 Step8 Viewing MeMory cccccccccccsesssscecececeesesseaecececsesssaaeceecceesesaaeceecescse
117. rsnnrnrsssnnrsrsssnnrsssnnrnssssnnrsrssarsssssnnrsssssnssennn 153 12 1 5 Debugging multi modules cccccecesesesececececececececececeeeeeeececeeeeeceeeeeeeeeeeeeeeeeeeeeeeeeeess 153 12 1 6 Syncronized debugging cccccccccccccssssscecececsessssececececeesssseseeceeeseseeceeeeecsenestsseeeeseeenes 153 12 1 7 Compact Emulator reset SWitCh ccccccccccccessessscecececsessseceeececsesesececececeenesaeseeeeseeenes 153 12 2 Attention of the M16C R8C Debugger ccccccccccecsessseceeececsesssaececececsesssaeeeeececeesessseeeeeeeeenes 154 12 2 1 Map of stack area used by the compact emulator cccccccceceessseceeececeesssseeeeeeesenses 154 12 2 2 Interrupt stack pointer when resetting the target Program ccccssseseseseseseseeenees 154 12 2 3 Options for compiler assembler and linker rrrrrrrrnnnnrvrrrnrrrrnsnnrnrnrnnrernennrnrnenssennennner 154 12 2 4 TASKING C Compiler cccccccccccccsssssscecececsessaececececeenssaeceeececsesesaeeeeeescsenesseaeeeeseeenes 154 12 2 5 Target MCU HOLD terminal oororrooroooronnnnrrnnrererennnnrrnnrenerennnnnnnnsenerennnnnsnnsesessnnnnnsen 155 12 2 6 Hardware break function cccccccccessececeescecesssececseeeeecseeeeceeaeeecsesaeeessneeeceeaeeeseeaaees 155 12 207 Hardware Eventuussscagsessnsoainagsnoedjaslsedutrsnstsbvisesidarevistdefese 155 12 3 Options for compiler assembler and linker ccccccccccccecesseseececececeesesececececsenssssceeeeeeeenes
118. rst byte of the data 73 7 2 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Add Add watchpoint Add Bit Add bit lebel watchpoint Remove Remove the selected watchpoint Remove All Remove all watchpoints Set Set new data to selected watchpoint Radix Bin Display in Binary Dec Display in Decimal Hex Display in Hexadecimal Refresh Refresh memory data Layout Address Area Switch display or non display of Address area Size Area Switch display or non display of Size area RAM Monitor Enable RAM Monitor Switch enable or disable RAM moniter function Sampling Period Set RAM monitor sampling period Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 74 7 Windows 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 a CiWatch cx 16 2 Der EE Watch
119. rtain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electron
120. s not deleted even after quitting the debugger 35 5 3 4 Emulator Tab Glock Main O External Sub C Internal External 5 3 4 1 Specify the Target Clock Change the setting by synchronizing with the clock used by the target microcomputer Internal is set by default Glock Main amp Internal External Sub C Internal fe External Select Internal to set the internal clock and External to set the external clock The specified content becomes effective when the next being start 36 5 Setup the Debugger 5 3 5 Script Tab The specified content becomes effective when the next being start 5 3 5 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 TR By clicking the Refer button the File Selection dialog is opened The specified script file is displayed in the Init File field To disable auto execution of the script command erase a character string displayed in the Init File field 37 5 4 MCU Setting Dialog the M16C R8C Debugger In the MCU Setting dialog box setting information on the user target The MCU Setting dialog box opens after closing the Init dialog box MCU Setting 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
121. s switched in this debugger in the following circumstances The object file that includes the address indicated by the program counter becomes the current scope When the SCOPE command is used to set the scope the specified scope is the active When a command is entered scope During command execution The current scope automatically switches depending on the program address being handled by the command Priority levels of labels and symbols The conversion of values to labels or symbols and vice versa is subject to the following levels of Local symbols outside scope 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 Conversion of data values 1 Local symbols 2 Global symbols 3 Local labels 4 Global labels 5 6 Local labels outside scope Conversion of bit values 1 Local bit symbols 2 Global bit symbols 3 Local bit symbols outside scope excluding the debugger for M16C R8C 141 Macro Variables Macro variables are defined by assign statements in the script file See section 9 1 Structural Elements of a Script File in the Reference part for details Precede variables with for use as macro variables You can specify alphanumerics and or the underbar _ in the variable name following the percent sign However do not star t the names with a numeric You cannot u
122. s the currently set range of trace measurement 7 First line cycle Shows the cycle of the first line displayed 8 First line address Shows the address of the first line displayed 9 First line time First line time Shows the time information of the first line displayed 10 Window splitting box Double clicking this box splits the window into parts In addition to bus information the window can display disassemble source line or data access information in combination In this case the display will be similar to the one shown below Trace ioj x ViBi Q QQ var z Ev Range 32511 00000 Area Break File Cycle 32389 Address OFO107 Time 00 00 00 053587 Label Address Data BUS BIU R W RUT CPU ON B T Q T 76543210 Datadccess hv m s ms us a GLOBAL C 52 for 4 0 j lt 5 j I DFO107 CHP U SH 4H FB 32389 0007E2 0000 16b DW W o em a g f 11111111 O0007E2 0000 W 00 00 00 053 587 32388 0007E2 0000 16b DW R o RB 0 1 1 11111111 0007E2 0000 R 00 00 00 053 588 32387 OFO10A CA7D 16b IW R o 2 1 1 11111111 oo o0 00 053 588 OFO10C R o 4 1 1 11111111 00 00 00 053 588 wj 124 7 Windows 7 9 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 Trac Range 18960
123. s to the elements of array a before and after the execution of the sort function it is clarified that random data is sorted in descending order 61 6 15 Step13 Stack Trace Function The emulator uses the information on the stack to display the names of functions in the sequence of calls that led to the function to which the program counter is currently pointing 6 15 1 Reference the function call status Double click the S W Breakpoints column in the sort function and set a software breakpoint sort long a long t imt ls ke k gap gap 5 while gap gt 0 1 fort k 0 k lt gap ktt fort itktgap i lt 10 i itzap for j i gap j gt k j j zap i if alj gt alitgap f t alj alj a j gap a j gap t else break gap gap 2 To executes the user program from the reset vector address select Reset Go from the Debug menu or click the Reset Go button on the toolbar After the break in program execution select Stack Trace from the Code submenu of the View menu to open the Stack Trace window ip x Kind Name Value F sort 0F0140 F tutorial OFO272 F main OFOZ1E The upper figure shows that the position of the program counter is currently at the selected line of the sort0 function and that the sort function is called from the tutorial0 function 62 6 Tutorial 6 16 What Next This tutorial has described the usage of this debugger Soph
124. s window Double click the register line to be changed The dialog is opened Enter the value to be changed PC Set Vale TE Value Radix Hex v Set As hole Register y eel 53 6 10 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 10 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 from the popup menu enter __msize in the Address edit box and set Word in the Size combo box 2x Address _msize Size Word v Radix f Hex Dec Bin ment Click the OK button The ASM Watch window showing the specified area of memory is displayed GE Address Bit 000410 __msize Word Hex 0300 54 6 Tutorial 6 11 Step9 Watching Variables As the user steps through a program it is possible to watch that the values of variables used in the user program are changed 6 11 1 Watching Variables For example set a watch on the long type array a declared at the beginning of the program by using the following procedure Click the left of displayed array a in the Editor Source window to position the cursor and select
125. saaeeeecesesensaeeeeees 54 6 10 1 View nig Memory esenee aE EEEE Ee ar EEEE EEEn ora E Ee ES ES 54 6 11 Step9 Watching Variables mu drstdknlaandn a Co bess a a a come Mba 55 6 11 1 Watching Variables e icccice cc esiin ei EE E EE E E Eee 55 6 11 2 Registering Variable pirenen irese rere ef Naair ae SiP e kini eredet 56 6 12 Step10 Stepping Through a Program rrorsorvrrrrrserrenvrnrnrnssrrrennrnnnenssresennrnnnenssnesennnnnnenssneren 57 6 12 1 Executing Step In Command sersvarvrrverrrvrerrervrsververvasvesvseseesvesresvesvasvesvsrsesvsessesvesvene 57 6 12 2 Executing Step Out Command rsrervrrverrvrvvrsvevvrsververvssvervseseesvesvesvervesvesvsesesvsessesvesvenne 58 6 12 3 Executing Step Over Command sosorsrrvrsvrsvnvrevrsrevsrvesvevsrvervenervesvevesverveneenesreveenereneene 59 6 13 Step11 Forced Breaking of Program Executions cccccccscccceceeseseceeececsessaeceeececsensseeeeees 60 6 13 1 Forced Breaking of Program Executions cccccccccssssscesececeeeessececececsesessaeeeeeceesensaaees 60 6 14 Step12 Displaying Local Variables rrrorrrrrronnnorrrnrrrrrenannrnrnenrrrensnnrnrrenssnenennrnnnensreenennnnnsensnnn 61 6 14 1 Displaying Local Variables rrororororororererererereveveveveveveveveveveveveveveveveveveveveverevesevesssesene 61 6 15 St pl3 Stack Trace Functor onneen n EE A A UE EE Eeh 62 6 15 1 Reference the function call Status ccccccccccessecesssececsessececseececeeseeeecsese
126. se the names of registers as variable names Uppercase and lowercase letters are differentiated in variable names You can define a maximum of 32 macro variables Once defined a macro variable remains valid until you quit the debugger Macro variables are useful for specifying the number of iterations of the while statement 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 Product Name Register name The debugger for M16C R8C PC USP ISP SB INTB FLG ORO OR1 OR2 OR3 OAO OA1 OFB lt Bank 0 Register 1RO 1R1 1R2 1R3 1A0 1A1 1FB lt Bank 1 Register Uppercase and lowercase letters are not unique in register names You can specify either Memory variables Use memory variables to use memory values in expressions The format is as follows Address data size You can specify expressions in addresses you can also specify memory variables The data size is specified as shown in the following table data Length Debugger Specification 1 Byte All Borb 2 Bytes The debugger for M32R Horh Other W or w 4 bytes The debugger for M32R W or w The debugger for M32R M16C R8C Lorl Example Referencing the contents of memory at address 8000h in 2 bytes 0x8000 W The default data size is word if not specified Line
127. sennnnnsensnenen 34 5 3 3 Debugging Information Tabs e dcn r e E E E EEEE 35 5 3 4 Emulator Tab suvusvuvrccadassselkekseaskseraa ene EE EE 36 5 35 Script Tabs aadnk tenke EREE EE EE EET 37 5 4 MCU Setting Dialog the M16C R8C Debugger mmmmrnrrvrsesrnrrrrererersrserenrsrnesersrsererenerssssersesenene 38 Bide MCW Dab ts okt EE MEARE EE Me ee te Neth adr 39 5 42 Flask Clear Be 1 0 DAPEN A EEEE PE EEEE A AE bekke 41 Tutorial 6 Tutorial 45 6 1 hala coo lt ein 0 a ASENON EE AEE S EEEE E E A E EE daga GN 45 AA URE 11 TAA AAAA AAIR A A E TE TAE E AE A E A SAT kai 45 6 3 Step1 Starting the Debugger wsrrrrrnnrnrrrnrrernennnnrnrnsreerennnnnrensreerennnnnrnnsenerennnnnsnnenssnenennrnnnenenen 46 6 31 Pr paration before USG a E A OE 46 6 3 2 Setup the Debugger cccccccccccccecsesssssceeececsesssseeecececeeceesesseceeececsesesseeeeeeceesesssaeeeeseeeeenses 46 6 4 Step2 Checking the Operation of RAM rrrrnnnorernvnrsesnennrnrnrnsseenennrnnnenssresennrnnnenssnssennnnnnenssseren 46 6 4 1 Checking the Operation of RAM rerrrrrrrannnnrvrnerssrrnennrnrnenssersennnnrnrnssnerensnnnnensssssensnnnsssene 46 6 5 Step3 Downloading the Tutorial Program cccccccccceceessssscecececeensssececececeenenssaeseeeceesensaaeeeeecs 47 6 5 1 Downloading the Tutorial Program rererererevevereveveveverevevevevevevevevevevevevevevevevevesevesesesene 47 6 5 2 Displaying the Source Program rorvnnrnnnrannnnrnrnerernenenn
128. sesessaaeasces 7 8 1 Specify the Trace Event 7 8 2 Specify the Combinatorial Condition cccccccsesssccccceceesssssceeececsesssseceeceeceensaseeeeeeees 115 7 8 3 Specify the Trace Range ccccssssccccccsessssscecececsesessscesececsesesseseeecscsesenssseeeeseeesenssaeeeeecs 116 7 8 4 Specify the Trace Write Condition cccccccccceceesessscecececeesesseceeececeesesssseeeeeceesenssaeeeeecs 117 7 8 5 Command ButtOn ccccssccccssssccssssssecseseecesssscecsensusecseeneesessseecsensusecssseeeesssseecserenseseees 118 7 8 6 Specify the write CONGItION cccccccessssscceececsessnsececececsessnececececsessneaececeesensnsaaeeesees 119 te OVA CEs WAT O Wisc EEP A canna AAE A A re 123 7 9 1 Configuration of Bus Mode ccccccccccccessessscesececsesensececeeecsenesseseeeeccsesesnsseeeesesesensaaeeeeees 124 7 9 2 Configuration of Disassemble Mode arorrrnrrrnrennnnrvrnrnnrrensnnrvrnsnnsnensnnrnnnenssnensnnrnnnenssnnnene 125 7 9 3 Configuration of Data Access Mode ranvrnrnrennrennnnrnnnsnrsrensnnrnnnsnnsrensnnrnnnsnssnensnnrnnnsnssennene 126 7 9 4 Configuration of Source Mode r rrrarrrrnsnnrnrnvnnsnenennrnrrenssernennnnrrenssensennrnnrensssesennnnnsensssenen 127 7 9 5 Extended Menusuiseauaeidsaasnaukddiasko Gedalia Tied dine cal topes dene 128 7 9 6 Display of bus information on the M16C R8C Debugger rrrrrrrrnnrvrnrrrsrersnnrnrnrnssrrnnns 129 Te LOS GUST THO Windowussaskusateteuueakesukemostenseenenkerse ede
129. tails refer Pointer types When the number of the array elements is more than 1000 the following dialog box open Specify the number of the elements in the dialog box Please set array area Stati p gt End 1023 Cancel The elements from the index specified in Start to the index specified in End are displayed If you specify the value more than the max index of the array the value is regarded as max index of the array When you click the Cancel button the elements are not displayed Function Types When the result of calculation is a function type the starting address is displayed in hex as follows void main OxF000 all Radices Reference Types When the result of calculation is a reference type the reference address is displayed in hex as follows signed int amp ref 0xD038 all Radices Bit Field Types When the result of calculation is a bit field type it is displayed as follows unsigned int 13 s f 8191 when Radix is in initial state Ox1FFF when Radix is hex 1111111111111B when Radix is binary unsigned int 13 s f unsigned int 13 s f 149 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 lt not active gt all Radices Syntax Errors When the calculated expression contains a syntax error it is displayed as follows str p lt syntax error gt all Radices where str p is the
130. tents 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 1 78ms Label Register 0 2 3 4 H _ F ASCII 000460 000470 000480 000490 000440 51 4F 56 40 FC F3 OD AC 84 83 59 A3 63 A DO 58 O003FO 000400 pool SB it 000430 000440 0 MOi anaa Na CA 000480 14 28 41 98 05 C6 61 57 21 89 6D E9 FA 44 5F 5C A al m D xl This system has 1 Kbyte of RAM monitor area which can be located in any contiguous address location or in 4 separate blocks comprised of 256 bytes each The RAM monitor area can be changed to any desired address range Refer to 7 1 2 Setting the RAM monitor area for details on how to change the RAM monitor area The default RAM monitor area is mapped into a 1 Kbyte area beginning with the start address of the internal RAM The display content updating interval can be set for each window individually The actual updating interval at which the display contents are actually updated while running the target program is shown in the title field of the Address display area The background colors of the data display and code display areas are predetermined by access attribute as shown below Access attribute Background color
131. tes There is no support currently for sign inversion of floating point numbers Member Reference Using Comma You can only use variable name member name for checking the members of structures and unions using the comma Example class T I public int member1 char member2 class T t_cls class T pt_cls amp t cls In this case t cIs member1 pt cls member2 correctly checks the members Member Reference Using Arrow You can only use variable name gt member name for checking the members of structures and unions using the arrow Example class T I public int member1 char member2 k class T t_cls class T pt_cls amp t cls In this case amp t_cls gt member1 pt cls gt member2 correctly checks the members 145 Pointers to Members Pointers to members using the or gt operator can be refered only in the forms of variable name member name or variable name gt member name Example class T public int member class T t_cls class T pt_cls amp t_cls int T mp amp T member In this case t_cls mp and tp_cls gt 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 Parentheses Use the and to specify priority of calculation within an expression Arrays You can use the and to specify the elements of an array You can code arrays as follows
132. the following meanings Button Function Load Load setting information from a file in which it was saved Save Save the contents set in the window to a file Help Display the help of this window Add Add the break point Refer Open file selection dialog box Close Close the window Delete Remove the selected break point Delete All Remove all break points Enable Enable the selected break points All Enable Enable all break points Disable Disable the selected break point All Disable Disable all break points View Shows the selected breakpoint positions in the Editor Source window 80 7 Windows 7 5 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 1 6 2 Area where software breakpoint can be set for details 7 5 2 1 Setting and Deleting a Break Point from Editor Source Window 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 at Sample c i 0 whilef1 I for i 0 i lt DATA SIZE i I data i data i 1 data i 2 data it 3 sub Double click You can delete the break point by double cli
133. the product Command Name Short Name Contents AddPath Adds the search path ADdressInterruptBreak ADIB Sets and checks the address interrupt break Alias Specifies and checks command alias definitions Assemble A Line by line assembly Bit Checks and sets bit symbols BreakAt 5 Sets a software breakpoint by specifying a line No BreakIn Sets a software breakpoint by specifying a function BreakMode BM Sets and checks hardware break mode CD Specifies and checks the current directory Clock CLK Checks and changes the clock Date 3 Displays the date DisAssemble DA Disassembles memory contents line by line Down i Displays a called function DumpByte DB Displays the contents of memory in 1 byte units DumpLword DL Displays the contents of memory in 4 byte units Dump Word DW Displays the contents of memory in 2 byte units Echo Displays messages Exec Executes external application Exit Exits the script file Express EXP Displays an assembler expression File Checks a filename and displays the contents of that file FillByte FB Fills a memory block with the specified data in 1 byte units FillLword FL Fills a memory block with the specified data in 4 byte units FillWord FW Fills a memory block with the specified data in 2 byte units Func 5 Checks function names and displays the contents of
134. toolbar 60 6 Tutorial 6 14 Step12 Displaying Local Variables The user can display local variables in a function using the C Watch window 6 14 1 Displaying Local Variables For example we will examine the local variables in the tutorial function which declares four local variables a j i and sam Select C Watch from the Symbol submenu of the View menu The C Watch window is displayed By default C watch window has four tabs as following e Watch tab Only the variable which the user registered is displayed e Local tab All the local variables that can be referred to by the scope in which the the PC exists are displayed If a scope is changed by program execution the contents of the Local tab will also change e File Local tab All the file local variables of the file scope in which the PC exists are displayed If a file scope is changed by program execution the contents of the File Local tab will also change e Global tab All the global variables currently used by the downloaded program are displayed Please choose the Local tab when you display a local variable CWatch me iol xi mx 16 2 Der Gl amp Watch Local File Local Global Name Value signed long 10 a Ox6c2 31051 signed int i 10 signed long j 4086 struct Sample sam Ox6EA Click mark at the left side of array a in the Locals window to display the elements When the user refer
135. ude blanks 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 2 Area where software breakpoint can be set The area which can be set for software breakpoint varies depending on the type of MCU Please refer to 1 6 2 Area where software breakpoint can be set for details 152 12 Attention 12 1 3 Get or set C variables Ifa 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 and bit fields Values cannot be changed for 64 bit width variables long long double and so on Values cannot be changed for C C expressions that do not indicate the memory address and size For the sake of optimization the C compiler may place different variables at the same address In this case values of the C variable may not be displayed correctly Literal character strings can only be substituted for char array and char pointer type variables No arithmetic operations can be performed on floating point types Nosign inversion can be performed on floating point types Casting cannot be performed on floating point types Casting cannot be performed on register variables C
136. up menus that can be brought up by right clicking in the Menu Function Select Item Select an I O item Delete Delete the selected I O item Copy Copy the selected I O item Paste Paste the copied I O item Create Button Create a new button item Create Label Create a new label item Create LED Create a new LED item Create Text Create a new text item Display grid Display the grid line Save Save I O panel file Load Load I O panel file Sampling Period Set RAM monitor sampling period Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Hide Allow window docking Hide window 131 8 TableofScript Commands 8 1 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 Please refer to 8 2 Table of Script Commands alphabetical order when searching in alphabetical order 8 1 1 Execution Commands Command Name Short Name Contents Go G Program execution with breakpoints GoF ree GF Free run program execution GoProgramBreak GPB Run target program with software break point GoBreakAt GBA Run target program with software break point Stop Stops pr
137. urce of the emulator Use the MCU tab in the Init dialog box in order to specify for which function the resources are used On this tab deselect the Enable the Trace Point Function check box Details These events can be combined in one of the following ways E Break when all of the valid events are established AND condition E Break when all of the valid events are established at the same time simultaneous AND condition E Break when one of the valid events is established OR condition At the time the debugger starts up the hardware breaks have no effect 82 7 Windows 7 6 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 Event name Specify the event type 41 Set Event Status FETCH al addr Address v 0000 z Contents change with the setting of Event Type 83 Following events can be set by specifying Event Type in this dialog box When FETCH is selected Breaks for the instruction fetch adr Address SSC fran el Elle ss When DATA ACCESS is selected Breaks for the memory access Datat lt data lt Data2 m pooo pooo Rw FFFF__ 84 7 Windows When BIT SYMBOL is selected Breaks for the bit access 85 7 6 2 Specify the Combinatorial Condition To specify a combinatorial condition specify the desire
138. vvrrversenee 81 7 6 H W Break Point Setting Window ccccccccccccccsesssseccceceesesseceeceecsesesssaeceeeesesesaaeeeeceeeeesnsaeeeeeesees 82 7 6 1 Specify the Break Event cccccssscccccececsessscececececsesssaeceeececsesesaeceeeceeseseasseeeeeesenenseaeees 83 7 6 2 Specify the Combinatorial Condition cccccccccccsssssscecececsesessececececsesenseceeeeseeesenseaeeeeees 86 7 6 3 Command Buttonsessstase Boideect EE E ce ease EA 86 7 6 4 Specify the Events Instruction Fetcher Aani 87 7 6 5 Specify the Events Memory Access c cccessessssessescsseseescsseseeecsseseecsseseescssessescsseaeeecnsens 92 7 6 6 Memory Access The debugger for M16C R8C rsrrvrrvrvnrvrrvrrevsrvrrrevssvrsrevssvrerevssvesrenssnee 93 7 6 7 Specify the Events Bit Access ccccccccssescsssssescsseseescsesscsecsescsecsesscsecsesscsecsesseeecsesaeeeeaes 104 7 6 8 Specify the Event Combination Condition 0 ccccccccccccceesesseceeececeesesseceeeeseeenenssaeeeeecs 106 16 0 Select AND OR ES 106 7 6 10 Select AND Same Time osasin E E EA RNA 107 7 7 Address Interrupt Break Point Setting Window cccccsccccccecsesessececececeenssseseseeeceesenseaeeeeees 108 TI Command Buttons cotsticessioccee es tebe KE tele coer deacon eens es 109 7 7 2 Setting and Deleting a Break Points from Editor Source Window rsrarvrrvrrvervververr 110 7 8 Trace Point Setting Window ccccccssssssccccccecssssnscccececsensnseaececccsensnsaaeeeescsessseaaeeeese
139. w edd Addesst foo poo See 93 l Set Event Status DATA ACCESS w foo fo WRITE I Mask 94 7 Windows Example Writing byte length data 32h to even address 400h Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range faddr Address v Addresst 000400 Address2 000000 Function Source File a Function 3 ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 data amp 00FF 0032 mest Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range data Datal v Data 1 22 Data 2 ooo Access WRITE v Mask jaooo ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 data 0032 95 Example Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width 8 bits bus width 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range faddr Address1 v Address1 000401 J al Address2 Function Source File Function v ACCESS WRITE ADDRESS 000401 CONDITION addr 000401 data amp 00FF 0032 41 Set Event Status Event Type DATA ACCESS v Address Data Setting Range data Datal v Data 1 32 Data 2 0000 Access WRITE v VW Mask

Download Pdf Manuals

image

Related Search

Related Contents

CARACTÉRISTIQUES TABLE DES MATIÉRES  Newstar FPMA-W832 flat panel wall mount  Sony SVT141290X Marketing Specifications  Fujitsu LIFEBOOK E781  MooreCo 74954  EZ Cut CNC User Manual  Bracketron UFM-100-BL holder  MA-20 Manual 6-09.vp  Opérations d`entretien et de remplacement des pneumatiques  JRG CleanLine Combi  

Copyright © All rights reserved.
Failed to retrieve file