Home
M16C R8C Compact Emulator Debugger V.1.02 User's Manual
Contents
1. 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 75 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 mx A 16 2 Der IE Watch Local File Local Global Name Value struct tas S p Ox404 struct taz_S pS 0x404 signed int ni 1028 unsigned char cl 4 74 stru
2. Tutorial res Tutorial 3 Assembly source file 1 O 3 amp o o dbsctc 2 lowsre c B resetprg c 2 sbrk c Tutoriale Be Dependencie Download module E lowsrch Download module debug data only E sbrk h Unload module stacksct Configure View iv Allow Docking Hide 50 6Tutorial 6 2 3 2 Displaying the Source Program This debugger allows the user to debug a user program at the source level Double click tutorial c under C source file A Editor Source window opens and the contents of a Tutorial c file are displayed dd amp Tutorial Tutorial 3 Assembly source file dbsctc lowsre c E resetprg c sbrk c E lowsreh sbrk h stackscth 24 000b28 30 000b30 32 000b38 34 000b44 35 000b4c void main void void sort long ta void change long ta extern void srand unsigned int void main void long a 10 min max long j int srand 1 printf fit Data Input ftit n fort i 0 i lt 10 i j rand se 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 b
3. Item Contents ID ID No of data queue Dtqatr Attribute of each date queue Dtent Number of messages in each data queue Dtqsz Maximum number of messages that can be contained in each data queue Data Queue Wait ID No and task name of tasks waiting for message transmission waiting or message reception waiting Data Queue Data The messages stored in the data queue e The display of the ID field varies depending on which one is specified the standard data 32 bits or the extended data 16 bits MR308 4 If the standard data 32 bits the ID field displays a string 32 and data queue ID number If the extended data 16 bits the ID field displays a string 16 and data queue ID number MR30 4 If the standard data 16 bits the ID field displays a string 16 and data queue ID number If the extended data 32 bits the ID field displays a string 32 and data queue ID number 153 e The following are displayed in the Dtqatr area TA_TFIFO Task wait queue is in FIFO order TA_TPRI Task wait queue is in task priority order e The Data Queue Wait field displays a string Send if a task waiting for a message sending and then displays the ID number and name of the task waiting for a message sending Also if a task waiting for a message receiving displays a string Receive and then displays the ID number and name of the task waiting for a message receiving e When a task conne
4. Basic type Default char unsigned short signed int signed long signed Notes e Of the basic types of C casts to bool type wchar t type and floating point type float or double cannot be used e Casts to register variables cannot be used 178 10C C Expressions 10 1 13 Casting to typedef Types You can use casting to typedef types types other than the C basic types and the pointer types to them When casting to a pointer type you can also use pointers to pointers and pointers to pointers to pointers etc Notes e You cannot cast to struct or union types or the pointers to those types 10 1 14 Variable Name Variable names that begin with English alphabets as required under C C conventions can be used The maximum number of characters for variable name is 255 And this pointer is available 10 1 15 Function Name 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 10 1 16 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 code and used as 1 byte immediate values Notes e You cannot register character constants only as C watchpoints e Character constants are valid only when used in a C C expression that specifies a C watchpoint and when specifying a value to be
5. 156 7 Windows Dialogs 7 11 10 Display the Alarm Handler Status In the MR window select Popup Menu Mode gt Alarm Handler MR Fi wi Onega OSUD A o a a S Remain Handler Now System Clock Count 0000H 0000H 018AH ID Sta amp ddr name AlarmTime OF1C68H alarm 0000H OOOOH OF1C70H alarm 6 0000H 1000H OF1C66H alarml OOOOH ABCDH OF1C72H alarm OOODH OO13H OF1C6AH alarm3 OOCDH OOO3H OF1C6CH _alarm4 OOcDH 00039 OFIC6EH alarmd OOCDH OAAS3H When the realtime OS is MRxx conformed to uITRON specifications V 3 0 the following data is displayed in the status bar Remain Handler Now System Clock Count OOOOH 0000H 018AH 7 11 10 1 Display the Alarm Handler Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Of all the cycle start handlers defined in the configuration only those which are not started yet at present are listed in the ascending order of start time The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of alarm handler StaAddr Starting address of alarm handler name Name of alarm handler AlarmTime Starting time of alarm handler 7 11 10 2 Display the Alarm Handler Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Of all the cycle start handlers de
6. Double click You can delete the break point by double clicking 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 82 7 Windows Dialogs 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 E H W Break Points Setting 8 Enable H W Break 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 Setting of combination condition Setting of Process ID e 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 e Events at up to two po
7. Please set array area Start 0 End fi 023 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 10 2 5 Function Types e When the result of calculation is a function type the starting address is displayed in hex as follows void main 0xF000 all Radices 10 2 6 Reference Types e 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 10 2 7 Bit Field Types e 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 unsigned int 13 s f Ox1FFF when Radix is hex unsigned int 13 s f 1111111111111B when Radix is binary 182 10C C Expressions 10 2 8 When No C Symbol is Found If the calculated expression contained a C symbol that could not be found it is displayed as follows x lt not active gt all Radices 10 2 9 Syntax Errors e 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 syntax error 10 2 10 Structure and Union Types e When the result of calculation is a structur
8. cccccccccccseessssscecececsesssssceeeeecsenssseaeeeeeees 123 7 8 10 Specify the write CONItION cccccsssssccccececesssnnccecececsessacaecececeessacaecececesneseaececeees 124 ii T9 Trace WAN OW vedediccseeccecececcsecevcsccecetececccceeaceececededeceseactedevecececeseactedseccsdcccecacdudecedsdcceseacevcseedsdeceeees 127 7 9 1 Configuration of Bus Mode cccccccccesssssscecececsessaececccecsessseeeeececsessaeeeeceeesensseseeeeeees 127 7 9 2 Configuration of Disassemble Mode ccccccessessscecececsessssscecececsessseceeeceesensseaeeeeeees 129 7 9 3 Configuration of Data Access Mode cccccccccccsessessscecececeessececececsessseeeeeeeesensaseeeeeeees 130 7 9 4 Configuration of Source Mode cccccccssssssscsececeessssececececsesssececececsessaseeeeeeesenssseseeeeeees 131 TID extended Menus is sive a es hpiciher eee a tote e a a EN 132 7 9 6 Display of bus information on the M32C Debugger cccccccccccseesssssceeeeeeeensnteceeeeeees 133 7 9 7 Display of bus information on the M16C R8C Debugger rrrrrrrrnnrrrnrrrsrensnnrvrnvnssrennns 135 TNO GUI VO Wnd wssassadsrakskaktul vaare 136 70T Egytended Menus xcs tinh hone ates eels nese nesen 137 WEVA MR Windows r E FO eee eee aner 138 TALT Extended Menusuuapasanndr kon ee aeara e oead eeaeee Eea 139 7T 11 2 Display the Task Status runari e E A a aa 140 7 11 3 Display the Ready Queue Status ccccccccccccccssssssececccecsessececececsess
9. ccccccecssssssccececsesessscecececeesessscecececsesesssseeeesesesenseaeees 163 8 1 4 Memory Operation Commands cccccccccssssscceececeeseseceeececsesessscesececsensssaceeeeseeenenaaeees 163 8 1 5 Assemble Disassemble Commands cccccccssssecessseeeceessececseseesecseeeecseaeeecsesaeeeeneeeeenees 163 8 1 6 Software Break Setting Commands ccccccccccccesessessscecececsesesseceeceeceenesseaeeeeeceenenseaeees 164 8 1 7 Address Interrupt Break Setting Commands ccccccccccessessececececeenesseceeeeeesenenseaeees 164 8 1 8 Hardware Break Setting Command cccccccccccsessessscecececeesessececccecsesesssceecesesenenseaeees 164 8 1 9 Real time Trace Commands cccccccccssssscecsesececseeeeceeseeecseseececseeeeesesueeecsesaeeeeneeeeenses 164 8 1510 Seript Log Fil Commands ornare n e e N A 164 8 1 11 Program Display Commands c cccccccessssssseeececeeseececcceceeseeceeececsesesssaeeeeseeenensaaeees 165 SA Map Commands iss ea a bende e E NESA 165 CARROG ROO aiant haro PA EEE AE E EE REE 165 8 1 14 C Language Debugging Commands ccccccccccccessesssceeececeesessececececeesessceecesesenenseaeees 165 8 1 15 Real time OS Command cccccccccccccssecesssececseneeeecsueeecessaeeecsssaeeecsseeeeseaececseeaeeeesneeeenes 165 8 116 Utility Com mia F ASEE E EE E AE E EE N EEEE E EE EEEO 165 8 2 Table of Script Commands alphabetical order ccccccccescessescsscessesecesesscssescsccssesesasesseaeeeses 1
10. e 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 Start Size Area Start Size Area mm 4 poo400 000400 000400 000 ETTE 3 001000 001000 001000 0012 Changing tbe address Changing the sze 7 1 2 2 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 2 3 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 73 7 2 ASM Watch Window The ASM watch window is a window in which you can register specific addresses as watchpoints and inspect memory contents at those addresses If a registered address resides within the RAM monitor area the memory content at that address is updated at given intervals by default every 100 ms during program execution Toolbar s ASMWatch 080000 RUNt sk 080655 BufTsk7 1 084620 Dbe_cnt O108CB 4 Dbz_mode2 Address Bit
11. rerrronnrorrrnrnrrrennnnrrnnsnrrrennnrrnnsnrsrensnnnnnn 190 12 3 4 TASKING Com pile t sis erroreei en e E EE E A EAN cseessebuetencdecsedesbecsteaceeveevve 190 12 3 5 Target MCU HOLD terminal ssnin n a E E A Ea aa 190 iv 12 3 6 Hardware break function 12 3 7 Hardware Event seeren 12 3 8 Memory space expansi0N 000008 12 3 9 CPU rewrite srmrrrorvrrrrnrrrrrrrnnrrrrrrnnrn 12 4 Options for compiler assembler and linker 12 4 1 When Using NOxx rerrrrrrerrennrnrvenssrssen 12 4 2 When Using the IAR C Compiler EW srernerorvrrrererverrererverserervenserernenseresvevssvensenenne 12 4 3 When Using the IAR EC Compiler EW cccccccccccccsscsssscsesseeecsessesecsesscsecsesseseeaees 12 4 4 When Using the IAR C Compiler ICC cc cccccccccscscssescseesceecsesscsecsesscsecsesscsecsesscseeaees 12 4 5 When Using the TASKING C Compiler EDE ccccesesseeeeseteteeeeeeseseseseeeseseeesees 12 4 6 When Using the TASKING C Compiler CM ccccsessssseseseseseseeeeseeeeeeeeeseseeeseeesees Blank Page vi Setup of Debugger Blank Page 1Features 1 Features 1 1 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 e
12. 12 4 6 When Using the TASKING C Compiler CM 12 4 6 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 4 6 2 Command Execution Examples The following shows examples of entering commands gt CM16 g 00 filel c lt Enter gt 196 M16C R8C Compact Emulator Debugger V 1 02 User s Manual Publication Date Aug 01 2006 Rev 1 00 l Sales Strategic Planning Div POplished ty Renesas Technology Corp Microcomputer Tool Development Department Edited by Renesas Solutions Corp 2006 Renesas Technology Corp and Renesas Solutions Corp All rights reserved Printed in Japan M16C R8C Compact Emulator Debugger V 1 02 User s Manual ratENESAS RenesasTechnology Corp 2 6 2 Ote machi Chiyoda ku Tokyo 100 0004 Japan
13. Hardware break points COME execution To see the data which were rewritten by the program break the program out of the CPU rewrite control program and see by dump window memory window and so on 189 12 3 Attention of the M16C R8C Debugger 12 3 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 3 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 3 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 Refer to 12 4 Options for compiler assembler and linker The compiler that can be used by M16C R8C debugger e NCxx e the IAR EC Compiler e the IAR C Compiler e the TASKING C Compiler 12 3 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 unsigned short int 12 3 5 Targ
14. Pointer gt Member this gt Member Pointers to Members Object var Pointer gt var Parentheses G Arrays Array 2 DArrayl2 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 A b Character string literals 10 1 1 Immediate Values abedef I am a boy You can use hexadecimals decimals octals as immediate values Values starting with Ox are processed as hexadecimals those with 0 as octals and those without either prefix as decimals Floating point numbers can also be used to assign values to variables Notes e You cannot register only immediate values as C watchpoints e 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 175 10 1 2 Scope Resolution The scope resolution operator is available as following Global scope valiable name 1 x val Class scope class name member name class name class name member name e g T member A B member 10 1 3 Mathematical Operators You can use the addition subtraction multiplication and divis
15. Start 126 7 Windows Dialogs 7 9 Trace Window The Trace Window is used to display the results of real time trace measurement The measurement result can be displayed in the following display modes e 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 e 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 e 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 e 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 7 9 1 Configuration of Bus Mode When bus mode is selected t
16. 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 No sign inversion can be performed on floating point types Casting cannot be performed on floating point types Casting cannot be performed on register variables Casting 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 1 4 Function name in C When you input the address using the function name in setting display address setting break points and so on you can not specify the member function operator function and overloaded function of a class You can not use function names for C C expression No script commands e g breakin and func can be used in which function names are specified for arguments In address value specifying columns of dialog boxes no addresses can be specified using function names 1 5 Debugging multi modu
17. hit M16G R8C Compact Emulator X MCU Debugging Information Emulator Script MCU M16C264 mcu Refer Serial No 2 0290Y 3KMO1 9 v Self Check m Debug Option IV Enable the Address Match Interrupt Break Function Debug the program using the CPU Rewrite Mode Enable the Trace Point Function j Cancel Help T Do not show this dialog box again 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 M32C The debugger for M16C R8C MCU exist exist Debugging Information exist exist Emulator exist exist Script exist exist You can open the Init dialog using either one of the following methods e After the debugger gets started select Menu Setup gt Emulator gt System e Start Debugger while holding down the Ctrl key 25 5 1 1 MCU Tab The specified content becomes effective when the next being start MCU M16C29 mcu Refer Serial No 2 m30290 3K MO01 9 B I Self Check Debug Option IV Enable the Address Match Interrupt Break Function Debug the program using the CPU Rewrite Mode J Enable the Trace Point Function 5 1 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 e An MCU fil
18. Select it When two or more project types are displayed please select one of them 4 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 After a setting click the OK button 19 4 2 2 2 Step 2 Selecting of the Target Platform Select the target system used for your debugging emulator simulator A wizard starts and the following dialog box is displayed Setting the Target m for Debugging M16G PC4701 Emulator M16G R8C Compact Emulator M16G RSC FoUSB UART M16C R8C PC7501 Emulator Target type mes Next gt Finish re 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 20 4Preparation before Use 4 2 2 3 Step3 Setting the Configuration File Name Set the configuration file name for each of the all selected target The configuration file saves the sta
19. teaveinse ca eeea ts cuadeGthe Stee E E E T Meester aM art 9 Starting Setup of Debugger 10 3 1 Communication method by emulator cccccccssscccececsessssececececsesscneceeececeesesssceeeeecsesesseseeeeeeeenes 10 311 USB Interface su 55 eee 10 3 2 Download of Firmware srrrrnnvvrersnvrrrrssnvvrrrnnrnrsrennrnrsssnnrsrsnnnsrsrennrsrsssnnrsrsnnnssssennvsrsssnnrsssnnnsssssnnnne 10 3 3 Setting before emulator Starts ccccccccccccccecsessssscecececsessneceeececsesseceeececseneseeeececsenestsaeeeeeeeenes 11 3 3 1 USB communication with the Emulator rrrororrnrrrrrronnrrrrsorvverrnnrrrrrennrnrrrsrnvsrsnnrsrerennnnr 11 Preparation before Use 12 4 1 Workspaces Projects and Files rrrrrrrrrrrrrrrvrrrvrrrvrvnrrrrvrrrvrrrrrvrrrsrrereveresnsesesevesesevnsesesnsesesevesen 12 4 2 Starting the High performance Embedded Workshop rrvrrrrnvvvrrnrvvvrrrnnrrrrrsnnrnrrrrnrverrnnrresrrnnnn 13 4 2 1 Creating a New Workspace Toolchain Used c cccccccccsscsssesessccssesecssesscssesscssecssssesssensens 14 4 2 2 Creating a New Workspace Toolchain Not Used c cccccccccscsssssesscssesscsseesesscesesseceseseens 19 4 3 Starting the Debugger ccccccccccccsssseseceeececsesssececececsesaaeeecececsesssasceeececseeaaeeesececseneseseeeeeesenes 24 4 3 Connecting the Emulator neoe ea n e e sb iectioke A eked gence yoatee a 24 4 3 2 Ending the Emulator ererererororoverereveverevevevevereveveveveveveveveveveveveveverevevesesevevesesevesns
20. 2 _task2 15 _task15 16 _task16 17 taskl 18 taskl8 The following data is displayed in the status bar Current Run Task 1 main Number of Priority 100 7 11 3 1 Display the Ready Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 The function of each item is as described below When the realtime OS is MRxx conformed to ulTRON specifications V 3 0 Item Contents Pri Displays priority RdyQ Shows the ID Nos and task names of tasks in the ready queue e Up to 8 characters of the task name is displayed in the RdyQ field When the task name exceeds 8 characters the extra characters are omitted 7 11 3 2 Display the Ready Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 The function of each item is as described below When the realtime OS is MRxx conformed to ulTRON specifications V 4 0 Item Contents Pri Displays priority Ready Queue Shows the ID Nos and task names of tasks in the ready queue e Up to 8 characters of the task name is displayed in the Ready Queue field When the task name exceeds 8 characters the extra characters are omitted 144 7 Windows Dialogs 7 11 4 Display the Timeout Queue Status In the MR window select Popup Menu Model gt Timeout Queuel ENRETE FETEI Value ID name TOFFH 7FOOH 7FOFH TFFOH TFFFH 7FFFH TFFFH 21 task2l
21. 7 6 4 1 Instruction Fetch of Specified Address Set as below Example Instruction fetch at address 80000h Al Set Event Status FETCH v faddr Address1 vi om m afa 88 7 Windows Dialogs 7 6 4 2 Instruction Fetch of Specified Address Area In Set as below Example Instruction fetch at address 80000h to 80FFFh T Set Event Status FETGH 7 go el a BOF sl ET 89 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 T Set Event Status FETGH p faddr lt Address1 Address2 lt addr v po sl pOrFF sl 90 7 Windows Dialogs 7 6 4 4 Entering exiting to specified function Set as below Example Entering a break to function name wait AT Set Event Status Event Type HAJLAS v Fetch Setting Range Adderss1 lt addr lt Address v Address1 wait z Address2 F0188 V Function Source File maine a Function mit ACCESS FETCH ADDRESS wait CONDITION 0F0172 lt faddr lt 0F0188 Example Exiting from function name wait Al Set Event Status Event Type HAJLA v Fetch Setting Range addr lt ddress1 Address2 lt addr v Addresst wai z Bl Address2 Foise IV Function Source File maine v Function wait v
22. Address Label Register 0 1 42 8 4 5 6 7 8 9 4 4B 40 4D E F ASCII 000400 00 00 00 00 00 00 00 00 00 00 00 OO 00 OO 00 OO 000410 DF D5 Fe OF 20 OA 00 OO 20 OA 00 OO 00 03 00 00 000420 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000430 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000440 FF FF GS FF FF FF FF FF FF FF FF FF FF FF FF FF 000450 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000460 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000470 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000480 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000490 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000440 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000480 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00400 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 000400 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FR 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 49 6 2 3 Step3 Downloading the Tutorial Program 6 2 3 1 Downloading the Tutorial Program Download the object program to be debugged The download file and the address to be downloaded will depends on the target mcu you uses Please replace the screen image and addresses with corresponding one to your target mcu e The Debugger for M16C R8C or M32C Select Download module from Tutorial x30 under Download modules ax
23. Data Setting Range addr Address v Address 000401 J al Address2 Bl Function Source File 7 Function v ACCESS WRITE ADDRESS 000401 CONDITION faddr 000401 data amp 00FF 0032 Caneel Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range data Dat sti CS YS Data 1 22 Data 2 ooo Access WRITE v MV Mask DOFF ACCESS WRITE ADDRESS 000401 CONDITION faddr 000401 data amp 00FF 0032 mest 104 7 Windows Dialogs 16 bits bus width 41 Set Event Status DATA ACCESS vw m Effa 41 Set Event Status DATA ACCESS l fn for ooo WRITE H m Froo ooo 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 AT Set Event Status Event Type DATA ACCESS v Address Data Settine Ranee addr Address v Address1 fa00 Address2 fo0040F z gl Function Source File Function ACCESS WRITE ADDRESS 000400 CONDITION taddr 000400 data amp 00FF 0034 Caneel Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range data Datal
24. 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 Shows 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 k Trace iol xi Ve laga vas z Ev Range 32511 00000 Area Break File Cycle 32389 Address 0F0107 Time 00 00 00 053 587 Cycle Label Address Data BUS BIU R w RUT CPU ON B T Q T 76543210 Datatccess hv m 3 ms us GLOBAL C 52 for je 05 34 55 Te I OFO107 CHP W 5H 4H FB 32389 0007E2 0000 16b DU W 0 cu 1 1 1 11111111 0007E2 0000 W 00 00 00 053 587 32366 0007E2 0000 16b DW R o RB o 1 1 11111111 0007E2 0000 R 00 00 00 053 588 323867 OFO10A
25. O030FF Remove All View gt Start Area 000400 4 000400 OOO FF 003000 8 blocks 2048 bytes are available lt 1 block 256 bytes gt Save Load Close Use this window to add delete or change RAM monitor areas e Specify a RAM monitor area by its start address and size the latter by a number of blocks e 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 e 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 e 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 72 7 Windows Dialogs 7 1 2 1 Changing the RAM Monitor Area The start address and the size of the RAM monitor area can be changed e Changing from a dialog box Select the RAM monitor area you want to change from a list of RAM monitor areas and double click on it The Set RRAM Area dialog box shown below will appear Specify the start address and the size by a number of blocks of the RAM monitor area in the Start and the Size fields of this dialog box Set RRAM Area Start 400 v gl ps Size 4 blocks Area 000400 0007FF Cancel
26. for use as macro variables e 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 e You cannot use the names of registers as variable names e Uppercase and lowercase letters are differentiated in variable names e 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 172 9Writing Script Files 9 2 4 Register variables Register variables are used for using the values of registers in an expression Precede the name of the register with to use it as a register variable Use the following format Product Name Register name The debugger for M32C PC USP ISP INTB FLB SVF SVP VCT DMD0 DMD1 DCTO DCT1 DRCO DRC1 DMAO DMA1 DCAO DCA1 DRAO DRA1 ORO OR1 OR2 OR3 OAO OA1 OFB OSB lt Bank 0 Register 1RO 1R1 1R2 1R3 1A0 1A1 1FB 1SB lt Bank 1 Register 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 9 2 5 Memory variables Use memory variables to use memory values in expressions The format is as follows Address da
27. signed long 10 a signed signed signed signed signed signed signed signed signed signed long long long long long long long long long long al 0 al 1 al 2 al 3 al 4 al 5 a 6 al 7 al 8 al 9 Ox6C2 16838 5758 10113 17515 31051 5627 23010 7419 16212 4086 16838 58 6Tutorial 6 2 9 2 Registering Variable The user can also add a variable to the C Watch window by specifying its name Click the C Watch window with the right hand mouse button and select Add from the popup menu The following dialog box will be displayed Enter variable i Add new watch point DE FF Cancel Click the OK button The C Watch window will now also show the int type variable i CWatch x mx f E 2 walg Watch Local File Local Global Name Value signed long 10 a Ox6c2 16838 signed int i 10 59 6 2 10 Step10 Stepping Through a Program This debugger provides a range of step menu commands that allow efficient program debugging 1 Step In Executes each statement including statements within functions subroutines 2 Step Out Steps out of a function subroutine and stops at the statement following the statement in the program that called the function subroutine 3 Step Over Executes a function subroutine call in a single step 4 Step Steps the specified times repeated
28. specify ONBSD or Ono_Break_source_debug option together with O OR or OS option 12 4 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 M32C ylmb 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 193 12 4 3 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 F
29. ACCESS FETGH ADDRESS wait GONDITION faddr lt 0F0172 0F0188 lt taddr 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 7 6 5 1 Memory Access The debugger for M32C ATTENTION It is not detected that data access to the odd addresses in word size access 92 7 Windows Dialogs 76 5 1 1 Writing Reading a Specified Address Set as below Example Writing to even address 400h Al Set Event Status Event Type DATA ACCESS v Address Data Settine Ranee addr Address v Address1 fa00 J al Address g Function Source File v Function 7 ACCESS WRITE ADDRESS 000400 CONDITION taddr 000400 oeei Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range Not Specify v Data 1 pooo Data 2 pooo Access WRITE v i Mask p 000 ACCESS WRITE ADDRESS 000400 CONDITION taddr 000400 Caneel 93 Example Writing byte length data 32h to even address 400h Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range addr Address v Addressl 000400 v fal Address2 000000 Bl I Function Source Fi
30. Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Gdar Address v Address1 po l l Address2 Bl Function Source File z Function ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Not Specify v Data 1 poo Data 2 0000 Access WRITE v IT Mask 0000 ACCESS WRITE ADDRESS 000400 CONDITION addr 000400 mest 102 7 Windows Dialogs Example Writing byte length data 32h to even address 400h Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range addr Address v Addressl 000400 v fal Address2 000000 Bl I Function Source File Function z ACCESS ENE ADDRESS 00040 CONDITION ne 000400 data amp 00FF 0032 Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Jidata Datal v Data 1 2 Data 2 ooo Access WRITE v Mask poog ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 data 0032 108 Example Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width 8 bits bus width AT Set Event Status Event Type DATA ACCESS v Address
31. Area field Memory Expansion Mode 8bit and 16bit If you have an area to be assigned as the emulation memory in addition to internal ROM area specify it specify it separately The internal ROM area is automatically mapped into the emulation memory The address range of the automatically mapped area is displayed in the Internal ROM Area field Microprocessor Mode 8bit and 16bit Specify the area to be assigned separately There is no area which is automatically assigned ATTENTION The mapping setting data specified using the Map command is not reflected to the Emem dialog box et the emulation memory areas in the order of usage priority The emulation memory areas to be set by the Map command are numbered ignoring the unused Not Use areas Accordingly the emulation memory areas set in the Emem dialog box and the emulation memory area numbers set by the Map command will be mismatched 37 5 3 1 3 Flash Clear Tab The specified content becomes effective when the next being start F80000 FSFFFF F90000 FOFFFF FAOOO0 FAFFFF FB0000 FBFFFF FCOOOO FGFFFF FDO000 FDFFFF FE0000 FEFFFF FFOOOO FF FFF FF8000 FFOFFF oO O O O 0 O 0 O 0O 5 3 13 1 Setting to clear the MCUss 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 e The bl
32. Function name i CAF assessor aliens hate 187 12 1 5 Debugging multi modules rerererorernrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnnnrnrnrnnnrnnnvnnnvnrnvnrnnnnnnnnnne 187 12 1 6 Syncronized debugping uasianuskuetae skann aknlsGoneamioakearkuetanuee 187 12 1 7 Compact Emulator reset switch rm mrrrrrannrnrrrnrrrrrennrnrrrnssrsrennnnrrrnsrerrensnnrrnnsnessensnnnsen 187 12 2 Attention of the M82C Debugger ccccccccccceceesessecececececeesnsseceeeceesesssseceseceesesnsaeceeececeeneaaeas 188 12 2 1 Stack area used by the emulator ccccccccssssscecececeessscececececeesssaeeeeececsesssaseeeeeeeeesea 188 12 2 2 Interrupt stack pointer when resetting the target program cccccseseseseeesenenenens 188 12 2 3 Option of C Compiler Assembler Linker rerrrrrorrronnrnrrrnrrrrrennnnrnnnnnrsrenennrrnnenesrensnnnnnn 188 12 2 4 Target MCU HOLD terminal sorervrrreorronnrnrrrnrrrsrensrnrrrnrersrennnrreneressensnnnvnnssesrensnnnsen 188 12 25 Hardware Event suunss hasta lesende 188 12 2 6 CPU rewrtese satse ne kassan Ga nei ae Goa We RR ee 189 12 3 Attention of the M16C R8C Debugger rerrrrrrrrrannrvrnrnrsrrrennnnrrensrnrrennnnrrnnsnrsrensnnrnnnsnrssensnnrsnnene 190 12 3 1 Map of stack area used by the compact emulator ccccccceceesssssceeececeesssseeeeeeeeenses 190 12 3 2 Interrupt stack pointer when resetting the target program ccccseeeseseeeseeesenens 190 12 3 3 Options for compiler assembler and linker
33. Mailbox Displays Mailbox status Data Queue Displays Data Queue status Cyclic Handler Displays Cyclic Handler status Alarm Handler Displays Alarm Handler status Memory Pool Displays Memory Pool status Message Buffer Displays Message Buffer status Port Displays Port status Mailbox with Priority Displays Mailbox with Priority status Context Displays Context Layout Status Bar Switch display or non display of status bar Refresh Refresh memory data RAM Monitor Enable RAM Monitor Switch enable or disable RAM Monitor 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 139 7 11 2 Display the Task Status In the MR window select Popup Menu Model gt Task MR z LEEA Mea AA A Current Run Task 1 main ID Stazddr name Pri Status wup count timeout flg pen flg mode OF17F8H main 1 RUN 0000H OF1A68H task2 2 RDY 0000 OF1A76H _task3 sus 0000 OF1AS4H task4 WAT SLP 0000 OF1A9AH _task5 WAI SLP SuUS 0000 OF1ABOH _task6 WAI DLY 0000 OF1ACAH task WAI DLY SUS 0000 OFIAE4H tasks WAI FLG 0000 OF1BOZH task9 WAI FLG SUS 0000 1111H TWE_ORW 1111H TWF ORW 1 2 3 4 5 6 7 8 9 Tote eee By double clicking any line the information on the task context is displayed i
34. No Expression Radix e The addresses to be registered are called the watchpoints One of the following can be registered Address can be specified using a symbol Address Bit number Bit symbol e The registered watchpoints are saved in the debugger when the ASM watch window is closed and are automatically registered when the window is reopened e If symbols or bit symbols are specified for the watchpoints the watchpoint addresses are recalculated when downloading the target program e The invalid watchpoints are marked by lt not active gt when displayed on the screen e The order in which the watchpoints are listed can be changed by a drag and drop operation e The watchpoint expressions sizes radixes and datas can be changed by in place editing ATTENTION e The RAM monitor obtains the data accessed through the bus Any change other than the access from the target program will not be reflected e 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 first byte of the data 74 7 Windows Dialogs 7 2 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window
35. R8C Blank Page Setup of Debugger 1 Features 3 Ts RAM Monitor Punetion sesoses enara So Ae a a a a 3 1 1 1 RAM Monitor Areas 2 0 ccd a e aa aa a aa ied r ete eee aea ona E S Eesaia ESR 3 eh 2 Sam pling PeriOd EACE EAEE EA TE AASE EES A AAA EEEE OES EAA EAE EN 4 1 1 3 Related Windows eare ee a e a a E a a A aas 4 T2 Break PUC OA S e a a E a EE a a E 5 1 2 1 Software Breaks Function ccccccccccccccssscccssssececseeeeecseececsesececseaececeseseeeessueeessesaeeesseeaeens 5 1 2 2 Hardware Breaks Function asmoren ro E E E E O E E aS 6 1 2 3 Address Interrupt Breaks Function rrrerrronnnorvrnrnrrrrnsnnrnrnrnssnrnennrnnnenesrerennrnnnrnssnnssensnnnsen 6 1 3 Real Time Trace Function sienien des i a a a E iaa 7 TedsdTrace Areals doce ticecct sede coctseied sted EEEE co heecsbaiiebosds EE EE EA 7 1 3 2 Trace Condition Setting naene eens thaccdueesccbeesteadediebesusedadletidcecveseiee Wetiecotiseesee 8 1 3 3 Trace Data Write Condition ccccccccesscecesssececseceeecesececeesececsesaececeeeaeeeessueeecsesaeeeseeeaeens 8 1 4 Real Time OS Debugging Function ccccccccccccccsesssceseeececsessececeeececsesssaecececescseseaeaeseeseeenenneaeees 8 1 5 GUI Input Output Function rererrrorsoononnrnrnrnssersennrnrrenssresennnnrrenssresensnnnrnnnenssnnnannrnnnensseenannrnnsenseee 8 About the Compact Emulator 9 2 1 Communication method sssinisdoesistesdseinsee Maes di EE EEEE ER EEE detter 9 2 2 Function tableuuuns sausn
36. V 4 0 All the SEMs defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of semaphore Sematr Attribute of each semaphore Sement Semaphore count Semaphore Queue Task ID Nos and task names in the semaphore queue e The following are displayed in the Sematr area TA_TFIFO Task wait queue is in FIFO order TA_TPRI Task wait queue is in task priority order e When a task connected to the SEM queue is in the state of waiting with timeout enabled waiting in twai_sem a string tmol which indicates a state of waiting with timeout enabled is appended to a string displayed in the Semaphore Queue field When a task connected to the SEM queue is in the state of forced waiting double waiting a string s which indicates double waiting is appended to a string displayed in the Semaphore Queue field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 _task26 s Display when in WAIT SUSPEND with time out 26 task26 tmol s e Up to 8 characters can be displayed in the task name in the Semaphore Queue field If a task name exceeds 8 characters the extra characters are omitted 150 7 11 7 Display the Mailbox Status In the MR window select Popup Menu Model gt Mailbox 7 Windows D
37. 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 tt CWatch fl o x cx 6 2 De Ge 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 refers 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 64 6Tutorial 6 2 13 Step13 Stack Trace Function The debugger uses the information on the stack to display the names of functions in the sequence of calls that led to
38. 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 78ms Label 0008F0 000400 pool SB Register 0 1 2 8 F ASCII 00V8 Y c X t all m D 4 e 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 e 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 e 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 e The background colors of the data display and code display areas are predetermined by access attribute as shown below Access attribute Background color Read accessed address Green Write accessed address Red Non accessed address White The background colors can be changed ATTENTION e 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
39. condition specify the desired condition from the combinatorial condition specification area e 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 IV Enable HAW Break PASS E ADDRESS 1 Al 0000 42 0000 43 0000 44 0000 45 0000 46 0000 OOOEDE e 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 Al 0000 42 0000 43 0000 44 0000 45 0000 46 0000 OOOO 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 87 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
40. dly 24 task24 dly 22 _task22 dly 23 _task23 dly 6 task6 dly 7 task dly s 20 task20 dly 7 11 4 1 Display the Timeout Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 The function of each item is as described below Tasks waiting at present are displayed in the descending order of timeout value When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents Value Shows the timeout value of each task ID name Shows the ID No and task name of the tasks in the timeout queue e Following character strings are used to indicate the type of wait state Character string Wait state slp Wait due to tslp tsk dly Wait due to dly_tsk flg Wait due to twai flg sem Wait due to twai sem mbx Wait due to trev msg e When a task connected to the timeout queue is in the state of forced waiting double waiting a string s which indicates double waiting is appended to a string displayed in the ID name field Normal display 26 _task26 Display when in WAIT SUSPEND 26 _task26 sl 145 7 11 4 2 Display the Timeout Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 The function of each item is as described below Tasks waiting at present are displayed in the descending order of timeout value When the realtime OS is MRxx conformed
41. file Exit Exits the script file Wait Waits for an event to occur before command input Pause Waits for user input Sleep z Halts for user input until the specified time has elapsed Logon E Outputs the screen display to a log file Logoff Stops the output of the screen display to a log file Exec Executes external application 164 8 Table of Script Commands 8 1 11 Program Display Commands Command Name Short Name Contents Func Checks function names and displays the contents of functions Up Displays the calling function Down Displays a called function Where Displays a function call status Path Sets and checks the search path AddPath Adds the search path File Checks a filename and displays the contents of that file 8 1 12 Map Commands Command Name Short Name Contents Map Checks and sets mapping data 8 1 13 Clock Command Command Name Short Name Contents Clock CLK Checks and changes the clock 8 1 14 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 15 Real time OS Command Command Name Short Name Contents MR Displays status of realtime OS MRxx 8 1 16 Utility Comman
42. following the instructions on the screen 18 4Preparation before Use 4 2 2 Creating a New Workspace Toolchain Not Used When debugging the existing load module file with this product a workspace is created by this method It can work even if the tool chain is not installed 4 2 2 1 Step1 Creation of a new workspace In the Welcome dialog box that is displayed when the High performance Embedded Workshop is activated select the Create a new project workspace radio button and click the OK button Creation of a new workspace is started The following dialog box is displayed New Project Workspace Projects cc eens mee Workspace Name gt gt Debugger only M16C PC7501 DOSample0 gt Debugger only M16G Starterk Project Name gt Debugger only RBC E SYSTEM DOSampledi gt Debugger only R8C E8 SYSTEM Directory D work H EW4 Samples M16C DOSample01 Browse GPU family M16G h Tool chain None Properties reen 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
43. in Windows Me 98 2000 XP and cannot be used in any other OSs e When using Windows 2000 XP a user who install the USB device driver need administrator rights e 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 11 4 Preparation before Use Please run the High performance Embedded Workshop and connect the emulator In addition in order to debug with this product it is necessary to create a workspace 4 1 Workspaces Projects and Files Just as a word processor allows you to create and modify documents this product allows you to create and modify workspaces A workspace can be thought of as a container of projects and similarly a project can be thought of as a container of project files Thus each workspace contains one or more projects and each project contains one or more files 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
44. 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 7 8 6 Specify the Events Instruction Fetch How to set events for fetch is same as the way for H W Break Point Setting Window For detail about the setting refer to 7 6 4 Specify the Events Instruction Fetch 7 8 7 Specify the Events Memory Access How to set events for memory access is same as the way for H W Break Point Setting Window For detail about the setting refer to 7 6 5 Specify the Events Memory Access 7 8 8 Specify the Events Bit Access How to set events for bit access is same as the way for H W Break Point Setting Window For detail about the setting refer to 7 6 5 Specify the Events Memory Access 7 8 9 Specify the Event Combination Condition How to set combination of events is same as the way for H W Break Point Setting Window For detail about the setting refer to 7 6 7 Specify the Event Combination Condition 123 7 8 10 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
45. 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 3 Starting Setup of Debugger 3 1 Communication method by emulator The supported communication methods are as follows e USB 3 1 1 USB Interface e The supported host computer OS is Windows Me 98 2000 XP USB communication cannot be used in any other OS e Compliant with USB Standard 1 1 e Connections via USB hub are not supported e By connecting the host computer and the emulator with USB cable it is possible to install the supported device drivers using a wizard e The necessary cable is included with the emulator 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 e You have setup the debugger for the first time e You have upgraded emulator debugger e The firmware downloaded to the emulator is unknown one 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 fi
46. started by connecting with an emulator 4 3 1 Connecting the Emulator Connect the emulator by simply switching the session file to one in which the setting for the emulator use has been registered The session file is created by default The session file has information about the target selected when a project was created In the circled list box in the following tool bars select the session name including the character string of the target to connect After the session name is selected the dialog box for setting the debugger is displayed and the emulator will be connected 4 3 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 24 5Setup the Debugger 5 Setup the Debugger 5 1 Init Dialog The Init dialog box is provided for setting the items that need to be set when the debugger starts up The contents set from this dialog box are also effective the next time the debugger starts The data set in this dialog remains effective for the next start
47. 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 e 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 e When a script file is open you can invoke script commands from the command input area provided the script file is not being executed e 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 78 7 Windows Dialogs 7 4 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function 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 Record On Record the executed commands to a file Off Sto
48. 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 is switched in this debugger in the following circumstances e When a command is entered 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 scope e During command execution The current scope automatically switches depending on the program address being handled by the command 171 9 2 2 2 Priority levels of labels and symbols The conversion of values to labels or symbols and vice versa is subject to the following levels of priority Conversion of address values Local labels Global labels Local symbols Global symbols Local labels outside scope Local symbols outside scope Aap oH Conversion of data values Local symbols Global symbols Local labels Global labels Local labels outside scope Local symbols outside scope Aap wNpe Conversion of bit values Local bit symbols Global bit symbols Local bit symbols outside scope DnS 9 2 3 Macro Variables Macro variables are defined by assign statements in the script file See Section 9 1 2Assign Statement in the Reference part for details Precede variables with
49. with time out double wait WAI FLG TMO Event flag wait state with time out WAI FLG TMO SUS Event flag wait state with time out double wait WAI SEM TMO Semaphore wait state with time out WAI SEM TMO SUS Semaphore wait state with time out double wait WAI MBX TMO Message wait state with time out WAI MBX TMO SUS Message wait state with time out double wait 2Display the Wait Cancellation Condition of Event Flag flg mode Status TWF ANDW Waits for all bits set in the wait bit pattern to be set AND wait TWF ANDW TWF CLR Clears the event flag to 0 when an AND wait has occurred and the task wait status has been cancelled TWF ORW Waits for any one bit set in the wait bit pattern to be set OR wait TWF ORW TWF CLR Clears the event flag to 0 when an OR wait has occurred and the task wait status has been cancelled 141 7 11 2 2 Display the Task Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the tasks defined in the configuration are listed in the order of ID number The function of each item is as described below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Items Contents ID Task ID Name Task name Pri Priority Status 1 Task status Wupent Wake up count Actent Activated count Tmout Timeout value Flgptn Wait bi
50. 0 All the cycle handlers defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of cycle handler StaAddr Starting address of cycle handler name Name of cycle handler interval Interrupt interval count Interrupt count Status Activity status of cycle start handler e The following are displayed in the Status area TCY_ON Cycle handler enabled TCY_OFF Cycle handler disabled 155 7 11 9 2 Display the Cycle Handler Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the cycle handlers defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of cycle handler Name Name of cycle handler Cycphs The activation phase by the millisecond Cyctim The activation cycle time by the millisecond Tmout The amount of time by the millisecond remaining before the cyclic handler s next activation time Status Activity status of cycle start handler e The following are displayed in the Status area TCYC_STA TCYC_STP Cycle handler is in an operational state Cycle handler is in a non operational state
51. 003H 0005H 0003H 0005H 0005H 0007H 0007H 0002H 0002H 0003H 0003H 10 task10 11 _task11 s 7 11 6 1 Display the Semaphore Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the SEMs defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of semaphore Def cent Default value of semaphore counter Count Semaphore count semQ Task ID Nos and task names in the semaphore queue e When a task connected to the SEM queue is in the state of waiting with timeout enabled waiting in twai sem a string Itmol which indicates a state of waiting with timeout enabled is appended to a string displayed in the semQ field When a task connected to the SEM queue is in the state of forced waiting double waiting a string s which indicates double waiting is appended to a string displayed in the semQ field Normal Display 26 task26 Display when in WAIT SUSPEND 26 _task26 sl Display when in WAIT SUSPEND with time out 26 task26 tmo s e Up to 8 characters can be displayed in the task name in the semQ field If a task name exceeds 8 characters the extra characters are omitted 149 7 11 6 2 Display the Semaphore Status When the realtime OS is MRxx conformed to uITRON specifications
52. 16 bits bus width 53112 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 If the slider is at the middle position it means that the value is indeterminate 34 5Setup the Debugger 5 3 1 2 Emulation Memory Tab The specified content becomes effective when the next being start Debug Monitor Bank Address fo e Internal ROM Area F80000 FFFFFF is allocated r Emulation Memory Allocation Bank Leneth Map Areal fo fosse mj Nouse f Area fo f256kB mj Nouse f Areas fo f256kB mj Nouse Aread fo fosse mj Nouse f 8121 Debug monitor s bank address settings This product allocates a 64 Kbyte contiguous address area as the emulator s work area for use by the debug monitor Specify any bank that the target system does not use The debug monitor uses a 64 Kbyte area from the start address of the specified bank Example If the specified bank is FO then the debug monitor uses a 64 Kbyte area beginning with address FO00000h Debug Monitor Bank Address F0 e The bank specified here cannot have its contents referenced or set The contents of this area when displayed in the Memory window or the Program Source window s disassemble display mode may not be correct e The following bank addresses cannot be specified MCU internal resources e g SFR and RAM areas DRAM area and mu
53. 60 REC FoUSB UART MIM1SG REC PC7501 Emulator MMISC REC Simulator 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 16 4Preparation before Use 4 2 1 4 Step4 Setting the Configuration File Name Set the configuration file name for each of the all selected target The configuration file saves the state of High performance Embedded Workshop except for the target emulator simulator New Project 6 7 Setting the Debugger Options Emulator Debue M160 R8C PC7501 Emulator MGany The default name is already set If it is not necessary to change please click the next button as it is 17 4 2 1 5 Step5 The check of a created file name Finally confirm the file name you create The files which will be generated by the High performance Embedded Workshop are displayed If you want to change the file name select and click it then enter the new name hanging the File N The following source files will be generated Main Program nert0 a30 Start up file sect30 inc Start up file Next gt Finish Cancel This is the end of the emulator settings Exit the Project Generator
54. 66 9 Writing Script Files 168 9 1 Structural Elements of a Script File rerorrrrronnrorrrnrrrrrensnnrrrnenrsrrnsnnrnnnenssennennrnnnenssnesennnnnsensnensnn 168 9 151 Script Commands p satte a aa aa 169 9 1 2 Assign Statement ccccccccsccccccecsesessscecececeesesseseseeccsesesssseeeeeesesenssseseecceesesnsaeeeeeeeeeeneaaes 169 9 1 3 Conditional Statement a na aa n a Ee e RS i ie a IR ei he 169 9 1 4 Loop Statement while endw and Break Statement c ccccccccccssessescsseseescsseseesesseseees 169 9 1 5 Comment statements i 2 dc0csisccbisis cecexecetesSonwe hu EE EE E E E R Ea 170 9 2 Writing Expresslong rrrrrrrrrrrrrrvrrrrerrrrrrrereresesesesrsrsesesesesesesesesevevesevesesesesevesesssesssesesesnsssssesen 170 9 21 Constante sis Fikes ask he cae Rae add dared Bk SRI A ee 170 9 2 2 Symbols and labels ccccccccccecssssnsccecececsensnsececececsesensececececsesensaaececceseseeaaeceseesenesaaees 171 912 3 Macro Varia bles sii 2seccteesssiseotwecteeieite ide Debt epee a E aise cde Misbeets a e iene uadietees 172 9 2 4 Register variables rrrrrrrererererererererevereveveveverereveverereveveveveveveveveveveveverevesesevevevesnvesesesen 173 9 2 5 Memory Varia oI E EE E Gao a aaa as ee AEE Sedo hea E ha SR ES 173 9 26 LATO NOS soe c E dende brede a dncat duacais bossbeeaa renn sued dadendeboae E 173 iii 10 11 12 9 2 7 Character constants irena uien EE A E EEANN H CEA ER 174 9 2 S Operators serea n e a E E
55. 7FFFFh EXT EXT MAP Mode 80000h BFFFFh EXT EXT C0000h FFFFFh MAP 1 40000h 7FFFFh EXT EXT MAP 80000h BFFFFh EXT MAP PM13 bit3 of processor mode register1 00005h OFS offset bit bit2 of data bank register 0000Bh EXT memory access to the target system MAP memory access to the area which depends on MAP setting in MCU Settingts dialog INT means emulation memory in the compact emulator EXT means target system 191 Memory access to the expanded area C watch window Memory window and other debugging windows can not show correct values when it shows the expanded area of the memory space expansion fuction Debugging windows does not consider the bank register To see this area please use script commands listed below and specify the bank the status of offest bit and the address for M16C DumpByte2 DumpWord2 or DumpLword2 You can also use the commands below DumpByte2 DumpWord2 DumpLword2 SetMemoryByte2 SetMemoryWord2 SetMemoryLword2 FillByte2 FillWord2 FillLword2 Move2 MoveWord2 Caution The function below may not work as expected when these functions access to the expanded area Debbugger can not distinguish the bank information from BUS information RAM monitor function RAM Monitor window C Watch window etc Coverage measurement function Coverage window Coverage command etc Memory protect function Protect window Protect command etc Hard
56. AR EC Compiler e the IAR C Compiler 12 2 4 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 5 Hardware Event If you specify word length 2 byte length data from an odd address as an event in the following data accesses the event is not detected Also even when any other bit of the address that contains a specified bit is accessed during bit access the event may become effective Hardware Break Event Real time Trace Event 188 12Attention 12 2 6 CPU rewrite e Please don t rewrite the block 0 FFC000h FFFFFFh If you did emulator gets out of control e When you enabled CPU rewrite mode you can not use the debug functions below Setting address match interrupt break points Setting software break points to the internal flash ROM COME execution to the internal flash ROM e You can not use the functions below to the CPU rewrite control program from setting CPU rewrite mode select bit to clearing it If you use these functions it may be unable to shift to CPU rewrite mode or the contents of a flash ROM may be unable to be read to normalcy Single step Software break points
57. CA7D 16b IW R 0 2 1 1 11111111 00 00 00 053 588 32386 OFO10C 7318 16b IW R 0 4 1 1 11111111 00 00 00 053 588 xl 128 7 Windows Dialogs 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 Kax Range 32511 TD hv Beak Fie Dye o Tae OT ins A Cycle Obj code Laber hrm s ms us a 18960 0F0199 730BFO RO 10H FB 00 00 00 054 427 18957 OFO19C CS1BFD 1H 3H FB 00 00 00 054 427 18953 OFO19F FEC1 FO161H 00 00 00 054 427 18946 OFO161 778BFDOA00 OOO0AH 3H FB 00 00 00 054 428 18943 OFO166 7DCA39 FOIA1H 00 00 00 054 428 18936 OFO1A1 7DF2 00 00 00 054 428 18929 0F0087 F50600 randam FOOSEH 00 00 00 054 429 18920 OFOOSE 7CF204 randam access 04H 00 00 00 054 429 16916 OFOOS1 FDD40BOF rand FOBD4H 00 00 00 054 430 mi 18906 OFOBD4 7SCO6D4E _rand 4E6DH RO 00 00 00 054 430 18904 OFOBDS 75C2C641 41C6H R2 00 00 00 054 430 18902 OFOBDC 754F4004 0440H 00 00 00 054 430 18898 OFOBEO 7S4F3E04 043EH 00 00 00 054 431 18893 OFOBE4 FEO1 FOBE6H 00 00 00 054 431 18889 OFOBE6 FD1COCOF i4mull FOC1CH 00 00 00 054 431 18879 oFocic EC50 R1 R3 00 00 00 054 432 18875 OFOC1E 75B107 7H SP R1 00 00 00 054 432 18870 orocz1 7121 R2 R1 00 00 00 054 432 18865 orocz3 7312 R1 R2 00 00 00 054 433 18863 orocz5 75B109 SH SP R1 00 00 00 054 433 18859 o
58. D number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of memory pool Mplatr Attribute of each memory pool Mpladr Base address of memory pool Mplsz Size of memory pool Blkent Total block count of fixed length memory pool Fblkent Number of unused blocks and information on unused memory blocks Memory Pool Queue Displays the ID number and name of tasks waiting in the memory pool e The following are displayed in the Mplatr area TA_TFIFO Task wait queue is in FIFO order TA_TPRI Task wait queue is in task priority order e The display of the ID field varies depending on which one is specified fixed length or optional length If the data is of fixed length the ID field displays a string F and memory pool ID number For an arbitrary length the contents displayed on the first line are the character string V a memory pool ID number and a block ID number Displayed on the second to fourth lines are the memory pool ID and block ID numbers The block ID numbers are enclosed in parentheses 159 7 11 12 Display the Task Context 7 11 12 1 Display the Task Context In the MR window select Popup Menu Context The Context dialog box is opened The Context dialog box is used to reference specify the context information of the specified task You can also open the Context dia
59. ITRON specifications V 3 0 Item Contents ID ID No of memory pool BaseAddr Base address of memory pool Blk Size Block size of memory pool Total Blk_cnt Tot al block count of memory pool Free Blk_cnt map Number of unused blocks and information on unused memory blocks bit information e The display of the ID field varies depending on which one is specified fixed length or optional length If the data is of fixed length the ID field displays a string F and memory pool ID number For an arbitrary length the contents displayed on the first line are the character string V a memory pool ID number and a block ID number Displayed on the second to fourth lines are the memory pool ID and block ID numbers The block ID numbers are enclosed in parentheses When specifying the optional length memory pool is displayed in the Total Mlk cut field No bit information is displayed in the Free Blk_cnt map field When specifying the fixed length memory pool the display format of each bit in the memory block information in Free Blk_cnt map is as shown below item Contents iy Memory block in use busy ijt Memory block not in use ready No memory block 158 7 Windows Dialogs 7 11 11 2 Display the Memory Pool Status When the realtime OS is MRxx conformed to ulTRON specifications V 4 0 All the memory pools are listed in the order of I
60. Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 137 7 11 MR Window Use the MR Window to display the status of the realtime OS You can only use the MR Window when you have downloaded a program that uses the realtime OS if the downloaded program does not use the MR nothing is displayed in the MR Window when it is opened MR xi wi Orgu ORE EB Current Run Task 1 main ID Stazddr name Pri Status wup count timeout flg ptn flg mode OF17F8H main 1 RUN 0000H OF1A68H _task2 2 RDY 0000H OFIA76H _task3 SUS 0000H OF1484H _task4 WAI SLP 0000H DF1A9AH task5 WAI SLP SUS 00008 DF1ABOH task6 WAT DLY 0000H OF1ACAH task WAI DLY SUS 0000H OF1AE4H tasks WAI FLG 00008 1111H TWE_ORW OF1BOZH task9 WAI FLG SUS 0000H 11118 TWF ORW Fa gt 1 2 3 4 5 6 7 8 9 k _ e You can open the MR window as many as the number of display modes e By clicking the desired button the MR window display mode changes and the display data also changes e By double clicking the desired task line you can display the context data of the task e You can drag the cursor to change the width of the display area in each mode e If the downloaded program does not use MR you cannot select all the menu which will select the display mode e The supported display mode is as follows If a target program created by MR30
61. Points Setting ADDRESS ACCE CONDITION main FETCH addr 0F0042 Fune_Static FETCH addr OF01 A4 globalfloat WRITE addr 000400 0420 lt data lt O4FF 000000 FETCH addr 000000 000000 FETCH addr 000000 000000 FETCH addr 000000 Combinatior AND v Detail I Enable petai ace Area ite Condition About 16K 16K Total v Detail Setting of trace area Setting of trace write condition Setting of combination condition Setting of Process ID e 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 e 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 e These events can be combined in one of the following ways 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 118 7 Windows Dialogs 7 8 1 Specify
62. REJ10J1381 0100 Everywhere you imagine LE NESAS M16C R8C Compact Emulator Debugger V 1 02 User s Manual Renesas Microcomputer Development Environment System Rev 1 00 Aug 01 2006 Renesas Technology 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 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
63. U Rewrite Mode Select the above check box when you are debugging the target system that uses CPU rewrite mode 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 e Address match breakpoints cannot be set e No software breaks can be set in the internal ROM area e The command Come cannot be executed in the internal ROM area 5 1 1 7 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 IV Enable the Trace Point Function Select the above check box when you use the event of Compact emulator as a trace point Supplementary explanation When the trace point setting function is enabled the following limitations apply e Hardware break function cannot use 28 5Setup the Debugger 5 1 2 Debugging Information Tab The specified content becomes effective when the next being download Compiler NCSOWA NC8C Object Format fic EE 695 I On Demand 5 1 2 1 display the compiler used and its object format Display the compiler used and its object file format Compiler NO30WA NC8C 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 1 2 2 Specify the Storing
64. accessed via the target program as in the case where memory is rewritten directly from an external I O e 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 0018 0008 00D2 0000 007C 0000 0000 0000 0000 0000 0000 MOON 0000 0000 0000 0000 0000 0050 0000 70 7 Windows Dialogs e The displayed access attributes are initialized by downloading the target program e The interval time at which intervals the display is updated may be longer than the specified interval depending on the operating condition shown below Host machine performance load condition Communication interface Window size memory display range or the number of windows displayed 7 1 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function RAM Monitor Area 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 ad
65. ach 1 1 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 ii continuous area 000000h QOOFFFh FFFFFFh I FFFFFFH 1 1 2 Sampling Period Sampling cycle means the display update interval You can specify this function in any window which supports the RAM monitor The interval of 100 ms is set by default The actual sampling cycle may take longer time than the specified cycle depending on the operating environment Sampling cycle depends on the following environments e Communication interface e Number of the RAM Monitor windows displayed e Size of the RAM Monitor window displayed e Number of ASM watch points within the RAM monitor area of the ASM Watch window e Number of C watch points within the RAM monitor area of the C Watch window 1 1 3 Related Windows The window where the function of the real time RAM monitor function can be used is shown below e RAM Monitor Window e ASM Watch Window e C Watch Window 1Features 1 2 Break Functions 1 2 1 Software Breaks Function Software Break breaks the target program before execution of the command at the specified address This break point is called software breakpoint The software breakpoint is set reset in the Editor Source window or in the S W Breakpoint Setting w
66. ar to scroll through the user program and look at the other statements 51 6 2 4 Step4 Setting a Breakpoint A software breakpoint is a basic debugging function The Editor Source window provides a very simple way of setting a software breakpoint at any point in a program 6 2 4 1 Setting a Software Breakpoint For example to set a software breakpoint at the sort function call Double click the S W breakpoints column on the line containing the sort function call s tutorial c init amp sam 3 for 0 i lt 10 itt I j rand ifj lt 0 I J 53 ali j sort a change 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 52 6Tutorial 6 2 5 Step5 Executing the Program Execute the program as described in the following 6 2 5 1 Resetting of CPU By default CPU is not reset after downloading a program To reset the CPU select Reset CPU from the Debug menu or click the Reset CPU button et on the toolbar 6 2 5 2 Executing the Program To execute the program select Go from the Debug menu or click the Gol button on the toolbar The program will be executed up to the breakpoint that has been set and an arrow will be displayed
67. assigned character constants are processed in the same manner as immediate values 10 1 17 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 e 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 179 10 2 Display Format of C C Expressions C C expressions in the data display areas of the C Watch Windows are displayed as their type name C C expression variable name and result of calculation value as shown below The following describes the display formats of the respective types 10 2 1 Enumeration Types e When the result value of calculation has been defined its name is displayed DATE date Sunday all Radices e 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 10 2 2 Basic Types e When the result of calculation is a basic type other than a char type or floating point type it is displayed as follows unsigned int i unsigned int i unsigned int i 65280 when Radix is in initial state OxFF00 when Radix
68. bx a string tmol which indicates the state of timeout enabled is appended to a string displayed in the Mailbox Queue Wait field When a task connected to the mail box queue is in the state of forced waiting Double waiting a string s which indicates the state of double waiting is appended to a string displayed in the Mailbox Queue Wait field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 Is Display when in WAIT SUSPEND with time out 26 task26 tmol sl e Up to 8 characters can be displayed in the task name in the Mailbox Queue Wait field If a task name exceeds 8 characters the extra characters are omitted 152 7 Windows Dialogs 7 11 8 Display the Data Queue Status In the MR window select Popup Menu Model gt Data Queuel MR x mioOor AMuevdeoWi Oese Dtgatr Dtent Dtgsz Data Queue Wait Data Queue Data TA TFIFO 0 0 Send 23 task23 24 _task24 s 25 TA_TFIFO Receive 27 task27 28 _task28 s 0 TA TFIFO 0 Send 31 task3l 32 task32 s 33 0 Receive 35 task35 36 task36 s TA TPRI 7 11 8 1 Display the Data Queue Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the data queues defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0
69. 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 e 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 e The RAM monitor obtains the data accessed through the bus Any change other than the access from the target program will not be reflected e The variables which are changed in real time are global variables and file local variables only e 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 first byte of the data 76 7 Windows Dialogs 7 3 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Add Add C watchpoint Remove Remove the selected C watchpoint Remove All Remove all C watchpoints Initialize Reevaluates the selected C watchpoint Set New Value Set new data to selected C watc
70. ct tag_ next Ox404 signed short global_short 1028 signed long global_long 67372036 signed int 5 5 slobal array Ox444 1028 signed int 5 slobal array 0 Ox444 1028 signed int 5 global array 1 0x454 1028 signed int 5 global_array 2 Ox45E 1028 signed int 5 global_array 3 0x468 1028 signed int 5 global_array 4 0x472 1028 e Variables can be inspected by scope local file local or global e The display is automatically updated at the same time the PC value changes e Variable values can be changed e The display radix can be changed for each variable individually e Any variable can be registered to the Watch tab so that it will be displayed at all times The registered content is saved for each project separately If two or more of the C watch window are opened at the same time the registered e The C watchpoints can be registered to separate destinations by adding Watch tabs e Variables can be registered from another window or editor by a drag and drop operation e The C watchpoints can be sorted by name or by address e Values can be inspected in real time during program execution by using the RAM monitor function ATTENTION e You cannot change the values of the C watch points listed below Bit field variables Register variables C watch point which does not indicate an address invalid C watch point e Ifa C C language expression cannot be calculated
71. cted to the date queue is in the state of waiting with timeout enabled a string Itmol which indicates the state of timeout enabled is appended to a string displayed in the Data Queue Wait field When a task connected to the data queue is in the state of forced waiting Double waiting a string s which indicates the state of double waiting is appended to a string displayed in the Data Queue Wait field Normal Display 26 task26 Display when in WAIT SUSPEND 26 _task26 s Display when in WAIT SUSPEND with time out 26 _task26 tmo s Up to 8 characters can be displayed in the task name in the Data Queue Wait field If a task name exceeds 8 characters the extra characters are omitted 154 7 Windows Dialogs 7 11 9 Display the Cycle Handler Status In the MR window select Popup Menu Model gt Cyclic Handler MR mi OPA ID Stazddr name interval count hon Feo sala status 1 2 3 4 5 6 7 8 OF1C56H OF1C58H OF1c5AH OF1C5CH OF1CSEH OF1C60H OF1C62H OF1C64H eyclel cycle2 eycle3 cycle4 cyclesSj _cycle6 _cycele cycled 0064H O3E8H O1F4H 0258H O0c8H 012CH 0190H 015EH 0064H O3E8H O1F4H 0258H O0c8H 012CH 0190H 015EH TCY_ON TCY OFF TCY ON TCY ON TCY OFF TCY ON TCY ON TCY ON 7 11 9 1 Display the Cycle Handler Status When the realtime OS is MRxx conformed to uITRON specifications V 3
72. d access words ML on INT Interrupt acknowledge RB Read access bytes WB Write access bytes DRB Read access by DMA bytes DWB Write access by DMA bytes RW Read access words WW Write access words DRW Read access by DMA words DWW Write access by DMA words 133 R W Shows the status of the data bus R for r ead W for wr it e for no access 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 CPU OPC OPR This shows the signal between CPU and BIU In the column CPU the data shows whether CPU accesses BIU or not In the Column OPC the data shows the byte size of read operat ion code In the Column OPR the data shows the byte size of read operand Representation Status CPU OPC OPR Operation code size Operand size No accessing CPU 0 1 Obyte lbyte CPU 0 2 Obyte 2bytes CPU 0 3 Obyte 3bytes CPU 1 0 lbyte Obyte CPU 1 1 lbyte lbyte CPU 1 2 lbyte 2bytes CPU 1 3 lbyte 3bytes CPU 2 0 2bytes Obyte CPU 2 1 2bytes 1byte CPU 2 2 2bytes 2bytes CPU 3 0 3bytes Obyte CPU 3 1 3bytes lbyte DMA DMA accessing DMAT DMA accessing terminal count 134 7 Windows Dialogs 7 9 7 Display of bus information on the M16C R8C Debugger From left to right the contents are as follows Address The status of the address bus Data The s
73. d task names in the event flag queue e The following are displayed in the Flgatr area TA_TFIFO Task wait queue is in FIFO order TA_TPRI Task wait queue is in task priority order TA_WSGL Only one task is allowed to be in the waiting state for the eventflag TA_WMUL Multiple tasks are allowed to be in the waiting state for the eventflag TA_CLR Eventflag s bit pattern is cleared when a task is released from the waiting state for that eventflag e When a task connected to the event flag queue is in the state of waiting with timeout enabled waiting in twai flg a string tmo which indicates a state of waiting with timeout enabled is appended to a string displayed in the Flag Queue field When a task connected to the event flag queue is in the state of forced waiting double waiting a string s which indicates double waiting is appended to a string displayed in the Flag Queue field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 s Display when in WAIT SUSPEND with time out 26 task26 tmol sl e Up to 8 characters can be displayed in the task name in the Flag Queue field If a task name exceeds 8 characters the extra characters are omitted 148 7 11 6 Display the Semaphore Status 7 Windows Dialogs In the MR window select Popup Menu Mode gt Semaphorel MR mi OPA DSD AFEA AEA ID Def ent Count semQ 0000H 0000H 0003H 0
74. 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 e 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 e Trace when one of the valid events is established OR condition 1 2 3 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 Details 1 2 3 1 Setting and Deleting a Break Points The address interrupt beakpoint can be set by the following windows e Editor Source Window e Add
75. dress 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 Abytes 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 71 7 1 2 Setting the RAM monitor area Choose the popup menu RAM Monitor Area in the RAM monitor window The RAM monitor area setup window shown below will appear The currently set RAM monitor areas are listed in this window ma RAM Monitor Area Setting Current Assigned Area Add Remove 003000
76. dress 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 AT Set Event Status Event Type DATA ACCESS v Address Data Settine Ranee addr Address v Address1 fa00 Address2 fo0040F z gl Function Source File Function ACCESS WRITE ADDRESS 000400 CONDITION taddr 000400 data amp 00FF 0034 Caneel Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range data Datal v Data 1 0034 Data 2 pooo Access WRITE v Iv Mask JOOFF ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 fdata amp 00FF 0034 mest 97 2nd point A2 Set Event Status DATA ACCESS vw w da Effa ES A2 Set Event Status DATA ACCESS l ponz gt fom oo WRITE g m Dor O o 98 7 Windows Dialogs 16 bits bus width 41 Set Event Status DATA ACCESS vw ol Effa 41 Set Event Status DATA ACCESS l f od WRITE H m 99 765 12 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 fAddersst lt addr lt Add
77. ds 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 165 8 2 Table of Script Commands alphabetical order 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 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 gt Displays the date DisAssemble DA Disassembles memory contents line by line Down 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 DumpWord DW Displays the contents of memory in 2 byte units Echo 2 Dis
78. e 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 e If you are inputting a radix that matches the predetermined radix you can omit the symbol that indicates the radix excluding binary e 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 Type Radix Address Hex Line No Dec No of executions No of passes 170 9Writing Script Files 9 2 2 Symbols and labels You can include symbols and labels defined in your target program or symbols and labels defined using the Assemble command e You can include alphanumerics the underscore _ period and question mark in symbols and labels However do not start with a numeric e Symbols and labels can consist of up to 255 characters e Uppercase and lowercase letters are unique Product Name Notes The debugger for M32R e You cannot include the assembler structured instructions The debugger for M32C pseudo instructions macro instructions operation code or The debugger for M16C R8C reserved words SECTION BYTE switch if etc e You cannot use strings that start with two periods for symbols or labels 9 2 2 1 Local label symbol and scope This debugger supports both global label symbols
79. e 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 184 12Attention 12 Attention 12 1 Common Attention 12 1 1 File operation on Windows The following points should be noted 1 File Name and Directory Name Do not use directory names or filenames that include blanks Operation is not guaranteed if your directory names and filenames include kanji Use only one period in a filename 2 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 185 12 1 2 Area where software breakpoint can be set The area which can be set for software breakpoi
80. e Debugger 5 3 Setup the Debugger for M32C 5 3 1 Emem Dialog In the Emem dialog box setting information on the user target The Emem dialog box opens after closing the Init dialog box Status Emulation Memory Flash Clear Processor Mode Sine le chip Mode d MOU Status ONVss NMR RDY HOLD Hiji pam E Cancel Help T Do not show this dialog box again The tabs available on this dialog box vary with each product used For details click the desired tab name shown in the table below Tab Name Contents Status Specify the processor mode Emulation Memory Specify the emulation memory area Flash Clear Specify whether or not to clear the contents of the MCU s internal flash ROM To keep the Emem dialog box closed next time the debugger is started check Next Hide at the bottom of the Emem dialog box You can open the Emem dialog using either one of the following methods e After the debugger gets started select Menu Setup gt Emulator gt Target 33 5 3 1 1 Status Tab The specified content becomes effective when the next being start PD er IGE Bie 53111 Select the Processor Mode Specify the processor mode for the target system Either the following can be specified e Single chip Mode Single chip Mode e Memory Expansion 8 Bit Memory Expansion Mode 8 bits bus width e Memory Expansion 16 Bit Memory Expansion Mode
81. e contains the information specific to the target MCU e The specified MCU file is displayed in the MCU area of the MCU tab 5 1 1 2 Setting of the Communication Interface The displayed data varies depending on the specified communication interface The available communication interface varies depending on the products The following shows the setting for each communication interface Refer to 5 2 1 Setting of the USB Interface 5 1 1 3 Executing Self Check Specify this option to execute self check on the emulator when the debugger starts up I 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 e When the firmware cannot be downloaded e When although the firmware is successfully downloaded the debugger does not start e When the MCU goes wild or something is wrong with the trace results and you want to check whether the emulator is operating normally 26 5Setup the Debugger Select the check box to close the Init dialog box After connecting to the emulator and confirming the firmware the debugger will immediately start self check on the emulator Self check takes about 30 seconds to 1 minute If an error is found in this self check the debugger displays the content of the error and is finished When the self check terminated normally the dialog box shown below is displayed When you click OK the debugger starts up directly
82. e or two characters 16 bits max If more than two characters are specified the last two characters of the string are processed For example ABCD would be processed as CD or value 4344h 9 2 8 Operators The table below lists the operators that you can use in expressions e 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 Function Priority level 0 Brackets level 1 Kr Monadic positive monadic level 2 negative monadic logical NOT tl Dyadic multiply dyadic divide level 3 sp Dyadic add dyadic subtract level 4 gt gt Right shift left shift level 5 amp Dyadic logical AND level 6 G Dyadic logical OR dyadic level 7 exclusive OR lt lt gt gt Dyadic comparison level 8 174 10C 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 pA Pointers KE e Reference amp Sign inversion Member reference using dot operator Object Member Member reference using arrow
83. e 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 it i f indicating structure or union Value unsigned char str OxFOOOO 89 unsigned char str 89 y struct DATA pData 0x408 struct Answer ans Ox82B unsigned char ch 100 d signed int nID 3980 P 11 ttre I 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 e 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 183 11 Display the Cause of the Program Stoppage If the program is stoped by the debug function the cause of the stoppage is displayed in the Output window or Status window Platform sheet The contents of a display and the meaning of the cause of the stoppage are as follows Display The cause of the stoppag
84. ed The commands with yellow color displaying can be executed at run time The command to which adheres behind is not supported according to the product 8 1 Table of Script Commands classified by function 8 1 1 Execution Commands Command Name Short Name Contents Go G Program execution with breakpoints GoFree GF Free run program execution GoProgramBreak GPB Run target program with software break point GoBreakAt GBA Run target program with software break point Stop E Stops program execution Status 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 5 Resets the target MCU Time G 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 Re downloads the target program UploadHex UH Outputs data to an Intel HEX format file UploadMot UM Outputs data to a Motorola S format
85. ed 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 Renesas 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 co
86. ed when the address match interrupt is not used in the user application For details refer to 1 2 38 Address Interrupt Breaks Function You can set break points in the Editor Source Window To do so double click the break point setting area Address Match Interrupt Break column for the line in which you want to set the break A blue marker is displayed on the line to which the break point was set whilet gap gt 0 1 fort k 0 k lt gap k 1 fort i ktgap i lt 10 i itgap OI for j i gap j gt k j i gap iffalj gt alitgapl it t alj alj 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 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 column can be set up for each Editor Source windows 117 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 E Trace
87. eecseeeseesaeeecseaaees 179 10 9 17 Character String Dte aS a a arae Ea E a EE de ETES 179 10 2 Display Format of C C Expressions c ccccccccssessssesecececsesseseeeeeceecesssaeceeeceesesnsaeceeeeeesensaaeas 180 10 2 Enumeration Types aoe noerder T Ee EE EEE E E a 180 10 22 B sie Types sauen ra 180 10 2 3 Pomte erTypesasnuoanestheakeekkde koke es O E ker 181 10 2 Array Typessstkatai Garn OERE EE ELAT E PREET itte sanitet 182 1025 Hunt On Py pee skinin EE E es een Oe PSS Boss 182 10 2 6 Reference Types ccccccccccccssssssssecececsesssssseeccecsessaececececsessaeeeeececseseasseeeeseseneaeaeeeeeeeenes 182 102 7 Bit Freld Typ snastsusmasrlaamddkdksaetaerlaedastssta Slakt 182 10 2 8 When No C Symbol is Found erenororvrrrrrerennnnrrrnrersrennnnrrrnsersrennnnrrnnsnesrensnnrrnnsnessensnnnsen 183 10 2 9 Syntax ErrorsurssnddadfeedknbkvbesdiassdaksteG detyyedk ete 183 10 2 10 Structure and Union Types u cccccccsccccccccsessceceeececsesssseceeeceesesssaeeeeccecsesssaseeeeeeeeenees 183 Display the Cause of the Program Stoppage 184 Attention 185 12 1 C6mm n Attention san a a BU RS hae see RBA Sale needs 185 12 1 1 File operation on WindOWS cccccssesesesesesesesesesesesesesesesesesesesesesesesesesesesesesesesenesenenens 185 12 1 2 Area where software breakpoint can be Set c ccccccecsssssccceceeeesssseceeececsesssaseeeeeeeseees 186 12 1 3 Get or set C variables sisselrot eiedere diinsiin enes EEKE EKE Ee eR chess 187 12 1 4
88. en a task connected to the mail box queue is in the state of forced waiting Double waiting a string s which indicates the state of double waiting is appended to a string displayed in the WaitQueue Message field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 task26 s Display when in WAIT SUSPEND with time out 26 task26 tmol sl e Up to 8 characters can be displayed in the task name in the Wait Queue Message field If a task name exceeds 8 characters the extra characters are omitted 151 7 11 7 2 Display the Mailbox Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the mail boxes defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of mailbox Mbxatr Attribute of each mailbox Mailbox Queue Wait ID No and task name of tasks waiting for messages Mailbox Queue Message The messages stored in the mailbox e The following are displayed in the Mbxatr area TA_TFIFO Task wait queue is in FIFO order TA_TPRI Task wait queue is in task priority order TA_MFIFO Message queue is in FIFO order TA_MPRI Message queue is in message priority order e When a task connected to the mail box queue is in the state of waiting with timeout enabled waiting in trev m
89. ernerenereereesreresn 111 7 6 7 Specify the Event Combination Condition 0 ccccccccccccessesssceeeeecsesssseceeeeecsensseseeeceees 113 7 7 Address Interrupt Break Point Setting Window ccccccccccccssssssscecececsessaeceeececeesssseceeeeeeeenes 115 7 7 1 Command Button cccccccssccccssssececssececsssececseccecessseeecsesaececeeeeeesesaeeecsesaecesseseeeesseeeeseaes 116 7 8 Trace Point Setting Window cccccccccccececsesssececececsesssaececececsesesececececseneeseeeeecsenennsaeeeeeeeeees 118 7 8 1 Specify the Trace Event cccccccscccccecsessssscecececsesessececececeesesseseeeeeceeseaaseeeeseeenenssaeseeecs 119 7 8 2 Specify the Combinatorial Condition cccccccesscccececsesssnsceeececsesssnsceeececeesesssaeeeeeees 121 7 8 3 Specify the Trace Range ccccccsccccccccsessssececececsessaeceeccecsesssaeeeeececsessaseeeeeeceenssasseeeeeees 122 7 8 4 Specify the Trace Write Condition ccccccccccccesssssscecececsessseceeececsessaeeeceeeceesssseseeeeeees 122 7 8 5 Command Butt0on ccccssccesssssecssssssecseseceesssssecsensssecseceeeecesssecsesausecseseeesensnsecseseusesssaes 123 7 8 6 Specify the Events Instruction Fetch cccccccccscssessescssescescsceseescsessceecsesseecsessseeeseeaes 123 7 8 7 Specify the Events Memory Access c cccccsssssssescssessescssescecsesscsecsesscsecsessesecsesscsecseeaes 123 7 8 8 Specify the Events Bit Access 7 8 9 Specify the Event Combination Condition 0
90. es The following shows examples of entering commands depending on the product e The debugger for M32C gt ICCMC80 r filel c lt Enter gt gt ICCMC80 r file2 c lt Enter gt gt XLINK o filename 695 f lnkm80 xcl filel file2 lt Enter gt e 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 lnkml6c xcl filel file2 lt Enter gt The XCL file name varies depending on the product and memory model For details see the ICCxxxx manual 195 12 4 5 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 ncluding type checkeing and Genarate symbolic debug information 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 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
91. es from the start event established to the end event established e Only cycles where the start event is established e Cycles from the start event established to the start event unestablished e Other than cycles from the start event established to the end event established e Other than cycles where the start event is established e Other than cycles from the start event established to the start event unestablished 1 4 Real Time OS Debugging Function This function debugs the realtime OS dependent parts of the target program that uses the realtime OS This function helps to show the status of the realtime OS 1 5 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 2About the Compact Emulator 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 Compact Emulator SW Break 64 points HW Break 2 points Address Interrupt Break 4
92. esssesen 24 Setup the Debugger 25 5 1 Init Be 0 ea Yo nine 25 Pa D A KO DEA D T o EEE E E EEA E A oie Ga ei hd ne eee ce ee a aes 26 5 1 2 Debugging Information Tab c ccccccccccsssssscecececsessascecececsessseceececcseneasseeeeseeenensaeeeeees 29 51 83 Hmulator Vabrrcuseiniiimnitialaamiim iin Mahon adams ad TT R 30 51 4 Seript Di 0 a Pe ee 31 5 2 Setting of the Communication Interface ccccccccccccessesssceeececsesensscececccecsesssaececececeenestsaeeeeeeeenes 32 5 2 1 Setting of the USB Interface ccccccccccssssscesececsessaececececcenssssceecceceesesseeeesceenentsaeeeeees 32 5 3 Setup the Debugger for M32C rrrnnornrnrnrsrenannrvrnrnssrrnennrnrnrnssensennnnrnrnssnesennnnrvensnsnnensnnrnnnensseenennnen 33 5 3 1 Emem Diall aeoiee iak E REEERE KE E iea ERSE EKE EE EEEE RASE e 33 5 4 Setup the Debugger for M16C R8C rrrarrrrnnnnrvrnrnrseerennrnrrensserrennnnrnrnssnrsensnnrrensnnsrensnnrnnnenssnenennnnn 39 5AT MCU Setting Dialogs onerare E E i e AE E E R ORE EG 39 Tutorial 6 Tutorial 47 6 1 Introduction ce elles freaks ce Se ens E EE A AEA ENNE e E EE 47 6 2 sage c anda l senere ean Dass 48 6 2 1 Step1 Starting the Debugger rrvrvrnrrrrrennnnrvrnensrernsnnrnrnensseerennnnrnrnssnrrensnnnnnnsnsssensnnrsenene 48 6 2 2 Step2 Checking the Operation of RAM rervrnrnrnonnannrnnnrnssersennnnrnrnssessensnnnnnnsnrssensnnrvnnene 49 6 2 3 Step3 Downloading the Tutorial Program rerrrrnonnr
93. et 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 190 12Attention 12 3 6 Hardware break function While running program the following operations are not performed e execute BreakMode command e open H W break point setting window 12 3 7 Hardware Event If you specify word length 2 byte length data from an odd address as an event in the following data accesses the event is not detected Also even when any other bit of the address that contains a specified bit is accessed during bit access the event may become effective e Hardware Break Event e Real time Trace Event 12 3 8 Memory space expansion e Memory mapping If you select 4MB Mode for Memory Space Expansion in MCU setting dialog the memory map depends on the other setting of mcu Processor mode PM13 OFS Access area BankO Bank6 Bank7 of the MCU i Bank5 Memory 1 0 40000h 7FFFFh EXT EXT MAP Expansion Mode 1 40000h 7FFFFh EXT EXT MAP 0 0 40000h 7FFFFh EXT EXT MAP 80000h BFFFFh EXT EXT MAP 1 40000h 7FFFFh EXT EXT MAP 80000h BFFFFh EXT MAP Microprocessor 258 0 40000h
94. 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 AOT i GONG 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 e For condition 2 choose the Mode shown below and set the Start and End events Realtime trace Write Condition Setting Mode M gt Start End Cancel 124 7 Windows Dialogs e For condition 3 choose the Mode shown below and set the Start event Realtime trace Write Condition Setting we TT Start Similarly when specifying conditions 5 to 7 choose Exclude and click the Detail button to open the Realtime trace Write Condition dialog box Write Condition Exclude v 125 e For condition 5 choose the Mode shown below and set the Start and End events Realtime trace Write Condition Setting Mode Start For condition 6 choose the Mode shown below and set the Start event Realtime trace Write Condition Setting Start r Setting
95. f Script Commands Pause z Waits for user input Print R 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 5 Re downloads the target program Reset Resets the target MCU Return RET Executes a source line return ReturnInstruction RETI Executes an instruction return Scope 5 Sets and checks the effective local symbol scope Script Opens and executes a script file Section SEC Checks section information Set a 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 SetMemoryWord MW Checks and changes memory contents in 2 byte units Sleep s 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 Checks the operating status of the MCU Step S Step execution of source line StepInstruction SI Ste
96. file 162 8 Table of Script Commands 8 1 3 Register Operation Commands Command Name Short Name Contents Register R Checks and sets a register value 8 1 4 Memory Operation Commands Command Name Short Name Contents DumpByte DB Displays the contents of memory in 1 byte units DumpWord 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 memory contents in 1 byte units SetMemoryWord 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 blocks in 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 a
97. files to that project before we can actually do anything 12 4Preparation before Use 4 2 Starting the High performance Embedded Workshop Activate the High performance Embedded Workshop from Programs in the Start menu The Welcome dialog box is displayed Cancel Open recent project workspace Administration C Browse to another project workspace In this dialog box A workspace is created or displayed e Create a new project workspace radio button Creates a new workspace e Open a recent project workspace radio button Uses an existing workspace and displays the history of the opened workspace e 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 workspacel 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 Refer to 4 2 1 Creating a New Workspace Toolchain Used Refer to 4 2 2 Creating a New Workspace Toolchain Not Used When debugging the existing load module file with this product a workspace is created by this method 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 to
98. fined in the configuration only those which are not started yet at present are listed in the ascending order of start time The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of alarm handler Name Name of alarm handler Almtim The amount of time by the millisecond remaining before the alarm handler s activation time Status Activity status of alarm handler The following are displayed in the Status area TALM_STA Alarm handler is in an operational state TALM_STP Alarm handler is in a non operational state 157 7 11 11 Display the Memory Pool Status In the MR window select Popup Menu Mode gt Memory Pool MR wmioOor A mo0oHO lt FE ID BaseAddr Blk size Total Blk cnt Free Blk cnt map F 1 F 2 F 3 V 1 1 1 2 1 3 1 4 00078624 0008F2H 000956H 0018B6H 00000014 00000014 001496H 80 10 10 1111111110 30 15 1111111111111110 24 1 56 0 120 0 248 6 7 11 11 1 Display the Memory Pool Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the memory pools defined in the configuration are listed in the order of ID number The fixed length data comes first and the optional length data comes after the fixed length data The function of each item is listed below When the realtime OS is MRxx conformed to u
99. fter 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 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 _ Me Start Total Writes all cycles Pick up Writes only the cycles where specified condition holds true Exclude Writes only the cycles where specified condition does not hold true Also following three write modes are supported IT Only cycles where specified event is established f Cycles from where specified event is established to where specified event is not established T 11 Cycles from where start event is established to where end event is established 122 7 Windows Dialogs 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
100. g shows the format to be used while expression statement endw e 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 e You can nest while statements up to 32 levels e Use the break statement to forcibly exit a while loop If while statements are nested break exits from the inner most loop 169 9 1 5 Comment statements You can include comments in a script file Use the following format character string e Write the statement after a semicolon You can include only spaces and tabs in front of the semicolon e 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 e Constants e Symbols and labels e Macro variables e Register variables e Memory variables e Line Nos e Character constants e Operators 9 2 1 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 and 740 Hexadecimal Decimal Octal Binary Prefix 0x 0X Non
101. g 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 Address ms ize Size Word Radix Hex C Dec C Bin ment Click the OK button The ASM Watch window showing the specified area of memory is displayed mmx Ri 2 0 bb Address Bit 000416 __msize Word Hex 0300 57 6 2 9 Step9 Watching Variables As the user steps through a program it is possible to watch that the values of variables used in the user program are changed 6 2 9 1 Watching Variables For example set a watch on the long type array a declared at the beginning of the program by using the following procedure Click the left of displayed array a in the Editor Source window to position the cursor and select Add C Watch with the right hand mouse button The Watch tab of C watch window in which the variable is displayed opens tox mx b 2 De amp Watch Local File Local Global Value Name signed long 10 a Ox6C2 16838 The user can click mark at the left side of array a in the C Watch window to watch all the elements s t CWatch mx s 16 2 Der ENG Watch Local File Local Global Value
102. h 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 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 132 7 Windows Dialogs 7 9 6 Display of bus information on the M32C Debugger From left to right the contents are as follows Address The status of the address bus Data The status of the data bus BUS The width of the external data bus 8b for an 8 bit data bus and 16b for a 16 bit data bus 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 BIU This shows the status between the BIU bus interface unit and memory and BIU and I O Representation BIU status 5 No access WAIT Executing wait instruction RBML Read access bytes ML on F Fetch access QC Discontinuous Fetch access queue buffer RWML Rea
103. hether 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 e After the debugger gets started select Menu Setup gt Emulator gt Target 39 5 4 1 1 MCU Tab The specified content becomes effective when the next being start MCU Setting m MCU Status MCU M16G 62P NMI H Processor Mode Single Chip Mode v HOLD H RDY H External Data Bus Width fi 6 bit zj CNVss NG BYTE NC Memory Space Expansion Normal Mode v JV PM13 b3 of 000005H is 1 I PM10 b0 of 000005H is 1 54111 Select the Processor Mode Specify the processor mode for the target system MCU Setting MCL M16C 62P Processor Mode Single Chip Mode v External Data Bus Width fi bit Memory Space Expansion Normal Mode v V PM13 b3 of 000005H is 1 I PM10 0 of 000005H is 1 Either the following can be specified e Single chip Mode Single chip Mode e Memory Expansion Mode Memory Expansion Mode e Microprocessor Mode Microprocessor Mode Also you need to specify the following information according to the processor mode you ve selected e External Data Bus Width If you selected memory extension or microprocessor mode specify 16 bit or 8 bi
104. hpoint 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 TT 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 JO x DEKKER OM Script Script File Name Loe Log File Name gt assemble main LABEL PROGRAM main Execution Result Area assemble main Command History Area gt Enter Command Command Input Area e The Script Window has a view buffer that stores
105. ialogs MR x w Oeu oo TUD o a ID Msg_cnt MAXmsg WaitQueue Message 0000H OO0AH 0002H 0014H 0000H OO0AH 0000H 003CH 0000H 0022H 0000H OOOFH 0000H 0028H Task 12 _task12 Msg 0033H 0055H Task 13 _task13 s 7 11 7 1 Display the Mailbox Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the mail boxes defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Item Contents ID ID No of mailbox Msg cnt Number of messages in each mailbox MAXmsg Maximum number of messages that can be contained in each mailbox Wait Queue Message The messages stored in the mailbox or ID No and task name of tasks waiting for messages The WaitQueue Message field shows a string Msg when a message is stored when Msg_cont as described above is non zero and then displays the stored message When no message is stored when Msg_cont is zero the WaitQueue field displays a string Task if a task waiting for a message exists and then displays the ID number and name of the task waiting for a message When a task connected to the mail box queue is in the state of waiting with timeout enabled waiting in trev msg a string tmo which indicates the state of timeout enabled is appended to a string displayed in the WaitQueue Message field Wh
106. ied to be 1 Mbytes banks 00 10 20 and up to FO every 16 banks are specified for Bank Specify the mapping information Internal or External for the specified area If no area is specified select No Use Internal The area specified to be Internal is mapped into the internal area emulation memory External The area specified to be External is mapped into the external area external resources in the target system e Areas for which No Use is selected for Map and those not specified here are mapped into external areas If compared to the case where areas are explicitly specified to be External the only difference is a download speed Downloading into these areas is slower than downloading into the areas specified to be External e The internal ROM area is automatically mapped into the emulation memory Therefore there is no need to set here e Becareful that the debug areas will not overlap e Make sure the total size of the specified debug target areas does not exceed the emulation memory size of the emulation memory board used 36 5Setup the Debugger The setting of the emulation memory area varies depending on the specified processor mode Single chip Mode You do not need to specify the area to be assigned as the emulation memory The internal ROM area is automatically mapped into the emulation memory The address range of the automatically mapped area is displayed in the Internal ROM
107. in that state 7 The self check succeeded This specification is effective only when the debugger 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 1 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 e To use 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 e 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 1 1 5 Using unusing the watchdog timer Specify whether or not to use the watchdog timer By default the watchdog timer is unused This specification exist for the M32C debugger only I Debug the program using the Watchdog Timer When debugging the target system that uses a watchdog timer select the check box shown above 27 5 1 1 6 Choosing to use or not to use CPU rewrite mode Specify whether or not you want to use CPU rewrite mode By default CPU rewrite mode is unused I Debug the program using the GP
108. in the S W Breakpoints column to show the position that the program has halted init amp sam for 0 i lt 10 i I j rand ifj lt 0 I J J ali j sort a change a sam s0 a 0 sam st 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 3 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 53 6 2 5 3 Reviewing Cause of the Break The break factor is displayed in the Output window Connected 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 break Item Status Connected to Mi6c RSC PC7501 Emulator CPU M16C Run Status Ready Cause of last break S W break Run time count 00 h OO m OO sec 001 msec 991 usec memory Platform Events Please refer to 11 Display the Cause of the Program Stoppage about the notation of a break factor 54 6Tutorial 6 2 6 Step6 Reviewing Breakpoints The user can see all the breakpoints set in the program in the S W Break Points window 6 2 6 1 Reviewing Breakpoints Select S W Break Points fr
109. indow 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 2 1 1 Setting of software breakpoint The software breakpoint can be set by the following windows e Editor Source Window e 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 2 1 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 12 1 2 Area where software breakpoint can be set 1 2 2 Hardware Breaks Function This function causes the target program to stop upon detecting a data read write to memory instruction execution or the rising falling edge of the input signal fed from an external trace cable The contents of events that can be set vary with each target MCU The following designations are available as break events e Address designation Instruction fetch Memory access Bit access e External trigger designation e Interruption The number of events that can be specified are two events of all For the address
110. indows Dialogs 7 Windows Dialogs The window of this debugger is shown below Window Name View Menu RAM Monitor Window View gt CPU gt Ram Monitor ASM Watch Window View gt Symbol gt ASMWatch C Watch Window View gt Symboll gt CWatch Script Window View gt S W Break Point Setting Window View gt Break gt S W Break Points H W Break Point Setting Window Script View gt Break gt H W Break Points Window Address Interrupt Break Point Setting m m m fo View gt Break gt Address Break Points Interrupt Trace Point Setting Window View gt Trace gt Trace Points Trace Window View gt Trace gt Trace GUI I O Window MR Window gt View gt Graphicl gt GUI I O View gt RTOS gt MR For the reference of the following windows refer to the help attached to a High performance Embedded Workshop main part e Differences Window e Map Window e Command Line Window e Workspace Window e Output Window e Disassembly Window e Memory Window e IO Window e Status Window e Register Window e Image Window e Waveform Window e Stack Trace Window 7 1 RAM Monitor Window The RAM monitor window is a window in which changes of memory contents are displayed while running the target program The relevant memory contents are displayed in dump form in the RAM monitor area
111. ing with the clock used by the target microcomputer Internal is set by default Clock Main C External Sub C Internal 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 30 5Setup the Debugger 5 1 4 Script Tab The specified content becomes effective when the next being start Init File Refer 5 1 4 1 Automatically Execute the Script Commands To automatically execute the script command at start of Debugger click the Refer button to specify the script file to be executed Init File Refer 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 31 5 2 Setting of the Communication Interface 5 2 1 Setting of the USB Interface USB communication uses the personal computer s USB interface It is compliant with USB 1 1 Before USB communication can be performed the computer must have a dedicated device driver installed in it For details on how to install USB device drivers see 3 3 1 1 Install of USB device driver 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 0290Y 3K MO1 g v 32 5Setup th
112. ints 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 deselect the Enable the Trace Point Function check box e These events can be combined in one of the following ways Break when all of the valid events are established AND condition Break when all of the valid events are established at the same time simultaneous AND condition Break when one of the valid events is established OR condition e At the time the debugger starts up the hardware breaks have no effect 83 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 Evert name Al Set Event Status Specify the event type FETOH 7E po m ZZ Carterts change with the setting of Event Type Following events can be set by specifying Event Type in this dialog box 84 7 Windows Dialogs e When FETCH is selected Breaks for the instruction fetch main Ge l e When DATA ACCESS is selected Breaks for the memory access Rw 85 e When BIT SYMBOL is selected Breaks for the bit access 86 7 Windows Dialogs 7 6 2 Specify the Combinatorial Condition To specify a combinatorial
113. ion mathematical operators The following shows the order of priority in which they are evaluated 4 Notes e There is no support currently for mathematical operators for floating point numbers 10 1 4 Pointers Pointers are indicated by the asterisk You can use pointer to pointers and pointer to pointer to pointers etc Examples variable name variable name etc Notes e Immediate values cannot be processed as pointers That is you cannot specify 0xE000 for example 10 1 5 Reference References are indicated by the ampersand amp You can only specify amp variable_name 176 10C C Expressions 10 1 6 Sign Inversion Sign inversion is indicated by the minus sign You can only specify immediate value or variable name No sign inversion is performed if you specify 2 or any even number of minus signs Notes e There is no support currently for sign inversion of floating point numbers 10 1 7 Member Reference Using Dot Operator You can only use variable_name member_name for checking the members of structures and unions using the dot operator Example class T public int member1 char member2 bi class T t cls class T pt cls amp t cls In this case t cIs member1 pt cls member2 correctly checks the members 10 1 8 Member Reference Using Arrow You can only use variable name gt member name for checking the members of structu
114. is hex 1111111100000000B when Radix is binary e 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 e 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 ES indicates abbreviation 180 10C C Expressions 10 2 3 Pointer Types e 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 e 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 I 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 the 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 ES CWatch Va
115. ks are turned off have their flash contents cleared when downloading e Pressing the Select All button keeps all blocks from being cleared when downloading e Pressing the Clear All button clears all blocks when downloading 43 MEMO 44 Tutorial Blank Page 46 6Tutorial 6 Tutorial 6 1 Introduction This section describes the main functions of this debugger by using a tutorial program The tutorial programs are installed to the directory YWorkSpaceYTutorial of the drive you installed High performance Embedded Workshop There are workspaces for each targets and each MCUs Please select the corresponding one to your system and open the workspace file hws from the menu Open Workspace 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 e The tutorial function generates random data to be sorted e The sort function sorts the generated random data in ascending order e The change function 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 6 2 1 Step1 Starting the Debugger 6 2 1 1 Preparation before Use To run the High performance Embedded Workshop and connect the emulator refer to 4 Preparation before Use 6 2 1 2 Setup the Debugger If it connects
116. le Function z ACCESS ENE ADDRESS 00040 CONDITION ne 000400 data amp 00FF 0032 Al Set Event Status Event Type DATA ACCESS v Address Data Setting Range Jidata Datal v Data 1 2 Data 2 ooo Access WRITE v Mask poog ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 data 0032 94 7 Windows Dialogs Example Writing byte length data 32h to odd address 401h Contents of settings vary with each product and bus width 8 bits bus width AT Set Event Status Event Type DATA ACCESS v Address Data Setting Range addr Address v Address 000401 J al Address2 Bl Function Source File Function 7 ACCESS WRITE ADDRESS 000401 CONDITION faddr 000401 data amp 00FF 0032 Caneel Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range data Dat sti CS YS Data 1 22 Data 2 ooo Access WRITE v MV Mask DOFF ACCESS WRITE ADDRESS 000401 CONDITION faddr 000401 data amp 00FF 0032 mest 95 16 bits bus width 41 Set Event Status DATA ACCESS vw m Effa SEs 41 Set Event Status DATA ACCESS l fn for ooo WRITE H m Froo ooo 96 7 Windows Dialogs Example Writing word length data 1234h to even ad
117. les 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 187 12 2 Attention of the M32C Debugger 12 2 1 Stack area used by the emulator The emulator uses the interrupt stack area as its work area 20 bytes When debugging allocate a sufficient interrupt stack area consisting of the regularly used size plus 20 bytes 12 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 Option of C Compiler Assembler 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 Refer to 12 4 Options for compiler assembler and linker The compiler that can be used by M32C debugger e NCxx e the I
118. located area is regarded as EXTERNAL The maps of SFR internal RAM and internal ROM are set automatically 64121 Emulation memory allocation Set the memory area in 4 KB units into which you want the emulation memory to be mapped Four of such memory areas can be set The emulation memory is mapped into the areas marked Internal The unselected areas and the areas which have nothing specified are allocated to external areas Note that MAP settings are effective for only the areas CS3 CS2 CS1 and CS0 The SFR internal ROM and internal RAM areas are automatically mapped 42 5Setup the Debugger 5 4 1 3 Flash Clear Tab The specified content becomes effective when the next being start Flash ROM Block 040000 080000 ocoo00 000000 0E0000 OFOOO0 OF8000 OF ADDO OFCOOD DAFFFF OBFFFF OCFFFF ODFFFF OEFFFF OF FFF OFSFFF OF BFFF OFDFFF The checked blocks are over written not erased on download Select All El Clear All zi 54131 Setting to clear the MCUs 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 e 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 e The blocks whose check mar
119. log box by double clicking the data display area in the task state display mode Context Task ID Context Task ID 14 taskl4 Status WAI SEM Priority 15 PC FF2883 0000 0001 0000 0014 000001 000050 OOO40E Enter the task ID number in the Task ID field and click the View button or press the Enter key The context of the specified task appears in the Context field e Ifthe task entered in the Task ID field is RUN or DMT when clicking the View button the context is not displayed In the Context field only the task ID and task state are displayed e Ifa task ID number which does not exist is entered in the Task ID field when clicking the View button an error occurs 160 7 Windows Dialogs 7 11 12 2 Change the task context Enter the task ID number in the Task ID field in the Context dialog and click the Set button The Set Context dialog is opened The Set Context dialog is used to set the specified context register value of the specified task Set Context Data Task ID 14 Register py v Value fiz Cancel Specify the register to be changed in the Register field list box and enter the value to be set in the Value field If an expression description set in the Value field is wrong or if the specified value is outside the allowable range set for the specified register an error occurs 161 8 TableofScript Commands The following script commands are prepar
120. ltiplexed area Interrupt vector area 8122 Automatic emulation memory allocation for the internal ROM When single chip or memory extension mode is selected emulation memory is automatically allocated to the internal ROM area The automatically allocated internal ROM address range is displayed in this field Internal ROM Area F80000 FFFFFF is allocated 35 6812 8 Emulation memory allocation for an extended area When memory extension or microprocessor mode is selected emulation memory can be allocated to the extended area to be debugged in up to four areas When the emulation memory board is not connected to the emulator the emulation memory cannot be allocated Here allocate memory for the debug target area and specify its mapping information Emulation Memory Allocation Bank Length Map Area 1 fo fime f INTERNAL Area 2 2 256KB EXTERNAL Areas fo f256kB mj Nouse f Area fo f256kBe Nouse Follow the procedure described below Specify size of area Map Specify area map Bank Specify the bank address of the debug target area to be allocated in Set bank address hexadecimal If specified as CO CO0000h is the start address of the debug target area Length Specify the size of the debug target area 256 bytes or 1 Mbytes If Length is specified to be 256 bytes banks 00 04 08 and up to FC every four banks are specified for Bank if Length is specif
121. lue unsigned char str OxFOOOO 89 Y struct DATA pData 0x408 struct DATA pData 0x408 signed int nID 0 unsigned char str OxFOOOS 83 s 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 181 10 2 4 Array Types e 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 e 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 details refer to 10 2 3 Pointer Types When the number of the array elements is more than 100 the following dialog box open Specify the number of the elements in the dialog box
122. ly at a specified rate 6 2 10 1 Executing Step In Command The Step In command steps into the called function subroutine and stops at the first statement of the called function subroutine To step through the sort function select Step In from the Debug menu or click the Step In button 8 on the toolbar The PC cursor moves to the first statement of the sort function in the Editor Source window p_sam gt s5 p_sam gt s6 p sam gt s p sam gt s8 p_sam gt s9 I sort long ta long t int i J gap Te n oooos k gap 5 while gap gt 0 Df for k 0 k lt gap kt fort i ktgap i lt 10 i itzap OL for j i gap j gt k j j gap iftalil gt alit sapld i t alj alj alitgap 60 6Tutorial 6 2 10 2 Executing Step Out Command The Step Out command steps out of the called function subroutine and stops at the next statement of the calling statement in the main function To step out of the sort function select Step Out from the Debug menu or click the Step Out n button on the toolbar The PC cursor slips out of a sort function and moves to the position before a change function tutorial c j rand ifj lt 0 I j j ali j sorta changea sam s0 a 0 sam s1 a 1 sam s2 a 2 sam s3 a 3 sam s4 a 4 Note It takes time to execute this function When the calling source is clarified use Go To Curs
123. maphore wait state with timeout WAI SEM TMO SUS Semaphore wait state with timeout double wait WAI MBX TMO Message wait state with time out WAI MBX TMO SUS Message wait state with timeout double wait WAI SDTQ TMO Transmission data with timeout wait status WAI SDTQ TMO SUS Transmission data with timeout wait status double wait WAI RDTQ TMO Reception data with timeout wait status WAI RDTQ TMO SUS Reception data with timeout wait status double wait WAI VSDTQ TMO Transmission extended data with timeout wait status WAI VSDTQ TMO SUS Transmission extended data with timeout wait status double wait WAI VRDTQ TMO Reception extended data with timeout wait status WAI VRDTQ TMO SUS Reception extended data with timeout wait status double wait WAI MPF TMO Fixed length memory pool with timeout wait WAI MPF TMO SUS Fixed length memory pool with timeout wait double wait 143 e 2Display the Wait Cancellation Condition of Event Flag Wfmode Status TWF ANDW Waits for all bits set in the wait bit pattern to be set AND wait TWF ORW Waits for any one bit set in the wait bit pattern to be set OR wait 7 11 3 Display the Ready Queue Status In the MR window select Popup Menu Mode gt Ready Queuel wiOr Amo0eoHOU lt HES Current Run Task 1 main Number of Priority 100 Pri RdyQ 1 _main
124. n the Context dialog For details on the Context dialog see 7 11 12 Display the Task Context The following data is displayed in the status bar Current Run Task 1 main 7 11 2 1 Display the Task Status When the realtime OS is MRxx conformed to uITRON specifications V 3 0 All the tasks defined in the configuration are listed in the order of ID number The function of each item is as described below When the realtime OS is MRxx conformed to uITRON specifications V 3 0 Items Contents ID Task ID StaAddr Starting address of task name Task name Pri Priority Status 1 Task status wup count Wake up count timeout Timeout value flg ptn Wait bit pattern of event flag flg mode 2 Wait cancellation condition of event flag 140 1Task Status 7 Windows Dialogs Display Status RUN Run status RDY Ready Status SUS Suspend status DMT Dormant status WAI SLP Sleep state WAI SLP SUS Sleep state double wait WAI DLY Time wait state duw to dly_tsk WAI DLY SUS Time wait state duw to dly_tsk double wait WAI FLG Event flagwait status WAI FLG SUS Event flagwait status double wait WAI SEM Semaphore wait status WAI SEM SUS Semaphore wait status double wait WAI MBX Message wait status WAI MBX SUS Message wait status double wait WAI SLP TMO Sleep state with time out WAI SLP TMO SUS Sleep state
125. nds 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 e You cannot include comments on the same lines as script commands e You can nest script files up to five levels e You can nest if statements and while statements up to 32 levels e If statements must be paired with endi statements and while statements with endw statements in each script file e 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 e You can specify up to 4096 characters per line An error occurs if a line exceeds this number of characters e 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 168 9Writing Script Files 9 1 1 Script Command You can use the same script commands that
126. ne a E TE ate ie A 174 C C Expressions 175 10 1 Writing C C Expressions ccccccccccccessessscesececeesesesesececeeseseseceeseseseuaseeeesceeeesnsaeseeeeeseennageas 175 10 1 1 Immediate Valuesuarassnatadddkd cee Da tact tees dete inde aas h EE EEEE 175 10 1 2 Scope Resolution ccccccssssssccccececssssnccccecscssssneaececscsessaeeecececeessaaeaecececsessaaeaeeececeenes 176 10 1 3 Mathematical Operators nenene e a teadedtabevebessdodcaveawssesteetialeAisoss see 176 10 14 Pointersuanfessav24 se 176 10 15 Reference nar anne ARR eee 176 10 1 6 Sign Inversion m remrrererersvvrvrrrrrrrrnsnnrrrnerssrensnnrnnnenssesnennrnnsenssnensnnrnnnenssennannrnnnenesessannnen 177 10 1 7 Member Reference Using Dot Operator cccccccccceceessssscececeesesseaeeeeececeesnsseeeeeeeeeenees 177 10 1 8 Member Reference Using Arrow ccccccccccccesssssssecececeesssceeeeececeesssaeeeeeeeesesssaseeeeeeeeenees 177 10 1 9 Pomt rs to Mem beri ccs 2c cesceccadvtes ccadecks chs a ie a E cusubins Ee ia a aan E ii 178 10 1 10 Parentheses 10 1 11 Arrays 10 1 12 Casting to Basic Types cc cccccccccssssssescceceesesseseceeccecsesssseseeeceesesaaeeeeseeesenssaseeeeeeeeenees 178 10 1 13 Casting to typedef Types cen cea nae oa a a oo E a enas 179 IKOR R E DET Ei o EA E a oT EE EE EE canes E EE 179 10 1 15 Function Name issen aN EE N E E n 179 10 1 16 Character Constants cccccccccccssscccssssececssccecessnececsesaeeeceeeeecnssaeeecseaee
127. nt Status Event Type DATA ACCESS v Address Data Setting Range fddr lt Address i H Address1 PFF oy Address2 pom al J Function Source File Function ACCESS WRITE ADDRESS 0007 FF CONDITION faddr lt OOO FF oeei Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range Not Specify v Data 1 pooo Data 2 pooo Access WRITE v i Mask p 000 ACCESS WRITE ADDRESS O007FF CONDITION faddr lt OOO FF Caneel 110 7 Windows Dialogs 7 6 6 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 6 1 Writing Reading a Specified Bit Set as below Example Writing 0 to bit 2 at address 400h 111 7 6 6 2 Writing Reading a Specified Bit Symbol Set as below Example Writing 1 to bit symbol bitsym 41 Set Event Status BIT SYMBOL i 112 7 Windows Dialogs 7 6 7 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
128. nt varies depending on the type of MCU 12 1 2 1 The debugger for M32C The area which can be set for software breakpoint varies depending on the processor mode Processor Mode Can be set area Single Chip Internal RAM Internal ROM Memory Extension Internal RAM Internal ROM Emulation memory Only the Internal area Micro Processor Internal RAM Emulation memory Only the Internal area To stop the target program outside the emulation memory area use the Come execution ATTENTION e The setting for emulation memory is available when an emulation memory board is connected to the emulator e Software breaks can not be set to the internal ROM when the target program is running 12 1 2 2 The debugger for M16C R8C The area which can be set for software breakpoint varies depending on the processor mode Processor Mode Can be set area Single Chip Internal RAM Internal ROM Memory Extension Internal RAM Internal ROM Emulation memory Micro Processor Internal RAM Emulation memory ATTENTION e The setting for emulation memory is available when an emulation memory board is connected to the emulator e Software breaks can not be set to the internal ROM when the target program is running 186 12Attention 12 12 12 1 3 Get or set C variables If a variable is declared with the same name as the type definition name declared by typedef you cannot reference that variable
129. nts Setting IV Enable HW Break ADDRE CONDITION Al 000400 WRITE addr 000400 data 0032 42 0F0528 FETCH addr 0F0528 43 000000 FETCH addr 000000 44 000000 FETCH taddr 000000 A5 000000 FETCH faddr 000000 000000 faddr 000000 OOOOOE Combination PID ro Same Time v Detail F Enable Detail Reset Save 114 7 Windows Dialogs 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 0F0000 0F00C2 36 GLOBAL C 0F012C 22 LOCAL C Display Break Point Operation Buttons to Break Points e 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 Details e The number of address interrupt breakpoints that can be set varies with each product e Breakpoints can be specified b
130. ocks 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 e The blocks whose check marks are turned off have their flash contents cleared when downloading e Pressing the Select All button keeps all blocks from being cleared when downloading e Pressing the Clear All button clears all blocks when downloading 38 5Setup the Debugger 5 4 Setup the Debugger for M16C R8C 5 4 1 MCU Setting Dialog In the MCU Setting dialog box setting information on the user target The MCU Setting dialog box opens after closing the Init dialog box MCU Setting MOU Flash Clear m MOU Setting MCU M160 62P Single Chip Mode v fi 6 bit v Processor Mode External Data Bus Width Memory Space Expansion JV PMIG GS of 00000650 fe 7 I PM10 60 of O00005H is 1 Normal Mode p MCU Status NMH H HOLD H RDY H CNYss NO BYTE NG f Cancel Help T Do not show this dialog box again 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 MCU Specify the MCU s processor mode debug options etc MAP Set memory areas into which emulation memory is mapped The emulation memory board is necessary to use this tab Flash Clear Specify w
131. 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 e 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 e 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 e If the load module size is large the on memory method may be inefficient because it requires a very large amount of time for downloading In such a case select the on demand method e In the on demand method a folder in which to store a reusable temporary file is created in the folder that contains the downloaded load module This folder is named after the load module name by the word INDEX_ to it If the load module name is sample abs for example the folder name is INDEX_sample This folder is not deleted even after quitting the debugger 29 5 1 3 Emulator Tab Clock Main C External Sub C Internal External 5 1 3 1 Specify the Target Clock Change the setting by synchroniz
132. olchain 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 13 4 2 1 Creating a New Workspace Toolchain Used 4 2 1 1 Step1 Creation of a new workspace In the Welcome dialog box that is displayed when the High performance Embedded Workshop is activated select the Create a new project workspace radio button and click the OK button Creation of a new workspace is started The following dialog box is displayed New Project Works Projects Workspace Name ies Empty Application Sample01 t5 Import Makefile Project Name Library Sample01 Directory D work H EW4 Samples M16C Sample01 Browse GPU family m160 v Tool chain Renesas M16C Standard Properties reen 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 type 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 4 Specify the workspace name and project name In the Workspace Name edit box enter the new work
133. om the Break submenu of the View menu The S W Break Points window is displayed W S W Break Points Load Save Help C af C Filename Refer Line JEE Close S W Break Point OFO26F L 37 D M16C TutorialM16C tutorialml6c source tutorial c Delete Delete All Enable All Enable Disable All Disable This window allows the user to set or change breakpoints define new breakpoints and delete enable or disable breakpoints 55 6 2 7 Step7 Viewing Register The user can see all registers flags value in the Register window 6 2 7 1 Viewing Register Select Registers from the CPU submenu of the View menu The Register window is displayed The figure below shows a Register window of the debugger for M16C R8C 0 BANK Register 0024 OFOO 0000 0000 O6E6 0000 0718 O6c2 02420 OFO26F 0400 INTB OFFDOO 10000101 6 2 7 2 Setting the Register Value You can change a register flag value from this window Double click the register line to be changed The dialog is opened Enter the value to be changed PG Set Value Value Radix Hex v Set As hole Register 3 56 6Tutorial 6 2 8 Step8 Viewing Memory When the label name is specified the user can view the memory contents that the label has been registered in the ASM Watch window 6 2 8 1 Viewing Memory For example to view the memory contents correspondin
134. or 61 6 2 10 3 Executing Step Over Command The Step Over command executes a function subroutine call as a single step and stops at the next statement of the main program To step through all statements in the change function at a single step select Step Over from the 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 tutorial c for 0 i lt 10 itt I j rand iffi lt 0 I j J chanze a sam s0 a 0 sam st 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 3 62 6Tutorial 6 2 11 Step11 Forced Breaking of Program Executions This debugger can force a break in the execution of a program 6 2 11 1 Forced Breaking of Program Executions Cancel all breaks To execute the remaining sections of the main function select Go from the Debug menu or the Go button on the toolbar The program goes into an endless loop To force a break in execution select Halt Program from the Debug menu or the Halt button on the toolbar 63 6 2 12 Step12 Displaying Local Variables The user can display local variables in a function using the C Watch window 6 2 12 1 Displaying Local Variables For example we will examine the local variables in the tutorial function which declares four local variables a j 1
135. or MR308 conformed to uITRON4 is downloaded this window supports the displays listed below Task status Ready queue status Timeout queue status Event flag status Semaphore status Mailbox status Data queue status Cyclic handler status Alarm handler status Memory pool status 138 7 Windows Dialogs If a target program created by MR30 or MR308 conformed to uITRONS is downloaded this window supports the displays listed below If a target program created on MR30 V 1 00 is downloaded the MPL mode cannot be used on MR30 You cannot select the menu which changes the current mode to the MPL mode Task status Ready queue status Timeout queue status Event flag status Semaphore status Mailbox status Cyclic handler status Alarm handler status Memory pool status ATTENTION Please use the startup file crtOmr axx start axx whoes contents matches with the version of MRxx when you make downloaded program The MR Window and MR command will not run properly if the startup file you uses don t match with the version of MRxx 7 11 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Mode Task Displays Task status Ready Queue Displays Ready status Timeout Queue Displays Timeout status Event Flag Displays Event Flag status Semaphore Displays Semaphore status
136. ormat area check the Other option and select the elf dwarf as Output Format Include Tab In the XCL File Name area specify your XCL file ex 2 Edit the XCL file Add the command line option y to your XCL file depending on the product Inkm32cf xcl The designation of y option varies Product Name y Option The debugger for M32C yspe The debugger for M16C R8C yspe 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 194 12Attention 12 4 4 When Using the IAR C Compiler ICC 12 4 4 1 Specify the Option Please compile according to the following procedures and link e At compilation Specify the r option e 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 M32C ylmb The debugger for M16C R8C ylmb e 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 4 4 2 Command Execution Exampl
137. p execution of instructions Stop E Stops program execution Symbol SYM Checks assembler symbols Time 2 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 5 Cancels the alias defined for a command UnAliasAll S Cancels all aliases defined for commands Up Displays the calling function UploadHex UH Outputs data to an Intel HEX 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 z Displays a function call status 167 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 e Script commands e Assign statements e Conditional statements if else endi Program execution branches to the statement s to be executed according to the result of the conditional expression e Loop statements while endw A block of one or more statements is repeatedly executed according to the expression e break statement Exits from the innermost loop e Comment statements You can include comments in a script file The comment statements are ignored when the script comma
138. p recording the executed commands Copy Copy the selection and put it on the Clipboard Paste Insert Clipboard contents Cut Cut the selection and put it on the Clipboard Delete Erase the selection Undo Undo the last action Toolbar display Display toolbar Customize toolbar Open toolbar customize dialog box Allow Docking Allow window docking Hide Hide window 79 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 E S W Break Points S W Break Point 0F0000 0F00C2 36 GLOBAL C 0F012C 22 LOCAL C Display Break Points Operation Buttons to Break Points e If you have set multiple software breakpoints program execution stops when any one software break address is encountered OR conditions e You can continue to set software breakpoints until you click the Close button to close the S W Break Point Setting Window e 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 e 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 point
139. plays messages Exec Executes external application Exit 3 Exits the script file Express EXP Displays an assembler expression File 3 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 Checks function names and displays the contents of functions Go G Program execution with breakpoints GoBreakAt GBA Run target program with software break point GoFree GF Free run program execution GoProgramBreak GPB Run target program with software break point HardwareBreak HB Sets and checks a hardware break Label 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 g Stops the output of the screen display to a log file Logon 5 Outputs the screen display to a log file Map f Checks and sets mapping data Module MOD Displays modules names Move E Moves memory blocks MoveWord MOVEW Moves memory blocks in 2 byte units MR Displays status of realtime OS MRxx OverStep O Overstep execution of source lines OverStepInstruaction OI Overstep execution of instructions Path a Sets and checks the search path 166 8 Table o
140. r to the one shown below Cycle ap HE pe m 3 GLOBAL C 44 Grates Sten ter eal 1 05012 global struct 000470 42 W 00 00 00 055 299 GLOBAL C 45 global struct m long 6 05007 00047D 05W 00 00 00 055 299 00047E 00W 00 00 00 055 299 00047F 06 W 00 00 00 055 299 000480 00W 00 00 00 055 299 GLOBAL C 47 global struct m struct m uchar 0x10 i 04995 000481 oo Ww 00 00 00 055 300 04994 000482 00W 00 00 00 055 300 vi 130 7 Windows Dialogs 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 OFOODS global long 3 OFOOGDB global struct m char B global struct m short 5 global struct m long 6 DOFOOEB global struct m struct m uchar 0x10 OFOOEF global struct m struct m ushort 0x20 global struct m struct m uint 0x30 OFOOFB for i 0 i lt Ss i OFO104 for 3 0 3 lt 5 j OFO10D global array i j 0 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
141. race 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 Trace SP Range 3251 2 7 TOM OT 7654 mm s ms us R 0 1 11111111 00 00 00 055 114 R 2 nl 11111111 00 00 00 055 114 R 4 2 11111111 00 00 00 055 115 WwW 3 1 11111111 00 00 00 055 115 R 3 1 11111111 00 00 00 055 115 R 3 1 11111111 00 00 00 055 115 3 EE 11111111 00 00 00 055 115 R nk 1 11111111 00 00 00 055 115 R 3 1 11111111 00 00 00 055 115 R 4 11111111 00 00 00 055 115 a 2 3 4 127 1 Cycle display area Shows trace cycles Double click here to bring up a dialog box to change the displayed cycle 2 Label display area Shows labels corresponding to address bus information Double click here to bring up a dialog box to search for addresses 3 Bus information display area The content displayed here differs depending on the MCU or emulator system used e Refer to 7 9 6 Display of bus information on the M32C Debugger e Refer to 7 9 7 Display of bus information on the M16C R8C Debugger r Time information display area Shows time information of trace measurement result One of the following three modes can be selected from the menu The compact emulator debugger is not supported Absolute Time Shows an elapsed time from the time the program started running up to now in terms of absolute time default
142. res and unions using the arrow Example class T public int memberl char member2 hi 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 177 10 1 9 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 bi 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 e Note that the expression mp cannot considered as the variable of pointer to member type 10 1 10 Parentheses Use the and to specify priority of calculation within an expression 10 1 11 Arrays You can use the and to specify the elements of an array You can code arrays as follows variable name element No or variable variable name element No or variable element No or variable etc 10 1 12 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
143. ress 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 1Features 1 3 Real Time Trace Function The real time trace function records the execution history of the target program 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 The execution history is referred to in the tracing window The execution history can be referred to in the following mode e 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 e 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 e 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 e Source mode This mode allows you to inspect
144. ress2 f Address1 po Hal Address far f Bl I Function Source File 3 Function 3 AGGESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F oeei Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range Not Specify v Data 1 pooo Data 2 pooo Access WRITE v i Mask p 000 ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt faddr lt O0040F Caneel 100 7 Windows Dialogs 76 5 1 8 Reading writing data to addresses outside the specified range Set as below Example Writing data to addresses below 7FFh AT Set Event Status Event Type DATA ACCESS v Address Data Setting Range fddr lt Address i H Address1 PFF oy Address2 pom al J Function Source File Function ACCESS WRITE ADDRESS 0007 FF CONDITION faddr lt OOO FF oeei Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range Not Specify v Data 1 pooo Data 2 pooo Access WRITE v i Mask p 000 ACCESS WRITE ADDRESS O007FF CONDITION faddr lt OOO FF Caneel 101 7 6 5 2 Memory Access The debugger for M16C R8C ATTENTION It is not detected that data access to the odd addresses in word size access 76 6 2 1 Writing Reading a Specified Address Set as below Example Writing to even address 400h
145. rmware 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 10 3Starting 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 automatically installed For details see Install of USB Device Driver 3 3 1 1 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 lt A USB Device SJ Installing Go on following the wizard and a dialog box for specifying the setup information file Gnf file is displayed Specify the musbdrv inf file stored in a location below the directory where this debugger is installed ATTENTION e Before the USB device drivers can be installed the debugger you use must already be installed Install this debugger first e USB communication can be used only
146. roc28 7101 RO R1 00 00 00 054 433 18854 OFOCZ2A A112 R1 R2 00 00 00 054 433 zj E 2 3 4 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 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 ve laaa viasznv Range 32511 00000 Area Break File Cycle 19026 Address OFO161 Time 00 00 00 054 423 Cycle Address Obj code Label Mnemonic Datalecess hr m s ms us LOCAL C 42 for i 0 i lt 10 i 19026 OFO161 778BFD0400 CHP W 0004H 3H FB 00 00 00 054 423 0007E3 OS R 0007E4 00 R 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 OH 7H FB OOO7ES 61 W 00 00 00 054 423 19014 OFO16F D90BFB MOV UW HOH SH FB OOO7DF 00 W 00 00 00 054 423 x 129 7 9 3 Config
147. s t GUI 1 0 Sample pni Fi Ha Haw TE Input Panel Hem e You can arrange the following parts on the window Label character string Displays erases a character string specified by the user when any value is written to the specified address bit 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 Text Display the text string e You can also save the created panel in a file and reload it e 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 136 7 Windows Dialogs 7 10 1 Extended Menus This window has the following popup menus that can be brought up by right clicking in the window Menu Function Select Item 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
148. s from a file they are added to any existing break points 80 7 Windows Dialogs 7 5 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 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 81 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 12 1 2 Area where software breakpoint can be set for details You can set break points in the Editor Source Window To do so double click the break point setting area S W breakpoints column for the line in which you want to set the break A red marker is displayed on the line to which the break point was set tt Sample c i 0 while 1 for 0 i lt DATALSIZE i I data i data i 1 data i 2 data i 3 sub
149. space 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 After a setting click the OK button 14 4Preparation before Use 4 2 1 2 Step2 Setting for the Toolchain A wizard for the project creation starts New Project Toolchain version 53000 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 ned Finish Cancel Here the following contents are set e toolchain e the setting for the real time OS when using e 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 15 4 2 1 3 Step 3 Selecting of the Target Platform Select the target system used for your debugging emulator simulator When the setting for the toolchain has been completed the following dialog box is displayed iNew Project 5 7 Setting the Target System for Debugging pe p MM1
150. 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 7 1 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 IV Enable HAW Break ADDRE CONDITION Al 000400 WRITE addr 000400 data 0032 42 0F0528 FETCH addr 0F0528 43 000000 FETCH addr 000000 44 000000 FETCH addr 000000 45 000000 FETCH addr 000000 46 000000 FETCH addr 000000 OOOO88 AND v Detail Enable Detail AND Save Load gt Close Combination PID AND Same Time OR State Transition 113 7 6 7 2 Select AND Same Time Change the Combination group to AND Same Time Next check turn on an event in the event specification area that you want to use No pass counts can be specified fixed to 1 ME HAV Break Poi
151. ssembler labels Express EXP Displays an assembler expression 163 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 software breaks BreakAt Sets a software breakpoint by specifying a line No BreakIn S 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 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 z Opens and executes a script
152. ssseeceecsensasaeeeeeees 144 7 11 4 Display the Timeout Queue Status cccccccccccccsssssscccccecsesssseceeececsessaeseeeeecsenssssseeeeeees 145 7 11 5 Display the Event Flag Status ccccccccccccccscsessssececececsensnececececsensaaecececsesensaeeeeeeeens 147 7 11 6 Display the Semaphore Status cccccssccccccecsessssececcceceesssseseeccecsessseseecesesensraeseeeeeees 149 711 7 Display the Mailbox Status iscirsiccecccseevsrc cate evaien sta co tee ee wats e tea ts NERE E eaves 151 7 11 8 Display the Data Queue Status ccccccccccccccecsssssseceeececeessseceeececsessaeeeeceeesensasaeeeeeees 153 7 11 9 Display the Cycle Handler Status cccccccccccccsssssscecececsesssseceeececsessaeceeeeecsesssssseeeeeees 155 7 11 10 Display the Alarm Handler Status cccccccccsssscccccecsesesseceeececsessasceeceeesesssteseeeeeees 157 7 11 11 Display the Memory Pool Status cccccccccccsssssssecececsessssececececsesessceeeeeceenesseseeeeeees 158 7 11 12 Display the Task Context c ccccccccssssscccececsesssececccecsesssseeecceecsesssaeeeecesesensasseeeeeees 160 8 Table of Script Commands 162 8 1 Table of Script Commands classified by function r rrevrsrevrrvrrrerrrvrrrerrrverrersrvesrerssvesverssvessenn 162 8 1 1 Execution Commands rrannrnrrranvrnrrnsrrrrrrnnrrrrrsnnrsrsnernrsrsnnrnrrssnnrsrrssnsrsrennrsrsssnnrsrssnrssssennn 162 8 1 2 File Operation Commandssusvarskkss ansetter 162 8 1 3 Register Operation Command
153. t for the external bus width Make sure the specified external bus width matches settings of the BYTE pin e Memory Space Expansion If you selected memory extension or microprocessor mode specify whether or not to use the memory space expansion facility Select 4MB Mode if you want to use the memory space expansion facility or Normal Mode if you do not e PM13 b3 of 000005H Specify whether you set the bit PM13 b3 of 000005H When you use your target system with the setting that PM13 is 1 check this option e 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 40 5Setup the Debugger 54112 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 MCU Status NMI H HOLD H RDY H CNYss NG BYTE WC NC means that the value is indeterminate 41 5 4 1 2 MAP Tab The emulation memory board is necessary to use this command The specified content becomes effective when the next being start Emulation Memory Allocation M Areal 40 ooo PF FFF INTERNAL M areaz 00 om 00 ppr INTERNAL z M Areas O om 0 ppp INTERNAL z M Areas 00 ooo BO frr INTERNAL z This setting is effective only in the area CS3 CS2 CS1 and CS0 Not al
154. t Extended Menussuarsure ster ER 71 7 1 2 Setting the RAM monitor area m mrerrenrvvrrrrrrrrrenonvrrrnrrrrrrnsnnrnrnenereenennrnnsenssnesennnnnsensssenen 72 7 2 ASM Watch Window e a a E ea a aa aE A EREEREER 74 231 Extended Men s iorn er E E E E E E redi sua S 75 7 3 C Watch Window oireet ia e e e a a E EE a e a aa Ea 76 7 3 1 Extended MENUS a E A boats ok E i a deeds kata 77 TA Seript WATOWrscg EE EEE EE EEE E SE EEEE EEA E EE EE EE E TE tibet 78 Ad Extended Menus ionene e E E E E E E E RE 79 7 5 S W Break Point Setting Window rervrrrrrrrennnnrvrnrnrsrenennrnrnenssresennnnnrrnssnssenannrvensnssnensnnrnnnensseenennner 80 T 5 1 CommandButtonsssriasdrisarinirsaeter eee Seed 81 7 5 2 Setting and Deleting a Break Points from Editor Source Window srsrarvrrvrrvnrvrervenee 82 7 6 H W Break Point Setting Window 7 6 1 Specify the Break Event rrrnnrornrnrrrrrannnnrvrnsersnensnnrvrnenrsrnnsnnrnrnensseenennnnnnenssnesennnnnsenssseren 7 6 2 Specify the Combinatorial Condition rervrrrorroonnvnrvrnrnrsrensnnrnrrensrrenennnnnnenssnesennrnnvenssneren 87 7 6 3 Command Buttoni eeann a a aiaa ree aE Dean ee AEAEE EEIE aaeain aridan 87 7 6 4 Specify the Events Instruction Fetch cccccccccccsscssssessescssescescsseseescsseseescsseseescsseseesensens 88 7 6 5 Specify the Events Memory Access ccccccesscssssessesesseseescsseseescsseseescsscsescssessescsseaeesensees 92 7 6 6 Specify the Events Bit Access mmmernerrrnerrvresrvrerrn
155. t pattern of event flag Wfmode 2 Wait cancellation condition of event flag 142 7 Windows Dialogs e 1Task Status Display Status RUN Run status RDY Ready Status SUS Suspend status DMT Dormant status WAI SLP Sleep state WAI SLP SUS Sleep state double wait WAI DLY Time wait state due to dly_tsk WAI DLY SUS Time wait state due to dly_tsk double wait WAI FLG Event flagwait status WAI FLG SUS Event flagwait status double wait WAI SEM Semaphore wait status WAI SEM SUS Semaphore wait status double wait WAI MBX Message wait status WAI MBX SUS Message wait status double wait WAI SDTQ Transmission data wait status WAI SDTQ SUS Transmission data wait status double wait WAI RDTQ Reception data wait status WAI RDTQ SUS Reception data wait status double wait WAI VSDTQ Transmission extended data wait status WAI VSDTQ SUS Transmission extended data wait status double wait WAI VRDTQ Reception extended data wait status WAI VRDTQ SUS Reception extended data wait status double wait WAI MPF Fixed length memory pool wait WAI MPF SUS Fixed length memory pool wait double wait WAI SLP TMO Sleep state with timeout WAI SLP TMO SUS Sleep state with timeout double wait WAI FLG TMO Event flag wait state with timeout WAI FLG TMO SUS Event flag wait state with timeout double wait WAI SEM TMO Se
156. ta size e You can specify expressions in addresses you can also specify memory variables e The data size is specified as shown in the following table The debugger for 740 doesn t support four byte length 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 Lor Example Referencing the contents of memory at address 8000h in 2 bytes 0x8000 W e The default data size is word if not specified 9 2 6 Line Nos These are source file line Nos The format for line Nos is as follows line_no line_no source file name e Specify line Nos in decimal e 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 e If you omit the name of the source file the line Nos apply to the source file displayed in active Editor Source Window e Include the file attribute in the name of the source file e Do not include any spaces between the line No and name of the source file 173 9 2 7 Character constants The specified character or character string is converted into ASCII code and processed as a constant e Enclose characters in single quote marks e Enclose character strings in double quote marks e The character string must consist of on
157. tatus 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 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 BIU This shows the status between the BIU bus interface unit and memory and BIU and I O Representation BIU status 5 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 R W Shows the status of the data bus R for r ead W for wr it e for no access 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 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 135 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
158. te of High performance Embedded Workshop except for the target emulator simulator New Project 6 7 Setting the Debugger Options OG Emulator Debue_M16C_R8C_PC7501_Emulator Item 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 emulator 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 If preparation of an emulator is completed set up the debugger in this dialog box and connect with an emulator 21 4 2 2 4 Step4 Registering the Load modules to be downloaded Finally register the load module file to be used Select Debug Settings from the Debug menu to open the Debug Settings dialog box Debug Settings SessionM16C_RBC_PO7501 _Emulator z Target Options Target iz DoSamplel1 a m 6C REG PC7501 Emulator x Default Debue Format IEEE695 RENESAS v Download Modules Offset Address Format D work HEW4 Samples M16C Sample01 x30 00000000 tap 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
159. 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 i Specify the event type Contents change with the setting of Event Type Following events can be set by specifying Event Type in this dialog box e When FETCH is selected Traces for the instruction fetch ran ga Fr l 119 e When DATA ACCESS is selected Traces for the memory access 0000 pw e When BIT SYMBOL is selected Traces for the bit access 120 7 Windows Dialogs 7 8 2 Specify the Combinatorial Condition To specify a combinatorial condition specify the desired condition from the combinatorial condition specification area e 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 Event Status OOOO8 e 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 OOOOW 121 7 8 3 Specify the Trace Range For the compact emulator debugger 64K cycles equivalent of data can be recorded Trace Area About 32K 32K A
160. 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 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 131 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 searc
161. the function to which the program counter is currently pointing 6 2 13 1 Reference the function call status Double click the S W Breakpoints column in the sort function and set a software breakpoint sort long a long t int i j k gap gap 5 while gap gt 0 for k 0 k lt gap ktt fort i ktgap IS10 ititgap for j i gap j gt k j j gap i iftalil gt alitsapl t t alj alj alitgap alitgap 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 s t Stack Trace a Kind Name Value F sort OFO140 F tutorial OFO272 F main OFO2Z1E The upper figure shows that the position of the program counter is currently at the selected line of the sort function and that the sort0 function is called from the tutorial0 function 65 6 2 14 What Next This tutorial has described the usage of this debugger Sophisticated debugging can be carried out by using the emulation functions that the emulator offers This provides for effective investigation of hardware and software problems by accurately isolating and identifying the conditions under which such problems arise 66 Reference Blank Page 68 7 W
162. the program execution path in the source program 1 3 1 Trace Area The 64K cycles execution history can be referred to with this debugger The trace area of the following 5 mode is being supported e Break 64K cycles before target program stops e Before 64K cycles before trace point e About 32K cycles either side of trace point e 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 1 3 2 Trace Condition Setting The following designations are available as trace events e Address designation Instruction fetch Memory access Bit access The number of events that can be specified are two events of all These break events can be combined as below e 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 And same time condition e Trace when one of the valid events is established OR condition 1 3 3 Trace Data Write Condition Trace data write conditions can be specified You can specify the following write conditions e Write conditions unlimited default e Cycl
163. 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 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 publish
164. to uITRON specifications V 4 0 Item Contents Tmout Shows the timeout value ms of each task ID Name Shows the ID No and task name of the tasks in the timeout queue e Following character strings are used to indicate the type of wait state Character string Wait state slp Wait due to tslp_tsk dly Wait due to dly_tsk flg Wait due to twai_flg sem Wait due to twai_sem mbx Wait due to trev_mbx mpf Wait due to tget_mpf sdtq Wait due to tsnd dtq rdtq Wait due to trev dtq vsdtq Wait due to vtsnd_dtq vrdtq Wait due to vtrev_dtq e When a task connected to the timeout queue is in the state of forced waiting double waiting a string s which indicates double waiting is appended to a string displayed in the ID Name field Normal display 26 _task26 Display when in WAIT SUSPEND 26 _task26 I s 146 7 Windows Dialogs 7 11 5 Display the Event Flag Status In the MR window select Popup Menu Model gt Event Flag MR CERLE N Aea AEA ID lg_ptn flago 0000H 0000H 0000H 0000H 0000H 0000H 0000H 8 tasks 9 task s 7 11 5 1 Display the Event Flag Status When the realtime OS is MRxx conformed to ulTRON specifications V 3 0 All the event flags defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MR
165. tool IEEE695 TASKING IEEE 695 format file When Using Tasking cross tool ELF DWARF2_IAR ELF DWARF2 format file When Using IAR cross tool ELF DWARF2_TASKING ELF DWARF2 format file When Using Tasking cross tool This debugger does not support the object formats which are not shown in the drop down list 22 4Preparation before Use 3 Then register the corresponding download module in the Download Modules list box A download module can be specified in the dialog opened with a Add button Download Module a zi xi offset 53 Format IEEEGOS RENESAS o x Cmi Filename D HEW4 samples M160 demox30 gt Browse Access size fi I Download debug information only I Perform memory verify during download I Download automatically on target connection 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 ATTENTION Access size and Perform memory verify during download is ignored The access size is always set to 1 and the verification does not work 23 4 3 Starting the Debugger The debugging can be
166. untry 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 http 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 Supported CPU This help explains the debugging function corresponding to the following CPUs e M32C 80 M16C 80 Series Note In this help the information which depends on this CPU is described as for M32C e M16C Tiny R8C Tiny Series Note In this help the information which depends on this CPU is described as for M16C
167. uration 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 Jopd 05012 global struct 00047C 00 00 00 055 299 05007 00047D 00 00 00 055 299 05006 00047E 00 00 00 055 299 05001 00047F 00 00 00 055 299 05000 000480 00 00 00 055 299 04995 000481 00 00 00 055 300 04994 000482 00 00 00 055 300 04989 000483 00 00 00 055 300 04984 000484 00 00 00 055 300 04977 000486 00 00 00 055 301 04972 0007E4 00 00 00 055 301 04971 0007E4 00 00 00 055 301 04964 0007E2 00 00 00 055 302 00 00 00 055 302 00 00 00 055 302 oo 00 00 055 302 04963 0007E2 04957 0007E4 04949 0007E2 04939 global array 000444 00 00 00 055 303 04938 0007E2 00 00 00 055 303 04935 0007E2 00 00 00 055 303 00 00 00 055 304 00 00 00 055 304 no nn NN N55 3N5 x 04929 0007E2 04924 0007E4 pe OE EE EE EE N4916 iNNN7E2 1 Data access display area Shows data access information If the information displayed here is 000400 1234 W for example it means that data 1234H was written to the address 000400H in 2 byte width Other display areas are the same as in bus mode In addition to data access information the window can display source line information in combination In this case the display will be simila
168. v Data 1 0034 Data 2 pooo Access WRITE v Iv Mask JOOFF ACCESS WRITE ADDRESS 000400 CONDITION faddr 000400 fdata amp 00FF 0034 mest 106 2nd point 7 Windows Dialogs A2 Set Event Status DATA ACCESS vw w da Effa ES A2 Set Event Status DATA ACCESS l ponz gt fom oo WRITE g m Dor O o 16 bits bus width 41 Set Event Status DATA ACCESS vw ol Effa SEs 41 Set Event Status DATA ACCESS l f od WRITE H m 7 Windows Dialogs 7 6522 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 fAddersst lt addr lt Address2 f Address1 po Hal Address far f Bl I Function Source File 3 Function 3 AGGESS WRITE ADDRESS 000400 CONDITION 000400 lt addr lt 00040F oeei Al Set Event Status Event Type DATA ACCESS v Address Data Settine Range Not Specify v Data 1 pooo Data 2 pooo Access WRITE v i Mask p 000 ACCESS WRITE ADDRESS 000400 CONDITION 000400 lt faddr lt O0040F Caneel 109 7 6 5 2 3 Reading writing data to addresses outside the specified range Set as below Example Writing data to addresses below 7FFh AT Set Eve
169. vrrrnrrrrrennnnrrrnsrerrensnnnrnnsnrsrensnnrennene 50 6 2 4 Step4 Setting a Breakpoint onnorvnnrorrronnnnrnrnerrrrrnsnnrnrnrnssnenennnnrnrnsseesensnnnvnnsnrssensnnrsnnene 52 6 2 5 Step5 Executing the Program c ccccccccsesssssscecececsesssnsceccceceenesssceseeecsesessaeeeeeeeeeensaaees 53 6 2 6 Step6 Reviewing Breakpoint cccccccccesssssscecccecsessssscecccecsesesseseseeeceesesssaeeeeceeesensaaees 55 6 2 7 Step7 Viewing Register cccccccssssscccccecsessssececccecsessseceecesceesesssaeceesceesenssaeceeceseeensaaees 56 6 2 8 Step8 Viewing Memory rrrnrrrnrannnnrvrnrrrrrensnnrnnnerersenennrnnnenssnesennnnrnenssnnsenannnvensnsnsensnnnsenene 57 6 2 9 Step9 Watching Variables cccccccccccscsssssnccccececsessnaccecececsensscaececcesesseaaececsesesensaaes 58 6 2 10 Step10 Stepping Through a Program cccccccccesssssscecececeesensececeeeceesesssaeeeeeeeeeensaaees 60 6 2 11 Step11 Forced Breaking of Program Executions cccccccssssssccececsesesssceseeeceensnteaeees 63 6 2 12 Step12 Displaying Local Variables cccccccccccseesessscecececeesensececeeeceesesssaseeeeeeceentaaees 64 6 2 18 Step13 Stack Trace Function ccccccccccsssssscecececsessssscecececsesesseceeeeecsesessaeeeeceeesensaaees 65 62 14 What Next i4e4 ctl neon a Gielen aien ie ahh e E ee he eet 66 Reference 67 7 Windows Dialogs 69 TERAM Monitor Wind OW osoren e estore edness ea Sesion ieee ee 70 dads T
170. ware event H W break event Real time trace event Time measurement event etc About hardware event you can specify SameAND combination for the event you need and the status of bank select register to detect the access to collect bank 12 3 9 CPU rewrite e Please don t rewrite the last block If you did emulator gets out of control e When you enabled CPU rewrite mode you can not use the debug functions below Setting software break points to the internal flash ROM COME execution to the internal flash ROM e You can not use the functions below to the CPU rewrite control program from setting CPU rewrite mode select bit to clearing it If you use these functions it may be unable to shift to CPU rewrite mode or the contents of a flash ROM may be unable to be read to normalcy Single step Software break points Address match interrupt break points Hardware break points COME execution To see the data which were rewritten by the program break the program out of the CPU rewrite control program and see by dump window memory window and so on 192 12Attention 12 4 Options for compiler assembler and linker We do not evaluate other settings so we can not recommend to append other options 12 4 1 When Using NCxx When O OR or OS option is specified at compilation the source line information may not be generated normally due to optimization causing step execution to be operated abnormally To avoid this problem
171. with an emulator the dialog box for setting up a debugger will be displayed Please set up the debugger in this dialog box To setup the debugger in this dialog box refer to 5 Setup the Debugger After the setup of a debugger it will function as a debugger 48 6Tutorial 6 2 2 Step2 Checking the Operation of RAM Check that RAM is operating correctly Display and edit the contents of the memory in the Memory window to check that the memory is operating correctly Note The memory can be installed on the board in some microcomputers In this case however the above way of checking the operation of memory may be inadequate It is recommended that a program for checking the memory be created 6 2 2 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 z Display Address fam v Scroll Start Address 000000 v l Scroll End Address JOFFFFF v 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 Memory 000400 Be 6 1040 8 2 loxi
172. xx conformed to uITRON specifications V 3 0 Item Contents ID ID No of event flag flg ptn Bit pattern of each event flag flagQ Task ID Nos and task names in the event flag queue e When a task connected to the event flag queue is in the state of waiting with timeout enabled waiting in twai flg a string Itmol which indicates a state of waiting with timeout enabled is appended to a string displayed in the flag Q field When a task connected to the event flag queue is in the state of forced waiting double waiting a string s which indicates double waiting is appended to a string displayed in the flag Q field Normal Display 26 _task26 Display when in WAIT SUSPEND 26 _task26 sl Display when in WAIT SUSPEND with time out 26 task26 tmol s e Up to 8 characters can be displayed in the task name in the flag Q field If a task name exceeds 8 characters the extra characters are omitted 147 7 11 5 2 Display the Event Flag Status When the realtime OS is MRxx conformed to uITRON specifications V 4 0 All the event flags defined in the configuration are listed in the order of ID number The function of each item is listed below When the realtime OS is MRxx conformed to uITRON specifications V 4 0 Item Contents ID ID No of event flag Flgatr Attribute of each event flag Flgptn Bit pattern of each event flag Flag Queue Task ID Nos an
173. y Address or Filename Line No e If you have set multiple breakpoints program execution stops when any one break address is encountered OR conditions e 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 e 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 e Ifyou load breakpoints from a file they are added to any existing break points 115 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 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 116 7 Windows Dialogs 7 7 1 1 Setting and Deleting a Break Points from Editor Source Window The address interrupt break function can only be us
174. you enter in the Script Window You can also call script files from within other script files nesting up to 10 levels 9 1 2 Assign Statement Assign statement s define and initialize macro variables and assign values The following shows the format to be used macro variable expression e You can use alphanumerics and the underscore _ in macro variable names However you cannot use a numeric to start a macro variable name e You can specify any expression 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 e You can use macro variables within the expression Always precede macro variables with the sign 9 1 3 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 e If the expression is t rue other than 0 statement 1 is executed If false 0 statement 2 is executed e You can omit the else statement If omitted and the expression is false execution jumps to the line after the endi statement e if statements can be nested up to 32 levels 9 1 4 Loop Statement while endw and Break Statement In loop statements execution of a group of statements is repeated while the expression is true The followin
Download Pdf Manuals
Related Search
Related Contents
Dell OpenManage Server Administrator Version 5.5 SNMP Reference Guide TERMITE - ePestSupply Manuel Chrysler Le Baron 4 cylindres 1989 L:\user manual on making\C19A01 NBN Fibre End User Guide - Reflections Barlings Beach NordicTrack 831.2988 Treadmill User Manual Datamax O'Neil E-Class Mark III E-4206P Copyright © All rights reserved.
Failed to retrieve file