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.

[参考译文] TMS320F280039C:经优化的变量

Guru**** 2470230 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1479718/tms320f280039c-variable-optimized

器件型号:TMS320F280039C

工具与软件:

我已经 用 DATA_SECTION 定义了一个变量"版本":

".version_text"已在 cmd 文件中定义:

但变量"版本"仍 处于优化状态。

编译器版本为 TI v22.6.0.1.LTS。

如何保持版本不被优化?

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

    您好、Alice:

    感谢您的提问。 如果要保留此数据段、并且不让编译器将其删除、则还应使用 RETAIN pragma。  

    有关更多信息、请参阅编译器指南中的 RETAIN Pragma: https://www.ti.com/lit/ug/spru514z/spru514z.pdf

    此致、

    Ozino