 |
|
 |
RENESAS TOOL NEWS on February 16, 2005: RSO-M3T-NC30WA-050216D
A Note on Using C-Compiler Package M3T-NC30WA
|
Please take note of the following problem in using the M3T-NC30WA
C-compiler package:
- On information about the stack when an interrupt function is declared
- Versions Concerned
M3T-NC30WA V.5.10 Release 1 through V.5.30 Release 1
for the M16C/60, M16C/30, M16C/Tiny, M16C/20, M16C/10, and R8C/Tiny series
- Description
When the -finfo compile option is selected, information about the
inspector is generated. However, the necessary sizes for saving and
restoring the contents of the specified registers on and from the stack
when an interrupt is generated are not
provided as items of information about the inspector.
So, the stack-usage calculation utility STKViewer* cannot tell the
necessary sizes.
| * |
Calculates the stack usage from information about the inspector generated by the compiler. |
- 2.1 Conditions
-
This problem occurs if the following conditions are all satisfied:
| (1) | An interrupt function is declared. |
| (2) | The compile option -finfo is selected. |
-
- Workaround
- 3.1 When an auto variable exist
-
The necessary sizes for saving and restoring the contents of the
registers R0, R1, R2, R3, A0 and A1 on and from the stack when an
interrupt is generated are 12 and -12 respectively. So set these
values in the asm()functions placed before and after the processing
of an interrupt function using the assembler directive command ".stk"
as shown below.
--------------------------------------------------------------------
#pragma INTERRUPT i_func
void i_func(void)
{
asm( " .stk 12" ); /* Necessary size for saving
contents of registers
R0, R1, R2, R3, A0 and A1 */
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
asm( " .stk -12" ); /* Necessary size for restoring
contents of registers
R0, R1, R2, R3, A0 and A1 */
}
--------------------------------------------------------------------
NOTE: The above statements do not affect the assembler source code generated.
- 3.2 When an auto variable doesn't exist
-
The necessary sizes for saving and restoring the contents of the
registers R0, R1, R2, R3, A0, A1 and FB on and from the stack when an
interrupt is generated are 14 and -14 respectively. So set these
values in the asm()functions placed before and after the processing
of an interrupt function using the assembler directive command ".stk"
as shown below.
--------------------------------------------------------------------
#pragma INTERRUPT i_func
void i_func(void)
{
asm( " .stk 14" ); /* Necessary size for saving
contents of registers
R0, R1, R2, R3, A0, A1 and FB */
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
asm( " .stk -14" ); /* Necessary size for restoring
contents of registers
R0, R1, R2, R3, A0, A1 and FB */
}
--------------------------------------------------------------------
NOTE: The above statements do not affect the assembler source code generated.
- Schedule of Fixing the Problem
This problem has already been resolved in the M3T-NC30WA V.5.30 Release 02.
So please revise your product to this online from the
Software Download Site.
|
 |