AnsweredAssumed Answered

Share data between XGATE and S12X

Question asked by KoT on Mar 12, 2009
Latest reply on Mar 16, 2009 by Tom Thompson

I use for working out of program CodeWarrior 4.7 for HC12X.  

The code such:


main:

#pragma DATA_SEG SHARED_DATA

volatile int shared_counter; /* volatile because both cores are accessing it. */

volatile unsigned char* p;

#pragma DATA_SEG DEFAULT

 

xgate:

#pragma DATA_SEG SHARED_DATA

volatile extern int shared_counter; /* volatile because both cores are accessing it. */

volatile extern unsigned char* p;

#pragma DATA_SEG DEFAULT 


With variables all works remarkably but if it is necessary to use the pointer problems begin. In XGATE and in HC12 under the same pointer there is various data. I believe that the pointer specifies in various cells of memory in XGATE and in HC12.

Prompt as to be?

Outcomes