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.

[参考译文] TMS320F2.8027万:函数位于何处?

Guru**** 2540720 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/618587/tms320f28027-where-does-the-function-reside

部件号:TMS320F2.8027万

您好,

对于以下代码:

#pragma code_section (example_CallFlashAPI,"ramfuncs");
void Example_CallFlashAPI (void)

funcA();

}

作废功能A (作废)

}

我知道函数"Example_CallFlashAPI"将驻留在ramfuns中,函数"funnA"是否也位于ramfuncs中?

谢谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,Howard:

    以下是 TMS320C28x编译器用户手册中的内容。

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

    这应提供一些澄清。 在您的示例中,只有函数example_CallFlashAPI()位于指定的部分。


    6.9 ............5代码段Pragma
    code_section pragma为C中的符号或C++中声明的下一个符号在名为节名的节中分配空间。

    C中pragma的语法为:
    #pragma code_section (符号,“节名”)

    C++中pragma的语法为:
    #pragma code_section ("段名称")

    如果要将代码对象链接到独立于.text部分的区域,则code_section pragma非常有用。

    Tom

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    霍华德

    我可以确认Tom的回答。 example_CallFlashAPI()是唯一一个将被放入ramfuncs中的程序。

    Whitney