daniel herve

CONST in banked Memory.

Discussion created by daniel herve on Jun 8, 2007
Latest reply on Jun 25, 2007 by CrasyCat
hello,
I work on a s12DG256 with CW 3.1 and SofTec inDart.

I want to put my const in banked memory.

I do this :

#include /* common defines and macros */
#include /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12dg256b"

int nCar=12;

#pragma CONST_SEG __PPAGE_SEG CONST_USER

const far int tada0=0x6655;
const far unsigned char Array[10] = {0xB9, 0xED};

#pragma CONST_SEG DEFAULT


void main(void) {

if (nCar > tada0) nCar = tada0 + Array[0];

for(;:smileywink: {} /* wait forever */
}


In map file (SofTec.map)I found :

*********************************************
SECTION-ALLOCATION SECTION
Section Name Size Type From To Segment
-------------------------------------------------
.init 69 R 0xC000 0xC044 ROM_C000
.startData 31 R 0xC045 0xC063 ROM_C000
NON_BANKED 14 R 0xC064 0xC071 ROM_C000
.copy 8 R 0xC072 0xC079 ROM_C000
.text 25 R 0x308000 0x308018 PAGE_30
CONST_USER 10 R 0x398000 0x398009 PAGE_39
.data 2 R/W 0x1000 0x1001 RAM


quite good my array is in the right place but ...

NOT USED VARIABLES
main.c.o:
tada0

tada0 is not in CONST_SEG !

I look to compiler option

-Cc -CpPPAGE=RUNTIME -D_HCS12 -D__NO_FLOAT__ -Lp=%n.pre -Mb -Onca -OnCstVa

-OnCstVar is check ( disable const variable by const replacement )


What can i do? where is my mistake? I turn in round on this question for a long time...

thanks,

Outcomes