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.

Storing Structures in FRAM

Other Parts Discussed in Thread: MSP430FR4133

hi,

i am working with msp430fr4133, and i am using a structure to store data. the size of my strucuture is very large . by default it is going into .bss segment. i want it to go to FRAM. I am using ccs v6. this my strucutre:-

typedef struct button_press
{
	unsigned int remote_timinginfo[700];
}button;

typedef struct remote
{
unsigned char remote_id;
unsigned char remote_max_buttons;
unsigned char remote_frequency;
unsigned char remote_dutycycle;
struct button_press button[20] ;
};

  • Have you seen this document already? It explains how to place variables into FRAM.

    Dennis

  • Hi Dennis, Anup,

    There's actually an easier way now - use #pragma PERSISTENT to tell the compiler + linker that this should be placed in FRAM. (You can also use NOINIT, depending on what you are trying to do with these variables in FRAM) See www.ti.com/.../slaa628 and www.ti.com/.../slau132 for more information.

    For MSP430FR4133, the one thing that you need to note though is that this device does not have an MPU. So any time you want to do a write to the struct in FRAM, you need to clear the write protect bit, do the write, and set it again afterwards. You may need to also add __system_pre_init() and clear the write protect bit there to make sure that the c-startup code can write the initial value into the struct.

    Another option that might be desirable on MSP430FR4133 would be to instead use some other pragmas to explicitly place the struct in the INFO memory. The INFO memory has a separate write protect bit from main memory, so you could just leave the INFO memory write protect bit cleared/unlocked all the time while still having your main memory with your code in it protected. Whether this is an option will depend on how much space you need for your structs/variables vs the size of INFO memory.

    Regards,
    Katie
  • Thanks for the info, Katie. Didn't know that yet.
  • thanks katie and dennis for answering this question..

    katie i went through that link and i have added the .TI.noinit feild on to the linker file and its working fine.

**Attention** This is a public forum