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.

MSP430FR5994: Save a 34K byte array in FRAM

Part Number: MSP430FR5994


I would like to save a 34K byte image into the 256K FRAM but my compiler gives the following error:

line 169: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment fails for section ".cinit" size 0x68d9.  Available memory ranges:

I have never encountered a 'trampoline' or the Cinit before.  

I am guessing i am crossing some kind of page boundary?

Is it possible to store an array of 34K bytes?

I created my buffer like this

#pragma SET_DATA_SECTION ( ".fram_vars") // Tell the compiler to put the buffer in FRAM
unsigned char display_buffer[33808] = {..........................data,data............}

Could you help or point me to some literature that can explain what to do please?

Thanks

  • Do you have a closing blank SET_DATA_SECTION pragma? The syntax from the CCS Compiler User Guide (SLAU132Y), section 5.11.30 shows correct usage. Since this is a snippet of code, can't tell if you are using it correctly. For a single variable, it's cleaner to just use the DATA_SECTION pragma instead.

    I'm assuming you didn't modify your linker (.cmd) file to define where "fram_vars" should be located?

  • Thanks Seth

    I did have the closing statement but i hadn't modified the .cmd file with the  "fram_vars"

  • Part of the problem with your situation is with a fresh project, just the "display_buffer" takes up 69% of the FRAM segment. Since it appears you are also setting an initial value to the buffer with the code snippet you shared above, all those values have to be store in the ".cinit" segment so that the values can be filled during C-runtime initialization. This initial data is compressed, but still takes up space. Unfortunately, the ".cinit" is in the same FRAM segment that the "display_buffer" is assigned to.

    Open your lnk_msp430fr5994.cmd file. Scroll down a little until you get to the SECTIONS directive; you'll see some declarations such as ".cinit", ".text:_isr", etc. In that same block, add an entry for ".fram_vars" following a similar format, but also allowing it to be fit into the 213k FRAM2 segment.

    Since this is such a large block of memory, you'll need to change a project setting as well so that it can actually build correctly.

    Project -> Properties -> Build -> MSP430 Compiler -> Processor Options

    Make sure data memory model is set to either restricted or large, and also set the near_data to none.

    This should allow your program to compile and link.

    [EDIT]: Addendum, you will still probably have issues with the MPU if it's enabled. Check out this post: https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/589551/reading-and-writing-to-fram2-on-msp430fr5994

  • Hi Seth

    thanks for the really clear explanation of what's happening an i appreciate your help with this

    I am still getting an error.

    "../lnk_msp430fr5994.cmd", line 169: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment fails for section ".cinit" size 0x68d9. Available memory ranges:

    FRAM size: 0xbf80 unused: 0x3b4c max hole: 0x3b4c

    My edits:


    #pragma SET_DATA_SECTION (".display_buffer") 
    unsigned char display_buffer[33808] = { 0X41,0X10,0X82,0X00,0X82,0X00,0X01,0X1B,...............................};

    #pragma SET_DATA_SECTION()     

    cheers 

    Nigel

  • Hi Seth

    thanks for the really clear explanation of what's happening an i appreciate your help with this

    I am still getting an error.

    "../lnk_msp430fr5994.cmd", line 169: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment fails for section ".cinit" size 0x68d9. Available memory ranges:

    FRAM size: 0xbf80 unused: 0x3b4c max hole: 0x3b4c

    My edits:


    #pragma SET_DATA_SECTION (".display_buffer") 
    unsigned char display_buffer[33808] = { 0X41,0X10,0X82,0X00,0X82,0X00,0X01,0X1B,...............................};

    #pragma SET_DATA_SECTION()     

    cheers 

    Nigel

    After some more reading i found a Ti blog that had an example.  I now have 115208 bytes in FRAM and a scrappy looking bitmap on my LCD.

    i did this:

    #pragma PERSISTENT(display_buffer)
    unsigned char display_buffer[115208] = { 0X01,0X10,0XF0,0X00,0XF0,0X00,0X01,0X1B,.....}

    unticked the Enable Memory Protection Unit

    Commented out .TI.persistant

    Added this:

    set this:

**Attention** This is a public forum