FAQ
Assembler
- as-01Set the interrupt level at software interrupts
- as-02Handling of comment in assembler source code
- as-03Interrupt setting by using assembler language
Compiler (GCC)
- gcc-01Reduce the code size
- gcc-02Access way to PSR
- gcc-03Error by using "-S" at compiler startup option
- gcc-04How to support Shift-JIS
- gcc-05How to locate constant data on ROM area
- gcc-06Changing C compimer opitization options
- gcc-07How to check program size
- gcc-08How to check program size
- gcc-09Location address of program, data and variables
- gcc-10The purpose of generated file by build
- gcc-11How to define the interrupt vector
- gcc-12Startup routine
- gcc-13Exclusion of unused functions
- gcc-14How to specify the address directly
Integrated development environment (GNU17 IDE)
- ide-01Source file which should be controlled in project on IDE
- ide-02The meaning of "S1C17" in target CPU of GNU17 General
- ide-03Eclipse Plug-in install
- ide-04Unexpected Build error
- ide-05Using "dot" into project name
- ide-06Mixed .c and .C in project
- ide-07Shortcut key
- ide-08About error display
- ide-09About download plugins
- ide-10Abnormalities in the debugger startup screen
Linker
- lnk-01Description of stack pointer in map file
- lnk-02How to put the program in RAM
- lnk-03Variable addressing
Debugger (GDB)
- gdb-01Can not start the functions when step is executed.
- gdb-02How to monitor the registers of peripheral circuit
- gdb-03[resume] button is not available
- gdb-04Debugger cannot be controlled
- gdb-05Debugger Startup Options
- gdb-06Debugger quick reference guide
- gdb-07How to show a view which is undisplayed
- gdb-08Useful function for showing register values (How to use EmbSys registers)
- gdb-09Measurement of program execution time
- gdb-10Notes of showing memory or register value
- gdb-11Debugger suddenly stopped operation
- gdb-12Note of console view
- gdb-13I want to start only the debugger
- gdb-14Reduced debugger startup time
- gdb-15An error occurs when starting the debugger
- gdb-16Variable watch
- gdb-17Error occurred when rewriting non-volatile memory
- gdb-18Display local variables
Sample program
Other tools
- oth-01ICDminiV1/2 Flash writer mode on GNU17Ver3
- oth-02Disassemble psa file
- oth-03Manage data written to flash memory using checksum
- oth-04About the computer protection function by the OS
Multi Programmer
- mpg-01Verify error
- mpg-02How to use MultiProgrammer.dll
- mpg-03Used with power supplies other than 3.3V
- mpg-04LCD display on the main screen
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, |
- 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, Some models have implemented PSR accessing instructions. Example: PSR example |
- 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. |
- 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] |
- 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] [Linker Script] |
- gcc-06Changing C compiler optimization options
Target Version | Ver.3.x.x |
---|---|
Question | How do I change C compiler optimization options ? |
Answer |
- gcc-07How to check program size
Target Version | Ver.3.x.x |
---|---|
Question | I want to know program size. |
Answer |
- gcc-08How to check the size of stack
Target Version | Ver.3.x.x |
---|---|
Question | How many stack size is used ? |
Answer |
- 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 |
- 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 |
- gcc-11How to define the interrupt vector
Target Version | Ver.3.x.x |
---|---|
Question | I don't know how to define interrupt routines and interrupt vectors. |
Answer | The "crt0.c" file that is included in GNU17 Ver.3.x.x defines the vector table,and the basic sample software provides the following macros, so you can easily use them. 1)Vector definition(crt0.c) 2)Macro definition(crt0.h) 3)Macro usage example (user description content) |
- gcc-12Startup routine
Target Version | Ver.3.x.x |
---|---|
Question | How to replace the startup routine. |
Answer |
- gcc-13Exclusion of unused functions
Target Version | Ver.3.x.x |
---|---|
Question | How to build by excluding unused functions. |
Answer |
- gcc-14How to specify the address directly
Target Version | Ver.3.x.x |
---|---|
Question | I want to specify the address directly from C language and read or write the data. |
Answer | By describing as follows, it is possible to read the value from the specified address to "value" or write the value of "value" to the specified address. |
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;
|
- 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 |
Note)These are just for your reference. |
- ide-08About error display
- ide-09About download plugins
Target Version | Ver.3.x.x |
---|---|
Question | I want to change the notation to something other than English, but I don't know the URL of the latest plug-in. |
Answer | The URL of the latest plug-in as of August 2020 is as follows. URL: https://archive.eclipse.org/technology/babel/babel_language_packs/R0.18.0/2020-06/2020-06.php For example, in the case of Japanese, it will be the following file. BabelLanguagePack-eclipse-ja_4.16.0.v20200711020001.zip BabelLanguagePack-tools.cdt-ja_4.16.0.v20200711020001.zip |
- ide-10Abnormalities in the debugger startup screen
Target Version | Ver.3.x.x |
---|---|
Question | The debugger no longer starts. Also, the screen when starting the debugger has been changed. |
Answer | Please refer to the following documents. |
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. |
- lnk-02How to put the program in RAM
Target Version | Ver.3.x.x |
---|---|
Question | I want to put the object data of the program in the RAM area of the target MCU and execute it. |
Answer |
- lnk-03Variable addressing
Target Version | Ver.3.x.x |
---|---|
Question | I want to place a variable at a specific address. |
Answer |
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. |
- 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. |
- 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. |
- 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. |
- 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. |
- 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. |
- 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. |
- gdb-11Debugger suddenly stopped operation
Target Version | Ver.3.x.x |
---|---|
Question | Debugger suddenly stopped operation. |
Answer | Please refer to the following document. |
- 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. |
- gdb-13I want to start only the debugger
Target Version | Ver.3.x.x |
---|---|
Question | When starting the debugger, I don't want to rewrite the program / data to the flash memory of the target MCU. |
Answer | This can be achieved by rewriting the following "gdbmini3.ini" file in the project file. See gdb-05. For example, if you do not supply power from the outside and do not execute initial read, write, or erase, describe as follows. c17 model 17***@NOVCCIN,NOREAD,NOWRITE,NOERASE |
- gdb-14Reduced debugger startup time
Target Version | Ver.3.x.x |
---|---|
Question | Debugger startup time is slow. |
Answer | The download time can be shortened by rewriting the following "gdbmini3.ini" file in the project file. See gdb-05. If you write "NOREAD", it will not be read in advance, so you can write at high speed. |
- gdb-15An error occurs when starting the debugger
Target Version | Ver.3.x.x |
---|---|
Question | After setting 4 breakpoints, quit the debugger and then restart the debugger. An error occurs when starting. |
Answer | The debug circuit built into the S1C17Family can set up to 4 hard breakpoints. However, in this debugger, the point that should be stopped immediately after startup (the beginning of the main function) is also set as a hard breakpoint, so the number of hard breakpoints that can be set in advance at the time of initial startup is 3 points or less. |
- gdb-16Variable watch
Target Version | Ver.3.x.x |
---|---|
Question | I want to refer to variable values while running software. |
Answer | It doesn't have the ability to reference variables in real time, By following the steps below, you can refer to the variable value while running the user software. < Procedure> 1) Add the following to the end of the GDB command file "gdbmini3.ini" that is executed when the debugger is started. c17 stdout 1 WRITE_FLASH WRITE_BUF c17 stdin 1 READ_FLASH READ_BUF 2) Output the variable you want to monitor on the source code C:\EPSON\GNU17V3\sample\sample_gcc6 |
- gdb-17Error occurred when rewriting non-volatile memory
Target Version | Ver.3.x.x |
---|---|
Question | When writing the flash memory built into the MCU using ICDmini, a write error occurs when the boost mode in which the write power supply is generated internal the MCU is used. Alternatively, the software of the MCU tries to rewrite the EEPROM built in this MCU. Then, a rewrite error occurs. |
Answer |
- gdb-18Display local variables
Target Version | Ver.3.x.x |
---|---|
Question | Local variables do not appear in the Variables view. |
Answer | The optimization option is -O1 by default, so the local variables you want to display may be optimized. It can be displayed by adding a volatile declaration to the variable to prevent optimization. |
Sample program(sp)
- spl-01About clearing the interrupt factor flag
Target Version | - |
---|---|
Question | When a specific interrupt flag is cleared by bit operation, another interrupt flag in the same register is also cleared. |
Answer | When manipulating bits in C language, it is actually OR operation. That is, the target register information is read in byte units, specific bits are changed, and the target register information is written back in byte units. At this time, if another interrupt flag in a specific bit is 1, 1 is written back, and as a result, the flag is cleared. In such a case, it can be solved by performing a byte operation and specifying the value. |
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. |
- 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. 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. |
- oth-03Manage data written to flash memory using checksum
Target Version | Ver.3.x.x |
---|---|
Question | Write data to the flash memory built into the target MCU by in-house. I want to manage using a checksum to prevent data mistakes. |
Answer |
- oth-04About the computer protection function by the OS
Target Version | Ver.3.x.x |
---|---|
Question | In Windows10, the following screen is displayed when downloading the package from the MCU user site. |
Answer | There is no problem running it. |
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. |
- mpg-03Used with power supplies other than 3.3V
Target Version | Ver.4.0.0 |
---|---|
Question | It is necessary to switch the corresponding voltage of ICDmini according to the power supply voltage of the target connected to ICDmini.In the case of ICDminiVer.2, 3.3V / 1.8V and external power supply could be selected with the DIP switch, but in ICDminiVer.3, there is no DIP switch for switching the voltage. How should I set it? |
Answer | When using ICDmini Ver.3, first use the external power supply supplied to the TARGET_VCC_IN terminal. Try to connect to the target, and if this connection fails, switch to the internal power supply (3.3V) and try to reconnect. So you don't have to worry about it. Multi-programmers also use model-specific information files. Please check our website to make sure that this file is always up to date. |
- mpg-04LCD display on the main screen
Target Version | Ver.4.0.0 |
---|---|
Question | If the ICDmini is disconnected from the target board before the execution result is displayed (before the execution is completed), the LCD display on the main screen will advance and no error will occur. |
Answer | For models with a small target Flash memory, execution is complete before disconnecting the ICDmini from the target board. The timing may be different from what you think because it is visually displayed on the main screen for users to see. |
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. |