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.

MSP430FR5969-SP: Need help storing a constant in FRAM

Part Number: MSP430FR5969-SP
Other Parts Discussed in Thread: MSP430FR5969

Hi Experts

My customer had the following initial question:

I have other questions about storing the constants in the section “INFOA” of FRAM.

  1. Which area of FRAM can we use for storing the constants?
  2. Can we use section “INFOA” for that purpose? If so and how? If not where we can store them and how?

I responded with these e2e thread links which looked promising:

https://e2e.ti.com/support/microcontrollers/msp430/f/msp-low-power-microcontroller-forum/981193/msp-exp430fr2355-regarding-fram-store-in-msp430fr2355/3627070?tisearch=e2e-sitesearch&keymatch=msp430%20fram%20storing%20constants#3627070

 https://e2e.ti.com/support/microcontrollers/msp430/f/msp-low-power-microcontroller-forum/953555/msp430fr5994-unable-to-modify-persistent-data-stored-in-fram?tisearch=e2e-sitesearch&keymatch=msp430%25252520fram%25252520storing%25252520constants#

 https://e2e.ti.com/support/microcontrollers/msp430/f/msp-low-power-microcontroller-forum/986907/msp430fr2355-how-to-read-write-in-fram?tisearch=e2e-sitesearch&keymatch=msp430%252525252525252520fram%252525252525252520storing%252525252525252520constants#

It doesn't sound like he has it working yet, his latest comments and questions are as follows:

I read through the examples of the link, I tried something in which closed to my evaluation board’s model “MSP430FR5969” but no success.

Below is my really simple code:

////////////

#include <msp430.h>

#include <string.h>

#include <stdint.h>

#include <stdio.h>

#include "driverlib.h"

 

uint8_t val = 0x0;

#pragma PERSISTENT(a)

#pragma LOCATION(a,0x1980)

unsigned char a = 0x25;

int main(void) {

 

 

    WDT_A_hold(WDT_A_BASE);

    val = 0x55;

    a = val;

 

    printf("val =0x%x\n", val);

    printf(" a  =0x%x\n", a);

    return (0);

}

////////////

The output from the example is

val =0x55

a  =0x25

///

I expected to see the output:

val =0x55

a =0x55

 

Can someone provide recommended code to get him going?

Thanks!

Jim B

  • To make Information Memory writable, you need to re-configure the MPU.

    Start at "Show Build Settings->CCS General->MPU [tab]". Then

    1) Set the button "Manually Specify Segments"

    2) Next to "Info Memory" check the "W" box.

    3) For "Segment 1" to "Segment 3", check the "X" box. (This is to allow your code to go there. I don't know why this doesn't happen automatically.)

    4) For "Segment 1" to "Segment 3", uncheck any "W" boxes. (This is to protect your code from accidental overwrite.)

  • You can take this as an example

    #pragma RETAIN(bsl_password)
    #pragma LOCATION(bsl_password,0xFFE0)
    const unsigned char bsl_password[30] = {
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF //Retain two bytes at end of the array by the boot code's start address to make sure the password to be 32 bytes
    };

**Attention** This is a public forum