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.

CCS/MSP430FR5994: Usage of FRAM for structure in C

Part Number: MSP430FR5994

Tool/software: Code Composer Studio

Dear team,

Can you please help us to make member of the structure element as #PERSISTENT to make it as FRAM variable in C using Code composer studio.

for eg:

struct strmain

{

struct strsubmain

{

int a;

int b;

}strsubmain;

int c ;

int d;

}strmain;

I want to use #PERSISTENT for strsubmain  member of main structure. what will be the syntax for this. tried many methods. not working out.

Thanks & regards,

Anil Dsouza

  • By #PERSISTENT, I presume you mean #pragma PERSISTENT as described in the MSP430 compiler manual.

    Vijeth K Shastry said:
    I want to use #PERSISTENT for strsubmain  member of main structure.

    Unfortunately, that is not possible.  The point of control is a single C variable.  strsubmain is not a variable, but a structure that is contained within a larger structure.  For the example you show, #pragma PERSISTENT can be applied to strmain, but not strsubmain.

    Thanks and regards,

    -George

  • Dear George,

    Thank u. Yea i was referring to #pragma PERSISTENT. 

    Any chance of  having this feature implemented in coming near future ?

    Thanks & Regards,

    Anil Dsouza

  • Vijeth K Shastry said:
    Any chance of  having this feature implemented in coming near future ?

    Unfortunately, no.  The C standard requires that elements of a structure be laid out in memory in the same sequence as given in the source.  For that reason, it is not possible for one part of a structure to be in one range of memory, and another part of that same structure in a different range of memory.

    Thanks and regards,

    -George