Cmos 16-bit single chip microcontroller (203 pages)
Summary of Contents for Epson S5U1C17001C
Page 1
CMOS 16-BIT SINGLE CHIP MICROCONTROLLER (C Compiler Package for S1C17 Family) (Ver. 3.1) 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
S5U1C17001C Manual Revision History Code No. Page Chapter/Section Description of revision 411086412 Entire manual Version No. changed from 3.0 to 3.1 ― Entire manual Description revised ― "ICDmini3" changed to "ICDmini" How to Read the Manual Description revised "Explains the functions and handling methods of the ICDmini (S5U1C17001H)."...
Page 4
Code No. Page Chapter/Section Description of revision 411086412 3-15 3.5.2 Executing a Build Process Description revised Build process description revised 3-17 3.6 Debugging the Program Description revised "Starting the Debugger" changed to "Debugging the Program" Entire description revised 3-18 3.6.2 Setting Standard Output Description revised "Example"...
Page 5
Code No. Page Chapter/Section Description of revision 411086412 8-10 8.5.1 List of Commands Description added The following added to "Other" in the list of commands: c17 cpu 8-56 8.5.13 Other Commands Description added The following added: c17 cpu (set CPU type) 8-59 8.5.13 Other Commands Description revised...
Page 8
General Source Files GNU17 IDE C Compiler Library Assembler Linker Debugger Creating Data to Be Submitted 10 Other Tools Quick Reference...
Page 9
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 10
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). Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
3.6.1 GDB Command File ......................3-17 3.6.2 Setting Standard 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 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. Seiko Epson Corporation S5U1C17001C Manual (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. Seiko Epson Corporation S5U1C17001C Manual (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 28
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. Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 29
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. Example: ;Error FOO: 1label: _Abcd: 0_ABC: S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 30
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. Seiko Epson Corporation S5U1C17001C Manual (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 32
%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 2-10 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
; R0 ← symbol + 0x10 xjpa LABEL + 5 ; Jumps to address LABEL + 5. For details about the extended instructions that include operands, refer to Section 6.6, "Extended Instructions". S5U1C17001C Manual Seiko Epson Corporation 2-11 (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.) 2-12 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
→ 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 36
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. 2-14 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 37
*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.
Creating a new project creates a directory with the same name as the project in the current workspace or the directory specified in (3). If a directory with this project name already exists, the IDE uses it as the project directory. S5U1C17001C Manual Seiko Epson Corporation...
(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. Seiko Epson Corporation S5U1C17001C Manual (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. Seiko Epson Corporation S5U1C17001C Manual...
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. Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
A value dependent on GNU17_MODEL is set when the GNU17 Setting property is changed. Normally, you should leave this unchanged. GNU17_MODEL_RS A value dependent on GNU17_MODEL is set when the GNU17 Setting property is changed. Normally, you should leave this unchanged. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 50
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. 3-10 Seiko Epson Corporation S5U1C17001C Manual (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)
To specify your own linker script, specify the linker script file using the -T option. If this is not set, linking will use the default linker script. Example: To specify the linker script file elf32c17.x on the project folder -T ../elf32c17.x 3-12 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
-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 3-14 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
You also can also execute “clean” as described below: (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. S5U1C17001C Manual Seiko Epson Corporation 3-15...
Page 56
Except when you intend to rebuild a project, you will need to execute a build process after altering certain source files or header files. You must perform a rebuild in the following cases: • When project properties have been changed • When the included header file has been changed 3-16 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
If using the ICDmini3 for debugging, edit the gdbmini3.ini GDB command file 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.
To enable, remove the “#” characters for the lines in red text within the GDB command file. Example: GDB command file[gdbmini3.ini] # Please uncomment following commented out lines to enable STDOUT while debugging. hbreak WRITE_FLASH commands printf "%s",WRITE_BUF continue Note: Enabling this function occupies one hardware breakpoint. 3-18 Seiko Epson Corporation S5U1C17001C Manual (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)
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. 3-20 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
\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 Description: An assembly source file to be input to the as assembler. This file is generated when the -S option is specified. 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. Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 67
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 68
This option allows the user program to reduce the RAM size for storing static variable pointers. 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. Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 69
Outputs a warning if a format is not specified when a variable or function is declared. "-Wimplicit-function-declaration" Outputs a warning when a function is used before declaration. "-Wimplicit" Same as "-Wimplicit-int" and "-Wimplicit-function-declaration" in enabled state. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 70
Same as all "-Wunused-xxxx" above in the enabled state. "-Wuninitialized" Outputs a warning when a local variable is used without initialization. This warning is not output when -O0 is selected. Default: The above warning options are disabled. Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 71
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. S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
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 option is specified). Seiko Epson Corporation S5U1C17001C Manual (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 74
With gcc4, bit fields are accessed using the size corresponding to the type defined. Program struct IFtag { volatile union { volatile struct { unsigned short DATA : 1; /* 1bit */ unsigned short Dummy : 15; } bCTL; unsigned short usCTL; } rOUT; 4-10 Seiko Epson Corporation S5U1C17001C Manual (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-13...
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. 4-14 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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-15 (Rev. 1.0)
• When the -mno-sjis-filt option is not specified in versions 1.5.0 or later with gcc3 int i_Val = L'空'; → i_Val is replaced by 0x8bf3 if the prefix "L" is specified. If the prefix "L" is not specified, i_Val is replaced by 0xfff3. 4-16 Seiko Epson Corporation S5U1C17001C Manual (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-17 (Rev. 1.0)
24-bit memory model libraries for models with COPRO2 16-bit memory model libraries for models with COPRO2 \lib\MD2\16bit 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. Seiko Epson Corporation S5U1C17001C Manual (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 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 91
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. Seiko Epson Corporation S5U1C17001C Manual (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 5-10 Seiko Epson Corporation S5U1C17001C Manual (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. 5-12 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 97
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-13 (Rev. 1.0)
Page 98
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: 5-14 Seiko Epson Corporation S5U1C17001C Manual (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 5-18 Seiko Epson Corporation S5U1C17001C Manual (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). Seiko Epson Corporation S5U1C17001C Manual (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. Seiko Epson Corporation S5U1C17001C Manual...
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 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
.align VAR2: 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. 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) Seiko Epson Corporation S5U1C17001C Manual (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. Example: .section .bss .global VAR1 .align VAR1: Secures an space for the 4-byte global variable VAR1. .zero 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. 6-10 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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. 6-12 Seiko Epson Corporation S5U1C17001C Manual (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 .align 2 ; ←Essential .long data1 .long data2 6-28 Seiko Epson Corporation S5U1C17001C Manual (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. Seiko Epson Corporation S5U1C17001C Manual (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 143
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...
Page 146
The .stab and .stabstr sections are used to embed debugging information used by the debugger into the program. The contents of these sections are not loaded to the target. 7-10 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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)
24-bit limit (0xffffff) or lower than 0x0, the address bits that exceed 24 bits are masked with 0 and no error occurs. 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". 7-12 Seiko Epson Corporation S5U1C17001C Manual (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 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. Seiko Epson Corporation S5U1C17001C Manual (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. Seiko Epson Corporation S5U1C17001C Manual (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. Specifies the model name. (Voltage level 3.3 V) 17 model 17W23@NOVCCIN target icd icdmini3 Connects the target.
Note: When using an ICD to debug a program, always be sure to close the debugger before turning off power to the ICD. Should you turn off power to the ICD while running the debugger, you will be unable to reconnect it. Seiko Epson Corporation S5U1C17001C Manual (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 Seiko Epson Corporation S5U1C17001C Manual (Rev.
○ ○ 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. 8-10 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
(gdb) x /4w 0x0 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 162
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. 8-12 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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 164
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. 8-14 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 165
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. 8-16 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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 168
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. 8-18 Seiko Epson Corporation S5U1C17001C Manual (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 170
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. 8-20 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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. 8-22 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 173
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. 8-24 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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. 8-26 Seiko Epson Corporation S5U1C17001C Manual (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. 8-28 Seiko Epson Corporation S5U1C17001C Manual (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...
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. 8-30 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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 182
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. 8-32 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 183
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. 8-34 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 185
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. 8-36 Seiko Epson Corporation S5U1C17001C Manual (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. 8-38 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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. 8-40 Seiko Epson Corporation S5U1C17001C Manual (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. 8-42 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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. 8-44 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
(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. 8-46 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 198
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. 8-48 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
(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. 8-50 Seiko Epson Corporation S5U1C17001C Manual (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". 8-54 Seiko Epson Corporation S5U1C17001C Manual (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. 8-56 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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. 8-58 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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 210
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. 8-60 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 211
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.
■Example 4: When the debug I/F voltage is 3.3 V and FLS is also specified (gdb) c17 model 17W23@FLS=FLS17W23.saf,NOVCCIN (gdb) target icd icdmini3 Specifications included in Detail must be separated by commas. Notes This command must be executed before the target command. 8-62 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
(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-63 (Rev. 1.0)
The number of software PC breakpoints set exceeds the limit (up to 200). Cannot write file Cannot write to the file. command result error! An error occurred on executing an undefined command. icdmini3 dll open failure. Failed to connect to ICD mini Ver3. 8-64 Seiko Epson Corporation S5U1C17001C Manual (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-65 (Rev. 1.0)
LCD file path LCD panel setting file File format: Binary file File name: <filename>.lcd Description: This is an LCD panel setting file for ES-Sim17 created by LcdUtil17. ES-Sim17 can simulate dot-matrix and segment LCDs. 8-66 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 217
LCD screen-capture bitmap file 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. S5U1C17001C Manual Seiko Epson Corporation 8-67 (Rev. 1.0)
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. 8-68 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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-69 (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 8-70 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 221
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-71 (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. 8-72 Seiko Epson Corporation S5U1C17001C Manual (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-73 (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". 8-74 Seiko Epson Corporation S5U1C17001C Manual (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. Seiko Epson Corporation S5U1C17001C Manual...
Page 229
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\GNU17V3\dev S5U1C17001C Manual Seiko Epson Corporation (Rev. 1.0)
Page 230
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. Seiko Epson Corporation S5U1C17001C Manual (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 233
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 234
[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. Seiko Epson Corporation S5U1C17001C Manual (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 9-10 Seiko Epson Corporation S5U1C17001C Manual (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 238
← * 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. Function: Display global symbol information 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\GCC4\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) Display version number 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 10-4 Seiko Epson Corporation S5U1C17001C Manual (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\gcc4\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. 10-6 Seiko Epson Corporation S5U1C17001C Manual (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 248
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. 10-8 Seiko Epson Corporation S5U1C17001C Manual (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. 10-10...
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. 10-12 Seiko Epson Corporation S5U1C17001C Manual (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. 10-14 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
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. 10-18 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 259
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 260
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. 10-20 Seiko Epson Corporation S5U1C17001C Manual (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 262
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. 10-22 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 263
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 264
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. 10-24 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 265
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 266
[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. 10-26 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 267
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 Save Ctrl + S Ctrl + P Print Ctrl + Z Undo Alt + BS Ctrl + Y Redo 10-28 Seiko Epson Corporation S5U1C17001C Manual (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 270
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. 10-30 Seiko Epson Corporation S5U1C17001C Manual (Rev. 1.0)
Page 271
S1C17 Family C Compiler Package Quick Reference...
Page 274
5-3) Pack the PSA and FDC files into a single PA file using PSA file Board (ROM data) File.psa File.fdc 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 275
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 276
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 277
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 278
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 279
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 280
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 281
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 282
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 283
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 adddf3 x ← a + b Addition Exponent part Fixed-point part subdf3 x ← a - b Subtraction muldf3 x ← a * b Multiplication Double-type effective range divdf3...
Page 284
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 divsi3 x ← a / b muldi3 x ← a * b Signed 32-bit integral division Signed 64-bit multiplication modsi3 x ←...
Page 287
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 288
Instruction List (2) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE 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 – – – – – –...
Page 289
Instruction List (3) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE 16-bit data transfer %rd, %rs rd(15:0)←rs(15:0), rd(23:16)←0 – – – – – – ◯ %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 290
Instruction List (4) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE ld.a [%rb], %rs A[rb](23:0)←rs(23:0), A[rb](31:24)←0 – – – – – – 32-bit data 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 291
Instruction List (5) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE ↔ ↔ ↔ ↔ Arithmetic operation %rd, %rs rd(15:0)←rd(15:0)+rs(15:0), rd(23:16)←0 – – ○ ↔ ↔ ↔ 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 292
Instruction List (6) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE Arithmetic operation ssub.a %rd, imm20 rd(23:0)←rd(23:0)-imm20 (with zero extension) – – – – – – – %sp, imm20 sp(23:0)←sp(23:0)-imm20 (with zero extension) – – – – – –...
Page 293
Instruction List (7) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE ↔ ↔ Logic operation %rd, %rs d(15:0)←rd(15:0) | rs(15:0), rd(23:16)←0 – – – ○ ↔ ↔ 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 294
Instruction List (8) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE 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 295
Instruction List (9) Assembly Programming Mnemonic Flags Classification Function Opcode Operand IL IE jreq / jreq.d sign7 Branch pc←pc+2+sign8 if Z is true; sign8={sign7,0} – – – – – – – sjreq / sjreq.d label±imm20 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