Tool News
 
 
 

Tool News

Products Info
Downloads
Tools FAQs
MAEC TOOL NEWS: MAECT-MR32R_2-010601D

MR32R
Precaution

Please take note of the following problem in using real-time OS MR32R for the M32R family of microcomputers:
  • On using the vref_mbx system call


  1. Versions Concerned
    MR32R V.3.20 Release 1 -- V.3.30 Release 1


  2. Description
    The ID number returned by the vref_mbx system call may be incorrect.
    2.1 Conditions
    This problem occurs if the following five conditions are satisfied:
    (1) The attribute of the mailbox taken as an argument by a vref_mbx system call is TA_TPRI.
    (2) An interrupt is requested during processing the vref_mbx system call.
    (3) The handler invoked by the interrupt in (2) issues an ichg_pri system call.
    (4) The ichg_pri system call alters a task's priority from low to high.
    (5) The mailbox ID of the mailbox for which the task whose priority was changed in (4) is waiting and the one that is taken as an argument by the vref_mbx system call in (1) are the same.


  3. Workaround
    Disable the interrupt before processing the vref_mbx system call and enable it after processing the system call.
        Example 1: Disabling and enabling interrupts by using loc_cpu() 
                   and unl_cpu() respectively
         ---------------------------------------------------------------------
         void task(stacd)
         {
                         :
                     loc_cpu();        /* Disables interrupts */
              ercd = vref_mbx(&rmbx,ID_mbx);
                     unl_cpu();        /* Enables interrups */
                        :
         }
         ---------------------------------------------------------------------
        Example 2: Disabling and enabling interrupts by using the asm function
         ---------------------------------------------------------------------
         void int_handler(void)
         {
                        :
                /* Disables interrupts */
    
                  asm(" mvfc      R0,PSW\n"
                      " and3      R0,R0,#0xFFBF\n"
                      " mvtc      R0,PSW\n");
    
              ercd = vref_mbx(&rmbx,ID_mbx);
    
                /* Enables interrupts */
                  asm(" mvfc      R0,PSW\n"
                      " or3       R0,R0,#0x0040\n"
                      " mvtc      R0,PSW\n");
                        :
         }
         ---------------------------------------------------------------------

  4. The Schedule of Fixing the Problem
    This problem has already been fixed in MR32R V.3.40 Release 1.
    For details refer to MAEC TOOL NEWS "MR32R V.3.40 Release 1 Upgraded Version Announcement" issued on June 1, 2001.





© 2008. Renesas Technology Corp., All rights reserved. Privacy | Legal