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.

MSP430FR5972: INFO Memory Segment

Part Number: MSP430FR5972
Other Parts Discussed in Thread: MSP430F5232

Hi Experts,

I am using the MSP430FR5972 controller for my project and I want to log data into INFO memory so I need information regarding how to write data into INFO memory or we can directly access INFO memory.

Is there any code snippet available showing how to write data into INFO memory.

And I want to know wheather  Segment A of the information memory is locked separately from all other segments.(LIKE IN CONTROLLER MSP430F5232).

  • Hi Himanshu,

    Thanks for posting. You can define an array and set it to be placed in INFO memory by using for example:

    #pragma DATA_SECTION(loggingData, ".infoD")
    unsigned char loggingData[128];

    You can then access loggingData just as you would any array in RAM (e.g. loggingData[x] = 42; //write 42 to loggingData at index x) - since this is an FRAM device not Flash you don't have to do special handling like you did with the flash controller on MSP430F5232. However in this case you will also need to modify the MPU (memory protection unit) settings so that INFO memory has read + write access (default in MPU tool is read-only access for INFO memory). I can give you more details on how to do that if you would like, but first I want to make sure that using INFO memory is the right solution for your use case and make sure that I give you the correct recommendation for what you are trying to do.

    I would like to know a little bit more about your data logging - about how much data logging space will you need? The reason I ask about how much space you will need is because each section of INFO memory is only 0x80 bytes. But because this is an FRAM device, you can easily use a much larger piece of your FRAM for data logging if you would like. With FRAM you don't have to do any special handling you had to do on the FLASH device: in FLASH devices the INFO memory was especially important because you had to erase FLASH before you could write to it - using INFO memory allowed you to erase the area without risking erasing your code. On FRAM parts, instead you can use the main FRAM without fear because no erases are needed before writes, and because we provide an MPU (memory protection unit) to prevent you from accidentally overwriting your application code. The MPU allows you to partition main FRAM in up to 3 segments and set the access rights (read, write, execute) for each segment. We've made this simple by providing a method for automatic memory partitioning and MPU setup in CCS. Simply place any arrays etc that you want to be read + write accessible (e.g. logging data) into the .persistent area by using #pragma PERSISTENT.

    #pragma PERSISTENT(loggingData)
    unsigned char loggingData[2000] = {0};

    In this instance, you can leave everything at default in the MPU tool found at Project > Properties > General on the MPU tab (leave it at "enable MPU" and "let compiler handle memory partitioning..."). The loggingData will be retained through power cycles and you don't have to do any further special handling you can just treat it like a normal array in RAM. This allows you to have more data in your logging data if needed and you won't have to do any modification to get the MPU set correctly for your project.

    Regards,

    Katie

     

  • Hi Katie Pier,

    Thank You for the reply. Right now my requirement is just to log data of 20byte so can you share MPU settings which need to be changed to access INFO D so that I can read+write in INFO D.

  • Hi Himanshu,

    Thanks for the additional information. You can change this very simply in the MPU tool included in CCS. Go to Project > Properties > General. Select the tab for "MPU".

    Select Enable Memory Protection Unit (MPU) and then select "Manually specify memory segment boundaries and access rights". If all of your main FRAM area will only be used for consts and code, then we can set just one segment for all of the main memory by setting the boundaries to both be 0x4400 (the beginning of FRAM) and set the permissions to be read + execute. Then for INFO memory, choose read + write permission, so that you can use the info memory for your variables. See screenshot showing these settings:

    That should be all you have to do. Now you can place your logging data in the INFO D segment as I showed in the previous post.

    Regards,

    Katie

  • Thanks a lot for sharing this info.
    It really helped.
    Once last question is that if I want to log data in all info memory such as INFO Memory D,C,B, A then this is right way:

    #pragma DATA_SECTION(loggingData, ".infoD")
    unsigned char loggingData[128];

    #pragma DATA_SECTION(Data, ".infoC")
    unsigned char Data[128];

    #pragma DATA_SECTION(memory_data, ".infoB")
    unsigned char memory_data[128];
  • Hi Himanshu,

    Glad that I could help! Yes, this looks correct for logging additional data in the other info sections.

    Regards,

    Katie

**Attention** This is a public forum