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/MSP-EXP430FR5969: Save data on FRAM and retreive it using the launchpad with the MSP430FR5969

Part Number: MSP-EXP430FR5969

Tool/software: Code Composer Studio

Hello!

I'm writing a firwmware in which I get a lot of measurement data that doesn't fit the RAM. I need to save this data on FRAM for getting it later. It seems to be very simple, but I'm failing.

For what I understood, I can use the vacant memory not used in the memory organization table 6.6 of the microcontroller datasheet. There are 2 vacant memory gaps on the table: 0x1B00-0x1BFF (256 16-bit positions) and 0x2400-0x43FF(8192 16-bit positions). I'm trying to use the biggest one.

I press a button and try to record a number in the position 0x2400 and read it. Below, a part of my code:

    unsigned int *address=(unsigned int *)0x2400; // 9216
        char buffer[30];
        snprintf(buffer, 30, "address = %lu.\r\n", address);
        transmitUSB(buffer);
        snprintf(buffer, 30, "*address = %u.\r\n", *address);
        transmitUSB(buffer);
    *address=0x0001u;
        snprintf(buffer, 30, "*address = %d.\r\n", *address);
        transmitUSB(buffer);
        snprintf(buffer, 30, "*address = %d.\r\n", *(address++));
        transmitUSB(buffer);
        snprintf(buffer, 30, "*address = %d.\r\n", *(address++));
        transmitUSB(buffer);

But the response I get is:

address = 9216.
*address = 16383.
*address = 16383.
*address = 16383.
*address = 16383.

I'm not saving the number, and all the 3 consecutive addresses give the same result.

  • In this context "vacant" means "there's really nothing there". You need to use one of the FRAM segments (Main or Information) seen in data sheet (SLASS704F) Table 6-6. You'll have to explicitly make that segment writable in the MPU.

    1) Make one of the segments writable using Build Settings->General->MPU. [CCS User Guide (SLAU157AP) Section 4.1]
    2) Locate your variable there using "#pragma NOINIT(var)" and "#pragma LOCATION(var,0xXXX)". [CCS cc UG (SLAU132S) Sections 5.12.21-22]
  • Thank you very much for the help, Bruce!

**Attention** This is a public forum