Epson S5U1C17001C Manual

Cmos 16-bit single chip microcomputer, c compiler package for s1c17 family
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

Quick Links

CMOS 16 - BIT SINGLE CHIP MICROCOMPUTER
S5U1C17001C
Manual
(C Compiler Package for S1C17 Family)
(Ver. 1.5.0)

Advertisement

Table of Contents
loading

Summary of Contents for Epson S5U1C17001C

  • Page 1 CMOS 16 - BIT SINGLE CHIP MICROCOMPUTER S5U1C17001C Manual (C Compiler Package for S1C17 Family) (Ver. 1.5.0)
  • Page 2 No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not...
  • Page 3 S5U1C17001C Manual Revision History Code No. Page Chapter/Section Description of revision − 411086605 Entire manual Version number changed from 1.4.0 to 1.5.0 − Entire manual Technical term changed “implementation-dependent” → “implementation- defined” 2.2 Installation Method Explanation added xgcc_filt.exe: Kanji filter (same as egcc.exe) 3-55 3.5 Tutorial 3...
  • Page 4 Code No. Page Chapter/Section Description of revision 411086605 6-16 to 6.7 Known Issues Section added 6-18 6.7 Known Issues 7.2.3 Floating-point Number Section added 7.2.3 Floating-point Number Processing Processing Implementation Definition Implementation Definition 7.3.1 Overview Explanation modified Certain ANSI library functions ... See the table in Section 4.2.2, “Library Functions and Header Files”...
  • Page 5 1 general General 2 installation Install 3 Software Development Procedures SoftDev 4 Source files SrcFiles 5 gnU17 iDE 6 C Compiler Compiler 7 library Library 8 assembler Assemblr 9 linker Linker 10 Debugger Debugger 11 Other Tools Tools Quick reference Reference...
  • Page 7 This document describes the development procedure from compiling C source files to debugging and creating the mask data which is finally submitted to Seiko Epson. It also explains how to use each development tool of the S1C17 Family C Compiler Package common to all the models of the S1C17 Family.
  • Page 8 An annotation enclosed in < > indicates that a specific name should be placed here. For example, <filename> needs to be replaced with an actual file name. Development tool name ICD: Indicates the ICD Mini (S5U1C17001H) or the ICD board. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 9: Table Of Contents

    5 gnU17 iDE ........................5-1 5.1 Overview ..........................5-1 5.1.1 Features ......................5-1 5.1.2 Some Notes on Use of the IDE ................5-1 5.2 Starting and Quitting the IDE ...................5-2 5.2.1 Starting the IDE ....................5-2 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 10 5.7.4 Setting Assembler Options ................5-118 5.7.5 Setting Linker Options ..................5-120 5.7.6 Setting the Vector Checker................5-124 5.7.7 Generated Makefile ..................5-126 5.7.8 Editing a Linker Script ..................5-130 5.7.9 Executing a Build Process ................5-154 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 11 7.3.2 ANSI Library Function List .................7-9 7.3.3 Declaring and Initializing Global Variables ............7-15 7.3.4 Lower-level Functions ..................7-16 8 assembler ........................8-1 8.1 Functions ..........................8-1 8.2 Input/Output Files ......................8-1 8.2.1 Input Files ......................8-1 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 12 10.3.2 Startup Options ....................10-5 10.3.3 Quitting the Debugger ..................10-6 10.4 Windows ........................10-7 10.4.1 Basic Window Configuration ................10-7 10.4.2 [Source] Window .....................10-8 10.4.3 [Console] Window ..................10-20 10.4.4 [Registers] Window ..................10-21 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 13 10.7.6 CPU Reset Commands..................10-89 c17 rst (reset)[ICD Mini / SIM] ..............10-89 c17 rstt (reset target)[ICD Mini] ..............10-90 10.7.7 Interrupt Commands ..................10-91 c17 int (interrupt)[SIM] ................10-91 c17 intclear (clear interrupt)[SIM] ............10-92 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 14 ..........10-137 c17 clock(display execution counter)[ICD Mini / SIM] ......10-137 target (connect target)[ICD Mini / SIM]...........10-139 detach (disconnect target)[ICD Mini / SIM] ..........10-140 pwd (display current directory) ..............10-141 EPSOn viii S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 15 11.3.3 Method for Using objdump ................11-17 11.3.4 Dump Format ....................11-18 11.3.5 Error Message ....................11-21 11.3.6 Precautions ....................11-21 11.4 objcopy.exe ........................11-22 11.4.1 Function ......................11-22 11.4.2 Input/Output Files ..................11-22 11.4.3 Method for Using objcopy ................11-23 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 16 11.11.6 Producing an LCD File .................11-56 11.11.7 Shortcut Key List ..................11-63 11.11.8 Warning Messages and Error Messages .............11-64 11.12 Stand-Alone Flash Writer ...................11-66 11.12.1 Overview ......................11-66 11.12.2 Procedures for Stand-Alone Flash Write............11-66 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 17: General

    General S5U1C17001C Manual 1 General...
  • Page 19: Features

    Designed to run under Microsoft Windows 2000 Professional, Windows XP, and Windows Vista, the GNU17 IDE is a seamless integrated development environment suitable for a wide range of development tasks, from source creation to debugging. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 20: Outline Of Software Tools

    Only the command options for each tool described in the respective section are guaranteed to work. If other options are required, they should only be used at the user's own risk. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 21: Installation

    Install S5U1C17001C Manual 2 Installation...
  • Page 23: Working Environment

    If so, remove the copy of cygwin1.dll installed in your system or exclude it from the environment variable PATH settings to ensure that the file referenced is always the copy of cygwin1.dll located in the \gnu17 directory. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 24: Installation Method

    (1) Start Windows 2000/XP/Vista. If Windows is already running, close all other programs that are currently open. (2) Download the compressed S5U1C17001C file from the EPSON user site and expand it in the desired folder.. (3) Double-click Setup.exe to launch the installer.
  • Page 25 When installation is completed, a complete screen is displayed. (9) Click the [Finish] button to quit the installer. This completes installation of the tools. Assuming installation finished successfully, an [EPSON MCU] > [GNU17vx.x] menu will be added to the Windows startup menu. EPSOn S5U1C17001C ManUal...
  • Page 26 : GNU17 IDE executable file eclipse.ini : Eclipse settings file .eclipseproduct : Eclipse version information epl-v10.html : EPL license notice.html : Software agreement gnu17_32_trans.ico : gnu17 icon file EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 27 Windows package. Uninstalling the tools To uninstall the tools, select [UnInstall] from [EPSON MCU] > [GNU17] in Windows startup menu, then click the [OK] button in the subsequent dialog box. →...
  • Page 28 Foundation, Inc. Please read the "Copying.GNU" text file for the license before using. GNU17 IDE complies with the Open Source Initiative EPL (Eclipse Public License) 1.0. For more information on the EPL, refer to epl-v10.html in the \gnu17\eclipse directory. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 29: Software Development Procedures

    SoftDev S5U1C17001C Manual 3 Software Development Procedures...
  • Page 31: Software Development Flow

    Motorola S2 Function option file.psa file.fdc ROM data file document file Mask data checker winmdc17 Mask file.PA data file SEIKO EPSON Figure 3.1.1 Software development flow EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 32 PC to emulate device operations as the S1C17 Core and memory models. Debugger setting and startup can be performed from the IDE. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 33 Finally, pack the verified ROM data file (psa file) and the mask option data file generated by winfog17 into a mask data file using winmdc17 and present it to Seiko Epson. Note that winfog17 and winmdc17 can be started by the IDE.
  • Page 34: Software Development Using The Ide

    •Project migration from another environment existing (3) Importing an existing IDE project •Program revision, etc. project 3.5 Tutorial 3 (Importing an IDE Project) Figure 3.2.1 Software development with the iDE EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 35 For detailed information on basic operations, from starting the IDE to debugging the program, refer to Section 3.3, "Tutorial 1 (Basic Operations, from Project Creation to ROM mask Data)". EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 36 To use user makefiles, you must correct the makefile itself and alter the settings made in the IDE. Unless doing so would result in problems, we recommend using the files automatically generated by the IDE. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 37 For detailed information on how to import a project, refer to Section 3.5, "Tutorial 3 (Importing an IDE Proj- ect)", which describes the procedure for importing a sample program created with the IDE. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 38: Tutorial 1 (Basic Operations, From Project Creation To Rom Mask Data)

    3.3.1 Starting the iDE Step 1: Double-click the eclipse.exe icon in the c:\EPSON\gnu17\eclipse directory to start the IDE. You also can start the IDE by selecting [EPSON MCU] > [GNU17] > [GNU17 IDE] from the Windows Start menu. After an Eclipse splash screen, the [Workspace Launcher] dialog box shown below will appear. Specify the work- space (directory) in which you want to save the project resources and output files.
  • Page 39 To quit before completing the tutorial, select [Exit] from the [File] menu of the IDE. Or use the window's (close) button. When the following dialog box appears, click the [OK] button to quit or the [Cancel] button to cancel quitting. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 40: Creating A Project

    You can also select [New GNU17 Project] from the [File] menu or from [New] on the context menu (displayed by right-clicking) in the [C/C++ Projects/Navigator] view. The [New GNU17 Project] wizard will start. EPSOn 3-10 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 41 The executable object file (.elf) generated when building a project is assigned the name you specify here. Step 5: Click the [Next>] button. The system will go to the next screen, where you select a target CPU, memory model and vector table file. EPSOn S5U1C17001C ManUal 3-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 42 IDE as well as it will be used as the VMA of the .vector section that will be written in the linker script file. It is not necessary to alter the default value. EPSOn 3-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 43 The [New GNU17 Project] wizard will be closed, creating a project with the specified name. SoftDev Note that the target CPU cannot be changed later. The memory model, coprocessor library, and vector table file can be revised later. EPSOn S5U1C17001C ManUal 3-13 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 44: Creating, Adding, And Editing A Source File

    Step 11: Select [Import...] from the [File] menu. The [Import] wizard will start. Step 12: From the list displayed, select [General] > [File System] and click the [Next>] button. EPSOn 3-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 45 3 SOfTWarE DEVElOPMEnT PrOCEDUrES SoftDev Step 13: Click the [Browse...] button for [From directory:]. The [Import from directory] dialog box will be dis- played, so select the \EPSON\gnu17\sample\S1C17common\simulator\tst directory from the drive (C) in which you installed the IDE and click [OK]. EPSOn...
  • Page 46 (flagged by a check mark when selected). Step 15: Click the [Browse...] button for the [Into folder:]. This displays the [Import into Folder] dialog box. Select the "sample" folder and click [OK]. EPSOn 3-16 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 47 The added source files are displayed in the "sample" folder in the [C/C++ Projects] view. Step 18: Click [+] for "main.c" in the [C/C++ Projects] view. The global variables and functions defined in the file are displayed for C sources. EPSOn S5U1C17001C ManUal 3-17 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 48 For detailed information, refer to Section 5.5, "The Editor and Editing Source Files". If C sources are displayed, reserved words, comments, and C strings are highlighted in color. EPSOn 3-18 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 49 When assembler sources are displayed, the labels, directives, and registers are highlighted. Step 22: Click the (close) button on the editor tab of each open source to close the editor. EPSOn S5U1C17001C ManUal 3-19 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 50: Editing The Build Options And The Linker Script

    In this tutorial, although no particular changes are needed here, we'll take a look at the method on how to add a user include path and a library file. EPSOn 3-20 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 51 [Browse...] button. When the directory select dialog box is closed, the path entered or selected is added to the list as shown below. EPSOn S5U1C17001C ManUal 3-21 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 52 TOOL_DIR is the environment variable in which the path to the gnu17 tool directory is defined. The defined contents can be verified in the [Environments] tab page. Example: If the gnu17 tools have been installed in the c:\EPSON\gnu17 directory TOOL_DIR = c:/EPSON/gnu17 Since the macro is replaced with the contents of the environment variable described in () during execution of make.exe, -I$(TOOL_DIR)/include will be resolved to -Ic:/EPSON/gnu17/include.
  • Page 53 Step 29: Select [Linker] > [Libraries] from the [Build Options] tree. Displays the page in which a library file can be set. The [Libraries] column lists the ANSI library and emulation library included in this package. EPSOn S5U1C17001C ManUal 3-23 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 54 Step 32: If you closed the [Properties] dialog box, select [Properties] from the [Project] menu to reopen it. Step 33: Click to select [GNU17 Linker Script Settings] from the properties list. EPSOn 3-24 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 55 LMA>, and <end of LMA>. These labels may be used to specify addresses in a source file when, for example, copying sections from ROM to RAM. During actual program development, user defined sections can be added using the [Add] button. EPSOn S5U1C17001C ManUal 3-25 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 56 (boot.o, main.o) will be generated from the source files added to a project in the same name as those of the source files. EPSOn 3-26 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 57 Editing objects to be located and section attribute of a user section (displayed in black) automatically updates the object configuration of the standard section with the same attribute. By the above, you are finished with preparations for building a program. EPSOn S5U1C17001C ManUal 3-27 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 58: Building A Program

    When the build command is selected this way, makefiles are generated with the current settings and then make. exe is executed to generate an executable format object file sample.elf. The commands executed during a build process and tool messages are displayed in the [Console] view. EPSOn 3-28 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 59: Debugging A Program

    Step 41: Click on the RAM line in the list box to get it displayed in inverse video and click the [Edit] button. The [Edit Parameter] dialog box will be displayed. EPSOn S5U1C17001C ManUal 3-29 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 60 Step 45: Enter 8000 in the [Start Address:] text box and 17fff in the [End Address:] text box. Select "halfword" (16 bits) from [Access Size:]. Step 46: Click the [OK] button. EPSOn 3-30 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 61 The debugger must be set to the appropriate mode that suits the ICD used, etc. before it can be operated. For detailed information, refer to Section 3.7, "Debugging Environment". EPSOn S5U1C17001C ManUal 3-31 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 62 Step 52: Click the [OK] button. When above settings are made, a command file named "sample_gnu17IDE.cmd" is generated and it will be passed to the debugger. EPSOn 3-32 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 63 This dialog box may be used to edit the command line of the gdb debugger. No particular changes are required for executing the sample, so start the debugger directly with this setting. Step 55: Click the [Run] button. The gdb debugger will start. EPSOn S5U1C17001C ManUal 3-33 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 64 The sample program here endlessly increments the int variable counter 'i' (addresses 0x0–0x3). Use a forcible break to stop such an endless loop. To forcibly break a program Step 57: Click the [Stop] button in the toolbar. EPSOn 3-34 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 65 There is the pulldown list box that shows SOURCE in the toolbar. Use it to specify the display mode of the [Source] window. Step 58: Select "SOURCE", "ASSEMBLY", "MIXED", or "SRC + ASM" in the pulldown list to change display modes. EPSOn S5U1C17001C ManUal 3-35 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 66 Only the currently halted function can be displayed at a time, and no other functions can be displayed in the same window. EPSOn 3-36 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 67 In SRC + ASM mode, the window is split into the upper and lower parts for simultaneous display in SOURCE and ASSEMBLY modes. Step 59: Select SOURCE to reverse the display mode. Let's take a look at other windows of the debugger here. EPSOn S5U1C17001C ManUal 3-37 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 68 'i' in the [Memory] window. Step 60: Enter '&i' or '0' in the [Address] text box of the [Memory] window and press the [Enter] key. EPSOn 3-38 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 69 'i' (i = global variable) earlier verified in the [Memory] window. The procedure is described below. Step 63: Enter 'i' in the text box located at the bottom of the window and click the [Add Watch] button. EPSOn S5U1C17001C ManUal 3-39 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 70 In contrast to Step 56, the program this time should have stopped at the line set to be a breakpoint. Try pressing the [Continue] button a number of times. You will see that the program stops at the same place each time. EPSOn 3-40 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 71 (i.e., executes a function or subroutine as one step, without stopping at every instruc- tion). If you do not need to debug the subroutines instruction by instruction, use the [Next] button instead. EPSOn S5U1C17001C ManUal 3-41 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 72 ICD to the target board. For detailed information on how to debug in this mode, refer to Section 3.7, "Debugging Environment". Finally, we'll quit the IDE. To quit the iDE Step 72: Select [Exit] from the IDE's [File] menu. EPSOn 3-42 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 73: Creating Rom Data

    The mask data to be presented is generated based on this ROM data HEX file. After a program for a model with built-in ROM is completed, you will be requested to present the masked data for the internal ROM to Seiko Epson. Creating a rOM data HEX file When a build process is executed, a Motorola-S2-format ROM data HEX file with the same name as the ‘elf’...
  • Page 74 The [Pack successfully completed!!] dialog box appears, and a packed file (sample.pa file) is created in the project directory. For detailed information on winmdc17.exe, refer to the section describing other tools. Present the mask data file generated by the above operations to Seiko Epson. EPSOn 3-44 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver.
  • Page 75: Tutorial 2 (Using The User Makefiles)

    IDE to starting the debugger. For basic information on using the IDE, etc., refer to Tutorial 1. Files used Tutorial 2 uses the sample files listed below that exist in the c:\EPSON\gnu17\sample\S1C17common\ simulator\simulatedIO directory. Vector table file vector.c...
  • Page 76 CPU, memory model and .vector section. Step 5: Deselect the check box [Allocate a specific file to '.vector' section]. Step 6: Click the [Finish] button to create a project. EPSOn 3-46 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 77: Importing Source Files

    This launches the [Import] wizard. Step 8: Select [General] > [File System] from the list displayed and click the [Next>] button. Step 9: Using the [Browse...] button in [From directory:], select the C:\EPSON\gnu17\sample\ S1C17common\simulator\simulatedIO directory that contains the files to be imported.
  • Page 78 Debugger command file mycmdfile.cmd Parameter file myparfile.par Step 11: Click the [Finish] button. You can inspect the files that have been added to the project from the [Navigator] view. EPSOn 3-48 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 79: Disabling The Gnu17 File Builder

    Do not disable the file builder if any of the above files must be automatically generated by the IDE. EPSOn S5U1C17001C ManUal 3-49 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 80: Setting And Correcting The Makefile

    Specify the target in the makefile to be called when executing a clean process (to clear the generated files). [Build on resource save (Auto Build)] is not used in the IDE. Step 18: Click the [OK] button. EPSOn 3-50 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 81: Building A Project

    IDE editor to make changes in the file. Example: Before change: SRCDIR= After change: SRCDIR=/cygdrive/c/EPSON/gnu17/sample/S1C17common/simulator 3.4.5 Building a Project After setting the makefile, you can execute a build process as you would normally do. There is no need to set build options or to edit the linker script file.
  • Page 82 Step 25: Click the [Close] button if you want to finish here. To actually start the debugger, click the [Run] button. See Tutorial 1 for basic debugger operations. EPSOn 3-52 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 83: Tutorial 3 (Importing An Ide Project)

    Step 2: Select [Import...] from the [File] menu. This launches the [Import] wizard. Step 3: Select [Existing Projects into Workspace] from the displayed list and click the [Next>] button. EPSOn S5U1C17001C ManUal 3-53 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 84 3 SOfTWarE DEVElOPMEnT PrOCEDUrES Step 4: Using the [Browse...] button in [Select root directory:], select the project directory C:\EPSON\ gnu17\sample\S1C17common\simulator\simulatedIO to be imported. Step 5: Select the [Copy projects into workspace] check box. This will make a copy of the project into the workspace directory and the original project files will not be modified.
  • Page 85 You will neither have a problem with the standard libraries and include directories as long as the tools are in- stalled in the same directory where the original project was created in (e.g. C:\EPSON\gnu17). Otherwise, corrections are required for the user library and include directory. Make these corrections in the [GNU17 Build Options] of the [Properties] dialog box for the project.
  • Page 86: Tutorial 4 (How To Use Es-Sim17)

    3.6 Tutorial 4 (How to Use ES-Sim17) The S5U1C17001C Package contains the Embedded System Simulator (ES-Sim17) for simulating the hardware functions of the target model, such as I/O ports and LCD display, during debugging on the PC. The debugger will launch ES-Sim17 by setting some conditions with the IDE.
  • Page 87 IDE to launch the debugger in simulator mode. Step 4: Display the [Properties] dialog box by selecting [Properties] from the [Project] menu and open the [GNU17 GDB Commands] page. EPSOn S5U1C17001C ManUal 3-57 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 88 Following the above steps the settings for launching ES-Sim17 at the same time the debugger starts up are fin- ished. Other operations are not necessary in the source edit and build stages to launch ES-Sim17. EPSOn 3-58 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 89: How To Launch Es-Sim17 In The Existing Project

    Step 2: Select [Import...] from the [File] menu. This launches the [Import] wizard. Step 3: Select [Existing Projects into Workspace] from the displayed list and click the [Next>] button. EPSOn S5U1C17001C ManUal 3-59 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 90 3 SOfTWarE DEVElOPMEnT PrOCEDUrES Step 4: Using the [Browse...] button in [Select root directory:], select the project directory C:\EPSON\ gnu17\sample\S1C17701\simulator\application to be imported. Step 5: Select the [Copy projects into workspace] check box. This will make a copy of the project into the workspace directory and the original project files will not be modified.
  • Page 91 (“S1C17701” is the name of the target processor.) ESSIM S1C17701 * When the user provides the original parameter file, add the above description to the file. EPSOn S5U1C17001C ManUal 3-61 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 92 Step 11: Display the [Create a simple startup command] dialog box by clicking the [Create commands from template] button and select "Simulator" from the [Debugger:] combo box. Step 12: Click the [Overwrite] button. EPSOn 3-62 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 93 * When the user provides the original command file that contains the "target icd usb" command, rewrite the command to "target sim". EPSOn S5U1C17001C ManUal 3-63 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 94 Step 14: Select [External Tools] > [GDB17 Launch for application] from the [Run] menu. The debugger starts up and enters simulator mode. At the same time the [ES-Sim] window opens. EPSOn 3-64 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 95 After the file selection dialog box is displayed, open the LCD file for the S1C17701 (as created in LCDUtil17) at C:\EPSON\gnu17\tool\LcdUtil17\sample\SVT17701.lcd. For the functions and how to operate ES-Sim17, see Section 10.11, "Embedded System Simulator (ES-Sim17)". EPSOn S5U1C17001C ManUal 3-65 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 96: Debugging Environment

    Select "Simulator" from the [Debugger:] combo box in the [Create a simple startup command] dia- log box to generate a startup command file. The trace function is available in simulator mode. The flash writer function cannot be used. EPSOn 3-66 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 97: Sections And Linkage

    .text section, you must change the .vector section attribute to .text. For more information, refer to Section 5.7.8, "Editing a Linker Script". EPSOn S5U1C17001C ManUal 3-67 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 98 = "ABCDEFGH"; /* .rodata section */ int main() /* .text section */ char sz_buf[10]; for( i = 0; i < 5; ++i ){ sz_buf[i] = sz_rodata[i]; return 0; EPSOn 3-68 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 99 __START_rodata = . ; file2.o(.rodata) file3.o(.rodata) C:/EPSON/gnu17/lib/24bit/libc.a(.rodata) C:/EPSON/gnu17/lib/24bit/libgcc.a(.rodata) C:/EPSON/gnu17/lib/24bit/libc.a(.rodata) __END_rodata = . ; /* load address symbols */ ...(10) __START_data_lma = LOADADDR( .data ); __END_data_lma = __START_data_lma + SIZEOF( .data ); EPSOn S5U1C17001C ManUal 3-69 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 100 (LMA) of the .data section in which the actual data is stored. These symbols are used to copy data from the LMA to the VMA in the program source. EPSOn 3-70 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 101 .data (3) .data (2) __START_data file1.o .bss (5) __END_bss .bss section .text (1) .bss (4) (VMA) .rodata (1) .bss (3) __START_bss 0x000000 Figure 3.8.1 Memory map configured by sample.lds EPSOn S5U1C17001C ManUal 3-71 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 102 3 SOfTWarE DEVElOPMEnT PrOCEDUrES THIS PAGE IS BLANK. EPSOn 3-72 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 103: Source Files

    SrcFiles S5U1C17001C Manual 4 Source files...
  • Page 105: File Format And File Name

    [Preference] menu (can be specified from 1 to 16 characters). Make sure that each statement starts on a new line and that EOF is entered after line feed (so that EOF will stand independent at the file end). EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 106: Grammar Of C Source

    = 0x1234567812345678LL; → OK Type wchar_t is the data type needed to handle wide characters. This data type is defined in stdlib.h/std- def.h as the type unsigned short. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 107: Library Functions And Header Files

    When using a library function, be sure to specify the library file that contains the function used when linking. The linker extracts only the necessary object modules from the specified library file as it links them. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 108: In-Line Assemble

    Interrupt handler functions should be declared in the following format: <type> <function name> __attribute__ ((interrupt_handler)); Example: void foo(void) __attribute__ ((interrupt_handler)); int int_num; void foo() int_num = 5; Assembler code foo: ld.a -[%sp],%r2 %r2,5 [int_num],%r2 ld.a %r2,[%sp]+ reti EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 109: Grammar Of Assembly Source

    Comments can be described using other characters than ASCII characters. When using non-ASCII characters (such as Chinese characters) for comments, use /* · · · */ as the comment symbol. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 110 Mnemonics can be written in uppercase (A–Z) characters, lowercase (a–z) characters, or both. For example, "ld", "LD", and "Ld" are all accepted as "ld" instructions. For purposes of discrimination from symbols, this manual uses lowercase characters. More will be said about operands later. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 111 Only the following characters can be used: A–Z a–z _ 0–9 A label cannot begin with a numeral. Uppercase and lowercase are discriminated. Examples: ;OK ;Error FOO: 1label: _Abcd: 0_ABC: EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 112 This assembler also allows a blank line containing only a return/line feed code. It need not be made into a comment line, for example, when used as a break in a series of routines. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 113: Notations Of Operands

    0x0 to 0xffffff 0b0 to 0b1111 1111 1111 1111 1111 1111 sign24 Signed 24-bit immediate data -8,388,608 to 8,388,607 0x0 to 0xffffff 0b0 to 0b1111 1111 1111 1111 1111 1111 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 114 %rd,LABEL ← LABEL = sign7 ld.a The as assembler also accepts the referencing of an address with a specified displacement as shown below. LABEL + imm24 LABEL + sign24 Example: xcall LABEL+0x10 EPSOn 4-10 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 115: Extended Instructions

    %r0,symbol + 0x10 ; Jumps to address LABEL + 5. xjpa LABEL + 5 For details about the extended instructions that include operands, refer to Section 8.6, "Extended Instructions". EPSOn S5U1C17001C ManUal 4-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 116: Preprocessor Directives

    The sources that contain preprocessor directives need to be processed by the preprocessor (use the xgcc options -c and -xassembler-with-cpp), and cannot be entered directly into the as assembler. (Direct entry into the assembler will result an error.) EPSOn 4-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 117: Precautions For Creation Of Sources

    3) short s_local_val = (short)boot; → A function name can be used to assign the pointer to the s h o r t type local variable s_local_val. EPSOn S5U1C17001C ManUal 4-13 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 118 4) short s_Global_Val; void sub() s_Global_Val = (short)fp_Pt; → A function pointer can be assigned to the short type global variable s_Global_Val except when it is declared. EPSOn 4-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 119 ・ When shift calculation is performed with a negative value or a value equal to or greater than the bit length of the calculation target after a type promotion. EPSOn S5U1C17001C ManUal 4-15 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 120 Because p2 and &p1 are incompatible pointers, a warning message will appear. In this case, access to variable p1 via pointer p2 or substitution will not proceed correctly. EPSOn 4-16 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 121 S5U1C17001C Manual 5 gnU17 iDE...
  • Page 123: Gnu17 Ide

    5.1.1 features The GNU17 IDE (hereafter simply the IDE) provides an integrated development environment that makes it user to develop software using the S1C17 Family C Compiler Package (S5U1C17001C). The main features of the IDE are outlined below. • Project management Allows collective management of all source files needed to create an application as a single project.
  • Page 124: Starting And Quitting The Ide

    Double-click the eclipse.exe icon in the c:\EPSON\gnu17\eclipse directory to start the IDE. You can also start the IDE by selecting [EPSON MCU] > [GNU17] > [GNU17 IDE] from the Win- dows Start menu, or from the command line without parameters.
  • Page 125: Quitting The Ide

    (close) button to quit the IDE. Click the [OK] button at the following dialog prompt to quit You also can use the or [Cancel] to continue working. Select the [Always exit without prompt] check box to skip this prompt. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 126: Ide Window

    The IDE window consists of an editor surrounded by several views and a menu bar and a toolbar. Menu bar Window toolbar Editor Perspective bar Status bar Views View toolbar EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 127: Menu Bar

    Places the file or directory selected in the [C/C++ Projects] or [Navigator] view in editing mode (allowing renaming of the file or directory). refresh (f5) Updates the displayed content of the [C/C++ Projects] or [Navigator] view. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 128 Searches for the next occurrence that matches the search string. find next (Ctrl+k) Jumps to the next instance of a search string. find Previous (Ctrl+Shift+k) Jumps back to the previous instance of a search string. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 129 Cuts out a constant from a source file for use in a variable. Extract function (alt+Shift+M) Cuts out a part of a code from a source file for use in a function. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 130 Edit location (Ctrl+Q) Jumps to the last edited position in the editor. go to line... (Ctrl+l) Jumps to the position in the active document indicated by the specified line number. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 131 IDE. Properties Displays a [Properties] dialog box that lets the user display or edit properties of the project selected in the [C/C++ Projects] or [Navigator] view. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 132 Makes the settings required to start the gdb debugger or an external tool. You also can start a tool from the displayed dialog box. Once launched, the tool is displayed in the tool list. Organize Favorites... Registers frequently used external tools. EPSOn 5-10 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 133 Minimizes the view or editor of the currently active view. Activate Editor (F12) Activates the document displayed in front of all other documents currently open in the editor. EPSOn S5U1C17001C ManUal 5-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 134 Installs an updater, updates, plug-ins, etc. for software management. Use this command only when required. about Eclipse for gnU17 Vx.x Shows IDE version information and detailed information on plug-ins, etc. EPSOn 5-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 135: Window Toolbar

    = [Navigate] > [Next Annotation] Previous Annotation = [Navigate] > [Previous Annotation] Last Edit Location = [Navigate] > [Last Edit Location] Back = [Navigate] > [Back] Forward = [Navigate] > [Forward] EPSOn S5U1C17001C ManUal 5-13 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 136: Editor Area

    In addition to the built-in editors, you can start an external editor from the IDE and edit the sources in it. For more information on editing features, refer to Section 5.5, "The Editor and Editing of Source Files". EPSOn 5-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 137 Changes the name of the selected type, function, or member in all locations, including other locations in the source. The submenu displays the [Undo...] and [Redo...] commands, which enable cancellation and re-execution of the operation. EPSOn S5U1C17001C ManUal 5-15 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 138 Displays the [Preferences] dialog box for the editor. Build Configuration... Defines the target to be selected by [Make Target...]. Make Target... Selects a target and performs a build using make.exe. EPSOn 5-16 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 139: C/C++ Projects] View

    Restores the display in the view to the immediately preceding state based on history. forward Advances the display in the view to the immediately following state based on history. Expands the display in the view to the immediately higher hierarchy. EPSOn S5U1C17001C ManUal 5-17 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 140 Export... = [File]>[Export...] Build Project = [Project]>[Build Project] (Effective when a project is selected) refresh = [File]>[Refresh] add Bookmark = [Edit]>[Add Bookmark] (Effective when a project is selected) EPSOn 5-18 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 141 Displays a [Properties] dialog box that shows and allows changes in the properties of the current project. Build Configuration... Defines the target to be selected by [Make Target...]. Make Target... Selects a target and performs a build using make.exe. EPSOn S5U1C17001C ManUal 5-19 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 142: Navigator] View

    Sorts display in the view in alphabetical order by file type. Filters... Specifies the type of file to be displayed. Link with Editor Updates the editor view to reflect the selection in the view. EPSOn 5-20 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 143 * An S record file is generated with a name “<project name>.psa” when a project is built. In normal use, it is not necessary to generate an S record file by the method described above. EPSOn S5U1C17001C ManUal 5-21 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 144 Displays a [Properties] dialog box that shows and allows changes in the properties of the current project. Build Configuration... Defines the target to be selected by [Make Target...]. Make Target... Selects a target and performs a build using make.exe. EPSOn 5-22 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 145: Outline] View

    Replaces a selected file with the content that was saved immediately before. Local History... Replaces a selected file with its previously saved content (selected from history). Object file conversion This submenu is not used in this view. EPSOn S5U1C17001C ManUal 5-23 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 146 (workspace, current project, specified working set). Create Make Target... Defines the target to be selected by [Build Make Target...]. Build Make Target... Selects a target and performs a build using make.exe. EPSOn 5-24 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 147: Console] View

    Displayed in the context menu of a console at debugger startup, etc. This menu command works the same way as the [Terminate] button described above. (For the menu commands not specifically discussed here, refer to the description of the menu bar.) EPSOn S5U1C17001C ManUal 5-25 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 148: Problems] View

    Deletes the error markers in the editor that correspond to the selected error. Properties Displays information on the error currently selected. (For the menu commands not specifically discussed here, refer to the description of the menu bar.) EPSOn 5-26 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 149: Properties] View

    5 gnU17 iDE 5.3.9 [Properties] View Displays information on the resource or member currently selected in the [C/C++ Projects], the [Navigator], or the [Outline] view. EPSOn S5U1C17001C ManUal 5-27 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 150: Make Targets] View

    Returns to the uppermost hierarchy in the tree list. go Back Returns to the hierarchy one level up in the tree list. go into Advances to the hierarchy one level down in the tree list. EPSOn 5-28 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 151: Search] View

    Shows the search results in a non-hierarchical flat layout. Hierarchical Layout Shows the search results in hierarchically structured mode. Preferences... Displays the preference dialog box to set search conditions. EPSOn S5U1C17001C ManUal 5-29 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 152 Compares the contents of two or three selected files with each other. Local History... Compares the content of a selected file with its previously saved content. (Effective when a file is se- lected) EPSOn 5-30 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 153 Displays information on the currently selected occurrence of search string. Create Make Target... Defines the target to be selected by [Build Make Target...]. Build Make Target... Selects a target and executes make.exe. EPSOn S5U1C17001C ManUal 5-31 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 154: Bookmarks] View

    Select all = [Edit] > [Select All] Properties Displays information on the selected bookmarks. (For the menu commands not specifically discussed here, refer to the description of the menu bar.) EPSOn 5-32 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 155: Tasks] View

    Copy = [Edit] > [Copy] Paste = [Edit] > [Paste] Delete = [Edit] > [Delete] Select all = [Edit] > [Select All] Mark Completed Adds a completion mark to a selected task. EPSOn S5U1C17001C ManUal 5-33 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 156 Deletes all of the completed tasks. Properties Displays information on the tasks selected. (For the menu commands not specifically discussed here, refer to the description of the menu bar.) EPSOn 5-34 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 157: View Manipulation

    A minimize button restores the view to its original size. If you click the minimize button of a view in ordinary display, only the tab is displayed. Maximize button Minimize button EPSOn S5U1C17001C ManUal 5-35 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 158 The edi- tor and lower view areas are enlarged as the views in the left pain are closed. Fast view area EPSOn 5-36 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 159 To restore a fast view to normal view, select [Fast View] from the context menu for the fast-view icon. Select [Close] from this context menu to close the view and remove the icon. EPSOn S5U1C17001C ManUal 5-37 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 160: Perspectives

    The word "GNU17" shown to the right of the perspective shortcut icon indicates that the GNU17 perspective is currently selected. Although the IDE allows you to switch perspectives, use only the default "GNU17" perspective. EPSOn 5-38 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 161: Projects

    (2) Enter a project name in the [Project name:] text box. notes: • Make sure the project name you enter is 100 characters or less. • Only single-byte alphanumeric characters and underscores may be used for project names. EPSOn S5U1C17001C ManUal 5-39 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 162 20 bits (Up to 1M-byte space can be used.) SMALL: 16 bits (Up to 64K-byte space can be used.) You can modify settings for the memory model later. (Refer to Section 5.7.1, "Setting the Memory Model".) EPSOn 5-40 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 163 Example: Project created with the name "sample" If multiple projects are created in the workspace, all will appear in the [C/C++ Projects] or [Navigator] view. EPSOn S5U1C17001C ManUal 5-41 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 164: Opening And Closing A Project

    (see Section 5.4.4). Or import an existing project you want to open into the current workspace (see Section 5.4.5). EPSOn 5-42 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 165: Switching Workspaces

    If the workspace to which you've switched contains any existing projects, the window is opened in the status at the time you finished work on that project. Specifying a nonexistent directory in (3) will create a new instance of your specified directory. EPSOn S5U1C17001C ManUal 5-43 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 166: Importing An Existing Project

    • Select [Import...] from the context menu for the [C/C++ Projects] or [Navigator] view. The [Import] wizard will start. (2) Select [Existing Projects into Workspace] from the list and click [Next>]. EPSOn 5-44 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 167 (3) When the project is not archived, select the [Select root directory:] radio button. Then select the project direc- tory you want to import in the directory select dialog box displayed by clicking the [Browse...] button. EPSOn S5U1C17001C ManUal 5-45 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 168 (when [Copy projects into workspace] is selected). (4) Click the [Finish] button. The imported project will be displayed in the [C/C++ Projects] or [Navigator] view. EPSOn 5-46 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 169 No problems will arise with the standard libraries and include directories as long as the tools are installed in the same directory (e.g., C:\EPSON\gnu17). If you use an IDE with a different tool directory, the user library and include directory must be changed as necessary using [GNU17 Build Options] in the [Properties] dialog box of the project.
  • Page 170: Deleting A Project

    When this happens, use the Task Manager to end the conime.exe process or reboot the PC, and then delete the project folder. EPSOn 5-48 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 171: Changing The Project Name

    • Note that the automatic change of project settings described above will not occur if a project is copied and pasted using the [C/C++ Projects] or [Navigation] view menu. EPSOn S5U1C17001C ManUal 5-49 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 172: Resource Manipulation In A Project

    If a source folder is created without selecting this checkbox, you must re-import a source file into the proj- ect folder. If a source file is placed in the project folder, be sure to select this checkbox (it is selected by default). EPSOn 5-50 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 173 • Select [Other...] from the [New] shortcut in the toolbar. The [New] dialog box is displayed. (2) Select [Folder] from the [General] tree list. (3) Click [Next >]. EPSOn S5U1C17001C ManUal 5-51 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 174 The source files located in this folder will not be included in a make process. Place the source files into a source folder to include them in a make process. EPSOn 5-52 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 175 The current project name is entered in [Source Folder:]. When creating the file in another directory, enter the path or select the directory using the [Browse...] button. EPSOn S5U1C17001C ManUal 5-53 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 176 (2) Select the project or the parent directory in which you want to create a new file by clicking on it in the direc- tory list in tree form. EPSOn 5-54 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 177 • Select [Import...] from the context menu in the [C/C++ Projects] or [Navigator] view. This launches the [Import] wizard. (3) Select [File System] from the list and click [Next>]. EPSOn S5U1C17001C ManUal 5-55 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 178 Always be sure to select the parent directory of the file/directory you want to import. The files/di- rectories to be imported are located in the directory displayed as the root directory in the directory list to the left of the dialog box. EPSOn 5-56 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 179 • Select [Properties] from the context menu in the [C/C++ Projects] or [Navigator] view. This will display the [Properties] dialog box. (3) Select [C/C++ Project Paths] from the properties list, then click the [Source] tab. EPSOn S5U1C17001C ManUal 5-57 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 180 This displays the [Source Folder Selection] dialog box. (5) Select the directory you want to register (indicated by a check mark when selected) and click the [OK] but- ton. EPSOn 5-58 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 181 • Select [Copy] from the [Edit] menu. • Select [Copy] from the context menu in the [C/C++ Projects] or [Navigator] view. This copies the selected resource to the clipboard. EPSOn S5U1C17001C ManUal 5-59 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 182 (2) Do one of the following: • Select [Export...] from the [File] menu. • Select [Export...] from the context menu in the [C/C++ Projects] or [Navigator] view. This launches the [Export] wizard. EPSOn 5-60 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 183 5 gnU17 iDE (3) Expand [General]. (4) Select [File System] from the wizard list and click [Next>]. EPSOn S5U1C17001C ManUal 5-61 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 184 • Select [New] > [File] from the context menu for the [C/C++ Projects] or [Navigator] view. • Select [File] from the [New] shortcut in the toolbar. • Select [File] from the [New C/C++ Source File] shortcut in the toolbar. EPSOn 5-62 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 185 (3) In [File name:], enter a name for the file to be created. (4) Click the [Advanced>>] button. (5) Select the [Link to file in the file system] checkbox. (6) Click the [Browse] button and select a file to reference. EPSOn S5U1C17001C ManUal 5-63 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 186 The object files for linked source files located outside the project folder will be generated directly under the project folder. EPSOn 5-64 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 187 • Select [New] > [Other...] from the context menu for the [C/C++ Projects] or [Navigator] view. • Select [Other...] from the [New] shortcut in the toolbar. The [New] dialog box is displayed. (2) Select [Folder] from [General] in the list. EPSOn S5U1C17001C ManUal 5-65 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 188 The newly-created folder will appear in tree view. (10) Register the folder as a source folder. After registration as a source folder, a “C” mark will appear on the icon. EPSOn 5-66 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 189 The object files for linked source files located outside the project folder will be generated directly under the project folder. EPSOn S5U1C17001C ManUal 5-67 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 190: File Filter

    • Files corresponding to "*.sa" (S3 format files of elf execut- able files) • Files corresponding to "*.saf" (S3 format files output by moto2ff) • Files corresponding to "*.out" (vector check files) EPSOn 5-68 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 191: Working Set

    ) in the [C/C++ Projects] view to display the [Select Working Set] dialog box (shown above). (2) Click the [New...] button. This launches the [New Working Set] wizard. EPSOn S5U1C17001C ManUal 5-69 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 192 To select for display one or more specific resources in the project directory, click the [+] icon of the project to list the resources contained in the directory and select the desired resource. (6) Click the [Finish] button. EPSOn 5-70 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 193 ) in the [C/C++ Projects] view to display the [Edit Working Set] dialog box. When you close the [Edit Work- ing Set] dialog box, any changes made will be directly reflected in the view. EPSOn S5U1C17001C ManUal 5-71 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 194 No working sets are selected in the display in this view. (3) Click the [OK] button. To use another working set, select one from the list before clicking [OK]. EPSOn 5-72 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 195: Project Properties

    C++ Project Properties] > [C/C++ General] from the Help menu. Code Style Formatter settings. Documentation Selects the Help document to be used for a project. Disregard in normal use. EPSOn S5U1C17001C ManUal 5-73 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 196 A launch configuration can be specified for the file being selected. Disregard in normal use. For more information, refer to Section 5.10.1 or the various sections that discuss the corresponding specific topic. EPSOn 5-74 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 197: The Editor And Editing Source Files

    Double clicking on a "*.cmd" or "*.bat" file launches Command Prompt. To edit a file of one of these types, drag and drop it on the editor area. EPSOn S5U1C17001C ManUal 5-75 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 198 A blank document is opened in the editor area. Opening a file To open a file in the editor, double-click on the file name (or icon) in the [C/C++ Projects] or [Navigator] view. EPSOn 5-76 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 199: Basic Editing Facilities

    – (Ctrl+A) Find [Edit]>[Find/ – – Replace...] (Ctrl+F) Replace [Edit]>[Find/ – – Replace...] (Ctrl+F) Find next [Edit]>[Find Next] – – (Ctrl+K) Find previous [Edit]>[Find Previous] – – (Ctrl+Shift+K) EPSOn S5U1C17001C ManUal 5-77 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 200: Editing Functions For C Source Files

    If an error occurs in the source file currently open in the editor, the line with the error is marked with a symbol ( ). Hover the mouse cursor over this marker to see the nature of the error. EPSOn 5-78 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 201 The editor's overview ruler (to the right of the vertical scroll bar) displays a marker to indicate the position of the error within the overall file. Click on the marker to jump to the line containing the error. EPSOn S5U1C17001C ManUal 5-79 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 202 Even in this case, since it is possible that matching strings will exist in the document, use the arrow keys [↑] or [↓] to search the document forward or backward. (5) To quit incremental search mode, press the [Enter] or the [Esc] key. EPSOn 5-80 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 203 All selected lines will be preceded by "//". Even if the selected line has already been turned into a comment, "//" is inserted unconditionally (whether marked with // or /*). EPSOn S5U1C17001C ManUal 5-81 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 204 While general-purpose templates are predefined, you can also define custom tem- plates. (Refer to [C/C++] > [Editor] > [Templates] in Section 5.9, "Customizing the IDE (Preferences)".) EPSOn 5-82 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 205 [source code] The elements in source code will be renamed. [comments] The string in comments will be replaced. [macro definitions] The elements in macro definitions will be renamed. EPSOn S5U1C17001C ManUal 5-83 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 206 [Refactor] > [Undo ·····] from the context menu of the selected element. After performing an Undo, [Redo ·····] in the menu will be effective, allowing you to repeat the operation canceled by Undo. EPSOn 5-84 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 207: Outline] View

    The [Outline] view shows the variables and functions defined in the C source currently in front of all other files in the editor area. Click on a variable or function name to jump to its defined position in the source. EPSOn S5U1C17001C ManUal 5-85 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 208: Navigation History

    Deleting the characters entered or undoing an operation does not reverse the history. If the last edit made was a line deletion, the history will go to the point preceding the deletion. EPSOn 5-86 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 209: Bookmarks

    Bookmark marker Open the [Bookmarks] view. The bookmark just set has been added to the list. You can rename a bookmark simply by clicking in the [Description] column. EPSOn S5U1C17001C ManUal 5-87 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 210 Right-click anywhere in the line of the desired bookmark to display the context menu, then select [Properties]. This displays the [Properties] dialog box, showing the date and time of creation, in addition to the information shown in the view. You also rename the bookmark. EPSOn 5-88 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 211 Enter the name of the filter to be configured and click [OK]. (4) If other filters are shown in [Configurations:], deselect the checkboxes for those filters and select the checkbox for the newly-created filter. EPSOn S5U1C17001C ManUal 5-89 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 212 [Configurations:] list. Or select them from the submenu of the [Show] view menu. Refer to Section 5.10.5 for information on settings made in the [Configure Contents] dialog box. EPSOn 5-90 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 213 (2) Select [Sort by] from the View menu (▽) and select the items in the list you wish to prioritize over oth- ers when sorting the list. Selecting [Ascending] sorts and arranges items in ascending order. Deselecting [Ascending] sorts and arranges items in descending order. EPSOn S5U1C17001C ManUal 5-91 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 214: Tasks

    Click in this column to display a pull-down list box. Use the pull-down list box to revise the task priority. Click in the [Description] column to change a task description. EPSOn 5-92 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 215 (2) This displays a confirmation dialog box. Click [OK] to remove or [Cancel] to cancel. You can also use filters to hide completed tasks without deleting them (described later). EPSOn S5U1C17001C ManUal 5-93 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 216 Use filters to display only the necessary tasks and to hide others. Furthermore, two or more filters can be configured and used as necessary. A new filter can be configured as in the procedure below. (1) Activate [Tasks] view. EPSOn 5-94 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 217 [On selected element only] The tasks set in the file that has been selected in the [C/C++ Projects]/[Navigator] view or activated in the editor will be displayed. EPSOn S5U1C17001C ManUal 5-95 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 218 The [Tasks] view now displays only the tasks meeting the specified condition. To change the conditions for the currently selected filter, omit Steps (3) and (4) and just select the condi- tions. EPSOn 5-96 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 219 (2) Select [Sort by] from the View menu (▽) and select the items in the list you wish to prioritize over other times when sorting the list. Selecting [Ascending] sorts and arranges items in ascending order. Deselecting [Ascending] sorts and arranges items in descending order. EPSOn S5U1C17001C ManUal 5-97 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 220: Customizing The Editor

    (2) Click [Change...] to display the font select dialog box. Select a font, font style, and display color in the dia- log box. Or use the [Use System Font] button to select the standard Windows font. (3) Click [Apply] or [OK] to complete the settings. EPSOn 5-98 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 221 To change the tab size, set the number of characters for the tab width in the [Displayed tab width:] text box. Select the [Show line numbers] check box to enable display of line numbers. You can also set highlighting and other options on this page. EPSOn S5U1C17001C ManUal 5-99 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 222: Using An External Editor

    If the file type does not appear in the list, display the dialog box below by clicking the [Add...] button for [File types:] and enter the file name extension (*.c, *.h, *.s) to add it to the list. EPSOn 5-100 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 223 This opens the selected file in the external editor. note: You must first close files already open in the iDE editor before reopening them in an external editor. EPSOn S5U1C17001C ManUal 5-101 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 224: Search

    \: Place in front of *, ?, or \ to specify them as the search character (\*, \?, or \\). [Case sensitive] Select this check box to make searches case-sensitive. EPSOn 5-102 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 225 Replaces the currently selected occurrence of the search string with the new string entered and begins searching for the next occurrence. [Cancel] Stops the search. [Search] Performs a search using the parameters specified above. [Cancel] Cancels a search. EPSOn S5U1C17001C ManUal 5-103 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 226: C Search

    Name space (ineffective) [Typedef] Type definition [Macro] Macro definition [Any Element] All elements are searched for. Selecting this check box disables the check boxes for all other elements. EPSOn 5-104 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 227: C Search From Context Menu

    The [Search] view is displayed at the start of the search. The [Cancel Current Search] button in the [Search] view toolbar remains enabled while a search is underway. Click this button to cancel the search. EPSOn S5U1C17001C ManUal 5-105 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 228: Search Results

    The [Search] view is initially set to display the search results in tree form. To display the search results in non- hierarchical mode, select [Flat Layout] from the [Show as List] view menu ( ). Show as Tree Show as List EPSOn 5-106 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 229 [Remove Selected Matches] Deletes all search results listed in the view. [Remove All Matches] The search results deleted here will no longer be displayed when you select [Show Previous Searches]. EPSOn S5U1C17001C ManUal 5-107 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 230: Building A Program

    (The default CPU type and memory model are S1C17 and REGULAR.) (4) The [Target CPU Device] combo box shows processor types. (5) From the [Memory Model] combo box, select the memory model of the target: EPSOn 5-108 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 231 [Revert Settings] Undoes the changes made, restoring the state in which this page was opened (or, if you clicked the [Apply] button, the content confirmed at that point). EPSOn S5U1C17001C ManUal 5-109 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 232: Setting The Build Goal

    (4) Select either [Build Mask File (psa)] or [Build Executable file (elf)] from [Build goal switch]. (5) To modify another property, click the [Apply] button. To end property setting, click the [OK] button. EPSOn 5-110 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 233: Setting Compiler Options

    Shown below are the pages in which compiler options are set for each category. For detailed information on the op- tions, refer to the section that discusses the C compiler. EPSOn S5U1C17001C ManUal 5-111 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 234 IDE is launched in a Japanese-language OS environment; in other language ver- sions, the checkbox is unselected by default. (When the checkbox is unselected, the -mno-sjis-filt option is specified during compilation.) EPSOn 5-112 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 235 No optimization performed. -O0: Optimizes code by prioritizing speed and size. -O1: Optimizes code execution speed. -O3: Refer to Section 6.3.2, “Command-line Options,” for detailed information on optimization. EPSOn S5U1C17001C ManUal 5-113 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 236 TOOL_DIR is the environment variable in which the path to the gnu17 tool directory is defined. The de- fined contents can be verified in the [Environments] tab page. Example: If the gnu17 tools have been installed in the c:\EPSON\gnu17 directory TOOL_DIR = c:/EPSON/gnu17 Since the macro is replaced with the contents of the environment variable described in () during execution of make.exe, -I$(TOOL_DIR)/include will be resolved to -Ic:/EPSON/gnu17/include.
  • Page 237 Moves the macro-definition selected in the list one position up in the list. [Move Up] Moves the macro-definition selected in the list one position down. [Move Down] EPSOn S5U1C17001C ManUal 5-115 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 238 [Do not expand built-in functions inline (-fno-builtin)] (default: ON) If this option is specified, built-in functions are ignored and the functions are always called. For the functions in question, refer to Section 6.3.2, "Command-line Options". EPSOn 5-116 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 239 (extension: .ext0), then assembles this file using an assembler. It is not necessary to specify the -S option or -c option for Other Flags. The C source assembly image can be confirmed by viewing the <C source file name.ext0> file. EPSOn S5U1C17001C ManUal 5-117 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 240: Setting Assembler Options

    Shown below are the pages in which assembler options are set. For detailed information on the options, refer to the section that discusses the assembler. EPSOn 5-118 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 241 Enter the options to be passed to the assembler. Insert one or more spaces between each option. The options entered are passed to the assembler as "-Wa,<option>, ...". EPSOn S5U1C17001C ManUal 5-119 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 242: Setting Linker Options

    Shown below are the pages in which the linker options are set. For detailed information on the options, refer to the section that discusses the linker. EPSOn 5-120 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 243 The -Map and -N options are always added. Set other linker options from this page. [Linker flags] (default: -T<project name>_gnu17IDE.lds) Enter other linker options in this text field. Insert one or more spaces between each option. EPSOn S5U1C17001C ManUal 5-121 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 244 * Either the 24-bit libraries or 16-bit libraries are specified by default according to the selected memory model. Furthermore, libc.a is specified twice to resolve cross-references between libc.a and libgcc.a. EPSOn 5-122 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 245 TOOL_DIR is the environment variable in which the path to the gnu17 tool directory is defined. The de- fined contents can be verified in the [Environments] tab page. Example: If the gnu17 tools have been installed in the c:\EPSON\gnu17 directory TOOL_DIR = c:/EPSON/gnu17 Since the macro is replaced with the contents of the environment variable described in () during execution of make.exe, -I$(TOOL_DIR)/lib/24bit/libxxx.a will be resolved to -Ic:/EPSON/gnu17/...
  • Page 246: Setting The Vector Checker

    Shown below is the page for setting vector checker options. [general] [Check if 'emu_copro_process()' is allocated to vector No. 3] (default: ON if the coprocessor library is used) EPSOn 5-124 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 247 (The Vector No. 3 data is searched as the start address for the .vector section in the elf executable file. If the elf file lacks a .vector section, this check is not performed.) The -t and -s options of the vector checker are always specified. EPSOn S5U1C17001C ManUal 5-125 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 248: Generated Makefile

    # macro definitions for object files OBJS= boot.o \ lib.o \ main.o \ sys.o \ # macro definitions for library files OBJLDS= $(TOOL_DIR)/lib/24bit/libstdio.a \ $(TOOL_DIR)/lib/24bit/libc.a \ $(TOOL_DIR)/lib/24bit/libgcc.a \ EPSOn 5-126 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 249 ; do \ $(AS_CC) $(ASFLAGS_CC) $(EXTFLAGS_CC) -o $$NAME.o $$NAME.ext0 ; done $(RM) -f $(TARGET).map # 2pass linking $(LD) $(LDFLAGS) -o $@ $(OBJS) $(OBJLDS) # restore 1pass object files EPSOn S5U1C17001C ManUal 5-127 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 250 : $(RM) -f $(OBJS) $(TARGET).elf $(TARGET).map $(DEPS) $(CEXTTEMPS) $(TARGET).dump lderr $(TARGET).sa $(TARGET).saf $(TARGET).psa @if [ -e obj1pass ]; then \ cmd /c "rd /s /q obj1pass" ; \ EPSOn 5-128 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 251 TOOL_DIR. The space characters in the path are converted to "\ " (\ + space). The link process cannot proceed if the path includes spaces. Confirm that one set of S5U1C17001C tools is installed in a directory that does not include spaces.
  • Page 252: Editing A Linker Script

    (3) Select [GNU17 Linker Script Settings] from the properties list. The list shows the configuration and location of sections in an executable file (.elf). This memory map is shown in Figure 5.7.6.1. EPSOn 5-130 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 253 Labels indicating the start and end addresses of a .bss section __START_data:__END_data:__START_data_lma:__END_data_lma Labels indicating the start VMA address, end VMA address, start LMA address, and end LMA ad- dress of a .data section EPSOn S5U1C17001C ManUal 5-131 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 254 Even so, the .vector section is defined as a section, but without an object. The contents set in the wizard can be changed in the [Edit Section] dialog box (refer to "Editing section infor- mation"). EPSOn 5-132 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 255 If you are not using the .vector section, deselect the [Allocate a specific file to '.vector' section] check box and edit the .text section in the [Edit Section] dialog box to locate boot.o at the top. EPSOn S5U1C17001C ManUal 5-133 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 256 (e.g., .data section) and programs executed in RAM. Leave unselected if the section is to be executed directly in its stored location, as in ROM. EPSOn 5-134 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 257 This button is ineffective for standard sections. [Select All] Selects all entries in the respective lists. This button is ineffective for standard sections. EPSOn S5U1C17001C ManUal 5-135 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 258 Since no source files are available for vector.o, it is removed without being moved to the unselected file list. This operation alone also removes vector.o from other section information. EPSOn 5-136 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 259 (6) Simply closing the [Edit Section] dialog box with the [OK] button will not automatically reflect the edits made here in the linker script. You must click the [Apply] or the [OK] button in the [Properties] dialog box to confirm your edits. EPSOn S5U1C17001C ManUal 5-137 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 260 VMA you set. To ensure that the new section location or objects will not overlap with another section, review the other section information, making alterations, if necessary. EPSOn 5-138 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 261 GNU17 Project] wizard, must be located in the project directory. The .vector section settings in the linker script must be edited when the object file is located in another directory. EPSOn S5U1C17001C ManUal 5-139 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 262 In the example here, the sections are located in order of boot.s and main.c. The vector table at the beginning of boot.s (i.e., the .rodata section) is placed at the beginning of the ROM (0x8000 and beyond). EPSOn 5-140 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 263 /* location counter */ . = 0x0; /* section information */ .bss 0x000000 : __START_bss = . ; boot.o(.bss) main.o(.bss) C:/EPSON/gnu17/lib/24bit/libstdio.a(.bss) C:/EPSON/gnu17/lib/24bit/libc.a(.bss) C:/EPSON/gnu17/lib/24bit/libgcc.a(.bss) C:/EPSON/gnu17/lib/24bit/libc.a(.bss) __END_bss = . ; EPSOn S5U1C17001C ManUal 5-141 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 264 .vector boot.o – .rodata main.o – .bss .bss section 0x008000 section No sections/files boot.o – .bss located here 0x000000 0x000000 Figure 5.7.6.3 Example of a section location 1 EPSOn 5-142 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 265 Correct the .rodata and .data section information as shown below. Use all other sections with default set- tings directly and unaltered. 1. Correcting the .rodata section Correct [Virtual map address] to 0x080000. EPSOn S5U1C17001C ManUal 5-143 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 266 5 gnU17 iDE 2. Correcting the .data section Correct [Load map address] to ".text". Section configuration (contents set in the [GNU17 Linker Script Settings] dialog box) EPSOn 5-144 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 267 __START_text = . ; boot.o(.text) main.o(.text) C:/EPSON/gnu17/lib/24bit/libstdio.a(.text) C:/EPSON/gnu17/lib/24bit/libc.a(.text) C:/EPSON/gnu17/lib/24bit/libgcc.a(.text) C:/EPSON/gnu17/lib/24bit/libc.a(.text) __END_text = . ; .rodata 0x080000 : __START_rodata = . ; main.o(.rodata) C:/EPSON/gnu17/lib/24bit/libstdio.a(.rodata) C:/EPSON/gnu17/lib/24bit/libc.a(.rodata) C:/EPSON/gnu17/lib/24bit/libgcc.a(.rodata) C:/EPSON/gnu17/lib/24bit/libc.a(.rodata) __END_rodata = . ; EPSOn S5U1C17001C ManUal 5-145 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 268 If these files contain functions, variables with initial values, or constants, the files in the example here will be located in the .text, .data, or .rodata sections. Editing sections (content set in the [Add/Edit Section] dialog box) EPSOn 5-146 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 269 Note that automatic updating is enabled for .bss section information and that bss1.o and bss2.o are not included in the list of files to be located. This is because they have been specified for the respective sections above. EPSOn S5U1C17001C ManUal 5-147 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 270 C:/EPSON/gnu17/lib/24bit/libgcc.a(.bss) C:/EPSON/gnu17/lib/24bit/libc.a(.bss) __END_bss = . ; .data __END_bss : AT( __END_rodata ) __START_data = . ; boot.o(.data) bss1.o(.data) bss2.o(.data) main.o(.data) C:/EPSON/gnu17/lib/24bit/libstdio.a(.data) C:/EPSON/gnu17/lib/24bit/libc.a(.data) C:/EPSON/gnu17/lib/24bit/libgcc.a(.data) C:/EPSON/gnu17/lib/24bit/libc.a(.data) __END_data = . ; EPSOn 5-148 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 271 C:/EPSON/gnu17/lib/24bit/libstdio.a(.rodata) C:/EPSON/gnu17/lib/24bit/libc.a(.rodata) C:/EPSON/gnu17/lib/24bit/libgcc.a(.rodata) C:/EPSON/gnu17/lib/24bit/libc.a(.rodata) __END_rodata = . ; /* load address symbols */ __START_data_lma = LOADADDR( .data ); __END_data_lma = __START_data_lma + SIZEOF( .data ); EPSOn S5U1C17001C ManUal 5-149 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 272 (vector table and stack initialization, etc.) boot.s (main and other functions) main.c func1.c (program 1 to be executed in RAM) func2.c (program 2 to be executed in RAM) EPSOn 5-150 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 273 Editing sections (content set in the [Add Section] dialog box) Create new sections .textu1 and .textu2, as shown below. Section configuration (content set in the [GNU17 Linker Script Settings] dialog box) EPSOn S5U1C17001C ManUal 5-151 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 274 __START_textu2 = . ; func2.o(.text) __END_textu2 = . ; .vector 0x008000 : __START_vector = . ; boot.o(.rodata) __END_vector = . ; .text __END_vector : __START_text = . ; boot.o(.text) main.o(.text) EPSOn 5-152 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 275 LMA specified will result in positioning the .rodata section behind the end VMA address of the .textu2 section. Do not locate any VMA-only sections behind LMA ≠ VMA sections. EPSOn S5U1C17001C ManUal 5-153 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 276: Executing A Build Process

    Therefore, in the first build process, make.exe compiles/assembles all sources to generate object files (*.o) and to link the generated files. Thereafter, it compiles/assembles only the altered sources (including alteration of include files) and links the generated files. EPSOn 5-154 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 277 The object files for linked source files located outside the project folder will be generated directly under the project folder. EPSOn S5U1C17001C ManUal 5-155 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 278: Clean And Rebuild

    You must perform a rebuild in the following cases: • When certain header files have been deleted from the project The dependency file is regenerated by rebuilding the project. EPSOn 5-156 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 279 You must rebuild if you've altered a header file not existing in the project file (i.e., external to the project). • When a build fails due to file privileges when a build is executed immediately after importing a project EPSOn S5U1C17001C ManUal 5-157 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 280: Using An Original Makefile

    [GNU17 File Builder] check box selected. Or select the [GNU17 File Builder] check box before executing a build process and deselect it after the above files have been generated. EPSOn 5-158 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 281 Leave the [Build on resource save (Auto Build)] check box at the default setting. (The default settings for the IDE disable this option.) (9) Click the [OK] button to close the [Properties] dialog box. EPSOn S5U1C17001C ManUal 5-159 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 282: Starting The Debugger

    (2) Select [Properties] from the [Project] menu or the context menu of the selected project. This displays the [Properties] dialog box. (3) Select [GNU17 Parameter Settings] from the properties list. This displays the currently set content in this page. EPSOn 5-160 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 283 0x000000-0x000FBF Byte Peripheral Area1 0x004000-0x0043FF Byte Peripheral Area2 0x005000-0x005FFF Halfword ROM(Flash) 0x008000-0x017FFF Byte SRAM(LCD Display) 0x080000-0x08055F Byte Reserved for Core I/O 0xFFFC00-0xFFFFFF STACK – – Stack area 0x000000-0x000FBF EPSOn S5U1C17001C ManUal 5-161 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 284 Internal RAM 0x004000-0x0043FF Byte Peripheral Area1 Byte Peripheral Area2 0x005000-0x0053BF Halfword SRAM (LCD Display) 0x0053C0-0x0053FF 0x008000-0x017FFF Halfword ROM(Flash) 0xFFFC00-0xFFFFFF Byte Reserved for Core I/O STACK Stack Area 0x000000-0x000FBF EPSOn 5-162 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 285 # SRAM (LCD Display) 005000 0057FF 00B # Peripheral Area2 008000 087FFF 10H # ROM (Flash) FFFC00 FFFFFF 00B # Reserved for Core I/O STACK 000000 002FBF # Stack area EPSOn S5U1C17001C ManUal 5-163 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 286 006000 0067FF 33H # IVRAM 020000 03FFFF 10H # ROM (Flash) 100000 FEFFFF 66B # SRAM FFFC00 FFFFFF 00B # Reserved for Core I/O STACK 000040 000FFF # Stack area EPSOn 5-164 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 287 F (hexadecimal), or 0 to 15 cycles. This is disabled for STACK areas. [Read:] Enter the number of wait states inserted during a read cycle. [Write:] Enter the number of wait states inserted during a write cycle. EPSOn S5U1C17001C ManUal 5-165 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 288 (4) Click the [Apply] button to change other sections or properties or the [OK] button to end property settings. If you haven't clicked [Apply], you can use the [Revert Settings] button to restore modified content to the state in which this page was opened. EPSOn 5-166 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 289: Setting The Debugger Startup Commands

    # connect to the debugger with specified mode and port target icd usb # load flash program load /cygdrive/C/EPSON/GNU17/mcu_model/17701/fls/fls17701.elf # flash set c17 fls 0x8000 0x17fff FLASH_ERASE FLASH_LOAD # flash erase c17 fle 0x8000 0 0 EPSOn S5U1C17001C ManUal 5-167 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 290 [Properties] dialog box is opened. In this case, open the [Properties] dialog box after closing the command file in the external editor. EPSOn 5-168 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 291 If the memory model is changed in the [Properties] > [GNU17 General] page, this dialog box also reverts to the de- fault setting (ICD Mini). EPSOn S5U1C17001C ManUal 5-169 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 292: Starting Up The Debugger

    (2) Select [GDB17 Launch for <project name>] from the tree list. * ${gnu17_loc} is resolved to the full path for \gnu17 (e.g., C:/EPSON/gnu17) in the current user environment. (3) Modify the [Arguments:] (arguments to the debugger command line) as necessary.
  • Page 293 If this happens, select the project icon in the [C/C++ Projects] or [Navigator] view and click the [External Tools] button once again. Or, change “-x ${program_name}_gnu17IDE.cmd” in [Arguments] in the [Main] tab screen of the [External Tools Configurations] dialog box to “-x <project name>_gnu17IDE.cmd.” EPSOn S5U1C17001C ManUal 5-171 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 294: Customizing The Ide (Preferences)

    The relevant page and the set content of each customization item are described below. Please do not attempt to change any settings not discussed here. EPSOn 5-172 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 295 If this check box is selected, a resource can also be opened in the editor by selecting it with arrow keys. (Effective only when [Single click] is selected) EPSOn S5U1C17001C ManUal 5-173 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 296 Specify the tab position displayed in the view. [Top] (default: ON) Tabs are displayed at the top of the view. [Bottom] (default: OFF) Tabs are displayed at the bottom of the view. EPSOn 5-174 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 297 Selecting this check box displays the tabs in the editor and views in an angular style. [Enable animations] (default: ON) Selecting this check box enables the function to animate fast views to their location when they are closed or opened. EPSOn S5U1C17001C ManUal 5-175 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 298 Color select button Select a new color in the [Color] dialog box. [Reset] Resets the changed color to the default color. This button is enabled once a color is changed. EPSOn 5-176 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 299 [Open new editor] (default: OFF) Opens an editor surpassing the limited number of editors without asking for your confirmation. EPSOn S5U1C17001C ManUal 5-177 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 300 Adds a file type or editor to the list. You can enter or select one in the dialog box that appears when you click this button. [Remove] Removes a selected file type or editor from the list box. [Default] Sets the editor selected in [Associated editors:] to the default editor. EPSOn 5-178 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 301 Selecting this check box enables the hyperlink style navigation feature allowing you to jump to the location where the function/variable is decelerated by clicking its name by holding down the [Ctrl] key (default). EPSOn S5U1C17001C ManUal 5-179 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 302 Background color Background color* Foreground color Character color* Hyperlink Hyper link character color * If the [System Default] check box is selected, default settings of the system are applied. EPSOn 5-180 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 303 Selects a location/state in which the command is enabled when assigning the key sequence set with [Binding] to the command. [Export...] Saves the contents of the list to a CSV format file. EPSOn S5U1C17001C ManUal 5-181 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 304 If this check box is selected, the [Search] view is displayed in front of other views after a search. [Ignore potential matches] (default: OFF) If this check box is selected, only complete matches for the search text are displayed. EPSOn 5-182 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 305 If this check box is selected, a dialog box prompting for confirmation is displayed if you click the (Close) button to close the last open IDE window. [Plug-ins activated on startup:] Select plug-ins you want to activate on IDE startup. Do not modify this setting. EPSOn S5U1C17001C ManUal 5-183 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 306 [Always] (default: OFF) Referenced projects will always be opened. [Never] (default: OFF) No other projects will be opened. [Prompt] (default: ON) A dialog appears to prompt for selection. EPSOn 5-184 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 307 Select a line delimiter. The selection will take effect for subsequent only. It does not affect the existing files. [Default] The standard Windows line delimiter is used. (default) [Other:] Select another line delimiter. EPSOn S5U1C17001C ManUal 5-185 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 308 Adds a project in the list. [Max iterations when building with cycles:] (default: 10) Set the maximum number of times to build the projects in the order specified in the list. EPSOn 5-186 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 309 Section 5.4.8, “Resource Manipulation in a Project.” [Enable linked resources] (default: ON) Disables use of the resource linking function when set to OFF. Do not change this setting in normal use. EPSOn S5U1C17001C ManUal 5-187 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 310 No history entry will be saved for a file whose size exceed the value set here. History entries exceeding these limits will be erased. Restart the IDE to apply these settings. EPSOn 5-188 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 311 5 gnU17 iDE C/C++ Disregard this screen. EPSOn S5U1C17001C ManUal 5-189 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 312 [Information message text color] This is the display color for status messages output by tools. [Error message text color] This is the display color for error messages output by tools. EPSOn 5-190 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 313 The settings selected here will be applied to files unrelated to the project or files without project level settings. EPSOn S5U1C17001C ManUal 5-191 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 314 [delay (ms)] (default: 500 ms) Specify the length of time (in milliseconds ) from the entry of a symbol described above to automatic display of the content assist. EPSOn 5-192 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 315 Select the functions to be added when the content assist is called repeatedly. Select an item and click the [Up] or [Down] button to set the priority order of that item. EPSOn S5U1C17001C ManUal 5-193 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 316 [Functions] (default: OFF) Functions [Methods] (default: OFF) Methods [Structures] (default: ON) Structures [Comments] (default: OFF) Comments [Header Comments] (default: ON) Headers [Inactive Preprocessor Branches] (default: ON) Inactive preprocessor branches EPSOn 5-194 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 317 [Text Hover key modifier preferences:] Select a hot key to activate text hover. For example, positioning the mouse cursor while pressing the [Ctrl] key links the target to the original declaration. EPSOn S5U1C17001C ManUal 5-195 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 318 Select this checkbox to display variables, functions, methods, types, macros, or other component marks. [Keep marks when the selection changes] (default: ON) Select this checkbox to retain marks even if the selection is changed. EPSOn 5-196 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 319 Disables the editor syntax coloring function. [Disable parsing-based content assist proposal] Disables the syntax-analysis-based content assist function. [Disable content assist auto-activation] Disables the content assist automatic launch function. EPSOn S5U1C17001C ManUal 5-197 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 320 [Color] button. The following checkboxes will modify character style attributes. [Bold] Bold [Italic] Italic [Strikethough] Strikethrough [Underline] Underline [Preview:] Displays a sample to confirm the settings above. EPSOn 5-198 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 321 “On” means that the template will be automatically inserted if there is only one candidate. [Preview:] Displays the contents of the template selected in the list. [New...] Displays the [New Template] dialog box, allowing you to create a new template. EPSOn S5U1C17001C ManUal 5-199 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 322 Loads a template definition from a file. [Export...] Writes the contents of the template definition selected in the list to a file. This file can be loaded using the [Import...] button. EPSOn 5-200 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 323 [In string literals] Sets processing for strings. [Wrap automatically] (default: ON) Select this checkbox to wrap strings automatically if they exceed the maximum number of characters per line. EPSOn S5U1C17001C ManUal 5-201 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 324 In normal use, disregard the following items. (These items are not discussed in this manual.) Environment File Types Indexer Language Mappings Make New CDT Project Wizard Property Page Settings Task Tags Template Default Values EPSOn 5-202 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 325: Additional Description On Dialog Boxes

    If you click the [Apply] or [OK] button after settings in a [GNU17 Build Options] or [GNU17 General] page have been changed, a dialog box appears for selecting "clean" build (see Section 5.7.8) to delete the files cre- ated with the previous settings (and rebuild). EPSOn S5U1C17001C ManUal 5-203 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 326 Select a line delimiter. The selection will take effect for files to be created subsequently. It does not affect the existing files. [Inherited from container] The standard Windows line delimiter is used. (default) [Other:] Select another line delimiter. EPSOn 5-204 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 327 Deselect this check box if you do not wish to automatically generate the makefiles and other files needed for a build when executing a build process. (Refer to Section 5.7.11, "Using an Original Makefile".) Other- wise, avoid making any other changes on this page. EPSOn S5U1C17001C ManUal 5-205 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 328 5 gnU17 iDE C/C++ Documentation Used to select the help documents for the project. No document is used in the IDE. EPSOn 5-206 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 329 Select this radio button to use a set of file formats specific to a project. Click the [New...] button to add new file extensions. You can remove unnecessary extensions and file names by selecting from the list and click- ing the [Remove] button. EPSOn S5U1C17001C ManUal 5-207 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 330 Once a build is executed, the include directory searched during that process and the macro-definitions passed to the preprocessor are added to [Discovered Paths] in the tree list. note: For normal use, leave this setting unchanged. EPSOn 5-208 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 331 5 gnU17 iDE C/C++ indexer Make settings for the indexer used by C search and content assist. Do not change any of the settings on this page. EPSOn S5U1C17001C ManUal 5-209 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 332 If you are using your own makefiles, you must also edit or make changes on other pages. For more information, refer to Section 5.7.11, "Using an Original Makefile". EPSOn 5-210 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 333 Select a source folder from the tree list, or click the [Create New Folder...] button to create a new source folder or link an existing source folder present outside the project directory. EPSOn S5U1C17001C ManUal 5-211 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 334 Edit the file pattern selected from the list. [Remove] Removes the file pattern selected from the list. [Remove] Removes the source directory selected from the list. (The directory is not removed from the file system.) EPSOn 5-212 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 335 [Build Options] tab > [Compiler] Shows the current settings for the compiler options. [Command:] Shows the program name of the C compiler. [All Options] Shows the currently set compiler options. EPSOn S5U1C17001C ManUal 5-213 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 336 The default check box status depends on the OS under which the IDE starts up; the check box is set to on under an OS with Japanese environment or is set to off under other language versions. EPSOn 5-214 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 337 5 gnU17 iDE [Build Options] tab > [Compiler] > [Optimization] Use this page to select compiler optimization option. [Optimization Level] Select the optimization level (-O1). EPSOn S5U1C17001C ManUal 5-215 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 338 Moves the path selected one position up in the list. The include files are searched by or- [Move Up] der of paths in the list, beginning with the uppermost path. Moves the path selected one position down in the list. [Move Down] EPSOn 5-216 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 339 Edits the macro-definition selected in the list. Displays a dialog box for editing the [Edit] macro-definition. Moves the macro-definition selected one position up in the list. [Move Up] Moves the macro-definition selected one position down in the list. [Move Down] EPSOn S5U1C17001C ManUal 5-217 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 340 When this option is specified, built-in functions are ignored for inline expansion and are always called. For the functions to which this option applies, refer to Section 6.3.2, "Command-line Options". EPSOn 5-218 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 341 [Build Options] tab > [Compiler] > [Miscellaneous] Use this page to set other compiler options. [Other flags] Enter other options directly into this text field. Insert one or more spaces between each option. EPSOn S5U1C17001C ManUal 5-219 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 342 Shows the program name of the compiler*. [All Options] Shows the currently set options. * In the IDE, the assembler sources are assembled by the C compiler for which -xassembler-with- cpp option is specified. EPSOn 5-220 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 343 Enter the options to be passed to the assembler. Insert one or more spaces between each option. The options entered are passed to the assembler as "-Wa,<option>, ...". EPSOn S5U1C17001C ManUal 5-221 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 344 [Build Options] tab > [linker] Shows the current settings for the linker options. [Command:] Shows the program name of the linker. [All Options] Shows the currently set options. EPSOn 5-222 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 345 The -Map and -N options are always added. Set other linker options from this page. [Linker flags] Enter other linker options in this text field. Insert one or more spaces between each option. EPSOn S5U1C17001C ManUal 5-223 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 346 * Either the 24-bit libraries or 16-bit libraries are specified by default according to the selected memory model. Furthermore, libc.a is specified twice to resolve cross-references between libc.a and libgcc.a. EPSOn 5-224 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 347 [Build Options] tab > [Vector Checker for Copro] Displays settings for vector checker options. [Command:] Displays the name of the vector checker program. [All Options] Displays the currently set options. EPSOn S5U1C17001C ManUal 5-225 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 348 [Confirm if 'emu_copro_process()' is allocated to vector No.3] When using the coprocessor library, select or unselect the checker that verifies whether the emu_copro_process interrupt function is allocated to the vector table. EPSOn 5-226 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 349 • Use the defined environment variables as $(environment variable) format. If an environment variable is described in another format, it will not be replaced and an error will occur during a build process. EPSOn S5U1C17001C ManUal 5-227 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 350 Create a simple startup command [Debugger:] Select the debugger (connect mode) to connect to. ICD Mini When using an ICD to debug. Simulator To debug with a PC only. EPSOn 5-228 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 351 When you change the target CPU or memory model in the [Properties] > [GNU17 General] page, this dialog box is restored to default settings (for ICD Mini). EPSOn S5U1C17001C ManUal 5-229 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 352 If you click the [Apply] or [OK] button after settings in this page have been changed, a dialog box appears for selecting "clean" build (see Section 5.7.8) to delete the files created with the previous settings (and rebuild). EPSOn 5-230 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 353 — for example, when a section is copied from ROM to RAM. The label names are generated automatically from section names. EPSOn S5U1C17001C ManUal 5-231 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 354 Edits the section information selected in the list. [Delete] Deletes the section information selected in the list. For more information on how to edit a linker script, refer to Section 5.7.8, "Editing a Linker Script". EPSOn 5-232 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 355 Edits the area information selected in the list. [Delete] Deletes the area information selected in the list. For more information on how to edit a parameter file, refer to Section 5.8.1, "Generating a Parameter File". EPSOn S5U1C17001C ManUal 5-233 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 356 5 gnU17 iDE Project references Select the project to be referenced. [Project references for sample:] Select the other projects to be referenced by the current project. EPSOn 5-234 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 357: Save Resources

    Deselects check boxes for all files. [OK] Closes the documents in the editor after saving the selected files. [Cancel] Cancels the action invoking the dialog box. The documents are neither saved nor closed. EPSOn S5U1C17001C ManUal 5-235 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 358: Import > File System

    Select a file name extension from the dialog box by clicking this button. Files other than the selected file for- mats will be deselected. [Select All] Selects all files displayed in the list box. [Deselect All] Deselects all files displayed in the list box. EPSOn 5-236 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 359 [Create selected folders only] If this radio button is selected, only the directory you selected is imported. No directory structures are imported. EPSOn S5U1C17001C ManUal 5-237 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 360: Export > File System

    If this check box is selected, any files or directories at the export destination having the same name are over- written without warning. If this check box is unselected (default), you will be prompted to confirm that you want to overwrite the files in question. EPSOn 5-238 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 361 (a tree structure from the project directory). [Create only selected directories] If this radio button is selected, only the directory you selected is exported. The directory structure of the project is not exported. EPSOn S5U1C17001C ManUal 5-239 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 362: Filters

    [C/C++ Projects] or [Navigator] view are displayed. [On selected element only] Only resources currently active in the editor or resources selected in the [C/C++ Projects] or [Navigator] view are displayed. EPSOn 5-240 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 363 Select the type of list to be displayed to a specific view. [Select All] Selects all items displayed in [Types]. [Deselect All] Deselects all items displayed in [Types]. [OK] Begins filtering with the set conditions. [Cancel] Cancels filter settings. EPSOn S5U1C17001C ManUal 5-241 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 364: Files Generated In A Project By The Ide

    *1: Can be edited using an editor only when the [Properties] dialog box for the project is closed. The files in the "File management required" column must be managed using a source management application. EPSOn 5-242 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 365: Compiler

    Compiler S5U1C17001C Manual 6 C Compiler...
  • Page 367: Functions

    File format: Text file File name: <filename>.s Description: An assembly source file to be input to the as assembler. This file is generated when the -S option is specified. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 368: Starting Method

    File search is performed in order of priorities, i.e., current directory, -B option, and PATH in that order. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 369 Basic makefiles created by the IDE use the -O option as the startup command for xgcc C compiler. The characteristics of each option are described below. No optimization performed. An area is secured in the stack even if an unused local variable is declared. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 370 However, the stack size cannot be reduced by this option. Default: The C compiler generates the object that allows data to be located in the 24-bit (16MB) space. -mshort-offset EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 371 It should have 0, 2, or 3 arguments of the appropriate format. -Wmissing-braces Outputs a warning when parentheses are used incorrectly during initialization of arrays. For EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 372 Description: This option disables the filter function for the Shift JIS code. For detailed information on this filter function, refer to Section 6.5, “Filter Function for Shift JIS Code.” Default: The preprocessor performs filtering for Shift JIS code. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 373 When the -c option is specified, the -mpointer16 option will also be passed to the assembler. Example of assembling: xgcc -B$(TOOL_DIR)/ -c -xassembler-with-cpp -Wa,--gstabs -Wa,-mpointer16 boot.s After boot.s is processed in the preprocessor, it will be assembled with the -mpointer16 option specified. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 374: Compiler Output

    .bss .align .type i,@object .size .zero For all symbols including function names and labels, symbol information by the .stab assembler directive is inserted (when the -gstabs option is specified). EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 375: Data Representation

    As shown in the diagram above, some unused areas may remain in the memory depending on the data type of a member. C language specifications permit implementation-defined adjustment of the method of configuring member variables of a structure or union. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 376 = (struct g_GAtag *)0x8300; pg_GAtag->g_IF.rOUT.bCTL.DATA = 1; return; Code compiled from the source line (*) pg_GAtag->g_IF.rOUT.bCTL.DATA = 1; ; Byte access ld.b %r3,[%r2] %r3,0x1 ; Byte access ld.b [%r2],%r3 EPSOn 6-10 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 377: Method Of Using Registers

    %r1 ← lData (lower-order 16 bits) %r2 ← ip_Pt (24 bits (for REGULAR/MIDDLE MODEL), 16 bits (for SMALL MODEL)) %r3 ← cp_Pt (24 bits (for REGULAR/MIDDLE MODEL), 16 bits (for SMALL MODEL)) EPSOn S5U1C17001C ManUal 6-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 378: Function Call

    If there are any arguments for function call that cannot be stored in the registers for passing argument, an area is allocated in the stack frame. All arguments are located at 4-byte boundaries. EPSOn 6-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 379: Grammar Of C Source

    The C compiler in this package is adjusted to yield even-number bytes for the size of a structure or union as an implementation definition feature. EPSOn S5U1C17001C ManUal 6-13 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 380: Filter Function For Shift Jis Code

    → i_Val is replaced by 0x8bf3 if the prefix “L” is specified. If the prefix ’; int i_Val = L’ “L” is not specified, i_Val is replaced by 0xfff3. EPSOn 6-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 381: Functions Of Xgcc And Usage Precautions

    • For information on bugs in the gcc core, refer to "\gnu17\doc\release_history.pdf." • For information on the C99 standard supported in gcc3.3, refer to the site below. http://gcc.gnu.org/gcc-3.3/c99status.html EPSOn S5U1C17001C ManUal 6-15 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 382: Known Issues

    The process of (1) & (2) is collected into one and compiled by optimization. For this reason, sign extension and operation are carried out at once. Then the result does not become the right value. EPSOn 6-16 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 383 Because a Kanji string sequence is changed in the order of the following at the time of compile. source code str(" ") "\" \"" ↓ Conversion by Kanji filter str("\x8e\x9a") "\"\x8e\x9a\"" ↓ Conversion by preprocessor "\"\\x8e\\x9a\"" "\"\x8e\x9a\"" EPSOn S5U1C17001C ManUal 6-17 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 384 *arg4 ) static long long int num ; num = *arg4 ; cause This is compiler internal error when failing to secure registers needed to process. EPSOn 6-18 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 385: Library

    Library S5U1C17001C Manual 7 library...
  • Page 387: Library Overview

    16-bit (64KB) memory model libraries \16bit libc.a libgcc.a libgccM.a libgccMD.a libstdio.a Link the 16-bit libraries with the application program when the -mpointer16 option is specified in the C compiler and assembler. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 388: Precautions To Be Taken When Adding A Library

    ANSI libraries ld.exe -T withmylib.lds -o withmylib.elf boot.o lib3.a lib2.a lib1.a libc.a libgcc.a libc.a Refer to Section 5.7.5, "Setting Linker Options", for how to add libraries using the IDE. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 389: Emulation Library

    • The registers %r4 to %r7 are protected by saving to the stack before execution of a function and by restoring from the stack after completion of the function. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 390: Floating-Point Calculation Functions

    • The comparison function changes the C, V, Z or N flag of the PSR depending on the result of op1 - op2, as shown below. Other flags are not changed. Comparison result op1 > op2 op1 = op2 op1 < op2 EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 391 Values 0x7f800001 to 0x7fffffff and 0xff800001 to 0xffffffff are not recognized as numeric values. note The floating-point numbers in the xgcc C compiler differ from the IEEE-based FPU in precision and functionality, including the manner in which infinity is handled. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 392: Floating-Point Number Processing Implementation Definition

    If the original value is −NaN → The significand of the single-precision floating-point number is shifted two bits to the right, and the logical sum of that value and 0xfff80000 00000000 is used. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 393: Integral Calculation Functions

    If the first bit with the value 1 is the LSB: 1 If the first bit with the value 1 is the MSB: 64 If no bits are found with the value 1: EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 394: Compatibility With Coprocessor Instructions

    32-bit multiplication 17 cycles __divhi3 Signed 16-bit division 14 cycles __modhi3 Signed 16-bit remainder calculation 14 cycles __udivhi3 Unsigned 16-bit division 14 cycles __umodhi3 Unsigned 16-bit remainder calculation 14 cycles EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 395: Ansi Library

    *fgets(char *s, int n, FILE *stream); from stdin. _iob, and call read function. char *gets(char *s); Input character string Conditional Refer to global variables stdin and from stdin. _iob, and call read function. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 396 The file system is disabled; stdin and stdout are enabled. When using stdin and stdout, the read() and write() functions are needed, respectively. Refer to Section 7.3.4 for more information. EPSOn 7-10 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 397 The table below lists the non-local branch functions included in libc.a. Table 7.3.2.3 Non-local branch functions Header file: setjmp.h function functionality reentrant notes Non-local branch Reentrant int setjmp(jmp_buf env); void longjmp(jmp_buf env, int status); Non-local branch Reentrant EPSOn S5U1C17001C ManUal 7-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 398 ALR and AHR. Calculate hyperbolic cosine. Nonreentrant Change global variable errno, double cosh(double x); destruct ALR and AHR. Calculate hyperbolic tangent. Nonreentrant Destruct ALR and AHR. double tanh(double x); EPSOn 7-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 399 Determine character type (hexadecimal). Reentrant int isxdigit(int c); Convert character type (uppercase alphabet → lowercase). Reentrant int tolower(int c); Convert character type (lowercase alphabet → uppercase). int toupper(int c); Reentrant EPSOn S5U1C17001C ManUal 7-13 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 400 Initialize the variable argument group. type va_arg(va_list ap, type); Return the actual argument. void va_end(va_list ap); Return normally from the variable argument function. EPSOn 7-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 401: Declaring And Initializing Global Variables

    * The libstdio.a library does not contain the ansi_InitMalloc() function. Be aware that it must be called from the user routine before calling malloc() or a similar function. (A heap area cannot be allocated if the ansi_InitMalloc() function is not called.) EPSOn S5U1C17001C ManUal 7-15 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 402: Lower-Level Functions

    A read function has been defined in the libstdio.a library. To use the read function, link libstdio.a and call the _init_sys() function from the boot routine in the user program. EPSOn 7-16 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 403 Contents of _exit function Format: void _exit(void); Functionality: Performs program terminating processing. Argument: None Returned value: None Library function that calls the _exit function: Direct call: abort, exit EPSOn S5U1C17001C ManUal 7-17 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 404 7 liBrary THIS PAGE IS BLANK. EPSOn 7-18 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 405: Assembler

    Assemblr S5U1C17001C Manual 8 assembler...
  • Page 407: Functions

    Description: File in which object mapping information is described. This file is delivered by the ld linker and is used to optimize the code for referencing global symbols when the -mc17_ext option is specified. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 408: Output File

    <filename>.o (The <filename> is the same as that of the input file.) Description: File in which symbol information and debugging information are added to the program code (machine language). EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 409: Starting Method

    The assembler does not optimizes extended instructions. When entering options in the command line, you need to place one or more spaces before and after the option. Example: as -otest.o -adhl test.s EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 410: Scope

    The as assembler regards the symbols SYMBOL and VAR1 in the file2 as those of undefined addresses in the assembling, and includes that information in the object file it delivers. Those addresses are finally determined by the processing of the ld linker. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 411: Assembler Directives

    .text Description Declares the start of a .text section. Statements following this instruction are assembled as those to be mapped in the .text section, until another section is declared. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 412: Data Section Defining Directives (.Rodata, .Data)

    Example: .section .data Defines a .data section. note The data space allocated by the data-define directive is as follows: 1 byte: .byte 2 bytes: .short, .hword, .word, .int 4 bytes: .long EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 413: Bss Section Defining Directive (.Bss)

    Defines the 4-byte global variable VAR2. .skip • Areas in .bss sections can be secured using the .skip directive. The .space directive cannot be used because it has an initial data. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 414: Data Defining Directives (.Long, .Short, .Byte, .Ascii, .Space)

    If <1-byte data> is omitted, the area is filled with 0x0. To fill the area with 0x0, the .zero directive (see the next page) can also be used. Example: .space 4,0xff Sets 0xff to the 4-byte area beginning from the current address. (= .space 4,0x0) .zero EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 415: Area Securing Directive (.Zero)

    The area begins from the current address unless it is immediately preceded by the .align directive. Example: .section .bss .global VAR1 .align VAR1: Secures an space for the 4-byte global variable VAR1. .zero EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 416: Alignment Directive (.Align)

    The .align directive is valid for only the immediately following data definition or area securing directive. Therefore, when defining data that requires alignment, you need to use the .align directive for each data definition directive. EPSOn 8-10 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 417: Global Declaring Directive (.Global)

    Example: .global SUB1 note The symbols are always defined as a local symbol unless it is declared using this directive. EPSOn S5U1C17001C ManUal 8-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 418: Symbol Defining Directive (.Set)

    Defines the symbol DATA1 that represents absolute address 0x80000. DATA1,0x80000 note The symbol is defined as a local symbol. To use it as a global symbol, global declaration using the .global directive is necessary. EPSOn 8-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 419: Extended Instructions

    Expanded into the add.a instruction sadd.a, xadd.a Expanded into the sub instruction ssub, xsub Expanded into the sbc instruction ssbc, xsbc Expanded into the sub.a instruction ssub.a, xsub.a EPSOn S5U1C17001C ManUal 8-13 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 420 (OP = add, sub) %sp,imm24 Example: xadd.a %rd,imm24 imm24 ≤ 0x7f 0x7f < imm24 ≤ 0xfffff 0xfffff < imm24 add.a %rd,imm24(6:0) imm24(19:7) imm24(23:20) add.a %rd,imm24(6:0) imm24(19:7) add.a %rd,imm24(6:0) EPSOn 8-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 421: Comparison Instructions

    %rd,imm20(6:0) imm20(19:7) cmp.a %rd,imm20(6:0) (3) xcmp.a %rd,imm24 imm24 ≤ 0x7f 0x7f < imm24 ≤ 0xfffff 0xfffff < imm24 cmp.a %rd,imm24(6:0) imm24(19:7) imm24(23:20) cmp.a %rd,imm24(6:0) imm24(19:7) cmp.a %rd,imm24(6:0) EPSOn S5U1C17001C ManUal 8-15 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 422: Logic Operation Instructions

    Expansion format (1) sOP %rd,imm16 / xOP (OP = and, oor, xor, not) %rd,imm16 Example: xand %rd,imm16 imm16 ≤ 0x7f 0x7f < imm16 %rd,imm16(6:0) imm16(15:7) %rd,imm16(6:0) EPSOn 8-16 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 423: Data Transfer Instructions (Between Stack And Register)

    (OP = ld.b, ld, ld.a) [%sp+imm24],%rs Example: xld.a %rd,[%sp+imm24] imm24 ≤ 0x7f 0x7f < imm24 ≤ 0xfffff 0xfffff < imm24 ld.a %rd,[%sp+imm24(6:0)] imm24(19:7) imm24(23:20) ld.a %rd,[%sp+imm24(6:0)] imm24(19:7) ld.a %rd,[%sp+imm24(6:0)] EPSOn S5U1C17001C ManUal 8-17 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 424: Data Transfer Instructions (Between Memory And Register)

    (OP = ld.b, ld, ld.a) [imm24],%rs Example: xld.a %rd,[imm24] imm24 ≤ 0x7f 0x7f < imm24 ≤ 0xfffff 0xfffff < imm24 ld.a %rd,[imm24(6:0)] imm24(19:7) imm24(23:20) ld.a %rd,[imm24(6:0)] imm24(19:7) ld.a %rd,[imm24(6:0)] EPSOn 8-18 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 425: Immediate Data Load Instructions

    %rd,symbol±imm16 Example: sld %rd,symbol±imm16 Unconditional (symbol ± imm16)(15:7) %rd,(symbol ± imm16)(6:0) (5) sld.a %rd,symbol±imm20 / sld.a %sp,symbol±imm20 Example: sld.a %rd,symbol±imm20 Unconditional (symbol ± imm20)(19:7) %rd,(symbol ± imm20)(6:0) ld.a EPSOn S5U1C17001C ManUal 8-19 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 426 8 aSSEMBlEr (6) xld.a %rd,symbol±imm24 / xld.a %sp,symbol±imm24 Example: xld.a %rd,symbol±imm24 Unconditional (symbol ± imm24)(23:20) (symbol ± imm24)(19:7) %rd,(symbol ± imm24)(6:0) ld.a EPSOn 8-20 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 427: Branch Instructions

    PC relative conditional jump (11) xjrule sign24 PC relative conditional jump (11) xcalla imm24 PC absolute subroutine call (12) xjpa imm24 PC absolute unconditional jump (12) EPSOn S5U1C17001C ManUal 8-21 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 428 (5) sOP (OP = jr*, jr*.d) sign20 Example: sjreq sign20 -128 ≤ sign20 ≤ 127 sign20 < -128 127 < sign20 jreq sign20(7:1) sign20(19:8) jreq sign20(7:1) EPSOn 8-22 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 429 (OP = calla, calla.d, jpa, jpa.d) imm24 Example: xcalla imm24 imm24 ≤ 0x7f 0x7f < imm24 ≤ 0xfffff 0xfffff < imm24 calla imm24(6:0) imm24(19:7) imm24(23:20) calla imm24(6:0) imm24(19:7) calla imm24(6:0) EPSOn S5U1C17001C ManUal 8-23 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 430: Coprocessor Instructions

    %rd,imm24(6:0) imm24(19:7) ld.ca %rd,imm24(6:0) (4) xOP (OP = ld.cw, ld.ca, ld.cf) %rd,symbol±imm24 Example: xld.ca %rd,symbol±imm24 Unconditional (symbol ± imm24)(23:20) (symbol ± imm24)(19:7) %rd,(symbol ± imm24)(6:0) ld.ca EPSOn 8-24 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 431: Xext Instructions

    (OP = ld.b, ld.ub, ld, ld.a) Basic instructions after expansion Expanded into the ext instruction Xext Expansion formats (1) Xext imm24 imm24 ≤ 0x1fff 0x1fff < imm24 ≤ 0xffffff imm20(12:0) imm24(23:13) imm24(12:0) EPSOn S5U1C17001C ManUal 8-25 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 432: Optimization Of Extended Instructions

    4. Create a dump file from the elf file using objdump. 5. Reassemble (with the -mc17_ext option) * Specify the same input/output files as Step 2. The makefile created by the IDE contains the procedure above. EPSOn 8-26 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 433 The extended instruction is expanded with no ext used. Branch distance = -16,777,216 to -1026 or 1024 to 16,777,214: The extended instruction is expanded with one ext used. EPSOn S5U1C17001C ManUal 8-27 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 434 Evaluation result = 0x80 to 0xfffff: The extended instruction is expanded with one ext used. Evaluation result = 0xfffff to 0xffffff: The extended instruction is expanded with two ext used. EPSOn 8-28 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 435 Furthermore, this condition does not affect optimization for global symbols using a map file. EPSOn S5U1C17001C ManUal 8-29 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 436: Error/Warning Messages

    Warning: Value XXXX truncated to AAA The constant declared exceeds the maximum value AAA . It has been corrected to AAA . (e.g. .byte 0x100000012 → .byte 0xff ) EPSOn 8-30 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 437: Precautions

    Furthermore, this condition does not affect optimization for global symbols using a map file. EPSOn S5U1C17001C ManUal 8-31 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 438 8 aSSEMBlEr THIS PAGE IS BLANK. EPSOn 8-32 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 439: Linker

    Linker S5U1C17001C Manual 9 linker...
  • Page 441: Functions

    Description: File to specify the start address of each section and other information for linkage. The IDE may be used to create a linker script file. It is input to the ld linker when the -T option is specified. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 442: Output Files

    The linker checks the alignment of data segments. When inputting options in the command line, one or more spaces are necessary before and after the option. Example: ld -o sample.elf -T sample.lds -N boot.o sample.o ..\lib\24bit\libc.a EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 443: Linkage

    Figure 9.4.1.1 shows the memory map after linkage. .data (initial values) .rodata VMA=LMA .text VMA=LMA 0x8080 .vector VMA=LMA 0x8000 Unused .data .bss VMA=LMA Figure 9.4.1.1 Memory map configured by default script EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 444: Examples Of Linkage

    __START_text_foo3_lma = LOADADDR( .text_foo3 ); .rodata 0x008000 : __START_rodata = . ; *(.rodata) ; __END_rodata = . ; .text __END_rodata : __START_text = . ; *(.text) ; __END_text = . ; EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 445 The .text sections in other files than these three files are located in the .text section that follows the .rodata section (0x8000–) and are executed at the stored address in the ROM. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 446: Error Messages

    Object files created in 16-bit pointer mode and object files from <archivefile16> ] with 24bit object <objectfile24> created in 24-bit pointer mode cannot be linked. [included from <archivefile24> ] EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 447: Precautions

    Example: xadd.a %r0,symbol-5 If the symbol is located at address 0, the specified absolute address is 0 - 5 = 0xfffffb (-5). Therefore, this code will be assembled as "xadd.a %r0,0xfffffb". EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 448 9 linkEr THIS PAGE IS BLANK. EPSOn S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 449: Debugger

    Debugger S5U1C17001C Manual 10 Debugger...
  • Page 451: Features

    The [Project > Properties > GNU17 Parameter Settings] dialog box of the IDE displayed by selecting Project and then Properties may be used to create parameter files. For details about parameter files, see Section 10.9, "Parameter Files". EPSOn S5U1C17001C ManUal 10-1 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 452 File format: Text file File name: reset.gdb Description: Same as the command file. User-defined button command file File format: Text file File name: userdefine.gdb Description: Same as the command file. EPSOn 10-2 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 453: Output Files

    Description: This file is created by the simulated output function. The c17 stdout command is used to specify a file name and other information. Breakpoint storage file File format: Text file File name: break.gdb Description: This file contains breakpoint data. EPSOn S5U1C17001C ManUal 10-3 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 454 File format: Text file Filename: c17_profile_path.gdb Description: This is the path in which the profile/coverage data files (c17_profile.prf) are stored. It is referenced by the profile window and coverage window. EPSOn 10-4 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 455: Starting The Debugger

    When entering options on the command line, insert one or more spaces to delimit each option. Example: c:\EPSON\gnu17\gdb -x sample.cmd --cd=/cygdrive/d/test/sample notes: • An error message as shown below will be displayed if an unknown option is specified. Error message: · · · gdb : unrecognized option 'XXXXXX' •...
  • Page 456: Quitting The Debugger

    ICD. Should you turn off power to the ICD while running the debugger, you will be unable to reconnect it. In such case, you need to restart your computer. EPSOn 10-6 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 457: Windows

    [Source] window. Clicking the [Close] button also closes windows. Closing the [Source] window also closes the debugger. All these windows can be moved, zoomed in or out, minimized, or maximized. EPSOn S5U1C17001C ManUal 10-7 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 458: Source] Window

    Selects the paper size and related settings, and sets up the page on which to print the sources. Print Source... Prints the currently displayed source in exactly the same form as displayed on the screen. Exit Quits the debugger. EPSOn 10-8 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 459 Issues the next command to execute the target program starting at one source line from the current PC address. In this case, all function and subroutine calls (including called functions and subroutines) are executed as one step. EPSOn S5U1C17001C ManUal 10-9 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 460 Issues the finish command to execute the target program from the current PC address. The program is made to stop upon returning from the current function to a higher-level function or routine. EPSOn 10-10 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 461 Opens the [Breakpoints] window. If already open, the window moves to the front of the screen. [Console] button Opens the [Console] window. If already open, the window moves to the front of the screen. EPSOn S5U1C17001C ManUal 10-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 462 The window shows source line numbers and source codes. This is the default display format selected at debugger startup. assembler display (with [ASSEMBLY] selected from pull-down list) The window shows addresses, labels, and basic and extended assembler instructions. EPSOn 10-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 463 The window is split into upper and lower halves, with the upper area showing source lines, and the lower area showing assembler display. The relative sizes of upper and lower areas can be changed by dragging the borders of both areas up or down. EPSOn S5U1C17001C ManUal 10-13 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 464 Note: If the asm statement contains a pseudo-command as shown below, a mixed display may not execute properly. asm(".global label"); asm("label:"); EPSOn 10-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 465 Because the function or label names defined in the source file displayed are also listed in the combo box, you can choose one from the list and jump to that position. This browse and highlighting does not affect the PC address or program execution. EPSOn S5U1C17001C ManUal 10-15 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 466 For more information, refer to Section 6.4.5, “Stack Frame.” Clicking function call or subroutine call symbols also displays the popup menu, and not just at the beginning of functions. EPSOn 10-16 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 467 Choose [Dump Memory at <symbol>] from this menu to display a new [Memory] window, showing the contents of memory beginning with the selected symbol value. EPSOn S5U1C17001C ManUal 10-17 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 468 (by default, R = 149, G = 149, and B = 226) Software Breakpoint: Symbols indicating normal software PC breakpoints (by default, R = 255, G = 0, and B = 0) EPSOn 10-18 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 469 • The contents displayed in the [Source] window do not change even when a command is used to correct the contents of memory in the program area. EPSOn S5U1C17001C ManUal 10-19 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 470: Console] Window

    Pressing the [Ctrl] + [V] key combination pastes the copied string at the cursor position in the [Console] window. limitations Up to 256 lines can be scrolled in the window. The contents displayed or entered in the window exceeding this limit are deleted. EPSOn 10-20 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 471: Registers] Window

    Display] can be redisplayed. Displayed contents The [Registers] window displays the contents of the CPU registers below. The register values displayed here are updated after program execution. r0–r7, sp, pc, psr EPSOn S5U1C17001C ManUal 10-21 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 472 You can use the arrow, backspace, and delete keys. Note that if a value exceeding the register size is entered, only the 24 low-order bits are handled as valid, with those after bit 24 ignored. EPSOn 10-22 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 473 Choose the register you wish to add by clicking it. Next, choose [Add to Watch] from the [Register] menu or the popup menu that appears by right-clicking. For details about the functions of the [Watch Expressions] window, see Section 10.4.7, "[Watch Expressions] Window". EPSOn S5U1C17001C ManUal 10-23 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 474: Memory] Window

    [Open New Window at <data>] from the popup menu that appears by right-clicking. A new [Memory] window then appears, with contents displayed in it starting from the address of the selected data. EPSOn 10-24 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 475 For example, when size = Half word and format = Hex, entering “100000” (0x186a0 in hexadecimal notation) results in the input of the most signification 16 bits (half word) of 0x186a0, which is 0x186a. EPSOn S5U1C17001C ManUal 10-25 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 476 Closes the dialog box without changing the settings you made in it. (Settings already changed by [Apply] cannot be undone.) Clicking [Apply] or closing this dialog box updates the contents displayed in the [Source] and other windows. EPSOn 10-26 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 477: Breakpoints] Window

    [Source] window with the background color for browse. When this address is reached, the program is made to break (stop running) before executing the instruction stored at that location. EPSOn S5U1C17001C ManUal 10-27 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 478 [Breakpoint] menu or popup menu that appears by right-clicking. To delete all PC breakpoints, choose [Remove All] from the [Global] menu or [Global] popup menu that appears by right-clicking. EPSOn 10-28 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 479: Watch Expressions] Window

    When the symbol is an array or pointer, a [+] sign is displayed before the symbol name. Clicking the symbol changes the sign to [-] and displays information in the array or content of the address indicated by the pointer. EPSOn S5U1C17001C ManUal 10-29 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 480 Common representation for the data type (e.g. decimal for int type values, hexadecimal for pointers) (default) Select a symbol whose display format you wish to change by clicking on its line in the window. Selected symbol EPSOn 10-30 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 481 • The value of the variable, which is allocated to a register, may not be displayed properly due to the optimization by the C compiler. EPSOn S5U1C17001C ManUal 10-31 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 482: Local Variables] Window

    If the variable is an array or pointer, a [+] sign is displayed before the variable name. Clicking the variable changes the sign to [-] and displays the information in the array or content of the address indicated by the pointer. EPSOn 10-32 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 483 Variable values are only updated when changed during program execution. • The value of the variable, which is allocated to a register, may not be displayed properly due to the optimization by the C compiler. EPSOn S5U1C17001C ManUal 10-33 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 484: Simulated I/O] Window

    The data to be supplied from stdin can be entered from this window. For details, see Section 10.6.8, "Simulated I/O". limitations Up to 256 lines can be displayed in the [Simulated I/O] window. EPSOn 10-34 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 485: Trace] Window

    When the trace function is turned off (default), display is not updated even by executing the program. limitations Up to 255 lines can be scrolled in the [Trace] window. EPSOn S5U1C17001C ManUal 10-35 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 486: Method Of Executing Commands

    In the [Console] window, you can use the arrow keys (↑, ↓) to redisplay commands that have already been executed at the prompt position, one command at a time. Thus, clicking the [Enter] key reexecutes the command currently displayed. EPSOn 10-36 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 487: Parameter Input Format

    Only characters 'a' to 'z,' 'A' to 'Z,' 0 to 9, /, and _ can be used. Drive names must be specified in /cygdrive/<drive name>/ format, with / instead of \ used for delimiting the path. Example: (gdb) file /cygdrive/c/EPSON/gnu17/sample/txt/sample.elf EPSOn S5U1C17001C ManUal 10-37 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver.
  • Page 488: Using Menus And Toolbar To Execute Commands

    However, do not write a command that executes the command file itself, for example, when "source userdefine.gdb" is written in the userdefine.gdb file, as it will enter an endless loop. EPSOn 10-38 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 489 Compared to actual command input, this method is subject to some limitations (e.g., parameters cannot be specified). The commands executed from menus, the toolbar, or windows are not displayed in the prompt part of the [Console] window. EPSOn S5U1C17001C ManUal 10-39 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 490: Using A Command File To Execute Commands

    By specifying the -x option (or --command option) in the debugger startup command, you can execute one command file at debugger startup. Example: c:\EPSON\gnu17\gdb -x startup.cmd 2. Execution by a command A command named "source" is available to execute a command file. The source command loads a specified file and executes the commands in it in the order written.
  • Page 491: Log Files

    All commands executed and execution results are saved. This includes commands that have been executed from menus or toolbar buttons and are not displayed in the [Console] window. EPSOn S5U1C17001C ManUal 10-41 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 492: Debugging Functions

    Select "Simulator" from the [Debugger:] combo box in the [Create a simple startup command] dialog box to generate a startup command file. The trace mode is available in simulator mode. The flash writer function cannot be used. EPSOn 10-42 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 493: Loading A File

    The debugger gdb loads source files according to debugging information to display the sources. Therefore, both contents and storage locations (directories) of the source files must be in the same state as at elf object file creation. EPSOn S5U1C17001C ManUal 10-43 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 494: Source-Level Debugging Function

    When gdb is up and running, you can debug a program while displaying the C source and assembly source in the [Source] window. For details about the source display, see Section 10.4.2, "[Source] Window". EPSOn 10-44 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 495: Manipulating Memory, Variables, And Registers

    Example: Saving the contents of addresses 0x80000 to 0x80103 as a Motorola S3 format file named dump.mot (gdb) c17 df 0x80000 0x80103 3 dump.mot Start address = 0x80000, End address = 0x8011f, File type = Motorola-S3 Processing 00080000-0008011F address. EPSOn S5U1C17001C ManUal 10-45 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 496 For display in the [Local Variables] window and how to operate in it, see Section 10.4.8, "[Local Variables] Window". EPSOn 10-46 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 497 You can set the contents of CPU registers to any desired values. Example: Setting the r1 register to 0x10000 (gdb) set $r1=0x10000 The register values can also be rewritten in the [Registers] window. (See Section 10.4.4, "[Registers] Window".) EPSOn S5U1C17001C ManUal 10-47 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 498: Executing The Program

    When the program stops, the cause of break and halted position are displayed in the [Console] window. Moreover, the contents displayed in the [Source] and [Registers] windows are updated. EPSOn 10-48 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 499 • Click the [Step] button. [Step] button To execute the stepi command: • Choose [Step Asm Inst] from the [Control] menu. • Click the [Step Asm Inst] button. [Step Asm Inst] button EPSOn S5U1C17001C ManUal 10-49 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 500 The CPU exits standby mode when an external interrupt is generated. Clicking the [Stop] button also releases the CPU from standby mode. EPSOn 10-50 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 501 Because the PC is set to the boot address, the [Source] window redisplays the program beginning with that address. The [Registers] window reappears with the initialized values. Memory contents are not changed. EPSOn S5U1C17001C ManUal 10-51 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 502: Break Functions

    However, it can be set as a breakpoint by specifying that address. EPSOn 10-52 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 503 Hardware PC breakpoints can also be set from the [Source] window. The lines where you can set hardware PC breakpoints are marked by a bar "–" at the beginning of the lines. EPSOn S5U1C17001C ManUal 10-53 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 504 Program received signal SIGTRAP, Trace/breakpoint trap. By using the check box of the dialog box in which this message is displayed, you can choose not to display the message. EPSOn 10-54 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 505 The program is made to break when executing an instruction at an invalid address. Illegal address exception. Execution of an invalid delayed instruction The program is made to break when executing an invalid delayed instruction. Illegal delayed instruction. EPSOn S5U1C17001C ManUal 10-55 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 506: Trace Functions

    The number of clock cycles executed (clk) displayed in a window is calculated using the wait cycle information set in a parameter file. The displayed information may not be correct if the parameter file was erroneously set. EPSOn 10-56 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 507: Simulated I/O

    Then it resumes executing the program from the address where it left off. Example: To set a data output function using the [Simulated I/O] window (gdb) c17 stdout 1 WRITE_FLASH WRITE_BUF EPSOn S5U1C17001C ManUal 10-57 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 508 • The parts of the program where c17 stdin or c17 stdout perform input/output must be executed successively by the continue command (do not execute in single stepping). Also make sure that no breaks will occur in areas near those parts. EPSOn 10-58 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 509: Flash Memory Operation

    Always run the c17 fle command after the c17 fls command. If you do not want to erase flash memory, specify the block range (“0 0” in the example above) as “-1 0”, precluding the need for erasing flash memory. EPSOn S5U1C17001C ManUal 10-59 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 510 Example 2: To load 1-MB data from the address FLASH_START on target memory after erasing all blocks of flash memory whose start address is 0x8000 (gdb) c17 fwdc FLASH_START 0x100000 0 0 0x8000 EPSOn 10-60 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 511 Comment : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Debugger CPU program address : xxxxxxxx Program size : xxxxxxxx Erase routine entry address : xxxxxxxx Write routine entry address : xxxxxxxx Comment : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx EPSOn S5U1C17001C ManUal 10-61 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 512: Support For Big Endian

    Swaps data suitable for endian format and writes data in units of 16 bits. For this reason, programs created by the C compiler cannot be loaded correctly in big endian areas. EPSOn 10-62 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 513: Command Reference

    Erase flash memory – 10-121 Trace c17 tm Set trace mode – 10-122 c17 stdin 10-125 Simulated I/O Data input simulation c17 stdout Data output simulation 10-126 EPSOn S5U1C17001C ManUal 10-63 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 514: Detailed Description Of Commands

    Describes limitations on use of the command or precautions to be taken when using the command. Some commands have additional items other than those described above when needed for explanatory purposes. EPSOn 10-64 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 515: Memory Manipulation Commands

    0x0: 0x00000001 0x00000001 0x00000001 0x00000001 The entire memory area from address 0x0 to address 0xf is rewritten with 32-bit data 0x00000001. (This applies to when using little endian.) EPSOn S5U1C17001C ManUal 10-65 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 516 [Source] windows are not updated. Therefore, perform the appropriate operation to update display in each window. Similarly, even when the program area is rewritten, the source displayed in a window remains unchanged. EPSOn 10-66 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 517: Memory Dump)[Icd Mini / Sim]

    When Length is specified, the specified amount of data is displayed. When a code area is displayed, <label+offset> is displayed as the symbol, even for addresses with no symbols defined as in ASSEMBLY display of the [Source] window. EPSOn S5U1C17001C ManUal 10-67 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 518 • If the specified address exceeds the 24-bit range, an error is assumed. • Executing this command does not affect the [Memory] window. EPSOn 10-68 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 519 [Source] windows are not updated. Therefore, perform the appropriate operation to update display in each window. Similarly, even when the program area is rewritten, the source displayed in a window remains unchanged. EPSOn S5U1C17001C ManUal 10-69 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 520: C17 Mvb (Copy Area, In Bytes)

    • If a specified memory section at the source contains an unused area, the data in that area is handled as 0xf0 when copied. • If a memory section at the destination contains an unused area, data is only copied to the effective area (excluding the unused area). EPSOn 10-70 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 521 [Source] windows are not updated. Therefore, perform the appropriate operation to update display in each window. Similarly, even when the program area is rewritten, the source displayed in a window remains unchanged. Debugger EPSOn S5U1C17001C ManUal 10-71 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 522: C17 Df (Save Memory Contents)[Icd Mini / Sim]

    (gdb) c17 df 0x10 0x1f 2 dump.txt a The contents of addresses 0x10–0x1f are appended in text form to the end of the file "dump.txt" when it is output. EPSOn 10-72 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 523 • If the specified address exceeds the 24-bit range, an error is assumed. • If the end address is smaller than the start address, an error is assumed. EPSOn S5U1C17001C ManUal 10-73 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 524: C17 Readmd (Memory Read Mode)[Icd Mini]

    • Selecting boundary exact mode will slow memory reading. • Memory read mode settings affect the reading of data from memory by the commands listed below. c17 df, x EPSOn 10-74 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 525: Register Manipulation Commands

    The contents of all registers can be confirmed in the [Registers] window. (See 10.4.4, "[Registers] Window".) Notes Be sure to specify register names in lowercase letters. Using uppercase letters for register names or specifying nonexistent register names results in an error. EPSOn S5U1C17001C ManUal 10-75 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 526 • The contents displayed in the [Registers] window are not updated by executing this command. EPSOn 10-76 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 527: Program Execution Commands

    When the target program is executed by the continue command, the contents displayed in the [Source] and [Registers] windows are updated in real time. The [Memory] window is not updated. EPSOn S5U1C17001C ManUal 10-77 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 528 Then execute the continue command without any parameters. EPSOn 10-78 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 529: Until (Execute Continuously With Temporary Break) [Icd Mini / Sim]

    A symbol can also be used, as shown below. (gdb) until *main main () at main.c:7 Note that adding an asterisk (*) causes even the function name to be regarded as an address. EPSOn S5U1C17001C ManUal 10-79 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 530 • When specifying temporary breakpoints by address value and the address is specified with an odd value, the specified address is adjusted to the 16-bit boundary by assuming LSB = 0. EPSOn 10-80 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 531: Step (Single-Step, Every Line)

    When the program is single-stepped using the method above, information about the line executed appears in the [Console] window and is also output to a log file at log output. EPSOn S5U1C17001C ManUal 10-81 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 532 Similarly, the halt and slp instructions are executed while single-stepping the program, causing the CPU to enter standby status. The CPU exits standby status when an external interrupt is generated. Clicking the [Stop] button also releases the CPU from standby mode. EPSOn 10-82 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 533 Ten lines are executed from the source line displayed on the current PC. n Example 4 (gdb) nexti 10 main () at main.c:13 Ten instructions (in mnemonic units) are executed from the address displayed on the current PC. EPSOn S5U1C17001C ManUal 10-83 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 534 Similarly, the halt and slp instructions are executed while single-stepping the program, causing the CPU to enter standby mode. The CPU exits standby mode when an external interrupt is generated. Clicking the [Stop] button also releases the CPU from standby mode. EPSOn 10-84 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 535: Finish (Finish Function)[Icd Mini / Sim]

    When the finish command is executed at the highest level (e.g., boot routine), the program does not stop. If no breaks are set, use the [Stop] button to halt the program. EPSOn S5U1C17001C ManUal 10-85 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 536: C17 Callmd (Set User Function Call Mode)[Icd Mini / Sim]

    (which is then closed) when the c17 call command is completed. If an existing file name is specified, the file is overwritten with the new execution results. EPSOn 10-86 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 537 %r1 : return address( mini Monitor ) ; output ****28 WBUF data1 : gdb output message start address <message format> size : message size (4 byte) message : String data EPSOn S5U1C17001C ManUal 10-87 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 538 *iprint_data( long arg1, long arg2, long arg3 ) tmpbuf.size = sprintf(tmpbuf.buf,"arg1=%d,arg2=%d,arg3=%d",arg1,arg2,arg3); return (void*)&tmpbuf; Notes If any function without an entry program is called, gdb may run uncontrollably. EPSOn 10-88 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 539: Cpu Reset Commands

    • The contents of memory and debugging status of break and trace are not reset. • When using gdb in ICD Mini mode, the bus status and I/O status are retained. EPSOn S5U1C17001C ManUal 10-89 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 540: C17 Rstt (Reset Target)[Icd Mini]

    • The c17 rstt command can only be used in ICD Mini mode. • To execute this command, a reset input pin is required on the target board. EPSOn 10-90 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 541: Interrupt Commands

    • Make sure the interrupt priority level is specified from 0 to 7. If this range is exceeded, an error is assumed. • TTBR is effective even in simulator mode. EPSOn S5U1C17001C ManUal 10-91 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 542: C17 Intclear (Clear Interrupt)[Sim]

    • The c17 intclear command can only be used in simulator mode. • Make sure the interrupt number is specified from 0 to 31. If this range is exceeded, an error is assumed. EPSOn 10-92 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 543: C17 Int_Load (Load Interrupt Event File)[Sim]

    • Up to 256 events (event lines) can be written in an interrupt event file. • Up to 300 characters can be written in an event line. EPSOn S5U1C17001C ManUal 10-93 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 544: Break Setup Commands

    If no instructions exist on line 10 with actual code, the program breaks at the beginning of the first instruction encountered with actual code thereafter. Because the breakpoint is set by tbreak, it is cleared after a break. EPSOn 10-94 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 545 [Source...] from the [Preferences] menu in the [Source] window. Any breakpoint disabled by a command, etc. changes color to black. Breakpoints can be disabled or enabled again in the [Breakpoints] window. For details, see Section 10.4.6, "[Breakpoints] Window". EPSOn S5U1C17001C ManUal 10-95 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 546 Note that the breakpoint setting must be cleared before the next execution. When a hardware break is set at (1), the process stops at (2). After (3) is processed by “next,” the process stops at (2). EPSOn 10-96 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 547: Hbreak(Set Hardware Pc Break)

    When the target program is run, it breaks before executing the first C instruction (expanded to mnemonic) in main(). The PC on which the program has stopped displays the start address of that instruction (i.e., address of first mnemonic expanded). EPSOn S5U1C17001C ManUal 10-97 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 548 Breakpoint]. The "–" mark at the beginning of the line will change to (in blue by default), indicating that a breakpoint has been set. Clicking on it again clears the breakpoint you have set. EPSOn 10-98 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 549 • When specifying hardware PC breakpoints by address value and the address is specified with an odd value, the specified address is adjusted to the 16-bit boundary by assuming LSB = 0. EPSOn S5U1C17001C ManUal 10-99 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 550: Delete (Clear Break By Break Number)[Icd Mini / Sim]

    (red, orange, or blue by default) can be changed to any desired color in the [Source Preferences] dialog box that appears by choosing [Source...] from the [Preferences] menu in the [Source] window. EPSOn 10-100 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 551 • The delete command clears all break settings. To disable a breakpoint temporarily, use the disable or Debugger ignore command. • Note that specifying a break number not set displays the "No breakpoint number N." message, with no breakpoints being deleted. EPSOn S5U1C17001C ManUal 10-101 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 552: Clear (Clear Break By Break Position)[Icd Mini / Sim]

    PC (main.c in this example) are deleted. If no breakpoints are set in the source, the "No source file specified." message appears, with no breakpoints being deleted. EPSOn 10-102 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 553 • The clear command completely clears break settings. To disable a breakpoint temporarily, use the dis- able or ignore command. • If you specify a function name, line number, or address for which no breakpoints are set, an error is assumed. EPSOn S5U1C17001C ManUal 10-103 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 554: Enable(Enable Breakpoint)

    0x00c00028 in main at main.c:13 breakpoint keep y 0x00c00038 in sub at main.c:20 When a break number is omitted, all breakpoints are enabled (or disabled) simultaneously. EPSOn 10-104 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 555 • The number of breakpoints that can be set is limited. Use the delete command to delete unnecessary breakpoints. • Note that specifying a break number not set displays the "No breakpoint number N." message, with no breakpoints being disabled or enabled. EPSOn S5U1C17001C ManUal 10-105 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 556: Ignore (Disable Breakpoint With Ignore Counts)[Icd Mini / Sim]

    • The ignore command cannot be used to collectively disable multiple breakpoints. • Note that specifying a break number not set displays the "No breakpoint number N." message, with program execution being aborted. EPSOn 10-106 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 557: Info Breakpoints (Display Breakpoint List)[Icd Mini / Sim]

    (gdb) info breakpoints No breakpoints or watchpoints. A list of software PC breakpoints (including temporary breaks) is displayed in the [Breakpoints] window. For details, see Section 10.4.6, "[Breakpoints] Window". EPSOn S5U1C17001C ManUal 10-107 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 558: C17 Timebrk (Set Lapse Of Time Break)[Icd Mini]

    • If another break condition is met or the [Stop] button is clicked before the set time has elapsed, the program being executed is made to break at that point immediately. EPSOn 10-108 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 559: C17 Hbreakmd (Change Mouse Left-Click Break Setting Mode) [Icd Mini/Sim]

    Hereafter, right-click results in a software break. Note Even if this command is executed, settings made with left-clicks or operations of break-related commands entered in the console window will not be affected. EPSOn S5U1C17001C ManUal 10-109 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 560: C17 Savebreak (Save Set Breakpoints)[Icd Mini/Sim]

    When the number of set breakpoints is 0, the count is saved as “0.” Note • Each time this command is executed, the contents stored by the gdb debugger are updated. EPSOn 10-110 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 561: C17 Loadbreak (Restore Saved Breakpoints)[Icd Mini/Sim]

    0. • For other notes, refer to the sections describing break, tbreak, hbreak, and thbreak. EPSOn S5U1C17001C ManUal 10-111 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 562: Commands (Setting A Command To Execute After Break) [Icd Mini/Sim]

    • The commands command cannot be nested. If a commands command occurs in the command line, the command line specified by the commands command cannot be entered during a break. EPSOn 10-112 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 563: Symbol Information Display Commands

    If the current position indicated by the PC address is outside the function (stack frame) (e.g., in boot routine of an assembly source), local symbols are not displayed. (gdb) info locals No frame selected. EPSOn S5U1C17001C ManUal 10-113 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 564: Print (Alter Symbol Value)[Icd Mini / Sim]

    Only a finite number of low-order bits equivalent to the size of the variable are effective, with excessive bits being ignored. For example, specifying 0x10000 for variable int is processed as 0x0000. EPSOn 10-114 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 565: File Loading Commands

    Basically, the series of operations from compiling to debugging should be performed in the same directory. • Once the file command is executed, operation cannot be aborted until the debugger finishes loading the file. EPSOn S5U1C17001C ManUal 10-115 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 566: Load (Load Program)[Icd Mini / Sim]

    • The size of file that can be downloaded for debugging is a maximum of 1,024 bytes per block (set down- load-write-size 1024). Setting a greater value will cause the debugger to operate erratically. EPSOn 10-116 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 567: C17 Loadmd (Set Program Load Mode)[Icd Mini]

    The program and data are loaded from sample.elf located in the current directory (specified by the file command) into the target memory using high-speed 8-bit instructions. Notes This command cannot be used in simulator mode. EPSOn S5U1C17001C ManUal 10-117 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 568: Map Information Commands

    If this command is not executed in simulator mode, the memory map information is set as follows: TTBR 0x8000 0x0–0xffffff, R/W wait cycle = 0, 16-bit access, little endian EPSOn 10-118 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 569: C17 Map (Display Map Information)[Sim]

    (gdb) c17 map CPU : C17 Memory map information Type Wait(r/w) Size Endian 00100000 TTBR 00000000-00ffffff 16Bit Little Notes The c17 map command can only be used in simulator mode. EPSOn S5U1C17001C ManUal 10-119 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 570: Flash Memory Manipulation Commands

    • Before you can erase flash memory of the target system or write data to flash memory, you must have written the data write and erase programs to the specified address locations. EPSOn 10-120 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 571: C17 Fle (Erase Flash Memory)[Icd Mini]

    To determine whether or not it is possible to set a desired flash erasure range, refer to readme_x.txt in the fls folder (\gnu17\mcu_model\MODEL NAME\fls) for the model in question. EPSOn S5U1C17001C ManUal 10-121 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 572: Trace Command

    If a file name is omitted, the information is displayed in the [Trace] window. n Example 2 (gdb) c17 tm off Trace mode is turned off. From this time on, no trace information is sampled even when running the program. EPSOn 10-122 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 573 003ef8 0 0 0010 (main.c) 00027 } 003ef8 0 0 0000 %r4,0x1 (main.c) 00014 for( j = 0; j < 6; ++j ) 003ef8 0 0 1001 %r4,0x5 EPSOn S5U1C17001C ManUal 10-123 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 574 Section 10.9, "Parameter Files". • To change trace mode (with contents of trace information displayed), temporarily turn off trace mode (by executing c17 tm off), then set a new trace mode. EPSOn 10-124 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 575: Simulated I/O Commands

    PC breakpoints are accepted. • If the break address is specified with an odd value, the specified address is adjusted to the 16-bit boundary by assuming LSB = 0. EPSOn S5U1C17001C ManUal 10-125 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 576: C17 Stdout (Data Output Simulation)[Icd Mini / Sim]

    PC breakpoints are accepted. • If the break address is specified with an odd value, the specified address is adjusted to the 16-bit boundary by assuming LSB = 0. EPSOn 10-126 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 577: Flash Writer Commands

    To determine whether or not it is possible to set a desired flash erasure range, refer to readme_x.txt in the fls folder (\gnu17\mcu_model\MODEL NAME\fls) for the model in question. EPSOn 10-126 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 578: C17 Fwlp (Load Program)[Icd Mini]

    ICD board (an error message will not be displayed). • The data erase/write program is 8KB or less in size. • For the value of EraseEntryAddr/WriteEntryAddr, refer to “readme_e.txt” located at mcu_model\MODEL NAME\fls. EPSOn S5U1C17001C ManUal 10-127 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 579: C17 Fwld (Load Data)[Icd Mini]

    To determine whether or not it is possible to set a desired flash erasure range, refer to readme_x.txt in the fls folder (\gnu17\mcu_model\MODEL NAME\fls) for the model in question. EPSOn 10-128 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 580: C17 Fwdc (Copy Target Memory)[Icd Mini]

    • This command can be used with the ICD Mini (S5U1C17001H). It cannot be executed normally with the ICD board (an error message will not be displayed). • The ICDmini flash memory can retain up to 4 MB of data. EPSOn S5U1C17001C ManUal 10-129 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 581: C17 Fwd (Display Flash Writer Information)[Icd Mini]

    • This command cannot be used in simulator mode. • This command can be used with the ICD Mini (S5U1C17001H). It cannot be executed normally with the ICD board (an error message will not be displayed). EPSOn 10-130 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 582: C17 Profilemd (Profile/Coverage Mode Setting)[Sim]

    C17 profilemd 0 Cont There is no measurement data during this period. Break generation C17 profilemd 1 Cont Break generation ← This profile measurement is not performed correctly. C17 profile EPSOn S5U1C17001C ManUal 10-131 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 583: C17 Profile (Launching Of Profiler Window)[Sim]

    • If the profile function is disabled by the c17 profilemd command, a profiler window will open but will not display measurement results, even if measurement data exists. EPSOn 10-132 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 584: C17 Coverage (Launching Of Coverage Window)[Sim]

    • If the profile function is disabled by the c17 profilemd command, a coverage window will open but will not display measurement results, even if measurement data exists. EPSOn S5U1C17001C ManUal 10-133 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 585: Other Commands

    8 = Octal 2 = Binary Usage example (gdb)print i $1 = -21846 (gdb)set output-radix 16 (gdb)print i $2 = 0xaaaa (gdb)set output-radix 8 (gdb)print i $3 = 0125252 EPSOn 10-134 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 586: C17 Log (Logging)[Icd Mini / Sim]

    • The c17 log command contained in the command file specified by startup option -x is only effective with the [Console] window open. Be careful not to close the [Console] window before executing the c17 log command, because no log files will be created. EPSOn S5U1C17001C ManUal 10-135 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 587: Source (Execute Command File)[Icd Mini / Sim]

    /cygdrive/c/EPSON/gnu17/sample/tst/sample.elf # reset c17 rst From # to the end of the line is interpreted as a comment. (gdb) source src.cmd (gdb) (gdb) file /cygdrive/c/EPSON/gnu17/sample/tst/sample.elf (gdb) (gdb) target sim boot () at boot.s:9 Connected to the simulator. Current language: auto;...
  • Page 588: C17 Clockmd(Set Execution Counter Mode)

    After setting in cumulating mode, the execution counter is reset by the reset command, thereby starting the program. In cumulating mode, the execution counter is not reset even when program execution is resumed after a break. EPSOn S5U1C17001C ManUal 10-137 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 589 4. When the c17 timebrk, step, stepi, next, nexti or finish command is executed in ICD Mini mode • Deviations of about 30 to 40 cycles will occur in ICDmini mode because it includes debugging mode entering and exiting processes. EPSOn 10-138 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 590: Target (Connect Target)[Icd Mini / Sim]

    (sets map information.) (gdb) c17 rpf sample.par (loads debugging information.) (gdb) file sample.elf (this command) (gdb) target icd usb (gdb) load (loads the program.) (resets the CPU.) (gdb) c17 rst EPSOn S5U1C17001C ManUal 10-139 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 591: Detach (Disconnect Target)[Icd Mini / Sim]

    This command can be used to turn the ICD off to switch between simulator mode and other modes, or perform operations on the target board. You need not execute this command to terminate debugging. EPSOn 10-140 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 592: Pwd (Display Current Directory)

    Working directory /cygdrive/c/EPSON/gnu17/sample/tst. (gdb) cd /cygdrive/c/EPSON/gnu17/sample/ansilib Working directory /cygdrive/c/EPSON/gnu17/sample/ansilib. After the current directory is confirmed, it is changed to "c:\EPSON\gnu17\sample\ansilib". Notes A drive name must be specified in "/cygdrive/drive name/" format. Do not specify a drive name in "c:" format. Moreover, use a slash (/) instead of (\) to delimit directories.
  • Page 593: C17 Firmupdate (Update Firmware)[Icd Mini]

    (gdb) c17 firmupdate icd17dmt.sa Loads the firmware file icd17dmt.sa and updates the ICD firmware with the loaded contents. Notes The c17 firmupdate command is effective only in ICD Mini mode. EPSOn 10-142 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 594: C17 Ttbr (Set Ttbr)[Sim]

    Sets address 0x8000 to TTBR. Notes • The c17 ttbr command can be used only in simulator mode. • This command must be executed before the target command. EPSOn S5U1C17001C ManUal 10-143 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 595: C17 Help (Help)[Icd Mini / Sim]

    Please type "c17 help continue" to get usage of command "continue". When you specify a command group number, a list of commands belonging to that group is displayed. EPSOn 10-144 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 596 SIM: The command can be used in simulator mode (when debugging with the PC alone) If "[ICD]" is displayed, it indicates that the command cannot be executed in modes other than ICD Mini mode. EPSOn S5U1C17001C ManUal 10-145 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 597: C17 Savewatch (Store Symbols Registered In Watch Window) [Icd Mini /Sim]

    • The symbols are not stored in the following cases: 1.The Watch Window is closed. 2. No symbols are registered. • Up to 300 symbols can be stored. Symbols exceeding this number will not be stored. EPSOn 10-146 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 598: C17 Loadwatch (Re-Register Stored Symbols In Watch Window) [Icd Mini /Sim]

    • Up to 300 symbols can be registered. Symbols beyond this number will not be registered. EPSOn S5U1C17001C ManUal 10-147 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 599: Quit (Quit Debugger)[Icd Mini / Sim]

    (gdb) q You also can choose [Exit] from the [File] menu in the [Source] window or click the [Close] box in the [Source] window to quit the debugger. EPSOn 10-148 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 600: Profiler And Coverage Functions

    * A profiler measurement data file includes all profiler and coverage measurement information and is used by the above two windows. EPSOn S5U1C17001C ManUal 10-149 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 601: List Of Functions

    Saves the profiler measurement data file. Saves display results to a file (test or csv format). Merges the current data with the coverage result most recently saved and displays the merged results. EPSOn 10-150 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 602: Detailed Description Of Functions

    In this case, you can open a profile window (no data display) by clicking the [OK] button. The profiler window closes when GDB ends. Comparison result state: When the list shows comparison results, this section Debugger indicates “COMPARISON RESULT.” (Otherwise, this section is blank.) Profiler window EPSOn S5U1C17001C ManUal 10-151 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 603 (4) In the TOTAL section, “TOTAL of displayed value − TOTAL of value of specified file” is displayed. Meaning of displayed value Positive value : Increase = Change for worse Negative value : Decrease = Improvement : No change EPSOn 10-152 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 604 0, sub @ main.c -1.78, -6.00, -4, sub2 @ main.c -15, -6.48, 0.00, 0, sub3 @ main.c 0.00, 0.00, 0, sub4 @ main.c -21, -4, *** TOTAL *** ---------------------------------------------------------------------------- EPSOn S5U1C17001C ManUal 10-153 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 605 Merging result state: When the list shows merging results, this section indicates “MERGING RESULT.” (Otherwise, this section is blank.) Function coverage display section Address coverage display section Coverage window EPSOn 10-154 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 606 Updates the address range and count of merged results and displays in alphabetical order (fixed) of address. Address : Displays the range of addresses additionally fetched. Count : Updates the value if the address is the same and the merged value is larger. EPSOn S5U1C17001C ManUal 10-155 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 607 Function Coverage result Fetched,Size,Ratio(%),Start,End,Name 40, 70.00,0x000604,0x00062C,boot 44,100.00,0x00062C,0x000658,main 40,100.00,0x000658,0x000680,sub @ main.c 38,100.00,0x000680,0x0006A6,sub2 @ main.c 30,100.00,0x0006A6,0x0006C4,sub3 @ main.c 180, 192, 93.75,,,*** TOTAL *** Address Coverage result Address,Count 0x000604-0x00061F, 0x00062C-0x0006A5, 0x0006A6-0x0006C3, ---------------------------------------------------------------------------- EPSOn 10-156 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 608 Merging mismatch (Start or End address) The starting addresses and ending addresses at the merge source and merge destination failed to match. EPSOn S5U1C17001C ManUal 10-157 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 609 ・ Static functions without debug information (without assembler −gstabs option or compiler −gstabs option) cannot be displayed in the form of “function name + @ + filename”; the filename section will not be displayed. EPSOn 10-158 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 610: Parameter Files

    (c17 rst) is executed and is used as the trap table (vector table) start address. The reset vector written in this address will be loaded to the PC for booting the system. EPSOn S5U1C17001C ManUal 10-159 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 611 This setting is effective in simulator mode, and causes a break to occur when the stack overflows. In no case will this setting affect SP operation by a program. EPSOn 10-160 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 612 2. Access to an undefined area 3. Stack overflow • Counts of the execution counter and the number of clocks in trace information do not indicate the correct values. EPSOn S5U1C17001C ManUal 10-161 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 613: Status And Error Messages

    The number of hardware PC breakpoints set exceeds the limit (one location only). Cannot set soft pc break any more. The number of software PC breakpoints set exceeds the limit (up to 200). EPSOn 10-162 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 614 It is not c17 architecture ELF file. The file specified with the file command is not an elf format file supported in S5U1C17001C. Load end address max(0x # ) overflow. The end address of the program to be written to flash memory exceeds the upper limit (0xffffff).
  • Page 615: Embedded System Simulator (Es-Sim17)

    The ES-Sim17 can simulate operations with the OSC1 clock in real time. For operations with the OSC3 clock, refer to "simulator_readme.txt". note: The ES-Sim17 is a simulator that runs on a PC, therefore, it has some restrictions. Refer to Section 10.10.7, "Restrictions", and "simulator_readme.txt". EPSOn 10-164 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 616: Input/Output Files

    OSC1 clock frequency = 32.678 kHz osc1=32768 OSC3 clock frequency = 4 MHz osc3=4000000 ;lcd file path LCD file path setting field [LCD FILE PATH] path=C:\EPSON\GNU17\tools\LcdUtil17\sample_lcd\SVT17701.lcd LCD file path EPSOn S5U1C17001C ManUal 10-165 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 617 File format: Bitmap file File name: <filename>.bmp Description: This is a bitmap file that contains an LCD screen image simulated and can be generated by the ES-Sim17. EPSOn 10-166 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 618: Starting And Terminating Es-Sim17

    The [ES-Sim] window cannot be opened twice. If you attempt to open the window when it is already opened, the [ES-Sim] window moves to the foreground but a new window does not appear. EPSOn S5U1C17001C ManUal 10-167 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 619: Menus

    Open an LCD file (.lcd) created in LCDUtil17. For information on LCDUtil17 and LCD files, see Section 11.11, “LCDUtil17 (LCD Panel Customizing Tool).” [Help] menu [About EssWnd] Shows ES-Sim Window version information. EPSOn 10-168 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 620: Simulating I/O Ports

    Setting the port input status Select either High or Low port data button. This determines the current port input level. P00 input = High P01 input = Low EPSOn S5U1C17001C ManUal 10-169 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 621 Port input interrupts Changing the input status by an operation in the port data control window can generate a port input interrupt. EPSOn 10-170 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 622: Simulating Svd

    SVD detection result register. SVD interrupt If the target model supports the SVD interrupt, setting a voltage level lower than the SVD compare voltage in this window can generate an interrupt. EPSOn S5U1C17001C ManUal 10-171 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 623: Simulating An Lcd Panel

    • The dot size, contrast, and background color are different from those of the actual LCD panels. • The LCD display refresh times differ from actual LCD panels. EPSOn 10-172 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 624: Es-Sim17 Error Massages

    ES-Sim17, they can operate with stability immediately after they start. * For the restrictions in the latest version of ES-Sim17 and model dependent restrictions, refer to "simulator_ readme.txt". EPSOn S5U1C17001C ManUal 10-173 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 625 10 DEBUggEr THIS PAGE IS BLANK. EPSOn 10-174 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 626: Other Tools

    Tools S5U1C17001C Manual 11 Other Tools...
  • Page 628: Make.exe

    11.1.2 input file make file File format: Text file File name: <filename>.mak Description: This file contains procedures for a make process. Normally use the make file created by the IDE. EPSOn S5U1C17001C ManUal 11-1 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 629: Starting Method

    This function is useful to rebuild the program from all the source files. To execute clean from the IDE, select [Clean] from the [Project] menu. The S5U1C17001C only supports ordinary makes without target names and makes with the target name “clean” and a designation of “all.”...
  • Page 630: Make Files

    # macro definitions for object files OBJS= boot.o \ lib.o \ main.o \ sys.o \ # macro definitions for library files OBJLDS= $(TOOL_DIR)/lib/24bit/libstdio.a \ $(TOOL_DIR)/lib/24bit/libc.a \ $(TOOL_DIR)/lib/24bit/libgcc.a \ $(TOOL_DIR)/lib/24bit/libc.a \ EPSOn S5U1C17001C ManUal 11-3 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 631 $(AS_CC) $(ASFLAGS_CC) $(EXTFLAGS_CC) -o $$NAME.o $$NAME.ext0 ; done $(RM) -f $(TARGET).map # 2pass linking $(LD) $(LDFLAGS) -o $@ $(OBJS) $(OBJLDS) # restore 1pass object files $(RM) -f $(OBJS) \ EPSOn 11-4 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 632 : $(RM) -f $(OBJS) $(TARGET).elf $(TARGET).map $(DEPS) $(CEXTTEMPS) $(TARGET).dump lderr $(TARGET).sa $(TARGET).saf $(TARGET).psa @if [ -e obj1pass ]; then \ cmd /c "rd /s /q obj1pass" ; \ EPSOn S5U1C17001C ManUal 11-5 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 633 "\" used in Windows must be replaced with "/". Additionally, write the drive name in the format "/cygdrive/ <drive name>/". Example: c:/EPSON/gnu17/sample/tst/boot.o : c:/EPSON/gnu17/sample/tst/boot.s as –o boot.o c:/EPSON/gnu17/sample/tst/boot.s ↓ /cygdrive/c/EPSON/gnu17/sample/tst/boot.o : /cygdrive/c/EPSON/gnu17/sample/tst/boot.s as –o boot.o c:/EPSON/gnu17/sample/tst/boot.s If a drive name is written in the form "<drive name>:", an error will result when make is executed.
  • Page 634: Macro Definition And Reference

    The last line that refers macros in the example above is a command line to invoke the linker. If the macros have been defined as the example, this line will be executed after the macro names are replaced as below. /cygdrive/c/EPSON/gnu17/ld -T sample.lds -Map sample.map -N -o sample.elf boot.o main.o /cygdrive/c/EPSON/gnu17/lib/libc.a /cygdrive/c/EPSON/gnu17/lib/libgcc.a Predefined macros $@ used in the example above is a predefined macro.
  • Page 635: Dependency List

    However, if a suffix definition with the extensions of the target file and the first dependent file is described, the command in the suffix definition is executed. EPSOn 11-8 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 636 5. The make process returns to Dependency list A and the command (linkage) is executed since target. elf has not been generated yet. The target.elf is then generated. EPSOn S5U1C17001C ManUal 11-9 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 637 Bad example: vector2.o : vector.c /cygdrive/c/EPSON/gnu17/sed.exe -f ../comm/place.sed vector.c > vector2.c /cygdrive/c/EPSON/gnu17/xgcc -B/cygdrive/c/EPSON/gnu17/ -c vector2.c -o vector2.o This example executes sed.exe to convert vector.c into vector2.c and then compiles vector2.c to generate vector2.o. It is better to separate into two dependency lists like below.
  • Page 638: Suffix Definitions

    $(LD) $(LDFLAGS) -o $@ $(OBJS) $(OBJLDS) $(LIBS) Dependency lists ## boot.s boot.o : $(SRC_DIR)/boot.s ## main.c main.o : $(SRC_DIR)/main.c ## sub.c sub.o : $(SRC_DIR)/sub.c # dependency list end EPSOn S5U1C17001C ManUal 11-11 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 639 (also the file name is case sensitive). Bad example: main.o : main1.c In this case, the suffix rule is not applied. The make ignores such dependency lists and executes nothing for them. EPSOn 11-12 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 640: Clean

    This command can be executed by specifying the target name clean when the make is invoked (in IDE, select [Clean] from the [Project] menu.). The following shows the command included in a make file: Example: TARGET= sample TOOL_DIR = c:/EPSON/gnu17 RM= $(TOOL_DIR)/rm Tools OBJS= boot.o \ main.o \ DEPS = $(OBJS:%.o=%.d)
  • Page 641: Messages

    Therefore, an error may occur during linkage if too many files that have long file names are added in the make file. EPSOn 11-14 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 642: Ccap.exe

    Warning Count of the warning messages Default: Error messages are not counted. When entering an option, you need to place one or more spaces before and after the option. Example: c:\EPSON\gnu17\ccap -a -o -e Compile.err "xgcc -c -gstabs test.c" EPSOn S5U1C17001C ManUal 11-15...
  • Page 643: Error Messages

    If no file name or execution command was specified or an option was not specified correctly, ccap ends after delivering the following message concerning the usage: ccap Console Capture Ver x.xx Copyright (C) SEIKO EPSON CORP. 199x Usage: ccap [options] <output-file> "command line" Options:...
  • Page 644: Objdump.exe

    Explanation: Displays all the section information in hexadecimal dump format. Data corresponding to unresolved symbols cannot be displayed correctly. Display disassembled contents for all sections Function: Explanation: Displays all the sections after disassembling the object code. EPSOn S5U1C17001C ManUal 11-17 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 645: Dump Format

    When entering an option, you need to place one or more spaces before and after the option. Example: c:\EPSON\gnu17\objdump -S test.elf 11.3.4 Dump format The following shows the display examples by specifying each option: -d (Disassembled display) Displays the disassembled information from the beginning of the executable section.
  • Page 646 Displays the relations between the sources and the execution addresses in the following display format: /* file <filename> line <source line number> addr 0x<address> */ The data types of the global symbols are also displayed. C:\EPSON\gnu17\>objdump -g sample.elf sample.elf: file format elf32-c17 boot.s:...
  • Page 647 <address> <raw data> <raw data> <raw data> <raw data> < ASCII characters> Contents of section <section name> <address> <raw data> <raw data> <raw data> <raw data> < ASCII characters> ..C:\EPSON\gnu17\>objdump -s sample.elf sample.elf: file format elf32-c17 Contents of section .data: Contents of section .rodata:...
  • Page 648: Error Message

    • When a .o file before linking is dumped, the relative addresses from the beginning of each section are displayed, not the absolute addresses. In this case the beginning of each section is address 0x0. EPSOn S5U1C17001C ManUal 11-21 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 649: Objcopy.exe

    Description: A HEX data file for writing to the ROM. When the system uses two or more ROMs, create a data file for each ROM by extracting the section data to write to the ROM from the elf object file. EPSOn 11-22 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 650: Method For Using Objcopy

    Function: Explanation: Displays the version number of objcopy, and then terminates the process. --help Function: Usage display Explanation: Displays the usage of objcopy, and then terminates the process. EPSOn S5U1C17001C ManUal 11-23 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 651: Creating Hex Files

    11.4.4 Creating HEX files Open the command prompt window and execute objcopy at the command line as shown below. C:\EPSON\gnu17\>objcopy -I elf32-little -O srec -R SectionName --srec-forceS3 InputFile OutputFile Running the above command converts sections other than those specified with the -R option into S3 records and generates an output file.
  • Page 652: Function

    (library file) File format: Archive file in binary format File name: <filename>.a Description: A library file that can be input to the linker ld. EPSOn S5U1C17001C ManUal 11-25 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 653: Method For Using Ar

    Use this modifier with key 'r' to replace only the updated objects in the <objects> that are newer than those included in the archive. v Specifies verbose mode to display the executed processes. Do not enter a space between the keys and modifiers. EPSOn 11-26 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 654 The archive is not modified. (6) removing an object ar ds mylib.a func5.o (mylib.a: func1.o + func2.o + func3.o + func4.o) func5.0 is removed from mylib.a. EPSOn S5U1C17001C ManUal 11-27 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 655: Moto2Ff.exe

    Motorola S3 format file generated by objcopy. The ROM area data generated by moto2ff should be processed with sconv32 and winmdc17 to generate the mask data to be submitted to Seiko Epson. For the mask data generation procedure, refer to Section 3.3.7, "Creating ROM Data."...
  • Page 656: Error/Warning Messages

    Then perform the final verification of program operation on the actual target board using that file. Finally, pack the verified ROM data file and the mask option data file generated by winfog17 into a mask data file using winmdc17 and present it to Seiko Epson. EPSOn...
  • Page 657: Sconv32.Exe

    The converted ROM data file should be processed with winmdc17 to generate the mask data to be submitted to Seiko Epson after performing the final verification of program operation on the actual target board using the ROM data file. For the mask data generation procedure, refer to Section 3.3.7, "Creating ROM Data".
  • Page 658: Outline Of The Development Tools

    2. Mask data checker <winmdc17.exe> The winmdc17 checks the data in development-completed built-in ROM file and option document file to create the mask data file that will be presented to Seiko Epson. Refer to Section 11.10 for details. 3. Device information definition file <S1C17xxx.ini>...
  • Page 659: Winfog17.Exe

    Description: This file contains option lists for various types of microcomputers and other information. Always be sure to use the files presented by Seiko Epson. This file is effective for only the type of microcomputer indicated by the file name. Do not modify the contents of the file or use the file in other types of microcomputers.
  • Page 660: Starting Up

    If the model lacks mask options, the [INI file does not include FOG information] dialog box will appear when you click the [Start Winfog17] button. In this case, there is no need to create a function options file. Close the dialog box and exit Winfog17. EPSOn S5U1C17001C ManUal 11-33 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 661 11 OTHEr TOOlS [FOG] Window (after reading the device information definition file) EPSOn 11-34 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 662: Window

    When you create a file by selecting [Generate] from the [Tool] menu or clicking the [Generate] button, this area displays a message showing the result of the selected operation. EPSOn S5U1C17001C ManUal 11-35 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 663: Menus And Toolbar Buttons

    Version Displays the version of winfog17. The [Help] button has the same function. [Help] button The dialog box shown below appears. Click [OK] to close this dialog box. EPSOn 11-36 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 664: Operation Procedure

    Select whether to create a function option HEX file. The S1C17 Family does not use a function option HEX file, so select "No". EPROM Type This option is not available for S1C17 Family microcomputers. EPSOn S5U1C17001C ManUal 11-37 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 665 The function option document file you specified from the [Setup] dialog box is created. When winfog17 has finished creating the files normally, it displays the message "Making file(s) is completed" in the message area. If an error occurs, an error message is displayed. EPSOn 11-38 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 666 The function option document file can be read only when the device information definition file has been loaded. (6) Quitting To terminate winfog17, select [End] from the [File] menu. EPSOn S5U1C17001C ManUal 11-39 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 667: Error/Warning Messages

    Making file(s) is not completed Table 11.9.7.2 Warning message Message Description Display Are you file update? Overwrite confirmation message Dialog xxxx is already exist (Specified file already exists.) EPSOn 11-40 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 668: Sample Output File

    ← File name (specified by [Setup]) * FILE NAME zzzzzzzz.FDC ← User name (specified by [Setup]) * USER'S NAME SEIKO EPSON CORPORATION ← Date of creation (specified by [Setup]) * INPUT DATE yyyy/mm/dd ← Comment (specified by [Setup]) * COMMENT...
  • Page 669: Winmdc17.Exe

    Description: This file contains option lists for various types of microcomputers and other information. Always be sure to use the files presented by Seiko Epson. This file is effective for only the type of microcomputer indicated by the file name. Do not modify the contents of the file or use the file in other types of microcomputers.
  • Page 670 Description: This is a text-format file for a function option document file section separated from a packed file. The content is the same as the function option document file used for packing. Tools EPSOn S5U1C17001C ManUal 11-43 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 671: Starting Up

    * The microcomputer model name on the title bar is the file name (not including the path and extension) of the device information definition file that has been read. * The [Pack] and [Unpack] buttons on the tool bar are enabled when the device information definition file is read. EPSOn 11-44 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 672: Menus And Toolbar Buttons

    Pack Packs the ROM data file and option document file to create a mask data file for presentation Tools to Seiko Epson. The [Pack] button has the same function. [Pack] button Unpack Restores files in the original format from a packed file. The [Unpack] button has the same function.
  • Page 673: Operation Procedure

    (2) Packing 1. Select [Pack] from the [Tool] menu or click the [Pack] button on the tool bar to bring up the [Pack] dialog box. [Pack] button EPSOn 11-46 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 674 If an error has occurred, an error message is displayed. 5. Click the [Cancel] button to close the dialog box. Alternatively, you can click the [Cancel] button to quit winmdc17 before it executes packing. EPSOn S5U1C17001C ManUal 11-47 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 675 5. Click the [Cancel] button to close the dialog box. Alternatively, you can click the [Cancel] button to quit winmdc17 before it executes unpacking. (4) Quitting To terminate winmdc17, select [End] from the [File] menu. EPSOn 11-48 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 676: Error Messages

    Option data error : Mask data is not enough. Mask data is insufficient. Message Option data error : Illegal start mark. Start mark is incorrect. Message Option data error : Illegal end mark. End mark is incorrect. Message EPSOn S5U1C17001C ManUal 11-49 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 677: Sample Output File

    ← Function option start mark \OPTION1 ← Model name/version * S1C17xxx FUNCTION OPTION DOCUMENT V x.xx * FILE NAME zzzzzzzz.FDC * USER'S NAME SEIKO EPSON CORPORATION * INPUT DATE yyyy/mm/dd * COMMENT SAMPLE DATA "xxxxxxxx.fdc" * *** OPTION NO.1 *** * --- OSC1 SYSTEM CLOCK --- * Crystal(32.768KHz) ---- Selected...
  • Page 678: Lcdutil17 (Lcd Panel Customizing Tool)

    Model information definition file (essim17.ini) This file contains recorded information on the simulator model. Be sure to use the setting file provided by Seiko Epson. Modifying the contents of this file may prevent the LcdUtil17 and ES-Sim17 operating properly. Bitmap file (file_name.bmp) This bitmap file contains an LCD panel image (in monochrome).
  • Page 679: Starting And Closing Lcdutil17

    This window is used to design an LCD panel layout and assign COM/SEG. Two or more windows can be opened at the same time, and icons and dot matrices can be dragged and dropped between two windows. EPSOn 11-52 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 680: Menus And Toolbar

    Opens the dialog box used for selecting the paper size or printer to use. File list Displays up to eight previously opened files and enables access to those files. [Exit] Ends LcdUtil17. EPSOn S5U1C17001C ManUal 11-53 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 681 Window list Displays a list of names of all currently open panel editing windows. Select a panel editing window in the list to activate the selected panel editing window. EPSOn 11-54 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 682 [redo] button Reperforms the command most recently undone with Undo. [Print] button Prints the bitmap image in the active panel editing window. [about] button Displays LcdUtil17 version information. EPSOn S5U1C17001C ManUal 11-55 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 683: Producing An Lcd File

    Enter the LCD panel size, then click the [OK] button. The default LCD size of a new panel editing window is 640 x 480 dots. Calculate the dot matrix size and set the LCD panel size. EPSOn 11-56 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 684 IDE, an LCD driver is already set and this dialog box does not appear. Note: Once set, an LCD driver cannot be changed. Be extremely careful when setting the LCD driver. 4) The [Dot matrix] dialog box appears. EPSOn S5U1C17001C ManUal 11-57 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 685 Click the [Preview] button after making the settings above. A dot matrix will be displayed in the panel editing window for confirmation. Click the [OK] button to produce a dot matrix based on the settings entered. EPSOn 11-58 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 686 Note: A dot matrix that is copied and pasted retains position and size information but discards port allocation information. Dot matrices without allocation information are indicated in black. EPSOn S5U1C17001C ManUal 11-59 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 687 Drag with the mouse to move an icon. You can also move an icon from one panel editing window to another by dragging and dropping. Cut, Copy Select the command from the [Edit] menu or click the toolbar button. EPSOn 11-60 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 688 IDE, an LCD driver is already set and this dialog box does not appear. Note: Once set, an LCD driver cannot be changed. Be extremely careful when setting the LCD driver. EPSOn S5U1C17001C ManUal 11-61 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 689 Note: The port allocation information is discarded if you copy and paste an icon or move an icon from another panel editing window. Dot matrices without allocation information appear in black. EPSOn 11-62 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 690: Shortcut Key List

    Ctrl + M Ctrl + N Open Ctrl + O Save Ctrl + S Print Ctrl + P Ctrl + Z Undo Alt + BS Redo Ctrl + Y EPSOn S5U1C17001C ManUal 11-63 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 691: Warning Messages And Error Messages

    The number of the matrix is exceeding 10 pieces. Cause: The total number of dot matrices exceeded the maximum value of 10. Corrective action: Reduce the total number of dot matrices to less than 10. EPSOn 11-64 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 692 The vertical or horizontal size of the bitmap file is too large. Corrective action: Use a bitmap file with a horizontal size of no more than 1280 and a vertical size of no more than 1024. EPSOn S5U1C17001C ManUal 11-65 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 693: Stand-Alone Flash Writer

    Ver. 1.1, we recommend updating the firmware if you are currently using Ver. 1.0. When the required files above are ready, download the two files to ICDmini flash memory. EPSOn 11-66 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 694 To write the same data to a different target, repeat the steps from step (10). ・ Refer to Section 10.7, "Command Reference" for detailed information on debugger commands. EPSOn S5U1C17001C ManUal 11-67 (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 695 11 OTHEr TOOlS THIS PAGE IS BLANK. EPSOn 11-68 S5U1C17001C ManUal (C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
  • Page 696 Reference S1C17 Family C Compiler Package Quick Reference...
  • Page 697 Memory Map and Trap Table (S1C17 Core) S1C17 Core Memory Map Trap Table Vector address 0xff ffff Reserved Core I/O area 0 (0x00) Reset TTBR + 0x00 1K bytes 1 (0x01) Address misaligned interrupt TTBR + 0x04 0xff fc00 2 (0x02) TTBR + 0x08 0xff fbff CMOS 16-bit Single Chip Microcomputer...
  • Page 698 5-3) Pack the ROM data file and option data file into a sconv32 generator winfog17 mask data file using winmdc17. Motorola S2 Function option file.p file.fd ROM data file document file 5-4) Submit the created data file to Seiko Epson. Mask data checker winmdc17 Mask file.P data file SEIKO EPSON...
  • Page 699 GNU17 IDE (1) Development Tools Overview Start-up Command The GNU17 IDE provides an integrated development environment that eclipse allows the user to easily develop software with the S1C17 Family C Compiler Package (S5U1C17001C). Editor Create new directory/file Search Navigate Build Launch Select Edits text files such as C sources and assembler sources.
  • Page 700 GNU17 IDE (2) Development Tools Menu Bar Menu Bar [File] menu [Edit] menu New (Alt+Shift+N) Creates a new project, a new file and a Find/Replace... (Ctrl+F) Finds and replaces a string in new directory. the editor. Open File... Choose a file to be opened with the editor. Find word Searches for the next occurrence matching the Close (Ctrl+W) Closes the current active file.
  • Page 701 GNU17 IDE (3) Development Tools Menu Bar Menu Bar [Navigate] menu [Project] menu Go Into Changes display of the [C/C++ Projects]/[Navigator] view Build All (Ctrl+B) Executes a build process on all projects open to display the content of just the currently selected directory. in the [C/C++ Projects]/[Navigator] view.
  • Page 702 GNU17 IDE (4) Development Tools Menu Bar [Help] menu Help Contents Displays Help files. Search Displays a search view for help topics. Dynamic Help Displays the help topic related to the view currently activated. Key Assist... (Ctrl+Shift+L) Displays the list of currently available menu commands.
  • Page 703 GNU17 IDE (5) Development Tools Editor Area The area of the editor where you edit source code. The IDE opens the C editor or the assembler editor according to the file type to be edited. Error marker Bookmark marker Reference Task marker Marker bar Editing area...
  • Page 704 GNU17 IDE (6) Development Tools [C/C++ Projects] View [Navigator] View Lists the projects present in the workspace along with the C and assembler sources, include files, Lists the directories and files present in the workspace. (The type of file to be displayed can be and generated execution format object files included in these projects.
  • Page 705 GNU17 IDE (7) Development Tools [Outline] View [Make Target] View Shows the functions and global variables that are written in the C source being displayed in the When using a makefile you created, specify a target to execute. editor. Clicking on one of these items allows you to jump to the position in the editor at which the function or variable is written.
  • Page 706 GNU17 IDE (8) Development Tools [Console] View Enable other view while the Displays the executed command line or the messages output by the GNU17 tools. [Console] view is displaying messages. Clear the contents displayed Switching [Console] Automatic scroll lock Opens a new [Console]. Reference [Problems] View Shows the errors that occurred during a build operation.
  • Page 707 GNU17 IDE (9) Development Tools [Properties] View Displays information on the resource or member currently selected in the [C/C++ Projects], the [Navigator], or the [Outline] view. Reference Item Set values/contents [Search] View Shows the result of a search that was performed using the [Search] dialog box. This view in the initial IDE configuration is not displayed.
  • Page 708 GNU17 IDE (10) Development Tools [Bookmarks] View Shows the bookmarks registered in the editor, letting you jump to a bookmark or delete a bookmark. Menu Reference Bookmark name/description Bookmark set locations (file/directory/line number) [Tasks] View Shows the tasks (To-Do) registered in the editor, letting you jump to or delete a task. Menu Completion mark (check) display Priority...
  • Page 709 C Compiler xgcc Development Tools Outline Start-up Command This tool is made based on GNU C Compiler and is compatible with ANSI C. This xgcc <options> <filename> tool invokes cpp.exe and cc1.exe sequentially to compile C source files to the <filename>...
  • Page 710 Assembler as (1) Development Tools Outline Start-up Command This tool assembles assembly source files output by the C compiler and converts as <options> <filename> the mnemonics of the source files into object codes (machine language) of the <filename> Assembly source file name S1C17.
  • Page 711 Assembler as (2) Development Tools Error/Warning Messages Error messages Warning messages Unrecognized opcode: 'XXXXX' The operation code XXXXX is undefined. Unrecognized .section attribute: The section attribute is not a, w or x. junk at end of line: 'XXXXX A format error of the operand. want a, w, x XXXXXX: invalid register name The specified register cannot be used.
  • Page 712 Linker ld (1) Development Tools Outline Start-up Command Defines the memory locations of object codes created by the C compiler and ld <options> <filename> assembler, and creates executable object codes. This tool puts together multiple <filename> Object and library files to be linked objects and library files into one file.
  • Page 713 Linker ld (2) Development Tools Default linker script file generated by the IDE .vector 0x008000 : __START_vector = . ; /* Linker Script file generated by Gnu17 Plug-in for Eclipse */ boot.o(.rodata) OUTPUT_FORMAT("elf32-c17", "elf32-c17", "elf32-c17") OUTPUT_ARCH(c17) __END_vector = . ; SEARCH_DIR(.);...
  • Page 714 <options> comes with a simulating function that allows you to perform debugging on a Example: gdb -x sample.cmd --cd=/cygdrive/c/EPSON/gnu17/sample personal computer. gdb.exe supports Windows GUI. Commands that are used frequently, such as break and step, are registered on the tool bar, minimizing the Command-line Options necessary keyboard operations.
  • Page 715 Debugger gdb (2) Development Tools Windows Combo box to display and search source file names Pull-down list for selecting a display mode (SOURCE/ASSEMBLY/MIXED/SRC+ASM) User defined button Forced break Reset button Current PC address and source line number button Combo box to display and search Program Connect mode and CPU type function names...
  • Page 716 Debugger gdb (3) Development Tools Menus Menus [Source] window [Source] window [File] menu Open... Executes the file command after selecting an elf object file. Next Asm Inst Issues the nexti command to execute one Close Closes the elf object file currently opened. instruction step of the target program at the current PC address.
  • Page 717 Debugger gdb (4) Development Tools List of Shortcut Keys Allowed in the gdb Main Screen Menus Executes the step command in Source or SRC+ASM display mode [Breakpoints] window (otherwise, stepi). [Global] menu Executes the next command in Source or SRC+ASM display mode Disable All Disables all the PC breakpoints that have been set.
  • Page 718 Debugger gdb (5) Development Tools Debug Commands Memory operation Break c17 fb addr1 addr2 data Fill memory area (8 bits) ICD Mini/SIM break [addr] Set software PC breakpoint ICD Mini/SIM c17 fh addr1 addr2 data tbreak [addr] Fill memory area (16 bits) ICD Mini/SIM Set temporary software PC breakpoint ICD Mini/SIM...
  • Page 719 Debugger gdb (6) Development Tools Debug Commands Status and Error Messages Profiler/coverage Status messages c17 profilemd Profile/coverage mode setting Breakpoint #, function at file:line Made to break at the set breakpoint. c17 profile Display of profile window Break by accessing no map. Made to break by the accessing of an unmapped c17 coverage Display of coverage window...
  • Page 720 It is not c17 architecture ELF file. The file specified with the file command is not an or until command. executed. elf format file supported in S5U1C17001C. Cannot measure clock timer. The program execution time cannot be measured as Load end address max(0x#) overflow.
  • Page 721 Emulation Library libgcc.a (libgccM.a / libgccMD.a) (1) Library Floating-point Calculation Functions Floating-point Data Format Double-type operation Double-type data format __adddf3 Addition x ← a + b x ← a - b __subdf3 Subtraction Exponent part Fixed-point part x ← a * b __muldf3 Multiplication x ←...
  • Page 722 Emulation Library libgcc.a (libgccM.a / libgccMD.a) (2) Library Integral Calculation Functions long long Type Calculation Functions Integral calculation long long type calculation __divsi3 Signed 32-bit integral division x ← a / b __muldi3 Signed 64-bit multiplication x ← a * b x ←...
  • Page 723 ANSI Library libc.a (1) Library Input/Output Functions Utility Functions (header file: stdio.h) (header file: stdlib.h) ∗1, ∗2 ∗1 fread( ) size_t fread(void *ptr, size_t size, size_t count, FILE *stream); malloc( ) void *malloc(size_t size); size_t fwrite(const void *ptr, size_t size, size_t count, FILE *stream); ∗1, ∗2 ∗1 fwrite( ) calloc( )
  • Page 724 ANSI Library libc.a (2) Library Mathematical Functions Character Functions (header file: math.h, errno.h, float.h, limits.h) (header file: string.h) ∗1 fabs( ) double fabs(double x); memchr( ) void *memchr(const void *s, int c, size_t n); ∗1 ceil( ) double ceil(double x); memcmp( ) int memcmp(const void *s1, const void *s2, size_t n);...
  • Page 725 Instruction List (1) Assembly Programming Bit Field Symbols in the Instruction List (X): Bit X of data. Registers/Register Data (X:Y): A bit field from bit X to bit Y. {X, Y···}: Indicates a bit (data) configuration. %rd, rd: A general-purpose register (R0—R7) used as the destination register or its contents %rs, rs: A general-purpose register (R0—R7) used as the source register or its contents Functions...
  • Page 726 Instruction List (2) Assembly Programming Mnemonic Flags Classification Function Opcode Operand Signed 8-bit data ld.b %rd, %rs rd(7:0)←rs(7:0), rd(15:8)←rs(7), rd(23:16)←0 – – – – – – transfer %rd, [%rb] rd(7:0)←B[rb], rd(15:8)←B[rb](7), rd(23:16)←0 – – – – – – %rd, [%rb]+ rd(7:0)←B[rb], rd(15:8)←B[rb](7), rd(23:16)←0, rb(23:0)←rb(23:0)+1 –...
  • Page 727 Instruction List (3) Assembly Programming Mnemonic Flags Classification Function Opcode Operand 16-bit data %rd, %rs rd(15:0)←rs(15:0), rd(23:16)←0 – – – – – – transfer %rd, sign7 rd(6:0)←sign7(6:0), rd(15:7)←sign7(6), rd(23:16)←0 – – – – – – %rd, [%rb] rd(15:0)←W[rb], rd(23:16)←0 – –...
  • Page 728 Instruction List (4) Assembly Programming Mnemonic Flags Classification Function Opcode Operand 32-bit data ld.a [%rb], %rs A[rb](23:0)←rs(23:0), A[rb](31:24)←0 – – – – – – transfer [%rb]+, %rs A[rb](23:0)←rs(23:0), A[rb](31:24)←0, rb(23:0)←rb(23:0)+4 – – – – – – [%rb]-, %rs A[rb](23:0)←rs(23:0), A[rb](31:24)←0, rb(23:0)←rb(23:0)-4 –...
  • Page 729 Instruction List (5) Assembly Programming Mnemonic Flags Classification Function Opcode Operand ↔ ↔ ↔ ↔ Arithmetic %rd, %rs rd(15:0)←rd(15:0)+rs(15:0), rd(23:16)←0 – – ↔ ↔ ↔ operation add/c %rd, %rs rd(15:0)←rd(15:0)+rs(15:0), rd(23:16)←0 if C = 1 (nop if C = 0) –...
  • Page 730 Instruction List (6) Assembly Programming Mnemonic Flags Classification Function Opcode Operand Arithmetic ssub.a %rd, imm20 rd(23:0)←rd(23:0)-imm20(with zero extension) – – – – – – – operation %sp, imm20 sp(23:0)←sp(23:0)-imm20(with zero extension) – – – – – – – xsub.a %rd, imm24 rd(23:0)←rd(23:0)-imm24 –...
  • Page 731 Instruction List (7) Assembly Programming Mnemonic Flags Classification Function Opcode Operand ↔ ↔ Logic %rd, %rs d(15:0)←rd(15:0) | rs(15:0), rd(23:16)←0 – – – ↔ ↔ operation or/c %rd, %rs rd(15:0)←rd(15:0) | rs(15:0), rd(23:16)←0 if C = 1 (nop if C = 0) –...
  • Page 732 Instruction List (8) Assembly Programming Mnemonic Flags Classification Function Opcode Operand Branch jrge / jrge.d sign7 pc←pc+2+sign8 if !(N^V) is true; sign8={sign7,0} – – – – – – – sjrge / sjrge.d label±imm20 pc←label±imm20 if !(N^V) is true – – –...
  • Page 733 Instruction List (9) Assembly Programming Mnemonic Flags Classification Function Opcode Operand Branch jreq / jreq.d sign7 pc←pc+2+sign8 if Z is true; sign8={sign7,0} – – – – – – – sjreq / sjreq.d label±imm20 pc←label±imm20 if Z is true – – –...
  • Page 734 Instruction List (10) Assembly Programming Mnemonic Flags Classification Function Opcode Operand Conversion cv.ab %rd, %rs rd(23:8)←rs(7), rd(7:0)←rs(7:0) – – – – – – cv.as %rd, %rs rd(23:16)←rs(15), rd(15:0)←rs(15:0) – – – – – – cv.al %rd, %rs rd(23:16)←rs(7:0), rd(15:0)←rd(15:0) – –...
  • Page 735 Expansion Format of Extended Instructions (1) Assembly Programming Extended instruction Expansion format Opcode Operand Condition 1 Condition 2 Condition 3 sld.b %rd, [%sp+imm20] imm20≤0x7f 0x7f<imm20 – sld.ub ld.b %rd, [%sp+imm20(6:0)] imm20(19:7) ld.b %rd, [%sp+imm20(6:0)] sld.a Example) sld.b %rd, [%sp+imm20] %rd, [imm20] imm20≤0x7f 0x7f<imm20 –...
  • Page 736 Expansion Format of Extended Instructions (2) Assembly Programming Extended instruction Expansion format Opcode Operand Condition 1 Condition 2 Condition 3 sld.a %rd, symbol±imm20 Unconditional – – (symbol+imm20)(19:7) ld.a %rd, (symbol+imm20)(6:0) Example) sld.a %rd, symbol+imm20 %sp, symbol±imm20 Unconditional – – (symbol-imm20)(19:7) ld.a %sp, (symbol-imm20)(6:0) Example) sld.a %sp, symbol-imm20...
  • Page 737 Expansion Format of Extended Instructions (3) Assembly Programming Extended instruction Expansion format Opcode Operand Condition 1 Condition 2 Condition 3 xld.a %rd, imm24 imm24≤0x7f 0x7f<imm24≤0xfffff 0xfffff<imm24 ld.a %rd, imm24(6:0) imm24(19:7) imm24(23:20) ld.a %rd, imm24(6:0) imm24(19:7) ld.a %rd, imm24(6:0) Example) xld.a %rd, imm24 %sp, imm24 imm24≤0x7f 0x7f<imm24≤0xfffff...
  • Page 738 Expansion Format of Extended Instructions (4) Assembly Programming Extended instruction Expansion format Opcode Operand Condition 1 Condition 2 Condition 3 xadd.a %rd, imm24 imm24≤0x7f 0x7f<imm24≤0xfffff 0xfffff<imm24 xsub.a sub.a %rd, imm24(6:0) imm24(19:7) imm24(23:20) sub.a %rd, imm24(6:0) imm24(19:7) sub.a %rd, imm24(6:0) Example) xsub.a %rd, imm24 %sp, imm24 imm24≤0x7f 0x7f<imm24≤0xfffff...
  • Page 739 Expansion Format of Extended Instructions (5) Assembly Programming Extended instruction Expansion format Opcode Operand Condition 1 Condition 2 Condition 3 scall label±imm20 Unconditional – – scall.d (label+imm20)(19:12) sjpr call (label+imm20)(11:1) sjpr.d Example) scall label+imm20 sign20 -1024≤sign20≤1023 sign20<-1024 or 1023<sign20 – sign20(11:1) sign20(19:12) sign20(11:1)
  • Page 740 Expansion Format of Extended Instructions (6) Assembly Programming Extended instruction Expansion format Opcode Operand Condition 1 Condition 2 Condition 3 xjr∗1 label±imm24 Unconditional – – xjr∗1.d (label+imm24)(23:21) (label+imm24)(20:8) jreq (label+imm24)(7:1) Example) xjreq label+imm24 sign24 -128≤sign24≤127 -1048576≤sign24<-128 or 127<sign24≤1048575 sign24<-1048576 or 1048575<sign24 jrne sign24(7:1) sign24(20:8)
  • Page 741 20/F, Harbour Centre, 25 Harbour Road, Wanchai, Hong Kong Phone: +852-2585-4600 FAX: +852-2827-4346 Telex: 65542 EPSCO HX EPSON TAIWAN TECHNOLOGY & TRADING LTD. 14F, No. 7, Song Ren Road, Taipei 110, TAIWAN Phone: +886-2-8786-6688 FAX: +886-2-8786-6660 EPSON SINGAPORE PTE., LTD.
  • Page 742 S5U1C17001C Manual (C Compiler Package for S1C17 Family) (Ver. 1.5.0) SEMICONDUCTOR OPERATIONS DIVISION EPSON Electronic Devices Website http://www.epson.jp/device/semicon_e Document code: 411086605 First Issue September, 2007 Revised January 2009, Japan...

Table of Contents