FAQ

Assembler

Compiler (GCC)

Integrated development environment (GNU17 IDE)

Linker

Debugger (GDB)

Other tools

Multi Programmer

Gang Programmer


Assembler

  • as-01Set the interrupt level at software interrupts
Target Version Ver.3.x.x
Question Is there a way to set the interrupt level when using software interrupts (int instruction)?
Answer Use C17 assembly instruction 'intl' (interrupt with level).
intl imm5, imm3 Specify vector number as imm5, and interrupt level as imm3.
ex) intl 0x3, 0x2
This will invoke maskable software interrupt 0x3 and set IL to 0x2.
For more information, please refer to S1C17 Family Core Manual "7. Details of Instructions".
  • as-02Handling of comment in assembler source code
Target Version Ver3.x.x
Question The error occurs when "/*" is used on a comment line (with ";") in assembler source code.
Answer In assembler source code, "/*" is higher priority comment than ";".
"*/" is required with "/*" as a set.
  • as-03Interrupt setting by using assembler language
Target Version Ver3.x.x
Question I want to make a code of interrupt setting by using assembler language.
Answer Please refer S1C17Family startup Manual (Assembler version) on Epson web site, and sample program (C:\EPSON\GNU17V3\sample) in GNU17v3.

Compiler (GCC)

  • gcc-01Reduce the code size
Target Version Ver.3.x.x
Question How can I reduce the code size as much as possible?
Answer Use single arrays as much as possible instead of multi dimensional arrays, because accessing multi dimensional arrays decreases code efficiency.

In addition, it is better to use pointers in case of passing structures to functions, or returning structures from functions,
In case no to use pointer, the process to copy the whole structure is needed and the code size increases.

  • gcc-02Access way to PSR
Target Version Ver.3.x.x
Question How can PSR is read to know the current interrupt state?
Can PSR is modified directly?
Answer S1C17 does not have PSR accessing instructions.

To refer and modify PSR value,
PSR value is referred and modified after it is stored to stack memory by using int instruction, and then it is returned by using reti instruction.

Some models have implemented PSR accessing instructions.
Please refer to each technical manuals.

Example: PSR example PDF

  • gcc-03Error by using "-S" at compiler startup option
Target Version Ver.3.x.x
Question syntax error occurs when command-line option "-S" is used for compiler.
Answer

Even though syntax error occurs, assembly source file ".o" is output.
When this "-S" option is used, the object file cannot be generated due to GNU17 specification. Then, compile is failed at linker path.
In GNU17, it is general method to refer assembly result by objdump command with ".elf" file, instead of using command-line option "-S".

  • gcc-04How to support Shift-JIS
Target Version Ver.3.x.x
Question How do I use Shift-JIS on GNU17 ?
Answer

Basic character code on GCC is UTF-8. Please follow this process to support Shift-JIS.

Add -finput-charset=CP932 on the target project [Properties] dialog > C/C++ Build>Settings > [Tool Settings] > [Cross GCC Compiler] > [Dialect] > [Other dialect flags]
“-finput-charset” is an option to specify character code, Shift-JIS is CP932.

  • gcc-05How to locate constant data on ROM area
Target Version Ver.3.x.x
Question I would like to locate constant data to specific address on C source code.
Answer

As example, data 0x00-0x0F will be located to the address 0xB000-0xB00F by writing source code and linker script as follows.

[Source code]
const unsigned char __attribute__ ((section (".updatable"))) checkerLineBit[16] = {
0x00, 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F
};

[Linker Script]
.updatable (0xB000) :
{
*(.updatable);
. = ALIGN(0x800);
} > irom = 0xffff

  • gcc-06Changing C compiler optimization options
Target Version Ver.3.x.x
Question How do I change C compiler optimization options ?
Answer

Please refer to the following document.
PDF

  • gcc-07How to check program size
Target Version Ver.3.x.x
Question I want to know program size.
Answer

Please refer to the following document.
PDF

  • gcc-08How to check the size of stack
Target Version Ver.3.x.x
Question How many stack size is used ?
Answer

Please refer to the following document.
PDF

  • gcc-09Location address of program, data and variables
Target Version Ver.3.x.x
Question How do I get the location address of program data and variables ?
Answer

