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.

MSP430FR6972: Question about FRAM routine

Part Number: MSP430FR6972

Routine: dev.ti.com/.../node

Dear team:

My customer found after using routines to perform FRAM read and write tests:

After running the routine, use the emulator to reload it and find that the address content of the write operation is all 0.

He made the following modifications to the routine:

#define WRITE_SIZE 128

#pragma PERSISTENT(FRAM_write)
unsigned char FRAM_write[WRITE_SIZE] = {0};

void FRAMWrite(unsigned char *buff,unsigned char len)
{
unsigned int i=0;

for ( i= 0; i < len; i++)
{
FRAM_write[i] = buff[i];
}

}


void FRAMRead(unsigned char *buff,unsigned char len)
{
unsigned int i=0;

for ( i= 0; i < len; i++)
{
buff[i]= FRAM_write[i] ;
}

In addition, he would like to know whether the emulator can set certain areas of the fram not to be erased? And, how can I read and write FRAM at a specified address?

Best regards

  • PERSISTENT data is re-initialized when the code is re-loaded. (It is not re-initialized on a Reset.) To avoid this, you could use NOINIT [Ref CC User Guide (SLAU132U) Sec 5.12.22]. Considerations with NOINIT:

    1) You should change the CCS download settings "Project->Properties->Debug->MSP430 Flash Settings" to "Replace written" or "..necessary segments". (Alternatively, use Information Memory.)

    2) Your code will have to figure out when to initialize the area, since its contents will be indeterminate.

**Attention** This is a public forum