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.

custom NOINIT section initializes my variable

Other Parts Discussed in Thread: MSP430F5328

Hello,

I am having a lot of trouble getting a variable to be located at a specific location in RAM while also declaring it as a NOINIT variable.

In my linker file I have the section defined as:

.BATTERY_INFO_SECTION : {} > BATTERY_INFO type=NOINIT // Do not initialize the battery information

Where BATTERY_INFO is assigned to 0x1c00 with a length of 8.

In my code I have a variable defined as follows:

#pragma DATA_SECTION(_batMod_totalEnergy, ".BATTERY_INFO_SECTION")
volatile unsigned long long _batMod_totalEnergy;

However, When i run on the debugger, I see that variable getting initialized to 0 after every soft reset (watchdog instigated).

If i don't put it in a specified data section and just label it as #pragma NOINIT() then it works, however I still need to force the variable to specified location in RAM.

I am using CCS 5.4.0.00091 and compiler version 4.1.5.  My board is a MSP430F5328, so while this doesn't have FRAM, I should still be able to maintain the value across soft resets.  

Everything I have read has indicated this should work, so I am at a loss.  Any help would be greatly appreciated!

**Attention** This is a public forum