Part Number: MSP430FR5994
Hi!
In a data concentrator, I need to store some data in FRAM memory which could be updated depending on the radio communication with other devices. This data should be non-volatile, should not be affected by a hard reset, power cycle or code download. I did the following:
-code
unsigned int __attribute__((noinit)) NodeTable[16];
-linker script (I changed noinit location to HIFRAM)
/* This section contains data that is not initialised during load
or application reset. */
.noinit (NOLOAD) :
{
. = ALIGN(2);
PROVIDE (__noinit_start = .);
*(.noinit)
. = ALIGN(2);
PROVIDE (__noinit_end = .);
} > HIFRAM
I am using msp430-gcc, no IDE. I changed the memory model to mlarge. Here is the relevant memory map part:
.noinit 0x0000000000010002 0x20 0x0000000000010002 . = ALIGN (0x2) [!provide] PROVIDE (__noinit_start = .) *(.noinit) .noinit 0x0000000000010002 0x20 build/common/nvstore.o 0x0000000000010002 NodeTable 0x0000000000010022 . = ALIGN (0x2) [!provide] PROVIDE (__noinit_end = .)
So far so good, now hard reset or power cycles leave my data intact however the code download with MSP430Flasher resets the memory to 0xffff. My make install command is:
$(INSTALL) -n $(CPU_EXACT) -w $(BUILDDIR)/$(TARGET).hex -v -z [VCC]
Any advice would be greatly appreciated.