Other Parts Discussed in Thread: MSP430WARE
Tool/software: Code Composer Studio
I'm trying to understand how to store a value (unsigned long) in FRAM that, ideally, won't get erased when reprogramming the chip.
First, the examples use a the PERSISTENT and NOINIT pragma, which seems straightforward. but do I need to worry about the address of those variables changing place in the future? For example, in this version of the firmware, I only store a single unsigned long. If I decided to store additional variables in the future, will the address for the original unsigned long stay the same? How do I find its address when using the NOINIT pragma?
Second, regarding NOINIT, I read SLAA628 - MSP430 FRAM Technolgoy - How To and Best Practices. In section 5.1 it states: (I added the emphasis) "Note that unlike PERSISTENT, variables declared as NOINIT do not get located in FRAM by the default linker command files, requiring a minor modification of the linker command file if such functionality is required." So... what needs to be modified in the link command file and how?
Third, looking at the msp430fr243x_framwrite.c example, I'm very confused. (I'm trying to link to it, but the editor keeps acting strangely. So, located at: TI Resource Explorer > Software > MSP430Ware > MS430FR2XX_4XX > MSP430FR2633 > Peripheral Examples > Register Level > msp430fr243x_framwrite.c.")
The description says you should disable interrupt while writing to the main FRAM. But then says "This code examples is using DFWP which wouldn't have dangerous." I have no clue what that statement means. The only thing that makes sense to me is that the example claims to be using DFWP.
In the code, FRAM-TEST_START is defined as 0x1800. Looking at the linker command file that corresponds with INFOA. Which has a comment that says "/* MSP430 INFO FRAM Memory segments */." (Side note, what is an INFO FRAM memory segment?) If this example is writing to FRAM, why isn't the start address 0xC400?
In the FRAMWrite() function it looks like SYSCFG0 unlocks PFWP not DFWP. I thought the clearly written description specifically stated this code was not doing anything with PFWP. So what is going on there?
Also, on the line the LED is toggled, the comment says "show 512 bytes." That doesn't make sense. The LED will toggle after 5120 bytes have been written. Or am I missing something?
Lastly, all of the marketing data I find says that FRAM doesn't have the life cycle issues of Flash. Yet this example clearly warns that "Running this example for extended periods will impact the FRAM endurance." Yikes! How dangerous is running this code?! What is defined as an "extended period?"