Please refer to the following document.
PDF

  • gcc-10The purpose of generated file by build
Target Version Ver.3.x.x
Question Which files are generated by build ? What is the purpose for each files ?
Answer

Please refer to the following document.
PDF

Integrated development environment (GNU17 IDE)

  • ide-01Source file which should be controlled in project on IDE
Target Version Ver.3.x.x
Ver.2.x.x
Question I would like to control the project which is made by IDE in a source file version management software.Which file should be control?
Answer The files which need to be controlled are;
  • source file
  • header file
  • "File management required" files generated in a project by the IDE. Please refer the attached table.
    For GNU17v3: PDF
    For GNU17v2: PDF
  • ide-02The meaning of "S1C17" in target CPU of GNU17 General
Target Version Ver.3.x.x
Question In Project Properties - GNU17 General - Target CPU Device, there is a "S1C17" in the CPU name selection.
What purpose is this?
Answer S1C17 is prepared to simulate CPU core in the generic settings independent of the model of target CPU.
The memory maps are not configured.
The default boot address is set to 0x8000, which can be modified.
  • ide-03Eclipse Plug-in install
Target Version Ver.3.x.x
Question Eclipse plug-in is not listed up when I try to install it.
Answer When plug-in is installed by Help>Install New Software on GNU17, it takes 3 to 4 minutes till plug-in is listed after requirement is filled. It is also announced on Eclipse official size.
  • ide-04Unexpected Build error
Target Version Ver.3.x.x
Question The following error occurs at Build.
"Couldn't reserve space for cygwin's heap, Win32 error 0."
Answer It is an issue of library (msys-1.0.dll) in order to use GCC of GNU17 on Windows application.
It may be solved by OS reboot depending on user environment.
Or it will be solved by rebase in general. GNU17v3 prepares rebased msys-1.0.dll on "C:\EPSON\GNU17V3\utility\msys".
Please overwrite with this file at GNU17v3 folder (For GCC4, "C:\EPSON\GNU17V3\gcc4")
When the issue is not solved yet, please try followings.
- Reboot OS, and run GNU17v3 first (as much as possible)
- In case that msys-1.0.dll is already installed by another tool, overwrite with this file at GNU17v3 folder.
  • ide-05Using "dot" into project name
Target Version Ver.3.x.x
Question Build error occurs when project is named like "String1.String2" (using "." into project name)
Answer Only single-byte alphanumeric characters and underscores may be used for project name.
  • ide-06Mixed .c and .C in project
Target Version Ver.3.x.x
Question Is it possible to have both .c and .C in project ?
Answer No, it is impossible due to Eclipse CDT specification. Please use either .c or .C.
  • ide-07Shortcut key
Target Version Ver.3.x.x
Question What are the convenient shortcut key ?
Answer
Function Shortcut key
Uncomment Ctrl+/
Find and Replace in a file Ctrl+F
Find and Replace in other files Ctrl+H
Jump to a line Ctrl+L
Set break point Ctrl+Shift+B
Format Ctrl+Shift+F
Step Into F5(debugger)
Step Over F6(debugger)
Step Return F7(debugger)
Resume F8(debugger)

Note)These are just for your reference.

Linker (LNK)

  • lnk-01Description of stack pointer in map file
Target Version Ver.3.x.x
Question The stack pointer start ("__START_stack") 0x7c0 in map file is different with actual setting.
Answer

The default of stack pointer is set to 0x7c0 in linker script. In map file, it is always set to 0x7c0 without specifying linker script file.
Even if it has a different value, there is no impact to actual operation.

Debugger (GDB)

  • gdb-01Can not start the functions when step is executed.
Target Version Ver.3.x.x
Question When "step" is executed in the source window, functions sometimes does not start.
Answer It is because of the optimization of code by compiler.
The program location changes as the program language changes from C to assembler due to optimization of code by compiler. Then, it looks like that the program is not existing.

In this case, it can be avoided by setting the optimization off.
Refer the S5U1C17001C manual "C compiler" about setting of optimization.

  • gdb-02How to monitor the registers of peripheral circuit
Target Version Ver.3.x.x
Question How do I monitor the register values of peripheral circuit ?
Answer It is possible to use Expressions view.
As example of "MSCPROT" as register name, it may be described {MSCPROT_REG}0x4000 on expressions view.
  • gdb-03[resume] button is not available
