To our customers, Old Company Name in Catalogs and Other Documents On April 1st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all the business of both companies. Therefore, although the old company name remains in this document, it is a valid Renesas Electronics document. We appreciate your understanding. Renesas Electronics website: http://www.renesas.
Notice 1. 2. 3. 4. 5. 6. 7. All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please confirm the latest product information with a Renesas Electronics sales office.
User’s Manual M3T-ICC740 V.1.00 User’s Manual Cross Tool Kit for 740 Family Rev.1.00 2004.
• Microsoft, MS-DOS, Windows, and Windows NT are registered trademarks of Microsoft Corporation in the U.S. and other countries. • IBM and AT are registered trademarks of International Business Machines Corporation. • Intel and Pentium are registered trademarks of Intel Corporation. • Adobe, Acrobat, and Acrobat Reader are trademarks of Adobe Systems Incorporated. • All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
Contents PREFACE ................................................................ ................................................................................................ ................................................................................................ ................................................................7 ................................7 1. OVERVIEW................................ OVERVIEW................................................................ ..................
.3. CHANGING THE ICC740 OPTIONS ................................................................................ 34 6.3.1. 6.3.2. 6.3.3. 6.4. CHANGING THE A740 OPTIONS .................................................................................... 37 6.4.1. 6.4.2. 6.5. 7. Changing the Processor Group ........................................................................................35 Changing the Memory Model.................................................................................
Figure of Contents FIGURE 1 PROCEDURE FOR INSTALLING THE M3T-ICC740 ........................................................ 11 FIGURE 2 PROJECT BAR .............................................................................................................. 12 FIGURE 3 PROJECT BAR PASTED AT THE TOP .............................................................................. 12 FIGURE 4 TOOLS INFORMATION DIALOG BOX ..............................................................................
Teble of Contents TABLE 1 NEW PROJECT WIZARD EXECUTION STEPS ................................................................... 16 TABLE 2 PROCESSOR GROUP, MEMORY MODEL AND STACK AREA ............................................. 25 TABLE 3 FILES AND OPTIONS TO ALTER ...................................................................................... 25 TABLE 4 NEW PROJECT WIZARD EXECUTION STEPS ...................................................................
Preface Before reading this user’s manual, please read the release notes included with your product. Product configuration, product handling, precautions and other important information are written in it.
1. Overview The M3T-ICC740 is a cross tool kit for the 740 family of Renesas 8-bit microcomputers. The product package includes the C compiler ICC740 from LAR Systems (hereafter referred to as the ICC740) and the integrated development environment (TM), providing a powerful support for developing programs in C and assembly languages. The following items of software are included in the M3T-ICC740: • ICC740 This is the C compiler for the 740 family available from LAR Systems.
Furthermore, the following software items are included with the package. • M3T-PD38SIM This is a simulator debugger for the 740 family. • SC74 This is a source file converter that allows you to convert the source files created for Renesas’s 740 family assembler M3T-SRA74 into the source file format of the assembler A740 included with the ICC740. This software is outside the scope of technical support by Renesas. For details on how to use the SC74, please refer to the included file license.txt.
2. Installing Tools The M3T-ICC740 requires installing the following tools: • ICC740 • TM • TW74 The installation procedure is described below (Figure 1). • ICC740 Execute autorun.exe in the icc740 folder. QuickStart Installation information in the ensuing dialog box will show you how to install and the information on product registration for your reference. Follow the instructions of the installer as you install. A license ID for the ICC740 is needed.
License ID for the ICC740 Install the Develop at the MS- ICC740 DOS prompt Install the Install the TM TW74 Develop in the TM License ID for the M3T-ICC740 Figure 1 Procedure for installing the M3T-ICC740 Next, the following describes how to install the software that are included with the package. • M3T-PD38SIM Install this software if you wish to run a quick tour of this manual. Follow the instructions of the installer as you install. • SC74 The SC74 does not have an installer.
3. Starting and Quitting the TM 3.1. Starting the TM When the TM has been installed normally, you can start it from the Start menu by selecting Programs → RENESAS-TOOLS → TM V.3.xx When the TM has started up, the project bar in Figure 2 appears. Tool Register button Close button Figure 2 Project Bar When started for the first time, the Project Bar is in a “floating” state. Grasp this window and bring it to the top of the screen, and you can have it located at the uppermost part of the desktop(Figure 3).
3.3.
4. Quick Tour Let’s try using the TM actually following a quick tour. In the TM, you need to specify a project name and a working directory before you can develop a project. In the quick tour, the TM is set up as shown below. This setting can be changed as necessary. Working directory: c:\work\proj_1 Project name: proj_1 Source file: tutor3.c The TM does not automatically generate a directory for each project you create. Projects are generated in the working directory.
Source program tutor3.c /*----------------------------------------------------* File: tutor3.c * * Purpose: Handling real time interrupts * * Usage: ICC -r -L -q tutor3.c * XLINK -r -f tutor3 * * Description: Using BRK vector to print a character * * Copyright 1997 IAR Systems * * $Id: tutor3.c 1.3 1998/01/15 09:24:55Z Laban Exp $ *-----------------------------------------------------*/ #pragma language=extended #include #include #include "intr740.
4.1. Creating a New Project Click the New Project button in the project bar (Figure 6). New Project Button Figure 6 New Project Button in the Project Bar A new project wizard of the project editor will be launched. In this wizard, make the necessary selection shown in Table 1. Table 1 New Project Wizard Execution Steps Step Step 1 Step 2 Step Compiler Step Finish Selection For the Target chip, select the 740 Family (ICC740). Select C Project. For the compiler package, select the TW74.
4.2. Complementing a New Project To develop an ICC740 project in the TM, you need to complement the new project. Follow the procedure described below to complement your new project. 1. In the project tree of the project editor, click the plus sign [+] for [all] to display [.\proj_1.695]. 2. Click [+] for [.\proj_1.695] following [all] to display [.\proj_1.cmd]. 3. Click [.\proj_1.cmd] and then the Add File button (Figure 8 (a)). 4.
4.3. Creating a File Create a source file using the editor. Because tutor3.c is located in the SmpTw74 folder, copy it to the working directory. The SmpTw74 folder is created in the folder in which you installed the TW74 (normally \MTOOL). 4.4. Registering the File The source file you created need to be registered to the project. Since the source file cannot be registered by simply placing it in the working directory, follow the procedure described below to register it. 1.
Add File Button (a) Before adding a source file (b) After adding a source file (c) Displaying a source file Figure 9 Registering a source file 4.5. Saving the Project The projected you created must be saved. Click the Save button of the project editor (Figure 10).
4.6. Building a Project To build a project, use the Build, the Rebuild or the Partial Build Button in the Project Bar. Here, click the Rebuild Button (Figure 11). The builder will be launched, allowing you to build a project (Figure 12). If you’ve finished building without causing any error, a proj_1.695 file will be generated in the working directory.
4.7. Starting the Debugger For the project you’ve finished building, an absolute file proj_1.695 is generated in the working directory. This file proj_1.695 can be debugged by the M3T-PD38 or M3T-PD38SIM. Click the Start Debug Button in the Project Bar (Figure 13). Debug button Figure 13 Start Debugger button in the Project Bar In the initial state, since there are no debuggers registered in your system, the Tools Information dialog box is displayed (Figure 14).
If the M3T-PD38SIM and M3T-PD38 are not displayed in the dialog box, use the Add... button to register the debuggers. After registering the debuggers, select the check box for the debugger you want to use (Figure 15).
4.8. Debugging a Program Use the M3T-PD38SIM to debug the program (Figure 16). File menu Window menu Go button Global window SRC button View button Program window Figure 16 M3T-PD38SIM If this is the first time you start the M3T-PD38SIM, you must set up the SFR file corresponding to the target MCU. Use the [Refer...] button at the top of the Init dialog box (Figure 17) to set up. Select the M38000.sfr file present in the folder in which you installed the M3T-PD38SIM.
4.8.1. Loading a Program To load a program, use the File menu commands “Download” and “Load Module.” In the ensuing Download dialog box, select the proj_1.695 file. A program will be loaded, with part of the program at the position of the program counter displayed. The position of the program counter is marked by a yellow line. 4.8.2. Executing up to the main Function First, run the program up to the main function. To display the main function, select the View and the Source button and then select tutor3.
5. Creating a New Project The ICC740 requires setting up a processor group, memory model and stack area before you can develop a project. The M3T-ICC740 uses default settings in Table 2 as it creates a new project. In this manual, the project is named “proj_1.
5.1. New Project To create a new project, you must first start the TM. Launch the TM from the Start menu. When the TM has started up, the project bar shown in Figure 18 appears. New Project button Project Editor Start button Figure 18 Project Bar The TM does not automatically generate a directory for each project you create. Projects are generated in the working directory. Users must create a working directory as necessary. There are following three methods to create a new project: 1.
Table 4 New Project Wizard Execution Steps Step Step 1 Step 2 Step Compiler Step Finish Selection For the target chip, select the “740 Family(ICC740)”. If the M3T-SRA74 is installed in your computer, you will see the “740 Family” also displayed for the target chip, but be sure to select the “740 Family(ICC740)”. Select a C Project. For the compiler package, select the “TW74”. When this is selected, the ICC740 will be used when you compile.
Add File Button (a) Before registration (b) Open dialog box (c) After registration Figure 20 Registering the lnk740.xcl file The .\proj_1.cmd file is not needed when you create a new project. It is created when you build or rebuild. Because this file is managed by the TM, do not rewrite it.
6. Editing the Project After you created a new project, you must edit cstartup.s31 and lnk740.xcl and change options as necessary. 6.1. Editing cstartup.s31 In cstartup.s31, edit the items listed in Table 6 as necessary. Table 6 Items to Edit in cstartup.s31 Edit item Stack page Interrupt vector area Subject Stack area Target microcomputer Corresponding line Line 137 Line 375 6.1.1. Changing the Stack Page The line 137 in cstartup.s31 is used to set the stack page.
6.2. Editing the lnk740.xcl File You need to edit the lnk740.xcl file according to the target microcomputer, memory model and other settings you made. Table 7 Items to Edit in lnk740.xcl Edit item Subject Stack area Beginning address of page 0 Ending address of page N ROM area address Interrupt vector Library Memory model, target microcomputer Corresponding line in lnk740.
Note, however, that if you change the stack area to page 0, you also need to alter the cstartup.s31 file. 6.2.2. Changing the Beginning Address of Page 0 The ICC740 requires that the RAM area be set separately for page 0 and page N (from the address 100h on). To set page 0, specify -Z(ZPAGE).
group, remove the SFR area from page N. 6.2.4. Changing the ROM Area Address Set the ROM area as suitable for your target microcomputer. Here, you set a general program area and a special page. Set a general program area, as shown below. -Z(CODE)RCODE,Z_CDATA,N_CDATA,C_ICALL,C_RECFN,CSTR, CCSTR,CODE,CONST=C080-FEFF The above setting directs that segments for the ROM area be located in a ROM space ranging from the beginning address C080h of the ROM area to the address FEFFh preceding the special page.
6.2.6. Changing the Library Select the library that suits the processor group and memory model of your target microcomputer from Table 8. Table 8 Processor Group, Memory Model and Library with MUL/DIV without MUL/DIV with extended memory access Tiny model cl7400t.r31 cl7401t.r31 cl7402t.r31 Large model cl7400l.r31 cl7401l.r31 cl7402l.r31 There is a “-C” statement at the place where you specify a library. Do not delete it.
6.3. Changing the ICC740 Options Default options of the ICC740 are set as listed in Table 9. Table 9 ICC740 Options Option -z9 Category Code generation -e Code generation -K -r -ml -v0 -o Code generation Debug Target Target Command line Description Specifies code size prioritized optimization. Enables extended specification (e.g., zpage and npage). Enables C++ comment (“//”). Outputs debugging information. Selects Large model for the memory model. Selects an MCU with MUL/DIV.
In this dialog box, click the option macro CFLAGS and then the Edit button. The Options dialog box for the ICC740 will appear (Figure 23 (a)). Before setting each option here, select a category first (Figure 23 (b)). For details about the options, refer to the manual included with the ICC740. (a) When opened (b) Selecting a category Figure 23 Options dialog box for the ICC740 6.3.1. Changing the Processor Group In the Options dialog box, select Target for the category (Figure 24).
6.3.2. Changing the Memory Model Select Target for the category. In the ensuing dialog box, click the list “-ml, -mt” and then the Select button. The Select Options dialog box will be displayed, allowing you to select the appropriate memory model. 6.3.3. Changing the Optimization Level To change the optimization level, select Code Generation for the category. Click the displayed list “-z, -s” and then the Select button. In the ensuing Select Options dialog box (Figure 25 (a)), select “-z” or “-s.
6.4. Changing the A740 Options Default options of the A740 are set as listed in Table 10. Table 10 Default Options of the A740 Option -uN -v0 -o Category Code generation Target Command line Description Sets 16-bit addressing. Selects a MCU with MUL/DIV. Sets an object file name. To change the A740 options, use the Option Browser dialog box as for the ICC740 options. Click the option macro AFLAGS and then the Edit button. The Options dialog box for the A740 will be displayed (Figure 26).
6.4.2. Changing the Memory Model Select Code Generation for the category. If all of the referenced symbols are located in page 0, deselect the “-uN” option from the list in the displayed dialog box. Although the “-uN” option can be left intact without causing any adverse effects on program behavior, deselecting it will help to reduce the ROM size and increase the processing speed.
6.5. Changing the XLINK Options The XLINK options are set in the lnk740.xcl file and in the TM. Default options of XLINK in the TM are set as listed in Table 11. Table 11 Default Options of XLINK (Command Line) Option -o -Fieee695 Category Output file Output file -ylmba Output file -l -x -f List control List control Include Description Sets an object file name. Specifies a format. To allow the file to be debugged in the M3T-PD38 or M3T-PD38SIM, specify ieee695 that indicates the IEEE-695 format.
7. Developing a Project 7.1. Creating and Registering the Source Files Use your desired editor to create the C source and assembly language source files. If your desired editor is registered in the project bar, click the Open Editor button to invoke it (Figure 27). Editor Start button Figure 27 Editor Start button in the Project Bar The source files you created must be registered to the project. These files are not registered by simply placing them in the working directory.
7.2. Altering the lnk740.xcl File If you’ve created new segments in an assembler source file, etc., you must set the locations of those segments in the lnk740.xcl file. An example is shown below. < sample.s31 > ... RSEG RAM_DATA BLKB 10 ... RSEG ROM_DATA BYTE ‘Please enter your name’ ... < lnk740.xcl > ... -Z(NPAGE)NPAGE,C_ARGN,N_UDATA,N_IDATA,ECSTR=100-43F -Z(NPAGE) RAM_DATA=100-43F ... -Z(CODE)RCODE,Z_CDATA,N_CDATA,C_ICALL,C_RECFN,CSTR,CCSTR,CODE, CONST=C080-FEFF -Z(CODE) ROM_DATA= C080-FEFF ...
8. Building a Project When you’ve finished creating and registering the source files, execute Build to generate an absolute module from the source files. To execute Build, click the Build, the Rebuild or the Partial Build button in the project bar (Figure 29). Partial Build Build Rebuild Figure 29 Build buttons located in the Project Bar When you click one of the Build buttons, the builder is launched. The builder builds a project according to the button you’ve clicked, and displays the result.
8.2. Errors in the Linker XLINK If an error occurs while you are executing the linker XLINK, correct the project according to the displayed messages. The following describes the errors that are frequently encountered in the linker and the corrective actions to be taken. z Error[e16] If data cannot all fit into a segment, XLINK outputs the following error. Error[e16]: Segment Segment is too long for segment definition. In this case, change the segment size or move the segment to another location.
declaration. extern npage int n_i1; void func( char a, npage int n_b ); In assembler sources attach “np.” when referencing the data. lda np:n_data z Error[e27] If a symbol with the same name (including any C language variable or function) is defined in multiple files, the error shown below occurs. Error[e27]: Entry " symbol " in module module 1 ( file 1) redefined in module module 2 (file 2) In this case, examine the relevant file and alter it so that there will be no duplicate symbol name.
8.3. Setting Options in Source File Units In C and assembler source files, it may sometimes be necessary to set options in file units. In such a case, create additional option macros in file units. These option macros can be created in the same way for both C and assembler source files. Therefore, explanation is given by using a C source file as an example below. In the Option Browser dialog box, click “icc740” or “CFLAGS” (Figure 30 (a)). The New button will become active, so click it.
9. Debugging a Project For the project you’ve finished building, an absolute file proj_1.695 is generated in the working directory. This file can be debugged in the M3T-PD38 or M3T-PD38SIM. In the TM, you can use the Debug button in the project bar to invoke the debugger (Figure 31). Debug Button Figure 31 Debug button in the Project Bar The debugger invoked this way is the one that you registered to the TM. If there are no registered debuggers, the Tool Information dialog box will be displayed.
If you installed the M3T-PD38 or M3T-PD38SIM after installing the TW74, you must register the installed debugger in the same way as you do for other debug tools. In this case, the registered debugger will have “user” appended in the Name column as for other debug tools. The difference is whether or not the .695 file for the project is automatically loaded when you invoked the debug tool using the Launch Debugger button.
10. Creating a Hex File Before you can create a Hex file, you must first register xlink(lmc) as a load module converter to the TM. First, choose Information from the Project menu of the project editor. The Project Properties dialog box (Figure 33) will be displayed. Select the Tools tab of this dialog box. Figure 33 Project Properties dialog box Next, select the “xlink(lmc)” check box in the package information section and click the OK button.
Note that the options of xlink(lmc) in the TM are set as listed in Table 12. Table 12 Default Options of xlink(lmc) (Command Line) Option -o -Fintel-standard Category Output file Output file -Y0 Output file -f Include Description Sets an object file name. Specifies a format. For the Intel Hex files to be output, specify “intel-standard”. Additional information of intel-standard. For use in the mask file conversion utility MM, specify “0”. Specifies a command file. This is automatically set by the TM.
M3T-ICC740 V.1.00 User’s Manual Rev. 1.
M3T-ICC740 V.1.