Other Parts Discussed in Thread: C2000WARE, SYSCONFIG
器件型号: TMS320F2800157-Q1
Thread 中讨论的其他器件: C2000WARE、 SysConfig
我在使用 TI 编译器在 CCS 上构建 F2800157 目标时遇到了一个奇怪的问题、导致 dcsm.cmd 文件在链接器调用中被包含两次。
如果我清理并编译、或只是重新编译工程、没有链接错误:
[491]Building target: "hardware_c.out"[492]Invoking: C2000 Linker[493]"C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-c2000_22.6.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 -Ooff --opt_for_speed=5 --fp_mode=relaxed --fp_reassoc=on --define=__TMS320C28XX__ --define=DEBUG --define=_FLASH --c11 --fp_single_precision_constant --printf_support=full --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --parallel=8 -z -m"hardware_c.map" --heap_size=0x100 --stack_size=0x200 --warn_sections -i"C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-c2000_22.6.2.LTS/lib" -i"C:/ti/c2000/C2000Ware_5_04_00_00" -i"C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-c2000_22.6.2.LTS/include" -i"C:/Projects/my_project/hardware_c/debug/syscfg" --reread_libs --define=_FLASH --diag_wrap=off --display_error_number --xml_link_info="hardware_c_linkInfo.xml" --entry_point=code_start --rom_model -o "hardware_c.out" "./src/bsp/include/bsp/board.obj" "./src/bsp/include/bsp/device.obj" "./src/bsp/include/bsp/dcsm.obj" "./src/bsp/include/bsp/c2000ware_libraries.obj" "./f280015x_codestartbranch.obj" "./src/hal_impl/NTC.obj" "./src/hal_impl/analogInputs.obj" "./src/hal_impl/debugIO.obj" "./src/hal_impl/digital_io.obj" "./src/hal_impl/feedbackOutput.obj" "./src/hal_impl/gatedriver.obj" "./src/hal_impl/hal.obj" "./src/hal_impl/mcu.obj" "./src/hal_impl/power_up.obj" "./src/hal_impl/pwm_in.obj" "./src/hal_impl/tick_timer.obj" "C:/ti/c2000/C2000Ware_5_04_00_00/driverlib/f280015x/driverlib/ccs/Debug/driverlib.lib" "../linker_files/280015x_generic_flash_lnk.cmd" -l"C:/Projects/my_project/hardware_c/src/bsp/include/bsp/dcsm.cmd" -llibc.a -llib_common.lib -llib_app.lib -llib_chip.lib[494]<Linking>[495]Finished building target: "hardware_c
但是、如果我在一行中编译两次工程、会收到以下(截断)链接器错误:
[115]Building target: "hardware_c.out"[116]Invoking: C2000 Linker[117]"C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-c2000_22.6.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 -Ooff --opt_for_speed=5 --fp_mode=relaxed --fp_reassoc=on --define=__TMS320C28XX__ --define=DEBUG --define=_FLASH --c11 --fp_single_precision_constant --printf_support=full --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --parallel=8 -z -m"hardware_c.map" --heap_size=0x100 --stack_size=0x200 --warn_sections -i"C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-c2000_22.6.2.LTS/lib" -i"C:/ti/c2000/C2000Ware_5_04_00_00" -i"C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-c2000_22.6.2.LTS/include" -i"C:/Projects/my_project/hardware_c/debug/syscfg" --reread_libs --define=_FLASH --diag_wrap=off --display_error_number --xml_link_info="hardware_c_linkInfo.xml" --entry_point=code_start --rom_model -o "hardware_c.out" "./src/bsp/include/bsp/board.obj" "./src/bsp/include/bsp/device.obj" "./src/bsp/include/bsp/dcsm.obj" "./src/bsp/include/bsp/c2000ware_libraries.obj" "./f280015x_codestartbranch.obj" "./src/hal_impl/NTC.obj" "./src/hal_impl/analogInputs.obj" "./src/hal_impl/debugIO.obj" "./src/hal_impl/digital_io.obj" "./src/hal_impl/feedbackOutput.obj" "./src/hal_impl/gatedriver.obj" "./src/hal_impl/hal.obj" "./src/hal_impl/mcu.obj" "./src/hal_impl/power_up.obj" "./src/hal_impl/pwm_in.obj" "./src/hal_impl/tick_timer.obj" "C:/ti/c2000/C2000Ware_5_04_00_00/driverlib/f280015x/driverlib/ccs/Debug/driverlib.lib" "../linker_files/280015x_generic_flash_lnk.cmd" "../src/bsp/include/bsp/dcsm.cmd" -l"C:/Projects/my_project/hardware_c/src/bsp/include/bsp/dcsm.cmd" -llibc.a -llib_common.lib -llib_app.lib -llib_chip.lib[118]<Linking>[119]"C:/Projects/my_project/hardware_c/src/bsp/include/bsp/dcsm.cmd", line 19: error #10263: DCSM_OTP_Z1_LINKPOINTER memory range has already been specified[120]"C:/Projects/my_project/hardware_c/src/bsp/include/bsp/dcsm.cmd", line 19: error #10264: DCSM_OTP_Z1_LINKPOINTER memory range overlaps existing memory range DCSM_OTP_Z1_LINKPOINTER...[148]"C:/Projects/my_project/hardware_c/src/bsp/include/bsp/dcsm.cmd", line 39: error #10264: DCSM_ZSEL_Z2_P0 memory range overlaps existing memory range DCSM_ZSEL_Z2_P0[149]error #10010: errors encountered during linking; "hardware_c.out" not built
主要的区别是重建也突然包含"../src/bsp/include/bsp/dcsm.cmd",这显然是一个错误,因为同一个文件已经包含一次: -l"C:/Projects/my_project/hardware_c/src/bsp/include/bsp/dcsm.cmd"
通过查看工程属性、我找不到任何看起来负责包含 dcsm.cmd 条目的位置。 需要注意的是 、syscfg 生成的文件位于“ c:/Projects/my_project/hardware_c src /bsp/include/bsp/ “、那么该路径可能是自动扫描的、并且添加了已知的文件吗?
我的假设是在下配置了自动扫描的位置 “Projects Properties“->"Build"->"C2000 Linker"->"File“ Linker"->"File Search“ Search Path"“ Path"</s>“ ““但是、除了我自己的库之外、我在该位置设置了以下文件集、其中没有一个文件可以控制其中的任何一个文件。
将库文件或命令行文件作为输入 (--library,-l):
${INHERITED_LIBRARS}
${COM_TI_C2000WARE_libraries}
libc.a
例程
${INHERITED_LIBRARY_PATH}
${COM_TI_C2000WARE_LIBRARY_PATH}
${CG_TOOL_ROOT}/lib
${CG_TOOL_ROOT}/包含
${C2000WARE_ROOT}
${PROJECT_BUILD_DIR}/syscfg
我尝试从编译中排除文件,这使得第二个编译成为可能,因为该条目从链接器调用行中忽略了 — 但此修复只会持续到发出清理命令为止。 dcsm.cmd "../src/bsp/include/bsp/dcsm.cmd":-(
发生什么事了? 我如何确保同一个自动生成的文件不会(自动)包含两次?