Target Version Ver.3.x.x
Question There is no error and warning at Build. However, [resume] button is not available on debugger by selecting [run] > [Debug Configurations].
Answer There is a "Stop on startup" item on [run] > [Debug configuration] > [Debugger] tab in pull-down menu.
The check box may not be selected, or it may not be "main".
  • gdb-04Debugger cannot be controlled
Target Version Ver.3.x.x
Question Debugger is malfunctioned by run / single-stepping. Then it is uncontrollable.
Answer Please check following points.
・Is the stack pointer setting correctly ?
・Don't you set debug pins as GPIO ?
・Last 64byte on RAM is used by debugger. Is this area used ?
・Is there an interrupt by watchdog timer during program is running ?
Is the register bit (DBRUN) set to "1" which supplies clock to watchdog timer.
・If you use own startup routine, is there any issue on it ?
・Is there any possibility to access S1C17 core reserved I/O area (0xfffc00 - 0xffffff)
  • gdb-05Debugger Startup Options
Target Version Ver.3.x.x
Question Please explain the meaning of command option of gdbmini*/ini as debugger startup options.
Answer Please refer to the following document.
PDF
  • gdb-06Debugger quick reference guide
Target Version Ver.3.x.x
Question Do you have quick reference guide for debugger ?
Answer Please refer to the following document.
PDF
  • gdb-07How to show a view which is undisplayed
Target Version Ver.3.x.x
Question How do I show a view which is undisplayed ?
Answer Please refer to the following document.
PDF
  • gdb-08Useful function for showing register values (How to use EmbSys registers)
Target Version Ver.3.x.x
Question Is there any way to refer registers of peripherals as symbolic ?
Answer Please refer to the following document.
PDF
  • gdb-09Measurement of program execution time
Target Version Ver.3.x.x
Question How do I know the program execution time ?
Answer Please refer to the following document.
PDF
  • gdb-10Notes of showing memory or register value
Target Version Ver.3.x.x
Question Are there any notes of showing memory or register value ?
Answer Please refer to the following document.
PDF
  • gdb-11Debugger suddenly stopped operation
Target Version Ver.3.x.x
Question Debugger suddenly stopped operation.
Answer Please refer to the following document.
PDF
  • gdb-12Note of console view
Target Version Ver.3.x.x
Question It looks console view shows unexpected information.
Answer Please refer to the following document.
PDF

Other tools(oth)

  • oth-01ICDminiV1/2 Flash writer mode on GNU17Ver3
Target Version Ver.3.x.x
Question I want to use S5U1C17001H1/2 (ICDminiV1/2) Flash write mode on GNU17Ver3.
Answer

S5U1C17001H1/2(ICDminiV1/2) Flash writer mode is not supported on GNU17Ver3.
Please contact an Epson sales representative how to correspond it.

  • oth-02Disassemble psa file
Target Version Ver.3.x.x
Question Is there any way to convert assembler instruction by disassemble psa(motorola S-format) file ?
Answer

It is possible by using objdump command on GNU17.
Please start with following command.

 objdump -D -m c17 --stop-address=end-address XXXX.psa > XXXX.s

Note) Please be careful that this also converts the data which is defined with const, interrupt vector to instruction code.

Multi Programmer(mpg)

  • mpg-01Verify error
Target Version Ver.4.0.0
Question Verify error occurs at production with Multi Programmer.
Answer

Please check the length of wiring between ICDmini and target system. The writing data may be affected by noise with longer wiring.

  • mpg-02How to use MultiProgrammer.dll
Target Version Ver.4.0.0
Question It is difficult to understand the usage of MultiProgrammer.dll..
Answer

Sample software to use MultiProgrammer.dll is prepared. Please contact an Epson sales representative in your region.

Gang Programmer(gpg)

  • gpg-01The meaning of contents in log file (gplog.txt)
Target Version Ver.2
Question What is the meaning of contents in log file (gplog.txt) ?
Answer

Please refer the gang programmer User Manual.
When you contact an Epson sales representative, please share following information in order to solve issues.
・The photo of LCD panel (display) at the timing of problem.
・gplog.txt file