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.

TMS320F28027: where does the function reside?

Part Number: TMS320F28027


Hi,

For the codes below:

#pragma CODE_SECTION(Example_CallFlashAPI,"ramfuncs");
void Example_CallFlashAPI(void)
{

funcA();

}

void funcA(void)

{

}

I know that function "Example_CallFlashAPI" will reside in ramfuncs, will the function "funcA" also be in ramfuncs?

Thanks.

  • Hi Howard,

    The following is from the TMS320C28x compiler user manual.

    http://www.ti.com/lit/ug/spru514n/spru514n.pdf

    This should provide some clarification. In your example, only the function Example_CallFlashAPI() would be located in the specified section.


    6.9.5 The CODE_SECTION Pragma
    The CODE_SECTION pragma allocates space for the symbol in C, or the next symbol declared in C++, in a section named section name.

    The syntax of the pragma in C is:
    #pragma CODE_SECTION (symbol , "section name")

    The syntax of the pragma in C++ is:
    #pragma CODE_SECTION ("section name ")

    The CODE_SECTION pragma is useful if you have code objects that you want to link into an area separate from the .text section.

    Tom

  • Howard,

    I can confirm Tom's answer. Example_CallFlashAPI() is the only one that will be put in ramfuncs.

    Whitney