How to share the const data between CPU12 and xgate?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to share the const data between CPU12 and xgate?

ソリューションへジャンプ
2,361件の閲覧回数
100asong
Contributor I

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.

ラベル(1)
0 件の賞賛
返信
1 解決策
1,441件の閲覧回数
kef
Specialist I

1. "Expected ;" usually is a symptom of not recognised syntax. Maybe INTU8 is not defined in your code?

 

2. XGATE can't access misaligned words, thus XGATE compiler is padding >=2byte wide structure members. Try using in S12X code:

 

#pragma align on

#pragma align off

 

3. What you are doing is weird. You have two cores = you need to run two OS copies, one on S12X and another one on XGATE. From screenshot it looks like you are debugging the same OS on both cores. Shouldn't you try to run OS on one of cores first?

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,441件の閲覧回数
kef
Specialist I

XGATE is able to access only 30k of flash on PPAGE's E0 and E1. Thus only constants in pages E0 and E1 can be shared. Also S12X should be told constants are far.

 

#pragma CONST_SEG XGATE_CONST

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

    ...

    ...
  };

#pragma CONST_SEG DEFAULT

 

Shared header file should include this:

 

#pragma CONST_SEG XGATE_CONST

extern far INT8U  const  OSUnMapTbl[];

#pragma CONST_SEG DEFAULT

 

 

0 件の賞賛
返信
1,442件の閲覧回数
kef
Specialist I

1. "Expected ;" usually is a symptom of not recognised syntax. Maybe INTU8 is not defined in your code?

 

2. XGATE can't access misaligned words, thus XGATE compiler is padding >=2byte wide structure members. Try using in S12X code:

 

#pragma align on

#pragma align off

 

3. What you are doing is weird. You have two cores = you need to run two OS copies, one on S12X and another one on XGATE. From screenshot it looks like you are debugging the same OS on both cores. Shouldn't you try to run OS on one of cores first?

0 件の賞賛
返信
1,441件の閲覧回数
100asong
Contributor I

I use xgate to sub 1 for TCBDly counter,and find the highest priority task.And CPU switch task.

0 件の賞賛
返信