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/MSP430FR5959: Variable in fram memory initialization

Part Number: MSP430FR5959

Tool/software: Code Composer Studio

When i set a variable in fram like this

#pragma SET_DATA_SECTION(".sysmem")
unsigned int framinit;
#pragma SET_DATA_SECTION()

Sometime the variable is initialized to 0xFFFF sometimes 0x0000

I have two different projects with identical linker files. But they behave different.

in both projects all unused fram is set to 0xFFFF

in both projects the variable is located at 0xC400

One project output

@c400
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

the other does not write anything to this part of memory.
File starts at 0xc800 where i have some code

I guessing there is a setting in code composer that is different in each project.

In the pass i just dealt with this behavior but i would like to know how to correct it so i can expect it to always work one way. 

I hope i explain this well... 

Thank you in advance.

  • Hello Gerald,

    Thanks for your posting.

    We will look into this for you and get back ASAP.

    Thanks,

    Yiding

  • Hello Gerald,

    I recommend to store variables in FRAM using  PERSISTENT or NOINIT.

    #pragma PERSISTENT

    • PERSISTENT should be assigned to FRAM in your default linker cmd file
    • You will need to initialize PERSISTENT variables 

    #pragma NOINIT

    • NOINIT is not assigned to FRAM in your default linker cmd file, you will need to change it .
    • You will not need to initialize NOINIT variables

    For more information, please refer this document: 

    http://www.ti.com/lit/an/slaa628/slaa628.pdf

    Thanks,

    Yiding

**Attention** This is a public forum