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.

MSP430FR2633: Writing to Array in FRAM

Expert 1600 points
Part Number: MSP430FR2633


Hello, 

I'm trying to reserve a large uint8_t array segment in MSP430FR2633 FRAM to keep data in it available if the device was to be power cycled.

1- I declared the array in FRAM using #pragma Persistent

// Statically-initialized variable
#ifdef __TI_COMPILER_VERSION__
#pragma PERSISTENT(Array_Placeholder)
uint8_t Array_Placeholder[2000] = {0xFF};
#elif __IAR_SYSTEMS_ICC__
__persistent uint8_t Array_Placeholder[2000] = {0xFF};
#endif

2- I created a pointer to this array

uint8_t *FRAM_write_ptr;

int main(void) {
    WDTCTL = WDTPW | WDTHOLD;                       // Stop watchdog timer

    initClockTo16MHz();

    FRAM_write_ptr = Array_Placeholder;            // Set FRAM_write_ptr to START location

    __bis_SR_register(LPM0_bits + GIE);
    return 0;
}

3- My write procedure follows one of TI's reference examples:

    __disable_interrupt();                          // disable interrupts
    SYSCFG0 = FRWPPW | PFWP;                        // Program FRAM write enable
    for (count = 0; count < 10; count++)
    {
        *(FRAM_write_ptr + count) = dataToBeWritten[count+6];
    }
    SYSCFG0 = FRWPPW | PFWP | DFWP;                 // Program FRAM write protected (not writable)
    __enable_interrupt();                           // enable interrupts

The Problem is no matter what I write, the values in Array_Placeholder don't change. What's the problem?

**Attention** This is a public forum