Part Number: TMS320F2800157-Q1
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG
I have a strange problem building a F2800157 target on CCS with the TI compiler, whereby the dcsm.cmd file gets included twice in the linker invocation.
If I clean and build, or simply rebuild the project, I have no linking errors:
[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
But if I build the project twice in a row, I get the following (truncated) linker errors:
[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
The main difference is that the rebuild suddenly also includes "../src/bsp/include/bsp/dcsm.cmd", which is obviously an error as the same file is already included once: -l"C:/Projects/my_project/hardware_c/src/bsp/include/bsp/dcsm.cmd"
But looking through the project properties, I can't find any location that appear responsible for including either of the dcsm.cmd entries. It should be noted that the syscfg generated files are located at "C:/Projects/my_project/hardware_c/src/bsp/include/bsp/", so perhaps that path is auto-scanned and known files added?
It is my assumption that the auto-scanned locations are configured under Projects Properties -> Build -> C2000 Linker -> File Search Path, but aapart from my own libraries, I have the following set at that location, and none of them control either of the included files.
Include library file or commandline file as input (--library, -l):
${INHERITED_LIBRARIES}
${COM_TI_C2000WARE_LIBRARIES}
libc.a
<some private libs>
Add <dir> to library search path (--search_path, -i):
${INHERITED_LIBRARY_PATH}
${COM_TI_C2000WARE_LIBRARY_PATH}
${CG_TOOL_ROOT}/lib
${CG_TOOL_ROOT}/include
${C2000WARE_ROOT}
${PROJECT_BUILD_DIR}/syscfg
<some private libs folders>
I tried to exclude the dcsm.cmd file from the build, which made a second build possible, as the "../src/bsp/include/bsp/dcsm.cmd" entry did dissapear from the linker invocation line - but this fix only lasted till a clean was issued. :-(
So what is going on? And how can I make sure the same auto-generated file is not (automatically) included twice?