CC78K
Contents
FAQ-ID = 78cc- nnnn
78cc -0001
|
F861 No EXT_TABLE specifier is output.
|
| Q1 |
When I add the -zf option and perform compilation to create a program
to be placed into the internal flash FROM, "F861 No EXT_TABLE specifier" is output.
What can be done to prevent this?
|
| A1 |
The -zf option is used only when creating a program that supports self-programming
of the internal flash ROM.
To make the program that writen into the internal flash ROM by using a flash programmer,
set the -zf option to OFF.
|
78cc -0002
|
The startup routine settings dialog box is dimmed out and settings cannot be performed.
|
| Q1 |
I want to set the startup routine in the compiler option setting dialog box from the Project Manager,
but the setting items are dimmed and cannot be set.
|
| A1 |
When any of the source files is selected in the left-side window of Project Manager (PM32 Project Window),
the mode for setting individual source options is enabled,
and as a result the startup routine cannot be set.
Please perform the compiler option settings
after clicking a part other than the source file name in order to deselect the source file name,
and then perform the compiler option settings.
|
78cc -0003
|
It looks like 0x0080 gets sign extended.
|
| Q1 |
When I compile the following source, code that is different from the one intended is generated.
[Source]
typedef unsigned short USHORT;
#define MASK7 0x0080
sreg USHORT usVar7;
usVar7 += ~MASK7;
[Generation code]
Original source: usVar7 += ~MASK7;
Expected generation: usVar7 s usVar & 0xFF7F
Actual generation: usVar7 s usVar & 0x007F
|
| A1 |
Since, in the default, the -qc option is enabled,
#define MASK7 0x0080 is handled as char constant 0x80 and producing such a result.
To prevent this, write like
#define MASK7 ((unsigned short)0x0080).
(Reference)
Section describing the -Q option in the CC78K0S Operation User's Manual
|
78cc -0004
|
What is the output file name setting method?
|
| Q1 |
When building with the Project Manager,
load module (.lmf) file name becomes the first compiled file name.
Can this file name be set?
|
| A1 |
Yes, it is possible by setting a linker option.
In the Project Manager menu list, click "Option (O)",
and the select "Linker Option Setting (L)" from the pull-down menu.
The screen then changes to the Option Setting Screen (Output 1),
so set the file name that you want to set in the Output File Name field.
|
78cc -0005
|
How can re-start from the same address after a reset of the CC78K0?
|
| Q1 |
I would like to re-start the program from the same address as that of hardware reset
during program operation.
Can I describe this in C language?
|
| A1 |
No, this cannot be described in C language.
Execute the following instructions with assembler.
MOVW AX,!0
PUSH PSW
PUSH AX
RETI
By executing the these instructions,
you can branch to the address in the reset vector and execute the program from initialization.
|
78cc -0006
|
Is there a way to place function entities in the definition sequence?
|
| Q1 |
Regarding memory placement,
I would like to define entities from the current C language,
but entities not getting placed in the definition sequence.
Is there a good method for the problem?
|
| A1 |
No.
If you want to specify placement,
define entities in assembler and not C language,
making the symbols names that start with "_" and declarat as public symbol.
For C, use external declarations removing the "_" from symbol name.
|
78cc -0007
|
I want to place a program in the gap area. [CC78K0]
|
| Q1 |
Looking at the MAP file, the area from 3CAH to 800H is a gap area.
I want to add a program to this empty area.
I have described the following before the code I would like to map from 3CAH.
Is this a problem?
#pragma section @@CODE ROM
|
| A1 |
While this is not recommended, it is not a problem.
To use section specification, it is recommended to describe as
#pragma section @@CODE CODE 1
and specify
merge CODE1: AT (3CAH)
in the link directive file.
|
78cc -0008
|
How are bits specified in the various registers of SFR?
|
| Q1 |
How are bits specified in the SFR registers. (For example, to start/stop the TM1 or TM2 timer)
|
| A1 |
To start the TM1 timer, write
TCE1 = 1
or
TMC1.0 = 1
To stop the TM1 timer, write "0" instead of "1" for TM1.
And for TM2, write TCE2 instead of TCE1, and use TMC1.1. instead of TMC1.0.
|
78cc -0009
|
Securing interrupt stack with compiler
|
| Q1 |
The CC78K0 expanded functions include interrupt functions.
If stack switching specification has not been used,
does the compiler secure the required stack size?
|
| A1 |
No, CC78K0 does not secure stack area separatly, and only uses default stack area.
|
78cc -0010
|
How are macro services used in the C language?
|
| Q1 |
How are macro services used in the C language?
|
| A1 |
Basically, macro service is not supported in C language.
If processing does not execute the job in time, one can use macro service.
But C language is not suitable for such a time critical allication.
We recommend programming with the assembler.
Another thing you could possibly do would be to define a macro service channel as a structure,
allocate this to saddr1.
And regarding control words, these addresses are not reserved with the compiler,
it must be define by program.
Then you would simply need to set values for the defined variables in a structure.
|
78cc -0011
|
What is the result value when the floating-point calculation overflows?
|
| Q1 |
When the float/float calculation result has overflowed,
is the return value from the function the maximum value?
Or is it an error code?
|
| A1 |
The value returned from the function is either positive or negative infinity.
Additionally, matherr is called and ERANGE(=2) is set to errno.
|
78cc -0012
|
What is the result value when division by 0 is performed during floating-point division?
|
| Q1 |
What result is returned when division by 0 is performed?
|
| A1 |
The result differs according to the dividend. Combinations that also include input arguments other than the allowed ones, and calculation results are as follows.
\Divisor Dividend\ |
Not a number | Infinity | 0 | Normal number |
| Not a number | Not a number | Not a number | Not a number | Not a number |
| Infinity | Not a number | Not a number | Infinity | Infinity |
| 0 | Not a number | 0 | Not a number | 0 |
| Normal number | Not a number | 0 | Infinity | x/y |
|
78cc -0013
|
What is the maximum value that can be returned for divisions (fdiv) in floating-point division?
|
| Q1 |
What is the maximum value that can be returned with float division (fdiv)?
Is it the 38th power of +10 ?
|
| A1 |
Yes, it is this size.
The return value is the range of float values described in
"Table 2-3 Basic Types List" in the User's Manual (Language).
|
78cc -0014
|
Are double-precision floating points supported? [CC78K4]
|
| Q1 |
If during float/float division with CC78K4,
divisor underflow occurs and division by 0 is performed,
and an overflow error (+INF) occurs in the runtime routine.
Can this be avoided by casting the dividend and divisor to double-precision?
|
| A1 |
No, this is not possible.
In CC78K4, double-precision floating points are not supported.
Therefore, prior to performing division, be sure to check that the divisor is not 0,
and only then perform division.
|
78cc -0015
|
An error occurs with the external declaration of an external array variable.
|
| Q1 |
I would like to read the table data of the arrays defined in a separate file in C language.
for example, declaration of an array is
int const aa[3] = {0, 1, 2};
and reading as fllowing
extern int aa;
int a, b;
a = 2;
b = aa[a];
What is the declaration method when using arrays defined in a separate file?
|
| A1 |
To declare variables defined as arrays with extern, it is necessary to match the types.
Therefore, in this case, perform a declaration such as
extern int aa[3];
|
78cc -0016
|
Saving the work area during interrupts
|
| Q1 |
During the execution of a library function,
an interrupt occurs and an inadvertent program loop results
when running of the library function is attempted.
Are there any cautions when using library functions with interrupts?
(Is the work area automatically saved?)
|
| A1 |
It is not just the saddr area that needs to be saved, the registers need to be saved too.
It depends on how the interrupt function is defined.
For example, if the register bank is specified with an interrupt function,
register save is not performed.
If a register bank used in the main routine is specified by mistake,
the contents of the registers are destroyed.
For the types of information that are saved,
refer to "Table 11-13 Save/Recover Area when Using Interrupt Function"
in section "(10) Interrupt Function" in "Chapter 11 Expanded Function" in the Language manual.
Moreover, there is also the problem of whether the function is re-entrant or not.
Regarding this point,
the functions described in section "10.3 Re-entrance" in "Chapter 10 Library Functions"
in the Language manual is not re-entrant.
So if the same function is executed in the interrupt processing
during execution of that function in the main routine, the program does not work correctly.
|
| |
| Q2 |
Are there any point to use the libraries?
|
| A2 |
The point is what type of model (normal or static) is used and option.
For details, refer to the beginning of "Chapter 10 Library Functions" in the Manual (Language).
|
78cc -0017
|
Re-entrant characteristics of library function [CC78K4]
|
| Q1 |
In the CC78K4, how should link so as to meet the following conditions?
Since sprintf supporting floating points does not have re-entrant characteristics,
I would like to link items that do not support floating point for sprintf.
Should I link in the order of cl4.lib, cl4f.lib?
- I want to make sprintf() re-entrant
- Don't specify floating points such as %f for sprintf()
- Don't use sscnaf, scanf, vprintf, vsprintf
- Use floating points such as log10()
|
| A1 |
If you want to use floating point functions such as log10(),
linking in the sequence cl4f.lib, cl4.lib is required.
The reason :
Assuming a function sub() is used as following calling relationship.
somefunc() -> sub() that does not support floating points
log10() -> sub() that supports floating points
When cl4.lib is linked first and somefunc() and log10() are used,
sub() that does not support floating points operation is linked and log10() may not operate normally.
When cl4f.lib is linked first, sub() that supports floating point operation
includes the specifications of sub() that does not support floating points operation.
So,there is no problem.
To prevent the future problem,
you had better to realize the desired functions by obtaining the library source (CC78K4-L)
and incorporating a source related to sprintf() that does not support floating points in your source.
In this case, it is necessary to check the used floating point function sources such as log10()
and ascertain that calling functions such as the above-described function sub() are not used.
If such functions are used, changing the function name corresponding to sub() eliminates that undesirable influence.
|
78cc -0018
|
The message "ERROR F304 Operand out of range" is output when a 24-bit address space is accessed. [CC78K4]
|
| Q1 |
I want to access the data in a 24-bit address space (!!addr24) from a C language program.
What should I write the program?
Currently, during linking, the following error occurs.
*** ERROR F304 Operand out of range(segment'@@CODE',address xxxxH,type'!addr16')
During compilation, I use a medium model (-MM).
|
| A1 |
Use a large model (-ML) instead of a medium model.
In the case of a medium model, only a 64K data space is supported.
Therefore, a medium model cannot be used to access data in a space larger than 64K.
To access data in a space of 64K or more, use a large model, which does not have such a limitation.
|
78cc -0019
|
The message "A402 File has no string table for symbol" is output during linking.
|
| Q1 |
The following error occurs during linking when build is executed.
*** ERROR A402 File 'xxxxxx.REL' has no string table for symbol Program Aborted.
|
| A1 |
This error indicates that the symbol table has been destroyed.
There are several possible causes, but first check the following points.
(1) If using an inline assembler in C, check local symbols that start with something other than ?L are defined.
(2) Check the length of function names that exceed 24 characters.
If there are such descriptions, change the symbol name.
|
78cc -0020
|
The message "F304 Operand out of range " is output during linking.
|
| Q1 |
The following error message is output after compiling or linking.
*** F304 Operand out of range (segment '@@CODE', address xxxxH,type 'saddrp')
|
| A1 |
This error occurs when attempting to locate too many variables in the saddr area (FE00 to FF1F)
and the required area is over saddr area.
The saddr area is fixxed area and it can not be increased.
Please revise the variables to be placed in the saddr area.
Also, since it is not known during the compiling stage whether will overflow the saddr area at a whole,
no error is output and overflow likely occurred during linking, resulting in the output of an error.
|
78cc -0021
|
The message "F405 Undefined symbol '@@xxxx'" is output several times during linking.
|
| Q1 |
There is no error in during particular compiling and assembly with the uPD780053,
and the following errors occurs during linking.
*** ERROR F405 Undefined symbol '_@RTARG0' in file 'BURNER.REL'
*** ERROR F405 Undefined symbol '@@iumul' in file 'INT.REL'
*** ERROR F405 Undefined symbol '_@RTARG0' in file 'INT.REL'
*** ERROR F405 Undefined symbol '_@RTARG2' in file 'INT.REL'
*** ERROR F405 Undefined symbol '_@RTARG4' in file 'INT.REL'
*** ERROR F405 Undefined symbol '_@RTARG6' in file 'INT.REL'
*** ERROR F405 Undefined symbol '_@RTARG0' in file 'TIME.REL'
*** ERROR F405 Undefined symbol '@@iumul' in file 'TIME.REL'
|
| A1 |
These symbols are defined in the library and startup routine.
Check that the library (for example cI0.lib) is linked in order to use functions offered as a library.
Files such as described in section "2.2.2 Library files" in the CC78K0 User's Manual --Operation-- are provided.
Also, Check that the startup routine (for example, s0r.rel) linked.
The startup routine defines the processing, symbols, etc., required for starting up a C program.
As long as no substitute program is created, the startup routine needs to be linked.
|
78cc -0022
|
The message "F112 Too much internal node on temporary file" is output when the program amount increases.
|
| Q1 |
The following error is output when the program amount increases (variables, etc.).
F112 Too much internal node on temporary file. Program aborted.
I was able to prevent this error from occurring by splitting the C source,
but I still do not understand what causes this error.
The program length is about 3500 lines.
|
| A1 |
If it appears that -sa or -a option is specified,
the problem is likely to be caused by a processing limitation on output to the assemble source module file.
|
78cc -0023
|
The link error "Segment @@RTARGO can't allocate to memory" is output when the CC78K version is upgraded.
|
| Q1 |
Following CC78K0 version upgrade (V3.0 -> V3.1),
the following link error now occurs in a program for which there used to be no problem.
*** Segment "@@RTARGO" can't allocate to memory
This is followed by multiple occurrences of the "Operand out of range" error.
|
| A1 |
As a result of this upgrade,
the @@RTARGO definition method has changed and the need to actually map this part to memory has arisen,
but there is not the required memory space in the used link directive descriptions,
and so @@RTARGO requiring an 8-byte area could not be placed,
causing the above-mentioned error.
Add the 8-byte area for placing @@RTARGO to the directives.
|
78cc -0025
|
The link error "W417 The version of RA78K in file xxxxxx are more than one" is output when the CC78K version is upgraded.
|
| Q1 |
The following link error is output.
ERROR W417 The version of RA78K in file 'D:\NECTOOLS\LIB\CL4.LIB' are more than one.
Used the first one in file 'xxxxxx\CSTARTRN.REL'
|
| A1 |
This is simply a warning,
indicating that the version used to create the library differs from the version used to assemble the startup routine.
The versions of the assembler that can be used with the compiler are described in the manual or attached documents,
so please check this information.
|
| |
| Q2 |
*** ERROR F108 Overlapped memory area 'ROM' and 'rom'
*** ERROR F108 Overlapped memory area 'RAM' and 'ram'
|
| A2 |
These indicate that the link directive file specification is incorrect.
This error means the areas already defined as ROM, RAM are redefined with different names, rom, ram.
To redefine areas specified as ROM, RAM, use the same name (including uppercase and lowercase).
|
| |
| Q3 |
*** ERROR F304 Operand out of range (segment 'CODE03', address xxxxH, type 'saddrg1')
*** ERROR F304 Operand out of range (segment 'CODE03', address xxxxH, type 'saddrg1')
|
| A3 |
One cannot tell based on this information alone.
Refer to the assemble list, calculate the offset from the beginning (F5B from the map file),
and find the problematic instruction.
There, the fact that what should have been specified as saddrg1 for the operand is not saddrg1 is the cause.
|
78cc -0026
|
A link error is output when the CC78K version is upgraded. (@@RTARG0 area mapping)
|
| Q1 |
A link error (sol.elk) is generated after the CC78K0 upgrade (V3.0 -> V3.1).
|
| A1 |
Looking at the link directive file, memory is not allocated below FEB8H.
memory SDR: (0FE60H, 058H)
Since this area is used by @@RTARG0, memory could not be allocated and an error occurred.
(In the previous V3.00, definition was simply made with EQU, so no error was output, but in V3.10,
a change has been made necessitating the area to be defined, for which reason an error is output.)
As a countermeasure, broaden the above specification so that there is memory in the area, by writing something like:
memory SDR: (0FE60H, 0A0H)
In this example, up to FEFF is secured.
|
78cc -0027
|
Must 78K/4 link directive changes include the SFR area in RAM?
|
| Q1 |
An error is output during linking using the following link directive for the LK78K4.
memory ROM :(0, 0EE00H)
memory RAM :(0EE00H, 1100H)
|
| A1 |
There is a problem with the RAM area definition.
In the 78K4, the RAM must always include the SFR area.
In the inquiry settings, definition is done only until immediately before the SFR area.
Change the RAM size from 1100h to 1200h.
This problem is believed to cause the F111 error, and subsequently the F304 error.
|
78cc -0028
|
The error message "F702 Too many callt function" is output when the CC78K version is upgraded.
|
| Q1 |
The error "F702 Too many callt function" is output at the line where all the _callt functions are defined.
All 32 callt are used.
|
| A1 |
Regarding your inquiry,
the problem is due to the fact that the CC78K0 specifications have been changed from this version.
In the new version CC78K0, callt is being used for optimum performance.
As a result the callt functions that can be used by the customer are restricted.
The callt functions that can be used are controlled as follows according to the -QL option level.
| -QL option | -QL1 | -QL2 | -QL3 | -QL4 |
| Normal model | 31 | 29 | 9 | 0 |
| Static model | 32 | 28 | 19 | 10 |
|
78cc -0029
|
Do the compiler products include an assembler?
|
| Q1 |
Does the 78K0x C compiler include an assembler?
|
| A1 |
No.
The assembler is part of another package and must therefore be purchased separately.
|
|