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.

[参考译文] CCS/TMS320F28377S:抑制警告:将 RTOS 全局变量排列到固定地址

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/885612/ccs-tms320f28377s-suppress-the-warning-arrange-rtos-global-variables-to-fixed-address

器件型号:TMS320F28377S

工具/软件:Code Composer Studio

您好专家、

我的客户需要 将 RTOS 全局变量排列到固定地址。

因此、它们使用 pragma DATA_Section、然后实现了他的目标。

但是、这些 RTOS 全局变量有一些警告。

#824D pragma DATA_SECTION 只能应用于文件级符号定义。

我让客户在他的项目中测试该方法。 但是、没有任何变化。

那么、我想知道如何实现这些目标呢?

BR Emma

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

    [引用 USER="Emma Wang "] 这些 RTOS 全局变量有一些警告。

    则它们不能是全局变量。  考虑以下示例...

    /*支持*/
    #pragma DATA_SECTION (global_variable、"SPECIAL_DATA")
    int global_variable = 10;
    
    /*支持*/
    #pragma DATA_SECTION (file_static_variable、"SPECIAL_DATA")
    static int file_static_variable = 20;
    
    int function ()
    {
    /*不支持*/
    #pragma DATA_SECTION (FUNCTION_STATUS_variable、"SPECIAL_DATA")
    static int function_static_variable = 30;
    
    /*不支持*/
    #pragma DATA_SECTION (FUNCTION_LOCAL 变量、"SPECIAL_DATA")
    int function_local_variable;
    

    请注意如何在函数内定义最后两个变量。  如果以这种方式定义了这些 RTOS 变量、则不支持#pragma DATA_SECTION。

    谢谢、此致、

    乔治