AnsweredAssumed Answered

How to share the const data between CPU12 and xgate?

Question asked by li cang on May 7, 2010
Latest reply on May 12, 2010 by li cang

Hi,Sir

      Please give support about it,any advice is welcome.

     I am transfering UCOS-II to MC9S12XEP,I let xgate create time tick.

     The TickISR function in xgate is here:

void interrupt  RtiHandler(int dataptr)
{

        u8 y;

         ...

         ...
           y             = OSUnMapTbl[OSRdyGrp];          /* Get pointer to HPT ready to run              */
        OSPrioHighRdy = (INT8U)((y << 3) + OSUnMapTbl[OSRdyTbl[y]]);

 
      if(OSPrioHighRdy!=OSPrioCur)
      {
        asm("SIF");
        //{ SIF } ;
      }
 
}

OSUnMapTbl is defined in OS_CORE.c file.

  INT8U  const  OSUnMapTbl[] = {
    0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x00 to 0x0F                             */

    ...

    ...
  };

Now we can enter RTI_Handler,but y  can not get the right value.

question:

1. whether we should add some sentence to share OSUnMapTbl?

 

   I have a try here to share OSUnMapTbl:

#pragma CONST_SEG  XGATE_CONST_FLASH

  INT8U  const  OSUnMapTbl[] = {

...

#pragma CONST_SEG  DEFAULT

 

But system can not enter RtiHandler interrupt.

question:

2.How to share const variable?

3.Why we can not enter RtiHandler since add " #pragma CONST_SEG  XGATE_CONST_FLASH"

 

Please give me help.Wait online.thanks.

Outcomes