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.

MSP432 ramfunc problem

Hi all,

(MSP432, CCS 6.1.2)

I've created a new project (using the "MSP432 Driverlib - Empty Project with DriverLib" tempate) and I'd like to force one of the functions in my code to run from RAM (make it a ramfunc) but I can't get this to work. 

My linker file (the standard one generated when you create a new project) contains the following

SECTIONS
{
    .intvecs:   > 0x00000000
    .text   :   > MAIN
    .const  :   > MAIN
    .cinit  :   > MAIN
    .pinit  :   > MAIN
    .init_array   :     > MAIN
    .binit        : {}  > MAIN

    .flashMailbox : > 0x00200000

    .vtable :   > 0x20000000
    .data   :   > SRAM_DATA
    .bss    :   > SRAM_DATA
    .sysmem :   > SRAM_DATA
    .stack  :   > SRAM_DATA (HIGH)

#ifdef  __TI_COMPILER_VERSION__
#if     __TI_COMPILER_VERSION__ >= 15009000
    .TI.ramfunc : {} load=MAIN, run=SRAM_CODE, table(BINIT)
#endif
#endif

I append an attrribute to my function as follows

__attribute__((ramfunc)) void alg(.....) {  }

when I compile I'm given the warning "#1173-D unknown attribute "ramfunc"

I've also tried

#pragma CODE_SECTION(chaskey, ".TI.ramfunc")

void alg(.....) {  }

which gives the compile wanring "#10247-D creating output section ".TI.ramfunc" without a SECTIONS specification" 

In both cases, when I check the map file, I see nothing about a ramfunc section

Can anyone suggest what I'm doing wrong? 

References

https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/516600/1876179#1876179

https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/475690/1788958#1788958

https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/456985/1650130

http://www.ti.com.cn/cn/lit/ug/spnu118o/spnu118o.pdf

  • msp432p401r.cmdJulian,

       Can you also provide the compiler version that you are using?  I do not see any issues/warnings on my end but also my cmd file looks a little different.

    Regards,
    Chris

  • G'Day Chris,

    Please find attached a complete example project that generates this warning for me.

    I'm using CCS 6.1.2, TI compiler v5.2.7. 

    Project was generated by clicking project menu - > New CCS Project ->  Project Templates -> MSP432 DriverLib - > Empty Project with Driverlib (then add project name and click finish)

    Cheers

    Julian

    TestRAMFUNC.zip

  • Julian,
    You do need to use a higher version compiler. That is why in the command file it checks for a compiler version greater than 15.09.00

    /* Hint: If the user wants to use ram functions, please observe that SRAM_CODE */
    /* and SRAM_DATA memory areas are overlapping. You need to take measures to separate */
    /* data from code in RAM. This is only valid for Compiler version earlier than 15.09.0.STS.*/

    You can add the ARM compiler to CCS using the CCS App Center

    Help->CCS App Center
    In the Apps Center you will see the TI ARM Compiler CCS Add On. Once you have installed this you will be able to select a higher version compiler.

    Best Regards,
    Chris
  • G'Day Chris,

    The new compiler does indeed sort out my problem.

    Unfortunately clicking help->check for updates had not brought up any compiler updates for ages, so I though I *was* up to date with v5.2.7.

    But App Center did give me the newest compiler.

    Thanks!
    Julian

**Attention** This is a public forum