 |
|
 |
RENESAS TOOL NEWS [July 1, 2003: RSO-M3T-MR32R-030701D]
Notes on Using Real-Time OSes M3T-MR32R
|
Please take note of the following problems in using the M3T-MR32R real-time OSes for the M32R family MCUs:
- On using the vdel_mbx system call
- On executing system calls by using an assembler macro
- Problem on Using vdel_mbx System Call
- 1.1 Versions Concerned
- M3T-MR32R V.3.20 Release 1--V.3.40 Release 1
- 1.2 Description
- The waiting state of a task that waits for receiving a message from a mailbox with priority may not be cleared.
- 1.3 Conditions
- This problem occurs if the following five conditions are satisfied in this order:
| (1) | There exists a mailbox a property of which is TA_TPRI. |
| (2) | A task is waiting for receiving a message from the mailbox in (1). |
| (3) | The mailbox in (1) is deleted by the vdel_mbx system call. |
| (4) | During the vdel_mbx system call's processing in (3), an interrupt request is generated and the ichg_pri system call is issued by the interrupt handler. |
| (5) | The ichg_pri system call in (4) assigns higher priority to the task in (2). |
- 1.4 Workaround
- To circumvent this problem, disable any interrupt request until the vdel_mbx system call is complete; then enable it.
- Example 1: Using the loc_cpu() and unl_cpu() system calls to disable and enable interrupt requests
----------------------------------------------------------------
void task(stacd)
{
:
loc_cpu(); /* Interrupt request disabled */
ercd = vdel_mbx(ID_mbx);
unl_cpu(); /* Interrupt request enabled */
:
}
----------------------------------------------------------------
- Example 2: Using asm functions to disable and enable interrupt requests
----------------------------------------------------------------
void int_handler(void)
{
:
/* Interrupt request disabled */
asm(" mvfc R0,PSW\n"
" and3 R0,R0,#0xFFBF\n"
" mvtc R0,PSW\n");
ercd = vdel_mbx(ID_mbx);
/* Interrupt request enabled */
asm(" mvfc R0,PSW\n"
" or3 R0,R0,#0x0040\n"
" mvtc R0,PSW\n");
:
}
----------------------------------------------------------------
- 1.5 Schedule of Fixing the Problem
- This problem has already been fixed in M3T-MR32R V.3.50 Release 1.
- Problem on Executing System Calls by Using an Assembler Macro
- 2.1 Versions Concerned
- M3T-MR32R V.2.00 Release 1--V.3.40 Release 1
- 2.2 Description
- If any of the system calls listed below * is executed using an assembler macro **, an assemble error occurs or no correct parameter is passed to the system call.
NOTES:
| * | The system calls involved vary according to the combinations of the versions of M3T-MR32R and compilers. |
| ** | In the M3T-MR32R, an assembler macro for executing system calls is defined to use system calls in assembly language. |
- System calls involved:
| (a) | M3T-MR32R V.3.20 Release 1--V.3.40 Release 1
| Compilers |
| M3T-CC32R | M3T-TW32R | D-CC/M32R * |
ref_mbf,def_exc vrst_mbf | ref_mbf,def_exc vrst_mbf,irel_blf |
ref_mbf,def_exc vrst_mbf,irel_blf tslp_tsk,iset_flg set_tim,get_tim get_ver |
NOTE:
| * | The D-CC/M32R compiler, manufactured by Wind River Systems, Inc., can be used in combination with M3T-MR32R V.3.20 Release 1 or later. |
|
|
| (b) | M3T-MR32R V.3.00 Release 1 and V.3.10 Release 1
| Compilers |
| M3T-CC32R | M3T-TW32R |
ref_mbf,def_exc vrst_mbf,tslp_tsk tcal_por,tacp_por vrst_msg |
ref_mbf,def_exc vrst_mbf,irel_blf tslp_tsk,tcal_por tacp_por,vrst_msg |
|
|
| (c) | M3T-MR32R V.2.00 Release 1 and V.2.00 Release 2
| Compilers |
| M3T-CC32R | M3T-TW32R |
| snd_msg,isnd_msg | snd_msg,isnd_msg |
|
Example of calling ref_mbf using an assembler macro:
------------------------------------------
; ref_mbf
LD24 R2,#_rmbf
ref_mbf 9
------------------------------------------
- 2.4 Workaround
- Don't use an assembler macro to execute system calls; execute them by setting parameters in accordance with the descriptions in Chapter 3 "APPENDIX: Assembly Language Interface" of the M3T-MR32R Reference Manual.
Example of executing ref_mbf without using an macro
------------------------------------------
; ref_mbf
LD24 R2,#_rmbf
LDI R1,#9
LDI R0,#TFN_REF_MBF
TRAP #8
------------------------------------------
- 2.5 Schedule of Fixing the Problem
- This problem has already been fixed in M3T-MR32R V.3.50 Release 1.
|
 |