工具/软件:TI C/C++编译器
您好!
我创建了我的 cmd 文件、以便输出符合所使用的微控制器。 只有给定的参数在 cmd 文件中是未知的。 我可以更改它吗?
谢谢
示例:
我在我的 cmd 文件中得到了这个值
#ifdef TMS320F2837X
#define RAM_START (0x8000)
#define RAM_END (0x1BFFF)
#endif
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.
工具/软件:TI C/C++编译器
您好!
我创建了我的 cmd 文件、以便输出符合所使用的微控制器。 只有给定的参数在 cmd 文件中是未知的。 我可以更改它吗?
谢谢
示例:
我在我的 cmd 文件中得到了这个值
#ifdef TMS320F2837X
#define RAM_START (0x8000)
#define RAM_END (0x1BFFF)
#endif
[引用 user="EV"]#ifdef TMS320F2837X[/引用]
您需要使用 linker --define 选项为链接器定义该宏名称。 请参阅 《C2000汇编语言工具用户指南》的第8.4.11节(链接器命令文件预处理)。
如果这没有回答您的问题、请详细说明您要询问的内容。
可能我不理解、但参数会传递给链接器。 从控制台查看这行代码:
构建目标:"base.out"
调用:C2000链接器
"d:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/bin/cl2000 /ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/lib /HAL/C2000/TI "-v28 -ml -mt --cla_support=cla1 -float_support=fpu32 -tmu_support=tmu0 -vcu_support=vcu2 -O2 -advice:performance=all -define=HWBOARD=2180102 -define -define -intrack_info=tus.xml"-link_ram_ram_model -out_ram_ram_ram_infot.ategines-"-"-out_ram_ram_infot_isot.ature_isot-rom-content-content-display_infot_infot.htm"-display_ram_infot_infot_infot_infot.ature.ature.at_rom-rom-rom-rom-display_infot/infot_infot_infot.htm#-out./infot_display_infot_infot.htm#-display_infot.htm#-display_infot./infot_infot./infot_infot_display.htm#-display.//ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/include
完成的构建目标:"base.out"
[报价用户="EV"]也许我不理解、但参数会传递给链接器。
实际上不是。 "-z"之前的所有内容(如下突出显示)仅传递给编译器。 "-z"后的选项是传递给链接器的选项。
它可能会引起一些混淆、因为只有一个 shell 调用(cl2000)。 shell 在内部调用编译器和链接器、区分将哪些选项传递给每个可执行文件的方法是查看 z 前后的选项
"d:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/bin/cl2000 /ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/lib /HAL/C2000/TI "-v28 -ml -mt --cla_support=cla1 -float_support=fpu32 -tmu_support=tmu0 -vcu_support=vcu2 -O2 -advice:performance=all -define=HWBOARD=2180102 -define -define -intrack_info=tus.xml"-link_ram_ram_model -out_ram_ram_ram_infot.ategines-"-"-out_ram_ram_infot_isot.ature_isot-rom-content-content-display_infot_infot.htm"-display_ram_infot_infot_infot_infot.ature.ature.at_rom-rom-rom-rom-display_infot/infot_infot_infot.htm#-out./infot_display_infot_infot.htm#-display_infot.htm#-display_infot./infot_infot./infot_infot_display.htm#-display.//ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/include
要为链接器添加此选项、请转至 CCS 中的链接器选项、并将其添加到-define 中。