Cmos 16-bit single chip microcontroller (312 pages)
Summary of Contents for Epson S5U1C17001C
Page 1
CMOS 16-BIT SINGLE CHIP MICROCONTROLLER (C Compiler Package for S1C17 Family) (Ver. 3.2) S5U1C17001C Manual Rev.1.0...
Page 2
2. This evaluation board/kit or development tool is intended for use by an electronics engineer and is not a consumer product. The user should use it properly and in a safe manner. Seiko Epson dose not assume any responsibility or liability of any kind of damage and/or fire coursed by the use of it. The user should cease to use it when any abnormal issue occurs even during proper and safe use.
Page 3
General Source Files GNU17 IDE C Compiler Library Assembler Linker Debugger Creating Data to Be Submitted 10 Other Tools 11 Quick Reference...
Page 4
This document describes the development procedure from compiling C source files to debugging and creating the PA file (Data to be submitted) 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 5
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 ICDmini (S5U1C17001H). S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
3.6.2 Setting Standard Input/Output .................... 3-18 3.6.3 Using the Debugger ......................3-19 3.6.4 Setting the Debug Configuration ..................3-20 Files Generated in a Project by the IDE....................3-21 4 C Compiler ............................... 4-1 S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Integrated development environment for Windows Designed to run under Microsoft Windows, the GNU17 IDE is a seamless integrated development environment suitable for a wide range of development tasks, from source creation to debugging. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
"readmeVxxx.txt" (xxx indicates version) on the disk. Note: 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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
The recommended tab stop is every 4 characters. This is the default tab setting when the IDE displays sources. EOF 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). S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
→ warning:integer constant is too large for “long” type Ll_val = 0x1234567812345678LL; → OK Type wchar_t is the data type needed to handle wide characters. This data type is defined in stdlib.h/stddef.h as the type unsigned short. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
For details about the functions included in the libraries, refer to Chapter 5, "Library". 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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
(details below). 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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 19
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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 20
An actual address value will be determined in the linking process. Restrictions 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. ;Error Example: FOO: 1label: 0_ABC: _Abcd: S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 21
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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
"0b" cannot be followed by characters other than 0 or 1. Specified ranges of values The size (specified range) of immediate data varies with each instruction. The specifiable ranges of different immediate data are given below. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 23
%rd,LABEL ← LABEL = sign7 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 S5U1C17001C Manual Seiko Epson Corporation 2-10 (Rev. 1.0)
Note: 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.) S5U1C17001C Manual Seiko Epson Corporation 2-12...
→ A function name can be used to assign the pointer to the short type local variable s_local_val. 4) long l_local_val = (long)boot; → A function name can be used to assign the pointer to the long type local variable l_local_val. S5U1C17001C Manual Seiko Epson Corporation 2-13...
Page 27
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. S5U1C17001C Manual Seiko Epson Corporation 2-14 (Rev. 1.0)
Page 28
*p2 = (short *)&p1 ; Because p2 and &p1 are incompatible pointers, a warning message will appear. In that case, variable p1 may not be referenced by means of pointer p2 or assignment may not be performed correctly. S5U1C17001C Manual Seiko Epson Corporation 2-15...
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). This IDE combines the Eclipse IDE for C/C++ Developers package with the functions required for S1C17 program development (simply “GNU17-specific plug-ins”...
The method for starting the IDE is described below. Double-click the eclipse.exe icon in the C:\EPSON\GNU17V3\eclipse directory to start the IDE. You can also start the IDE by selecting [EPSON MCU] > [GNU17V3] > [GNU17V3 IDE] from the Windows Start menu, or from the command line without parameters.
If you do not find the intended target CPU in the list, obtain the model-specific information file (gnu17_mcu_model_xxx.zip) by visiting the Seiko Epson website or contacting the Seiko Epson sales operations. (7) From the [Memory Model] combo box, select the memory model of the target.
(6) You can also select and import folders. Importing folders also imports the directory configuration within the folder. (Only files within the selected folder are imported.) (7) Click [Finish]. (8) The imported file will appear in [Project Explorer] view. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
_vector08_handler(void) __attribute__((alias("sampleInterrupt"))); This description defines the _vector08_handler with the alias sampleInterrupt. The sampleInterrupt function is an interrupt handler function and must have a prototype declaration as shown below: void sampleInterrupt(void) __attribute__((interrupt_handler)); S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
However, if the project is configured with exclusive include search paths and library paths in the build options, you may have to modify these paths after importing the project. S5U1C17001C Manual Seiko Epson Corporation...
If gdbsim.ini includes the c17 ttbr command, edit this so that it points to the interrupt vector table. For example, if the interrupt vector table is the vector array, write this as c17 ttbr &vector. (7) Build the project. Build the project and check the build results in the [Console] view. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Data reading is prohibited. However, the CPU can execute commands. Read protect : OFF Data reading is allowed. Write protect : ON Data writing is prohibited. Write protect : OFF Data writing is allowed. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
To use flash security, set the startup option to be handed to winmdc17. GNU17_SECURITY_KEY Startup option Meaning Flash security version A value dependent on GNU17_MODEL is set. Normally, you should leave this unchanged. Sets the flash security password. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 38
When using flash protection, set the character string ("_ptd") to be added to the file name of the ROM data (PSA file) protected. Cygwin setting CYGWIN Set "nodosfilewarning" to hide the file path format warning output by Cygwin. S5U1C17001C Manual Seiko Epson Corporation 3-10 (Rev. 1.0)
The optimization options available will differ for each C compiler. Refer to Section 4.3.2, “Command-line Options” for more information on optimization. Miscellaneous Select other compiler options from this page. [Other flags] (default: -c –mpointer${GCC17_POINTER} –B${GCC17_LOC}) A compiler flag can be added. S5U1C17001C Manual Seiko Epson Corporation 3-11 (Rev. 1.0)
Select C/C++ Build > Settings > [Tool Settings] > [Cross GCC Assembler] from the [Properties] dialog box and set the assembler command options. For more information on options, refer to Chapter 6, “Assembler.” Note: When the IDE assembles the assembler source, the assembler is launched using xgcc (-c S5U1C17001C Manual Seiko Epson Corporation 3-12...
Page 41
-xassembler-with-cpp option specification) to process using the C preprocessor. General [Assembler flags] (default: -B${GCC17_LOC} –c –mpointer${GCC17_POINTER} –x assembler-with-cpp –Wa,--gstabs) Assembler flags can be added. [Include paths] (default: ../inc) Set the search path for the include file. S5U1C17001C Manual Seiko Epson Corporation 3-13 (Rev. 1.0)
Specify a linker script using the -T option. If no linker script is specified, linking will use the default linker script. Example: To specify the linker script file elf32c17.x in the project folder -T ../elf32c17.x S5U1C17001C Manual Seiko Epson Corporation 3-14...
(1) Select the project you want to execute “clean” in the [Project Explorer] view. (2) Select [Clean Project] from the context menu in the [Project Explorer] view. In this case, no dialog boxes are displayed, and the “clean” process only is executed. S5U1C17001C Manual Seiko Epson Corporation 3-15...
In the event of analysis failure A group of functions not linked to [Stack Size of Unsolved Functions and its Callees] are displayed. The following message appears: Note: This program contains some unsolved calls. S5U1C17001C Manual Seiko Epson Corporation 3-16...
If you use the ICDmini for debugging, edit the gdbminix.ini GDB command file corresponding to the ICDmini in the project, and specify the target model. With the c17 model_path command, specify the MCU model information folder. If GNU17 is installed in c:\EPSON\GNU17V3, specify as follows: c17 model_path c:/EPSON/GNU17V3/mcu_model With the c17 model command, specify the target model.
# Please uncomment following commented out lines to enable STDOUT while debugging. c17 stdout 1 WRITE_FLASH WRITE_BUF # Please uncomment following commented out lines to enable STDIN while debugging. c17 stdin 1 READ_FLASH READ_BUF Note: Enabling this function occupies one hardware breakpoint. S5U1C17001C Manual Seiko Epson Corporation 3-18 (Rev. 1.0)
Allows the CPU register values to be checked and modified. Variables Allows the variables to be checked and modified. Local variables are displayed automatically, depending on program execution status. Global variables are displayed if they are registered. S5U1C17001C Manual Seiko Epson Corporation 3-19 (Rev. 1.0)
[Source Lookup Path] Specify the search path for the source file used for symbolic debugging. The project folder is the default location of the source file, and the GNU17 library source code is set by default. S5U1C17001C Manual Seiko Epson Corporation 3-20...
× × \Debug\gpdata.bin Gang Programmer user setting/program data file \Debug Object file × × \<project name>.o The files in the “File management required” column must be managed using a source management application. S5U1C17001C Manual Seiko Epson Corporation 3-21 (Rev. 1.0)
Assembly source file File format: Text file File name: <filename>.s An assembly source file to be input to the as assembler. This file is generated when the -S option is specified. Description: S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
File search is performed in order of priorities, i.e., current directory, -B option, and PATH in that order. Default: The xgcc C compiler searches sub-programs in the current directory and the PATH directory. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 52
Code is compiled unchanged, generating unnecessary code as well, including code that assigns values to local variables that are never referenced. While the values of the variables loaded in registers will not be reused, local variables that are declared as registered will be optimized and deleted, as needed. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 53
-mrelax Output code size optimization Function: Description: Specifying the -mrelax option optimizes output code size by deleting the ext 0 instruction when linking. Default: The ext 0 instruction is not deleted when linking. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 54
Outputs a warning when a static function is declared but not defined. Also outputs a warning when a static function that is not inline is defined but not used. "-Wunused-label" Outputs a warning when a label is declared but not used. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 55
• Be sure to specify one of the -S, -E or -c options when invoking xgcc. If none is specified, xgcc continues processing until the linkage stops. Thus, the necessary linker options must also be specified. S5U1C17001C Manual Seiko Epson Corporation...
Example: int i; .global .section .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/-g option is specified). S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
When 4-byte boundary type is not contained: 2-byte boundary When the number of elements is 1: Store position for data type Array When 4-byte boundary type is contained: 4-byte boundary When the number of elements is 2 or more: 4-byte boundary S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 58
The C compiler in this package is adjusted to yield even-number bytes for the size of a structure or union as an implementation defined feature. Accessing bit fields Bit fields are accessed using the size corresponding to the type defined. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
If the registers for passing argument (%r0 to %r3) cannot be used, the values of the structure members are passed through the stack. When an argument is a structure larger than 64 bits, the values of the structure members are passed through the stack. S5U1C17001C Manual Seiko Epson Corporation 4-11...
If there are any local variables defined in the called function that cannot be stored in registers, an area is allocated in the stack frame. This area is not allocated if there is no local variable that needs to be saved in the stack. S5U1C17001C Manual Seiko Epson Corporation 4-12...
C language specifications permit implementation-defined adjustment of the method of configuring member variables of a structure or union. 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. S5U1C17001C Manual Seiko Epson Corporation 4-13 (Rev. 1.0)
For detailed information on known issues and limitations concerning the C compiler, refer to: readmeVxxx.txt in this package or the release history (GNU17v3_release_history_e.pdf). • For information on the C99 standard supported by the C compiler, visit the site below. http://gcc.gnu.org/c99status.html S5U1C17001C Manual Seiko Epson Corporation 4-15 (Rev. 1.0)
24-bit memory model libraries for models with COPRO2 \lib\MD2\16bit 16-bit memory model libraries for models with COPRO2 Link the 16-bit libraries with the application program when the -mpointer16 option is specified in the C compiler and assembler. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Set the stack pointer initial value to a value appropriate for the target model of the program. The linker script definition will be used if this is not set. The default linker script definition will be used if no linker script is specified. S5U1C17001C Manual Seiko Epson Corporation...
Permit interrupts using ei instruction. int main (void) (None) void _stop_device (void) Prevent interrupts using di instruction. void _exit (int) The argument is the value returned by the main function. Continue as an infinite loop. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
The registers %r0 to %r7 are used. 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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
The comparison function changes the C, V, Z or N flag of the PSR depending on the result of op1 - op2 (a-b), as shown below. Other flags are not changed. Comparison result op1 > op2 op1 = op2 op1 < op2 S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 71
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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
*1 The integer comparison function and the long long comparison function return the following values based on the result of op1 – op2. op1 > op2 → 2 op1 = op2 → 1 op1 < op2 → 0 S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
_iob , and call write function. count, FILE *stream); stdout. int fgetc(FILE *stream); Conditional Refer to global variables stdin and Input one character from _iob , and call read function. stdin. S5U1C17001C Manual Seiko Epson Corporation 5-11 (Rev. 1.0)
Page 76
Note: 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 5.4.4 for more information. S5U1C17001C Manual Seiko Epson Corporation 5-12 (Rev. 1.0)
Page 77
The table below lists the non-local branch functions included in libc.a. Table 5.4.2.3 Non-local branch functions Header file: setjmp.h Function Functionality Reentrant Notes int setjmp(jmp_buf env); Non-local branch Reentrant: void longjmp(jmp_buf env, int status); Non-local branch Reentrant: S5U1C17001C Manual Seiko Epson Corporation 5-13 (Rev. 1.0)
Address pointer to indicate the beginning of the next new area mapped unsigned char *ansi_ucTblPtr; Address pointer to indicate the beginning of the next management area mapped unsigned long ansi_ulRow; Line pointer to indicate the next management area mapped S5U1C17001C Manual Seiko Epson Corporation 5-17 (Rev. 1.0)
Binary file in elf format File name: <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). S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
The assembler generates object files for the 24-bit pointer mode (16MB memory model). 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 S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
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. S5U1C17001C Manual Seiko Epson Corporation...
Instruction format .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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
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 S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
.align VAR2: .skip Defines the 4-byte global variable VAR2. • Areas in .bss sections can be secured using the .skip directive. The .space directive cannot be used because it has an initial data. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
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. .zero (= .space 4,0x0) S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
This directive secures a <length> bytes of blank area in the current .bss section. The area begins from the current address unless it is immediately preceded by the .align directive. .section .bss Example: .global VAR1 .align VAR1: .zero Secures an space for the 4-byte global variable VAR1. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
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. S5U1C17001C Manual Seiko Epson Corporation 6-10 (Rev.
Makes global declaration of a symbol. The declaration made in a file with a symbol defined converts that symbol to a global symbol which can be referred to from other modules. Example:.global SUB1 Note The symbols are always defined as a local symbol unless it is declared using this directive. S5U1C17001C Manual Seiko Epson Corporation 6-11 (Rev. 1.0)
Defines the symbol DATA1 that represents absolute address 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. S5U1C17001C Manual Seiko Epson Corporation 6-12 (Rev. 1.0)
Expanded into the adc instruction sadd.a, xadd.a Expanded into the add.a instruction ssub, xsub Expanded into the sub instruction ssbc, xsbc Expanded into the sbc instruction ssub.a, xsub.a Expanded into the sub.a instruction S5U1C17001C Manual Seiko Epson Corporation 6-13 (Rev. 1.0)
(e.g. .byte 0x100000012 → .byte 0xff ) Warning: operand out of range The value specified in the operand is out of the effective ( XXXXXX : XXX not between AAA and BBB ) range. S5U1C17001C Manual Seiko Epson Corporation 6-27 (Rev. 1.0)
To prevent errors during linkage, be sure to write the .section directive with the .align directive to clearly define the section boundary. Example: .section .rodata ; ←Essential .align 2 .long data1 .long data2 S5U1C17001C Manual Seiko Epson Corporation 6-28 (Rev. 1.0)
Text file File name: <filename>.map Description: Mapping information file showing from which address of a section each input file was mapped. The file is delivered when the -M or -Map option is specified. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
The linker does not delete the ext 0 instruction. 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 S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 118
A program cache for high-speed program execution is realized in this method. The .text sections in other files than these three files are located in the .text section that follows the .vector section and are executed at the stored address in the ROM. S5U1C17001C Manual Seiko Epson Corporation...
Object files created in 16-bit pointer mode and object files Cannot link 16bit object <objectfile16> [included from created in 24-bit pointer mode cannot be linked. <archivefile16> ] with 24bit object <objectfile24> [included from <archivefile24> ] S5U1C17001C Manual Seiko Epson Corporation 7-11 (Rev. 1.0)
Close the linker script generation wizard by one of the following methods: Click the [Finish] button. In this case, a linker script file will be created. Click the [Cancel] button. In this case, no linker script file will be generated. S5U1C17001C Manual Seiko Epson Corporation 7-12...
(NOLOAD). OVERLAY setting This section is overlay To set the section as an OVERLAY section, select the checkbox. (Option) section (OVERLAY). The section will be combined as an OVERLAY section. S5U1C17001C Manual Seiko Epson Corporation 7-13 (Rev. 1.0)
Page 125
To set the section as a KEEP section, select the checkbox. (Option) eliminated (KEEP). For definitions that cannot be defined using the wizard, open and edit the generated linker script file in an editor. S5U1C17001C Manual Seiko Epson Corporation 7-14 (Rev. 1.0)
24-bit limit (0xffffff) or lower than 0x0, the address bits that exceed 24 bits are masked with 0 and no error occurs. xadd.a %r0,symbol-5 Example: 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". S5U1C17001C Manual Seiko Epson Corporation 7-15 (Rev. 1.0)
This object file does not contain debug information created from an object file (.elf). Source level debugging is not performed for ROM data, since debugging information is not included. It is used with the load command to load programs and data to target MCU memory. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
File format: Text file File name: gdb.txt Description: The commands executed and execution results are output to this file. Output by executing the set logging on command within the startup command file. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Simulator (SIM) mode In simulator mode, target program execution is simulated in the internal memory of a personal computer. No other tools are required. Note that ICDmini-dependent functions cannot be used in this mode. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Explanation: This option can be used to specify debugger operations corresponding to MCU models. To load a program to the Flash ROM inside the MCU, either specify this option or execute the c17 model command. Loading to the Flash ROM is not possible unless you specify the MCU model. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Example of a command file Only one command can be written per line. Example: c17 model_path c:/EPSON/GNU17V3/mcu_model Specifies the model-specific information file directory. 17 model 17W23@NOVCCIN Specifies the model name. (Voltage level 3.3 V) target icd icdmini3 Connects the target MCU.
Note: When using an ICDmini to debug a program, always be sure to close the debugger before turning off power to the ICDmini. Should you turn off power to the ICDmini while running the debugger, you will be unable to reconnect it. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
If you have entered an incorrect command by mistake, use the arrow (←, →), [Backspace], or [Delete] keys to correct it. When you have finished entering a command, press the [Enter] key to execute the command. Example: (gdb) continue (entry of command only) (gdb) target icd icdmini3 (entry of command and parameters) S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Only characters 'a' to 'z,' 'A' to 'Z,' 0 to 9, /, and _ can be used. Drive names must be specified in /<drive name>/format, with / instead of \ used for delimiting the path. Example: (gdb) file /c/EPSON/gnu17v3/sample/txt/sample.elf S5U1C17001C Manual Seiko Epson Corporation (Rev.
Display breakpoint list ○ ○ commands Set command to execute at break ○ ○ Symbol information info locals Display local symbol ○ ○ info var Display global symbol ○ ○ print Alter symbol value S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Notes 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. S5U1C17001C Manual Seiko Epson Corporation 8-10 (Rev. 1.0)
(gdb) x /4w 0x0 (memory dump command) 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.) S5U1C17001C Manual Seiko Epson Corporation 8-11 (Rev. 1.0)
Page 138
For example, when data 0x100 is specified in c17 fb, it is processed as 0x00. If the end address is smaller than the start address, an error is assumed. S5U1C17001C Manual Seiko Epson Corporation 8-12...
When Size is specified but Length omitted, one unit of data equal to the specified data size is displayed. The letter i is a symbol defined at address 0x0. If any address other than the address at the beginning of a variable, etc. is specified, <symbol+offset> is displayed as the symbol. S5U1C17001C Manual Seiko Epson Corporation 8-13...
Page 140
If the specified address exceeds the 24-bit range, an error is assumed. An error does not occur even if a value of 2147483648 or greater is specified for Length. The value for Length is set to 2147483647. S5U1C17001C Manual Seiko Epson Corporation 8-14...
Page 141
Data parameters are only effective for the 8 low-order bits for set {char}, 16 low-order bits for set {short} and set {int}, and 32 low-order bits for set {long}, with excessive bits being ignored. For example, when data 0x100 is specified in set {char}, it is processed as 0x00. S5U1C17001C Manual Seiko Epson Corporation 8-15...
Therefore, data is always copied even when the specified destination address exists within the source area. If the end address at the destination exceeds 0xffffff, data is only copied only up to 0xffffff. S5U1C17001C Manual Seiko Epson Corporation 8-16...
In Motorola S3 format, data is output 32 bytes per line. If one line is less than 32 bytes, the number of bytes for the address range specified will be written. (Contents of dump.mot) S3250008000094D4BA020FCA086120800961881C6F0AA4D4BA020FCA086120800961881C6F0AA8 S3250008002008D3730A00000000000000000000000008D3730A09CA026139A505610CD309613F S30800080100A4D5BABB S70500000000FA S5U1C17001C Manual Seiko Epson Corporation 8-17 (Rev. 1.0)
Page 144
If no Append parameters exist or the parameter 'f' is specified, a footer record is output to a Motorola S3 format file. Notes 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. S5U1C17001C Manual Seiko Epson Corporation 8-18 (Rev. 1.0)
1184810 0xaaaaaa 1184810 0x7f8 2040 0xc00030 12582960 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. S5U1C17001C Manual Seiko Epson Corporation 8-19 (Rev. 1.0)
Page 146
The contents of the set values are not checked internally. No errors are assumed even when values other than 16-bit or 32-bit boundary addresses are specified for PC or SP, respectively. However, when the registers are actually modified, values are forcibly adjusted to boundary addresses by truncating the lower bits. S5U1C17001C Manual Seiko Epson Corporation 8-20...
If break conditions other than the one that stopped the target program must be ignored a specified number of times, specify break conditions and the number of times that a break hit is to be ignored in the ignore command. Then execute the continue command without any parameters. S5U1C17001C Manual Seiko Epson Corporation 8-21...
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. S5U1C17001C Manual Seiko Epson Corporation 8-22 (Rev. 1.0)
Page 149
If temporary breakpoints are specified by an address value that exceeds the 24-bit range, an error is assumed. 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. S5U1C17001C Manual Seiko Epson Corporation 8-23...
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 [Suspend] button also releases the CPU from standby mode. S5U1C17001C Manual Seiko Epson Corporation 8-24...
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 [Suspend] button also releases the CPU from standby mode. S5U1C17001C Manual Seiko Epson Corporation 8-25...
Notes 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 [Suspend] button to halt the program. S5U1C17001C Manual Seiko Epson Corporation 8-26 (Rev. 1.0)
Notes 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. S5U1C17001C Manual Seiko Epson Corporation 8-27 (Rev. 1.0)
TARGET resetting ....failure Notes 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. S5U1C17001C Manual Seiko Epson Corporation 8-28 (Rev. 1.0)
Make sure the interrupt number is specified from 0 to 31. If this range is exceeded, an error is assumed. 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. S5U1C17001C Manual Seiko Epson Corporation 8-29...
Notes 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. S5U1C17001C Manual Seiko Epson Corporation 8-30...
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. S5U1C17001C Manual Seiko Epson Corporation 8-31 (Rev.
Page 158
If brk instructions cannot be embedded, hardware PC breaks are set in the same way as for the hbreak/thbreak command. Use the hbreak/thbreak command from the start if you know that brk instructions cannot be embedded. S5U1C17001C Manual Seiko Epson Corporation 8-32...
Page 159
When a hardware break is set at ①, the process stops at ②. After ③ is processed by "next," the process stops at ②. S5U1C17001C Manual Seiko Epson Corporation 8-33 (Rev.
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 thbreak, it is cleared after a break. S5U1C17001C Manual Seiko Epson Corporation 8-34 (Rev.
Page 161
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. An error will occur if an address is specified exceeding 24 bits. S5U1C17001C Manual Seiko Epson Corporation 8-35...
The delete command clears all break settings. To disable a breakpoint temporarily, use the disable or ignore command. Note that specifying a break number not set displays the "No breakpoint number N." message, with no breakpoints being deleted. S5U1C17001C Manual Seiko Epson Corporation 8-36 (Rev. 1.0)
The clear command completely clears break settings. To disable a breakpoint temporarily, use the disable or ignore command. If you specify a function name, line number, or address for which no breakpoints are set, an error is assumed. S5U1C17001C Manual Seiko Epson Corporation 8-37...
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. S5U1C17001C Manual Seiko Epson Corporation 8-38...
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. S5U1C17001C Manual Seiko Epson Corporation 8-39 (Rev. 1.0)
Moreover, the number of times a breakpoint has thus been hit is displayed in "breakpoint already hit N times" format. When breakpoints are not set at any location, the list is displayed as shown below. (gdb) info breakpoints No breakpoints or watchpoints. S5U1C17001C Manual Seiko Epson Corporation 8-40 (Rev. 1.0)
• The command line is not executed when a break occurs using a temporary breakpoint (tbreak, thbreak). • 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. S5U1C17001C Manual Seiko Epson Corporation 8-41...
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. S5U1C17001C Manual Seiko Epson Corporation 8-42 (Rev. 1.0)
Page 169
Even if the value you have specified exceeds the range of values for the type of variable you wish to alter, no errors are assumed. 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. S5U1C17001C Manual Seiko Epson Corporation 8-43...
Once the file command is executed, operation cannot be aborted until the debugger finishes loading the file. An error will occur if an unsupported elf file (with no C17 flag) is specified. S5U1C17001C Manual Seiko Epson Corporation 8-44...
(resets the CPU.) The load command loads only several areas of an object file containing the code and data. All other areas are left intact in the previous state before load command execution. S5U1C17001C Manual Seiko Epson Corporation 8-45...
■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. S5U1C17001C Manual Seiko Epson Corporation 8-46 (Rev. 1.0)
Page 174
This command cannot be used in ICD Mini mode. 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. S5U1C17001C Manual Seiko Epson Corporation 8-48...
(disables log output) Usage example ■Example 1 (gdb) set logging on Outputs a debugger command log. The log is saved as the file gdb.txt. ■Example 2 (gdb) set logging off Disables log output. S5U1C17001C Manual Seiko Epson Corporation 8-50 (Rev. 1.0)
# reset c17 rst From # to the end of the line is interpreted as a comment. (gdb) source src.cmd (gdb) (gdb) file c:/EPSON/gnu17v3/sample/tst/sample.elf (gdb) (gdb) target sim boot () at boot.s:9 Connected to the simulator. Current language: auto; currently asm (gdb) (gdb) load c:/EPSON/gnu17v3/sample/tst/sample.elf...
This command can be used to turn the ICDmini 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. S5U1C17001C Manual Seiko Epson Corporation 8-53...
Directory: Character string used to specify a directory Usage example (gdb) pwd Working directory c:/EPSON/gnu17/sample/tst. (gdb) cd c:/EPSON/gnu17/sample/ansilib Working directory c:/EPSON/gnu17/sample/ansilib. After the current directory is confirmed, it is changed to "c:\EPSON\gnu17\sample\ansilib". S5U1C17001C Manual Seiko Epson Corporation 8-54 (Rev. 1.0)
Usage example (gdb) c17 ttbr 0x8000 Sets address 0x8000 to TTBR. Notes This command can be used only in simulator mode. This command must be executed before the target command. S5U1C17001C Manual Seiko Epson Corporation 8-55 (Rev. 1.0)
The debugger sets the CPU type using either this command or the model information acquired via the c17 model command. If both this command and the c17 model command are executed, the setting for the last command executed takes priority. S5U1C17001C Manual Seiko Epson Corporation 8-56...
1. Overwriting clock control and clock source registers during break 2. Breaking while switching the clock within the target program 3. Step running the clock switching section within the target program In the cases described above, set Mode = 1. S5U1C17001C Manual Seiko Epson Corporation 8-57 (Rev. 1.0)
An error occurs if an undefined version is specified. The password will not be unlocked. An error occurs if invalid characters (non-alphanumeric characters) are specified for the password. The password is not unlocked. S5U1C17001C Manual Seiko Epson Corporation 8-58...
Number of steps to execute (decimal or hexadecimal) One step is assumed if ommitted. Conditions: 1-0x7fffffff example: (gdb)step (gdb)step 10 When you specify a command, a detailed description of that command is displayed. S5U1C17001C Manual Seiko Epson Corporation 8-59 (Rev. 1.0)
Page 186
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. S5U1C17001C Manual Seiko Epson Corporation 8-60...
Page 187
Debugger gdb.exe is normally located in c:\EPSON\GNU17V3, so the setting in this usage example will be the same as when this command is not executed. Settings made by this command are referenced when the c17 model command is executed. If this command is to be executed, be sure to execute before executing the c17 model command.
Parameter 7.5 [V], 7.0 [V] If an invalid value is specified, the operation will be the same as when this option is omitted. Example VPP=7.5; sets the voltage to 7.5 V. S5U1C17001C Manual Seiko Epson Corporation 8-62 (Rev. 1.0)
Page 189
(gdb) c17 model 17W23@FLS=FLS17W23.saf,NOVCCIN (gdb) target icd icdmini3 If multiple Detail options are specified in Detail, they must be separated by commas. Notes This command must be executed before the target command. S5U1C17001C Manual Seiko Epson Corporation 8-63 (Rev. 1.0)
After data is written to or deleted from flash memory, use the c17 flvs command to cancel the write/delete voltage setting. If the load command fails to execute, the voltage supply will be cancelled automatically. (In this case, the processing will be the same as that for c17 flvs.) S5U1C17001C Manual Seiko Epson Corporation 8-64...
Notes The model-specific information file for microcomputers equipped with a flash programming power terminal is required to use this command. This command cannot be used in simulator mode. S5U1C17001C Manual Seiko Epson Corporation 8-65 (Rev. 1.0)
The standard input application permits the input of only alphanumeric characters and symbols. The c17 stdin 1 command can not be executed continuously. Use the c17 stdin 1 and the c17 stdin 2 as a set. S5U1C17001C Manual Seiko Epson Corporation 8-66 (Rev.
The output buffer (READ_BUF) accepts up to 62 characters. Any characters beyond this limit are discarded. The c17 stdout 1 command can not be executed continuously. Use the c17 stdout 1 and the c17 stdout 2 as a set. S5U1C17001C Manual Seiko Epson Corporation 8-67 (Rev.
The c17 lcdsim command uses one hardware breakpoint. If the maximum number of hardware breakpoints is exceeded, an error will be generated. If the model does not support the LCD panel simulator, the following error will be generated. S5U1C17001C Manual Seiko Epson Corporation 8-68...
(quit debugger) [ICD Mini / SIM] Operation Terminates the debugger. Any ports or files used by the debugger that remain open are closed. Format quit q (abbreviated form) Usage example (gdb) q S5U1C17001C Manual Seiko Epson Corporation 8-69 (Rev. 1.0)
Failed to connect to ICD mini Ver3. C17 command error, command is not supported in present The selected model does not support the LCD panel simulator. target CPU. S5U1C17001C Manual Seiko Epson Corporation 8-70 (Rev. 1.0)
Since a measurement errors may occur during a switchover between break and continuous execution (resumption), use this function for measurements for extended periods, not for short-time execution of only several commands. This function does not support the LCD panel simulator function. S5U1C17001C Manual Seiko Epson Corporation 8-71 (Rev. 1.0)
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 8.7.8, "Restrictions", and "simulator_readme.txt". S5U1C17001C Manual Seiko Epson Corporation 8-72 (Rev. 1.0)
This file contains the hardware configuration for the target model to be simulated in the ES-Sim17. This file may be part of the model-specific information file for the target MCU. If not, obtain the latest model-specific information file (gnu17_mcu_model_xxx.zip) by visiting the Seiko Epson website or contacting the Seiko Epson sales operations.
ES-Sim17 has already terminated, execute the target sim command again. 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. S5U1C17001C Manual Seiko Epson Corporation 8-74...
Open an LCD file (.lcd) created in LCDUtil17. For information on LCDUtil17 and LCD files, see Section 10.8, "LCDUtil17 (LCD Panel Customizing Tool)." [Help] menu [About EssWnd] Shows ES-Sim Window version information. S5U1C17001C Manual Seiko Epson Corporation 8-75 (Rev. 1.0)
The port data buttons and simultaneous input ports select check boxes for the ports that do not exist in the target model are not displayed. 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 S5U1C17001C Manual Seiko Epson Corporation 8-76 (Rev. 1.0)
Page 203
To evaluate this function, use the same way as the simultaneous multiple key inputs described above. Port input interrupts Changing the input status by an operation in the port data control window can generate a port input interrupt. S5U1C17001C Manual Seiko Epson Corporation 8-77 (Rev. 1.0)
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. S5U1C17001C Manual Seiko Epson Corporation 8-78 (Rev. 1.0)
The ES-Sim17 generates a Windows standard bitmap file (.bmp). Restrictions • 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. S5U1C17001C Manual Seiko Epson Corporation 8-79 (Rev. 1.0)
• Some peripheral circuits, such as the oscillator and SVD circuits, need time until their operations stabilize. In the simulation by the 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". S5U1C17001C Manual Seiko Epson Corporation 8-80...
For more information on using the LCD window, refer to Section 8.7.6, “Simulating an LCD Panel.” Note: Since the LCD panel display in the LCD window is simulated by the computer, certain restrictions apply. For more information, refer to Section 8.8.4, “Restrictions.” S5U1C17001C Manual Seiko Epson Corporation 8-81...
If the LCD panel simulator has already terminated, execute the c17 lcdsim on command once again. The [ES-Sim] window cannot be opened twice. If you attempt to open the window when it is already opened, the [ES-Sim] window will move to the foreground. No new window will appear. S5U1C17001C Manual Seiko Epson Corporation 8-83...
Note: To run the program on an actual device equipped with an LCD panel, delete the include command for the LCD panel simulator library and the LCD panel simulator display update function from the program. Leaving these in the program will result in needless processing. S5U1C17001C Manual Seiko Epson Corporation 8-84...
• The LCD display refresh timing differs from that of actual LCD panels. • Enabling this function occupies one hardware breakpoint. • This function does not refer to the peripheral device status (GPIO, CLG, etc.). S5U1C17001C Manual Seiko Epson Corporation 8-85...
This absolute object file in elf format is generated by the linker ld. It must contain debug information, such as symbols. Output file Log file File format: Text file File name: < filename >.txt Description: This file stores contents output to [Console] view as a log. S5U1C17001C Manual Seiko Epson Corporation 8-86 (Rev. 1.0)
Enter an arbitrary file name. [Menu] tab Lacation: From [Browse File System], select c17debug.exe in the following folder: Folder name: C:\EPSON\GNU17V3 Working Directory: From [Browse File System], select the target project folder as the working folder. Arguments: Assign a name to the folder to which the log is output.
This function does not support measurement by functions that contain interrupt processing. The object file (.elf) must contain symbol information. ICDmini3 is the only ICDmini supported by this function. S5U1C17001C Manual Seiko Epson Corporation 8-90 (Rev. 1.0)
9 Creating Data to Be Submitted If using the service to load user programs to the internal ROM or Flash of the CPU at the Seiko Epson factory, a PA file (Data to be submitted) must be created and submitted to Seiko Epson.
Enter the filename and path in the text box in the dialog box displayed, or click the [Ref] button to load S1C17xxx.ini for the target CPU. The S1C17xxx.ini corresponding to the specific model can be found in the folder below. User_folder\EPSON\GNU17V3\mcu_model If no corresponding S1C17xxx.ini exists for the target CPU, contact the Seiko Epson sales operations. S5U1C17001C Manual Seiko Epson Corporation...
Page 219
Click the [Generate] button in winfog17 or select [Generate] from the [Tool] menu. Once the file has been correctly generated, the message "Making file(s) is completed" is displayed in the message area. The FDC files are generated in the folder below. User_folder\EPSON\GNU17V\dev S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 220
Enter the user's company name. The name can be up to 40 characters long, and any more than this will be ignored. The name may contain alphanumeric characters, symbols, and spaces. The details entered here are recorded in the "USER'S NAME" field of the FDC file. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
In either case, winmdc17 creates a PA file in accordance with the target CPU settings when a project is built on the IDE. If using the service to load user programs to the internal ROM or Flash of the CPU at the Seiko Epson factory, the PA files generated should be submitted to Seiko Epson.
ROM data Figure 9.2.4.1 Flowchart for PA file unpacking (1) Launch winmdc17.exe Double-click winmdc17.exe in User_folder\EPSON\GNU17V3\dev\Bin. If the model-specific information file (S1C17xxx.ini) was read in for the previous execution, the same file will be loaded automatically when winmdc17 is launched.
Page 223
CPU. The S1C17xxx.ini corresponding to the specific model can be found in the folder below. User_folder\EPSON\GNU17V3\mcu_model If no corresponding S1C17xxx.ini exists for the target CPU, contact the Seiko Epson sales operations. Figure 9.2.4.3 Load window for model-specific information definition file (3) Select input file Click the [Unpack] button in winmdc17.exe or select [Unpack] from the [Tool] menu.
Page 224
[Unpack message] area once unpacking has successfully been completed. With the default settings, the UFD and USA files will be generated in the following folder. User_folder\EPSON\GNU17V3\dev Click the [Cancel] button to close the dialog box. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Option data error : Mask data is not ROM data is insufficient. Message enough. Option data error : Illegal start mark. Start mark is incorrect. Message Option data error : Illegal end mark. End mark is incorrect. Message S5U1C17001C Manual Seiko Epson Corporation 9-10 (Rev. 1.0)
← * S1C17xxx_xxKB FUNCTION OPTION DOCUMENT Vx.xx Version * FILE NAME zzzzzzzz.FDC ← File name (specified in [Setup]) * USER'S NAME SEIKO EPSON CORPORATION ← User name (specified in [Setup]) ← * INPUT DATE yyyy/mm/dd Creation date (specified in [Setup]) ←...
Page 228
Function option start mark * S1C17xxx FUNCTION OPTION DOCUMENT V x.xx ← Model name/version * 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...
Explanation: Displays the relations between sources and addresses based on the debugging information. The data types of the global symbols are also displayed. Display global symbol information Function: Explanation: Displays a list of the global symbols including the local labels. S5U1C17001C Manual Seiko Epson Corporation 10-1 (Rev. 1.0)
Explanation: Displays all the executable sections after disassembling the object code. The source code is also displayed with the corresponding disassembled code if possible. When entering an option, you need to place one or more spaces before and after the option. Example: c:\EPSON\GNU17V3\GCC6\objdump -S test.elf 10.1.4 Error Message The following shows the error message generated by objdump: Table 10.1.4.1 Error message...
A 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. S5U1C17001C Manual Seiko Epson Corporation 10-3 (Rev.
-V(or --version) Function: Display version number Explanation: Displays the version number of objcopy, and then terminates the process. --help Usage display Function: Explanation: Displays the usage of objcopy, and then terminates the process S5U1C17001C Manual Seiko Epson Corporation 10-4 (Rev. 1.0)
10.2.4 Creating SA Files (ROM Data) Open the command prompt window and execute objcopy at the command line as shown below. C:\EPSON\GNU17V3\gcc6\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.
The ar can add files in this format into an archive or extract an object from an archive to generate a file in this format. Archive file (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. S5U1C17001C Manual Seiko Epson Corporation 10-6 (Rev. 1.0)
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. S5U1C17001C Manual Seiko Epson Corporation 10-7 (Rev. 1.0)
Page 236
The archive is not modified. 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. S5U1C17001C Manual Seiko Epson Corporation 10-8 (Rev. 1.0)
The ROM area data generated by moto2ff should be processed with sconv32 and winmdc17 to generate the PA file (Data to be submitted) to be ultimately submitted to Seiko Epson. For more information on the PA file generation procedure, refer to Section 9.2, "Procedure for Creating Data to Be Submitted".
Finally, pack the verified PSA file and the FDC file (Function option document) generated by winfog17 into a single PA file using winmdc17 and submit this to Seiko Epson. S5U1C17001C Manual...
The file should be processed with winmdc17 to generate the PA file (Data to be submitted) to be ultimately submitted to Seiko Epson after verifying program operation on the actual target board using the PSA file (ROM data). For more information on the PA file generation procedure, refer to Section 9.2, "Procedure for Creating Data to Be Submitted".
The input file has an unsupported record type. ADDRESS LENGTH RANGE OVER. The address range of the input file exceeds the address range for the S format to be converted. OTHER ERROR. Another error has occurred. S5U1C17001C Manual Seiko Epson Corporation 10-12 (Rev. 1.0)
Select whether buzzer sounds when program ends Set model name (required) User program location address (required) Set serial number initial value Set serial number write start address Flash memory security password Specify parameter input file S5U1C17001C Manual Seiko Epson Corporation 10-13 (Rev. 1.0)
Explanation: Specifies the data to be written to the address in 16-bit units. If multiple data is specified, data is written to subsequent addresses. An error will occur if the address specified does not exist in the input file. S5U1C17001C Manual Seiko Epson Corporation 10-14 (Rev.
Run ptd as follows at the command prompt. Example: C:\EPSON\GNU17V3\>ptd s1c17554.psa –e 0x27ffc=0xff80,0xffff This command rewrites the value at address 0x27ffc to 0xff80 and the value at address 0x27ffe to 0xffff inside s1c17554.psa and outputs to s1c17554_ptd.psa. The addresses for Flash Protection Bits in S1C17754 are 0x27ffc (write-protect) and 0x27ffe (data-read-protect).
CPU configuration 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.
Opening a bitmap file (.bmp) or LCD file (.lcd) will display the file in this window. 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. S5U1C17001C Manual Seiko Epson Corporation 10-17 (Rev. 1.0)
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. S5U1C17001C Manual Seiko Epson Corporation 10-18 (Rev. 1.0)
Page 247
Minimizes all open panel editing windows to icons at the bottom of the window. 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. S5U1C17001C Manual Seiko Epson Corporation 10-19 (Rev. 1.0)
Page 248
Commands that can be undone include Move, Cut, and Paste for icon/dot matrix, Change of SEG/COM, Group Icon, Release Group [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. S5U1C17001C Manual Seiko Epson Corporation 10-20 (Rev. 1.0)
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. S5U1C17001C Manual Seiko Epson Corporation 10-21...
Page 250
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. The [Dot matrix] dialog box appears. S5U1C17001C Manual Seiko Epson Corporation 10-22...
Page 251
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. S5U1C17001C Manual Seiko Epson Corporation 10-23 (Rev.
Page 252
Double-click a dot matrix to display the [Dot matrix] dialog to change settings. 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. S5U1C17001C Manual Seiko Epson Corporation 10-24...
Page 253
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. S5U1C17001C Manual Seiko Epson Corporation 10-25 (Rev. 1.0)
Page 254
[Start LcdUtility] button of the IDE is clicked while a project is selected by the 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. S5U1C17001C Manual Seiko Epson Corporation 10-26...
Page 255
A list appears and shows the icons in the currently active panel editing window. Click an icon in the list to display the corresponding icon in the panel editing window in blue. In this window, you can also change COM/SEG information for icons. S5U1C17001C Manual Seiko Epson Corporation 10-27...
Icon List Ctrl + M Dot Matrix Ctrl + N Ctrl + O Open Ctrl + S Save Ctrl + P Print Ctrl + Z Undo Alt + BS Ctrl + Y Redo S5U1C17001C Manual Seiko Epson Corporation 10-28 (Rev. 1.0)
This file was not saved. Cause: The icon or dot matrix extending from the LCD panel was not removed. Corrective action: Data cannot be saved if an icon or dot matrix extends from the LCD panel. S5U1C17001C Manual Seiko Epson Corporation 10-29 (Rev. 1.0)
Page 258
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. S5U1C17001C Manual Seiko Epson Corporation 10-30 (Rev.
Page 260
5-3) Pack the PSA and FDC files into a single PA file using PSA file Board File.psa File.fdc (ROM data) winmdc17. 5-4) Submit the created PA file to Seiko Epson. Data checker winmdc17 PA file File.PA (Data to be submitted) SEIKO EPSON...
Page 261
C Compiler xgcc Development Tools Outline Start-up Command xgcc <options> <filename> This tool is made based on GNU C Compiler and is compatible with ANSI C. This tool invokes cpp.exe and cc1.exe sequentially to compile C source files to the assembly source files for the <filename>...
Page 262
Assembler as (1) Development Tools Outline Start-up Command as <options> <filename> This tool assembles assembly source files output by the C compiler and converts the mnemonics of the source files into object codes (machine language) of the S1C17. The as.exe allows the user <filename>...
Page 263
Assembler as (2) Development Tools Error/Warning messages Error messages Error: Unrecognized opcode: 'XXXXX' The operation code XXXXX is undefined. Error: junk at end of line: 'XXXXX' A format error of the operand. Error: XXXXXX: invalid register name The specified register cannot be used. Warning messages Warning: Unrecognized .section attribute: want a, w, x The section attribute is not a, w or x.
Page 264
Linker ld (1) Development Tools Outline Start-up Command ld <options> <filename> Defines the memory locations of object codes created by the C compiler and assembler, and creates executable object codes. This tool puts together multiple objects and library files into one <filename>...
Page 265
Linker ld (2) Development Tools Default linker script file generated by the IDE .text : OUTPUT_FORMAT("elf32-c17") OUTPUT_ARCH(c17) PROVIDE (__START_text = .) ; ENTRY(_start) *(.text.*) SEARCH_DIR(.); *(.text) MEMORY PROVIDE (__END_text = .) ; } > irom iram : ORIGIN = 0, LENGTH = 32K .data : irom...
Page 266
Specify the command file using start-up options when executing from within the IDE. Example: gdb –x gdbmini3.ini Flowchart Command file from Linker Example: c17 model_path c:/EPSON/GNU17V3/mcu_model Specifies the model information file directory. c17 model 17W23@NOVCCIN Specifies the model name. source file Executable (Voltage level 3.3 V)
Page 267
Debugger gdb (2) Development Tools Debug Commands Memory operation Interrupt c17 fb addr1 addr2 data Fill memory area (8 bits) ICD Mini/SIM c17 int [intNo. level] Generate interrupt c17 fh addr1 addr2 data Fill memory area (16 bits) ICD Mini/SIM c17 intclear [intNo.] Clear interrupt c17 fw addr1 addr2 data...
Page 268
Debugger gdb (3) Development Tools Debug Commands Status and Error Messages Others Status messages set output-rad x Change variable display format ICD Mini/SIM Breakpoint #, function at file:line Made to break at a set breakpoint set logging on/off Log output setting ICD Mini/SIM Illegal instruction.
Page 269
Emulation Library libgcc.a (libgccM.a/libgccMD.a/libgccMD2.a) (1) Library Floating-point Calculation Functions Floating-point Data Format Double-type operation Double-type data format 52 51 x ← a + b adddf3 Addition Exponent part Fixed-point part x ← a - b subdf3 Subtraction x ← a * b muldf3 Multiplication Double-type effective range...
Page 270
Emulation Library libgcc.a (libgccM.a/libgccMD.a/libgccMD2.a) (2) Library Integral Calculation Functions long long Type Calculation Functions Integral calculation long long type calculation x ← a / b x ← a * b divsi3 muldi3 Signed 32-bit integral division Signed 64-bit multiplication x ← a % b x ←...
Page 273
Instruction List (1) Assembly Programming Symbols in the Instruction List Registers/Register Data Bit Field %rd, rd: A general-purpose register (R0–R7) used as the destination register or its contents (X): Bit X of data. %rs, rs: A general-purpose register (R0–R7) used as the source register or its contents (X:Y): A bit field from bit X to bit Y.
Page 274
Instruction List (2) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE rd(7:0)←rs(7:0), rd(15:8)←rs(7), rd(23:16)←0 – – – – – – ◯ %rd, %rs Signed 8-bit data ld.b transfer 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 275
Instruction List (3) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE rd(15:0)←rs(15:0), rd(23:16)←0 – – – – – – ◯ 16-bit data transfer %rd, %rs ◯ %rd, sign7 rd(6:0)←sign7(6:0), rd(15:7)←sign7(6), rd(23:16)←0 – – – – – – rd(15:0)←W[rb], rd(23:16)←0 –...
Page 276
Instruction List (4) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE A[rb](23:0)←rs(23:0), A[rb](31:24)←0 – – – – – – ○ ld.a [%rb], %rs 32-bit data transfer 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 277
Instruction List (5) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE rd(15:0)←rd(15:0)+rs(15:0), rd(23:16)←0 – – ↔ ↔ ↔ ↔ ○ Arithmetic operation %rd, %rs rd(15:0)←rd(15:0)+rs(15:0), rd(23:16)←0 if C = 1 (nop if C = 0) – – – ↔...
Page 278
Instruction List (6) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE rd(23:0)←rd(23:0)-imm20 (with zero extension) – – – – – – – Arithmetic operation ssub.a %rd, imm20 sp(23:0)←sp(23:0)-imm20 (with zero extension) – – – – – – – %sp, imm20 rd(23:0)←rd(23:0)-imm24 –...
Page 279
Instruction List (7) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE ↔ ↔ d(15:0)←rd(15:0) | rs(15:0), rd(23:16)←0 – – – ○ Logic operation %rd, %rs ↔ ↔ rd(15:0)←rd(15:0) | rs(15:0), rd(23:16)←0 if C = 1 (nop if C = 0) –...
Page 280
Instruction List (8) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE pc←pc+2+sign8 if !(N^V) is true; sign8={sign7,0} – – – – – – – Branch jrge / jrge.d sign7 pc←label±imm20 if !(N^V) is true – – – – –...
Page 281
Instruction List (9) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE pc←pc+2+sign8 if Z is true; sign8={sign7,0} – – – – – – – jreq / jreq.d sign7 Branch pc←label±imm20 if Z is true – – – – –...
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?
Questions and answers