 |
|
 |
RENESAS TOOL NEWS on October 16, 2006: 061016/tn1
| A Note on Using the C Compiler Packages
--M3T-NC308WA and M3T-NC30WA--
for the M16C MCU Family |
Please take note of the following problem in using the C compiler packages-- M3T-NC308WA and M3T-NC30WA--for the M16C MCU family:
- With automatic generation of variable interrupt- and special page vector tables
- Products and Versions Concerned
- The M3T-NC308WA C-compiler package
V.5.20 Release 1 through V.5.41 Release 00
(for the M32C/90, M32C/80, and M16C/80 MCU series)
- The M3T-NC30WA C-compiler package
V.5.30 Release 1 through V.5.40 Release 00A
(for the M16C/60, M16C/30, M16C/20, M16C/10, M16C/Tiny, and R8C/Tiny MCU series)
- Description
If you make the compiler generate any variable interrupt- or special page vector table automatically, a Windows error may arise at linking, dispatching the following error message:
"ln308.exe has encountered a problem and needs to close. We are sorry for the inconvenience."
If no Windows errors detected, the generation of tables is successful.
- Conditions
| 3.1 |
|
In Automatic Generation of Variable Interrupt Vector Tables
| 3.1.1 |
|
When the M3T-NC308WA V.5.40 Release 00 or V.5.41 Release 00; or M3T-NC30WA V.5.40 Release 00 or V.5.40 Release 00A Used
This problem may occur if either of the following conditions is satisfied:
| (1) |
The #pragma INTERRUPT directive is written in a format with an interrupt vector number. |
| (2) |
Link option "-VECT" or "-VECTN" selected. |
|
| 3.1.2 |
|
When the M3T-NC308WA V.5.20 Release 1 or V.5.20 Release 02; or M3T-NC30WA V.5.30 Release 1 or V.5.30 Release 02 Used
This problem may occur if the following conditions are all satisfied:
| (1) |
|
The #pragma INTERRUPT directive is written in a format with an interrupt vector number. |
| (2) |
|
Compile option "-fmake_vector_table(-fMVT)" selected. |
| (3) |
|
Assemble option "-fMVT" selected. |
| (4) |
|
Link option "-fMVT" selected. |
|
|
| 3.2 |
|
In Automatic Generation of Special Page Vector Tables
| 3.2.1 |
|
When the M3T-NC308WA V.5.40 Release 00 or V.5.41 Release 00; or M3T-NC30WA V.5.40 Release 00 or V.5.40 Release 00A Used
This problem may occur if "#pragma SPECIAL" is used. |
| 3.2.2 |
|
When the M3T-NC308WA V.5.20 Release 1 or V.5.20 Release 02; or M3T-NC30WA V.5.30 Release 1 or V.5.30 Release 02 Used
This problem may occur if the following conditions are all satisfied:
| (1) |
|
The "#pragma SPECIAL" directive used. |
| (2) |
|
Compile option "-fmake_special_table(-fMST)" selected. |
| (3) |
|
Assemble option "-fMST" selected. |
| (4) |
|
Link option "-fMST" selected. |
|
|
- Workarounds
How to avoid the above problem is explained below.
| 4.1 |
|
In Automatic Generation of Variable Interrupt Vector Tables
| 4.1.1 |
|
When the M3T-NC308WA V.5.40 Release 00 or V.5.41 Release 00; or M3T-NC30WA V.5.40 Release 00 or V.5.40 Release 00A Used
Perform the following procedures to modify your program:
| (1) |
|
Delete the interrupt vector number appended to #pragma INTERRUPT.
Example:
-------------------------------------------------------------
Original: #pragma interrupt _brk(vect=0)
Modified: #pragma interrupt _brk
------------------------------------------------------------- |
| (2)-1 |
|
If the start-up program in C language is used, add a variable interrupt vector table (vector section) in assembly language to the intprg.c file, which declares the functions used in the variable interrupt vector table.
Example of variable interrupt vector table (vector section)
to be added:
-------------------------------------------------------------
#pragma ASM
.glb __dummy_int
.section vector,ROMDATA
.lword __dummy_int ; vect 0
.lword __dummy_int ; vect 1
:
.lword __dummy_int ; vect 63
#pragma ENDASM
-------------------------------------------------------------
Sample of intprg.c file modified
A sample of the intprg.c file to which such a vector section as above added is supplied on our Web page.
So, download and decompress intprg.zip (1.52 KB) to refer to it.
|
| (2)-2 |
|
If the start-up program in assembly language is used, modify sect308.inc, the section definition file.
Example of sect308.inc file modified near the 423rd line:
-------------------------------------------------------------
;------------------------------------------------------
; variable vector section
;------------------------------------------------------
.section vector,ROMDATA ; variable vector table
.org VECTOR_ADR
;.if __MVT__ == 0 Comment out this line
.lword dummy_int ; BRK (software int 0)
.lword dummy_int ;
:
.lword dummy_int ; software int 63
;.endif ; __MVT__ Comment out this line
------------------------------------------------------------- |
| (3) |
|
In intprg.c in (2)-1 or sect308.inc in (2)-2, set the functions used in the variable interrupt vector table.
Example of setting function _brk() for vector number 0:
-------------------------------------------------------------
Original: .lword __dummy_int ; vect 0
Modified: .glb __brk
.lword __brk ; vect 0
-------------------------------------------------------------
NOTICE: Never select link option "-VECT" and "-VECTN". |
|
| 4.1.2 |
|
When the M3T-NC308WA V.5.20 Release 1 or V.5.20 Release 02; or M3T-NC30WA V.5.30 Release 1 or V.5.30 Release 02 Used
Perform the following procedures to modify your program:
| (1) |
|
Delete the interrupt vector number appended to #pragma INTERRUPT.
Example:
-------------------------------------------------------------
Original: #pragma interrupt _brk(vect=0)
Modified: #pragma interrupt _brk
------------------------------------------------------------- |
| (2) |
|
In the sect308.inc section definition file of the start-up program in assembly language, set the functions used in the variable interrupt vector table.
Lines to be set near the 171st line in sect308.inc:
-------------------------------------------------------------
.if __MVT__==0
;-------------------------------------------------------
; variable vector section
;-------------------------------------------------------
.section vector,ROMDATA ; variable vector table
.org VECTOR_ADR
.lword dummy_int ; BRK (software int 0) Modify this line
as shown below
.lword dummy_int ;
:
-------------------------------------------------------------
Example of setting function _brk() for vector number 0:
-------------------------------------------------------------
Original: .lword dummy_int ; BRK (software int 0)
Modified: .glb __brk
.lword __brk ; BRK (software int 0)
-------------------------------------------------------------
NOTICE:
Never select any of the following options:
- Compile option "-fmake_vector_table(-fMVT)"
- Assemble option "-fMVT"
- Link option "-fMVT"
|
|
|
| 4.2 |
|
In Automatic Generation of Special Page Vector Tables
Declare no functions using the #pragma SPECIAL directive in the versions concerned (see Section 1). |
- Schedule of Fixing the Problem
We plan to fix this problem in the next release of the M3T-NC308WA (by the end of the year) and in the V.5.42 Release 00 of the M3T-NC30WA, which is being published in this November.
|
 |