This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to initialize an array of pointers in Flash at compile time?



Hello,

I am currently trying to convert a working MSP430 project from IAR 2.x to the CCSv4.  I have an array of pointers that point to structures.  The structures and array of pointers are both in flash. When I build, the addresses in the array are all 0xFFFF as if it does not know the addresses of the structures.  However if I move the array to RAM it works fine.  Here are the declarations and intialization of some of the parts. 

struct StateMessage {
                       const unsigned char byMessage[4];
                       const unsigned long dwAttributes;
                     };

#pragma DATA_SECTION(Message000,".message");

#pragma DATA_SECTION(Message001,".message");

const struct StateMessage Message000 =
     { "TIME",COLONFL};

const struct StateMessage Message001 =
     { "TIME",OUTOFORDERFL+COLONFL};

#pragma DATA_SECTION(g_wszStateTable,".statetable");

const struct StateMessage *g_wszStateTable[4] = 
       {   

            &Message000, &Message001, &Message001, &Message001

        };