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.

MSPM0G3507: mspm0g3507 : reserve a memory sector for run time data save.

Part Number: MSPM0G3507

Tool/software:

Hi support,

I need to save my variables at run time at sector 310x00007C00, length = 0x00000400, last sector of high endurance)..

How can I reserve this sector not over write by compiler for any other code.

Best Regards

Tulsi Das

VP electronics.

  • Hi,

    You can do something like this.

    MEMORY
    { 
        FLASHVEC 		(RX)  : origin = 0x00000000, length = 0x00000400 //intvecs must always point to 0x0
        USER_VARIABLES  (RW)  : origin = 0x00007C00, length = 0x00000400
        FLASH           (RX)  : origin = 0x00008000, length = 0x00020000
    
        SRAM            (RWX) : origin = 0x20200000, length = 0x00008000
        BCR_CONFIG      (R)   : origin = 0x41C00000, length = 0x000000FF
        BSL_CONFIG      (R)   : origin = 0x41C00100, length = 0x00000080
    }

    However, there will be a gap in your flash between FLASHVEC and USER_VARIABLES.

    If you don't require your variables to be stored at 0x7C00, then you could eliminate that gap by placing them at 0x400.

    MEMORY
    { 
        FLASHVEC 		(RX)  : origin = 0x00000000, length = 0x00000400 //intvecs must always point to 0x0
        USER_VARIABLES  (RW)  : origin = 0x00000400, length = 0x00000400
        FLASH           (RX)  : origin = 0x00000800, length = 0x00020000
    
        SRAM            (RWX) : origin = 0x20200000, length = 0x00008000
        BCR_CONFIG      (R)   : origin = 0x41C00000, length = 0x000000FF
        BSL_CONFIG      (R)   : origin = 0x41C00100, length = 0x00000080
    }

    -Matthew

  • Hi Matthew,

    Thank you for your reply. I need more clarification over this issue as I just start working with TI controller switched from Microchip.

    I placed below code in device_liker.cmd file

    MEMORY
    {
        FLASHVEC        (RX)  : origin = 0x00000000, length = 0x00000400 //intvecs must always point to 0x0
        USER_VARIABLES  (RW)  : origin = 0x00000400, length = 0x00000800
        FLASH           (RX)  : origin = 0x00000800, length = 0x00020000
        SRAM            (RWX) : origin = 0x20200000, length = 0x00008000
        BCR_CONFIG      (R)   : origin = 0x41C00000, length = 0x00000080
        BSL_CONFIG      (R)   : origin = 0x41C00100, length = 0x00000080
    }





    It is automatic replaced back by syscfg as I build it again. Now I stop auto update as below.

    But building project have errors..

    I think I am missing some more step to follow or I am placing suggested flash change at wrong place. Could you please write all missing steps in details ? How to use  "USER_VARIABLES  (RW)  : origin = 0x00000400, length = 0x00000800" in my mains code?

    Best Regards

    Tulsi Das

  • Hi Matthew,

    here is correction in memory setting as


    MEMORY
    {
        FLASHVEC        (RX)  : origin = 0x00000000, length = 0x00000400 //intvecs must always point to 0x0
        USER_VARIABLES  (RW)  : origin = 0x00000400, length = 0x00000400
        FLASH           (RX)  : origin = 0x00000800, length = 0x0001F800
        SRAM            (RWX) : origin = 0x20200000, length = 0x00008000
        BCR_CONFIG      (R)   : origin = 0x41C00000, length = 0x00000080
        BSL_CONFIG      (R)   : origin = 0x41C00100, length = 0x00000080
    }

    But doesn't effect the result.

    Best Regards

    Tulsi Das

  • Hi,

    You need to stop syscfg from generating the linker file. See below for an example.

    As for placing the variable in the correct section --> Take a look at this document. It has examples that show various different types of "attributes" that can attached to objects. 

    -Matthew