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.

TMS320F280048-Q1: Purpose of __attribute__(())

Part Number: TMS320F280048-Q1

Hi,

I saw some kind of usage of __attribute__(()) in some reference software. I'm trying to understand what they are and what their help is.

1) What does it to do writing __attribute__((ramfunc)) on the line before writing a function? What are the benefits of using it?

2) Do I need to configure linker command file accordingly if I write this? If yes, how should I do it?

Thanks in advance.

  • HI,

    __attribute__ is a compiler directive,  details about it can be found in the Compiler User guide - https://www.ti.com/lit/ug/spru514y/spru514y.pdf

    Specifically , the ramfunc is a directive which specifies the compiler that the function will be placed in and executed from RAM. The ramfunc attribute allows the compiler to optimize functions for RAM execution, as well as to automatically copy functions to RAM on flash-based devices. 

    The linker command file should have a sectiion to specify where to load this function in RAM .

    Best Regards

    Siddhath