 |
|
 |
MESC TOOL NEWS:
MESCT-MR32R-010116D
Please take note of the following problem in using real-time OS MR32R for the M32R family of microcomputers:
- On the initial starting task *1
*1: The task for which "initial_start = ON;" has been set in the task definitions in the configuration file.
- Versions Concerned
- All the versions
from MR32R V.1.00 Release 1 to V.3.30 Release 1, inclusive
- Description
When execution is switched from the startup program to the initial starting task, the following symptoms may appear:
- (1) An address exception occurs
- As soon as the initial starting task initiated, the scheduler of OS is called, and it executes an instruction for referencing the value stored at the address that is indicated by the SPU register not yet initialized.
Since the SPU register is undefined, the referenced value remains indefinite; thus an address exception occurs if the value stored in SPU is not a multiple of 4.
- (2) Interrupts are disabled and no interrupts accepted
- Even when the symptom described in (1) does not occur, the scheduler may enable interrupts temporarily or keep interrupts disabled depending on the referenced value that is indefinite.
If the result of bitwise ANDing the referenced value and 0x4000 is equal to 0, interrupts are disabled, and no interrupt requests are accepted during the idle state.
- Note:
This problem does not occur in the following cases:
- When an emulator system (M32000TB-2MB-E, M32100T-SDI-E, M32310T-SDI-E, etc.) is used which initializes SPU at start-up (a multiple of 4 is stored), the symptom described in (1) above does not appear; that is, the symptom appears only when the target system is used by itself.
- If any task is performed in the scheduler before it executes the above instruction that references an indefinite value, both the symptoms (1) and (2) do not appear since the initial value of SPU is defined.
- Conditions
The conditions for the problem's occurrence vary with the version of MR32R as follows:
- When any of the versions from MR32R V.1.00 Release 1 to V.1.10 Release 1 is used, this problem may occur if either of the following two conditions is satisfied:
(1) No initial starting tasks exist in the program.
(2) All the initial starting tasks have a priority greater than 32.
- When any of the versions from MR32R V.2.00 Release 1 to V.3.30 Release 1 is used, this problem may occur if either of the following two conditions is satisfied:
(1) No initial starting tasks exist in the program.
(2) All the initial starting tasks have a priority greater than 8.
- Workaround
- Modify the startup routine (crt0mr.ms or crt0mr.s) as shown below.
This modification allows SPU to be initialized and the scheduler to enable interrupts by adding dummy data. Note that the addition of dummy data consumes 4 bytes in the system stack in the direction of decreasing addresses from __Sys_Sp.
For CC32R (startup routine: crt0mr.ms)
------------------------------------------------------------------
[Modified]
__START:
ld24 r1,#__Sys_Sp
addi r1,#-4 <-- Added
mvtc r1,SPI ;SPI initialize
mvtc r1,SPU <-- Added
ldi r0,#-1 <-- Added
st r0,@r1 <-- Added
ldi r0,#NULL
mvtc r0,PSW ;PSW initialize
[Original]
__START:
ld24 r1,#__Sys_Sp
mvtc r1,SPI ;SPI initialize
ldi r0,#NULL
mvtc r0,PSW ;PSW initialize
------------------------------------------------------------------
For TW32R or D-CC/M32R (startup routine: crt0mr.s)]
------------------------------------------------------------------
[Modified]
__START:
ld24 r1,#__Sys_Sp
addi r1,#-4 <-- Added
mvtc r1,CR2 ;SPI initialize
mvtc r1,CR3 <-- Added
ldi r0,#-1 <-- Added
st r0,@r1b <-- Added
ldi r0,#NULL
mvtc r0,CR0 ;PSW initialize
[Original]
__START:
ld24 r1,#__Sys_Sp
mvtc r1,CR2 ;SPI initialize
ldi r0,#NULL
mvtc r0,CR0 ;PSW initialize
------------------------------------------------------------------
- Schedule of Fixing Problem
- We plan to fix this problem in our next release.
|
 |