Robert Braisted

default pointer qualifiers for HC12 XEP100 (__far, __rptr)

Discussion created by Robert Braisted on Jan 19, 2010
Latest reply on Jan 22, 2010 by CompilerGuru

i am building for a board with the mc9s12xep100 target and using the banked memory model. When the data allocated to the DEFAULT_RAM section exceeds the 8K RAM, i need to modify my linker prm file to map additional data/variables into paged RAM so that everything will fit, for instance...

 

DEFAULT_RAM            

    INTO RAM, RAM_F4, RAM_F5, RAM_F6, RAM_F7, RAM_F8, RAM_F9, RAM_FA, RAM_FB, RAM_FC, RAM_FD;

 

PAGED_RAM INTO     RAM_F0, RAM_F1, RAM_F2, RAM_F3;

 

this allows the link to suceed instead of failing due to insuffient RAM allocation. Examing the resultant .map file shows the variables that get mapped to the RAM pages starting with RAM_F4. The problem we get is that our generated source code doesn't know what variables/objects the linker ends up mapping into paged ram and therefore doesn't know to add the __rptr or __far pointer qualifiers to pointers that are used to access this data. Alternatively, i've used the #pragma to force certain large data arrays into a RAM page as follows...(as per TN238)

 

#pragma DATA_SEG __RPAGE_SEG PAGED_RAM
  extern LargeDataStruct TestParams;
#pragma DATA_SEG DEFAULT

 

 but we still have the same problem in that our generated source code doesn't know that pointers to the TestParams data need to have the __rptr qualifier, so....

 

Is there a default compiler setting i can use that will cause all pointers to be declared with  __far qualifier? If so, what are the ramifications of that change, presumably some performance hit due to extra code required to use 24 bit pointers?

Outcomes