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.

MSP430FR6989: Running Function from RAM (also with power-loos scenario)

Part Number: MSP430FR6989

Hi,

I'm currently working on the workaround for PMM32 Errata. Like in the datasheet I implemented the solution

What I see now is, that on power loss the device does not work anymore. Maybe data is lost in RAM.

I thought of copy the function from FRAM to RAM on system start to get rid of this behaviour. 

How is this done on a FRAM device with TI toolchain?

How do I have to declare in this case the placement of the function and the linker command file?

  • Hi, 

    I'm not sure what you mean. FR6989 is an FRAM MCU. Our workaround is to use a RAM function disable the FRAM. What's your concern?

  • The PMM32 Errata says to place the function which sets the chip to sleep should be placed in RAM (2KB on the MSP430fr6989)

    So I did this:

    #pragma CODE_SECTION(processSleepState,".TI.ramfunc")
    void processSleepState(sleepState_t sleepState)
    {
    //******* workaround PMM32 ***********
    FRCTL0 = FRCTLPW;
    GCCTL0 &= ~(FRPWR+FRLPMPWR); //clear FRPWR and FRLPMPWR
    FRCTL0_H = 0; //re-lock FRCTL
    //************************************
    __bis_SR_register(sleepState);
    __no_operation();
    }

    in linker command file I did this:

    #define RAM_CODE_BEGIN 0x1C60
    #define RAM_CODE_LENGTH 0x0020
    #define RAM_CODE_END = RAM_CODE_BEGIN + RAM_CODE_LENGTH

    MEMORY

    {

    ...

    RAM_LEGAL_CODE : origin = RAM_CODE_BEGIN, length = RAM_CODE_LENGTH  // 28

    ...

    }

    SECTIONS

    {

    ...

        .TI.ramfunc : {} > RAM_LEGAL_CODE

    ...

    }

    I don't know what the chip does, but I think this function is placed directly into RAM and when a power loss occurs the function is gone. Is this right?

    If yes I now want to place this function in the FRAM and copy it to the RAM on system start and execute it there. 

    Is this possible or are my assumptions wrong? And how is this done?

**Attention** This is a public forum