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.

[参考译文] 编译器/TMS320F28377S:编译器工具 TI v18.1.LTS。 链接器似乎会添加具有.out 文件中.econst 段路径的源文件名

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/712053/compiler-tms320f28377s-compiler-tools-ti-v18-1-1-lts-the-linker-seems-to-add-source-file-names-with-path-to-econst-section-in-the-out-file

器件型号:TMS320F28377S
主题中讨论的其他器件:TMS320F28374S

工具/软件:TI C/C++编译器

您好!

我使用编译器版本18.1.1 LTS 为采用 TMS320F28374S 的电路板生成软件。 该固件在闪存中运行。

在编译过程之后、在.out 文件的.econst 段中有包含 soruce 文件名称的字符串文字。

示例:(使用十六进制编辑器)

我认为链接器会将这些字符串文字添加到.econst、因为我已抑制编译器中的所有符号调试生成(选项--symdebug:none)

在此过程结束时、我使用 hex2000实用程序生成 Intel Object 格式文件、然后使用自定义计算闪存的 CRC、

econst 段被分配在闪存区域中、因此、如果源文件的路径发生变化、CRC 也会发生变化。

到目前为止、我使用了旧的复杂版本、例如6.2.11、我没有遇到任何问题。

如何解决此问题?

---编译器选项---

-v28 -ml -mt --float_support=fpu32 --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_18.1.1.LTS/include --include_path="C:/Temp/CH111C/trunk/inc /Temp/CH111C/trunk/sdk/ti/c2000/device_support/f2837xs/headers/include /Temp/CH111C/trunk/build/CH111C/Debug --include_path="C:/Temp/CH111C/trunk/sdk/inc --include_path="C:/Temp/CH111C/trunk/sdk/ti/c2000/driverlib/f2837xs/driverlib --include_path="C:/Temp/CH111C/trunk/sdk/ti/c2000/device_support/f2837xs/common/include /Temp/CH111C/trunk/build/CH111C/Debug --include_path="C:ine_display=dote_gues=/Temp/CH111C/trunk/build/CH111C/Debug --define=dote_gues=coverview-coverview=cude_display-cine-directory=cep-cine-guide-guide-ding_debotep-ines=cines=cine-directory=-ines=-ines=coverview-ine-guide-guide-cep-ines=-ines=coverview-coverview-cine-directore-guide-gues=-cep-ines=-ines=coverview-coverview-cep-ine-directore-directore-guide-cep-ines=-ines=-ine-directore-directory=-ine-guide-de-

------------------------------------------

----链接器选项-------

-v28 -ml -mt --float_support=fpu32 --advice:performance=all --define=cpU1 --define=debug --define=dual_headers --define=ch111 --define=DCLOCK --define=BOOT1CMODE_SUPPORTED --define=ENET --etrature=EN_excluse-excluse-excluse-ine-ine-ine-excluse-exclusion-ine-ine-intrad_excluse-excluse-direction-ine-ine-ine-ine-control-ine-ine-ine-excluse-excluse-excluse-excluse-ine-ine-ine-ine-intrad_ine-control-ine-ine-ine-intrad_exclude-ine-ine-ine-excluse-ine-ine-ine-control-ine-ine-ine-ine-ine-ine-intrad_ine-exclude-ine-ine-ine-ine-ine-excluse-ine-excluse-in /ti/ccsv7/tools/compiler/ti-cgt-c2000_18.1.1.LTS/include /ti/ccsv7/tools/compiler/ti-cgt-c2000_18.1.1.LTS/lib /Temp/CH111C/trunk/build/CH111C/Debug/CH111C.map /Temp/CH111C/trunk/build/CH111C/Debug /Temp/CH111C/trunk/build/CH111C/Debug /Temp/CH111C/trunk/build/CH111C/Debug

--------------------------------------

Code Composer 版本: 7.4.0.00015

谢谢、此致

Massimo Ceschi

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

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

    我强烈怀疑某些头文件会将该字符串插入源代码中。  若要进行调试、请像以前一样构建、但还要添加选项 -gen_preprocessor_listing。  在 C28x 编译器手册中查找该选项。  它会创建与源文件具有相同基本名称的文件、扩展名为.RL。  在本例中、您不知道哪个源文件添加了问题字符串。  因此、在构建整个项目后、在所有.RL 文件中搜索意外的字符串。  我相信您会找到它、然后了解如何避免它。

    谢谢、此致、

    乔治

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

    正如您所说的、我添加了选项-gen_preprocessor_listing、我发现 问题的原因是  驱动程序库的头文件 debug.h 中定义的宏断言、该断言是由编译时开关"debug"启用的。

    在 effetct assert 中、引用源文件的完整路径。 这是我在.econst 段中看到的文学字符串。

    非常感谢!

    Massimo Ceschi