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.

CCS/TMS320F2812: CCS does not form correct cl2000 linker command line

Part Number: TMS320F2812
Other Parts Discussed in Thread: PROFIBUS

Tool/software: Code Composer Studio

Is there a way to trick CCS7.1 to form the correct link command line?

CCS7 forms the link command like below and linking fails -->

H:\Projects\PW-87xxx\Software\Python\Release>"C:/ti/ccsv7/tools/compiler/ti-cgt-
c2000_5.0.2/bin/cl2000" --define=LARGE_MODEL --keep_asm --symdebug:dwarf --diag_
warning=225 --issue_remarks --verbose_diagnostics --large_memory_model --silicon
_version=28 --unified_memory --gen_opt_info=2 --opt_level=3 --optimizer_interlis
t -z --rom_model --absolute_exe --heap_size=1 --map_file="Python.map" --no_symta
ble --priority --reread_libs --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2
000_5.0.2/lib" --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/incl
ude" --search_path="H:/Projects/PW-87xxx/Software/Python" --stack_size=1024 --wa
rn_sections --xml_link_info="Python_linkInfo.xml" -o "Python.out" "./src/ADC_Con
fig.obj" "./src/ADC_ISR.obj" "./src/App_ISR.obj" "./src/CanCtrl.obj" "./src/Comm
TimerISR.obj" "./src/Current_Fault_ISR.obj" "./src/DSP28_CodeStartBranch.obj" ".
/src/DSP28_DBGIER.obj" "./src/DSP28_GlobalVariableDefs.obj" "./src/DSP28_PieCtrl
.obj" "./src/DSP28_SWPrioritizedDefaultIsr.obj" "./src/DSP28_SWPrioritizedPieVec
t.obj" "./src/Discharge.obj" "./src/EvA_Config.obj" "./src/EvB_Config.obj" "./sr
c/Hall_Capture_ISR.obj" "./src/IO_Processing_ISR.obj" "./src/InitGpio.obj" "./sr
c/Precharge.obj" "./src/Profibus_ISR.obj" "./src/Python_Diagnostics.obj" "./src/
Python_Init_c.obj" "./src/Python_c.obj" "./src/RamFunctions.obj" "./src/Resolver
.obj" "./src/SCIRXTX_ISR.obj" "./src/SCIbRXTX_ISR.obj" "./src/ScaleFactors.obj"
"./src/SpeedPos_ISR.obj" "./src/Version.obj" "./src/WAKEINT_ISR.obj" "./src/Xint
f_Config.obj" "./src/datalog.obj" "./src/eeprom.obj" "./src/spi.obj" --library=r
ts2800_ml.lib --library="H:/Projects/PW-87xxx/Software/PythonLib/Release/PythonL
ib.out "../cmd/Flash.cmd"
<Linking>
>> C:\Users\moorep\AppData\Local\Temp\076003, line 52:   error:
               can't find input file
               'H:/Projects/PW-87xxx/Software/PythonLib/Release/PythonLib.out
               ../cmd/Flash.cmd '

>> Compilation failure

If I type in the linker command line, as shown below, from a cmd shell, linking succeeds.  The library files must precede the flash.cmd file -->

H:\Projects\PW-87xxx\Software\Python\Release>"C:/ti/ccsv7/tools/compiler/ti-cgt-
c2000_5.0.2/bin/cl2000" --define=LARGE_MODEL --keep_asm --symdebug:dwarf --diag_
warning=225 --issue_remarks --verbose_diagnostics --large_memory_model --silicon
_version=28 --unified_memory --gen_opt_info=2 --opt_level=3 --optimizer_interlis
t -z --rom_model --absolute_exe --heap_size=1 --map_file="Python.map" --no_symta
ble --priority --reread_libs --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2
000_5.0.2/lib" --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/incl
ude" --search_path="H:/Projects/PW-87xxx/Software/Python" --stack_size=1024 --wa
rn_sections --xml_link_info="Python_linkInfo.xml" -o "Python.out" "./src/ADC_Con
fig.obj" "./src/ADC_ISR.obj" "./src/App_ISR.obj" "./src/CanCtrl.obj" "./src/Comm
TimerISR.obj" "./src/Current_Fault_ISR.obj" "./src/DSP28_CodeStartBranch.obj" ".
/src/DSP28_DBGIER.obj" "./src/DSP28_GlobalVariableDefs.obj" "./src/DSP28_PieCtrl
.obj" "./src/DSP28_SWPrioritizedDefaultIsr.obj" "./src/DSP28_SWPrioritizedPieVec
t.obj" "./src/Discharge.obj" "./src/EvA_Config.obj" "./src/EvB_Config.obj" "./sr
c/Hall_Capture_ISR.obj" "./src/IO_Processing_ISR.obj" "./src/InitGpio.obj" "./sr
c/Precharge.obj" "./src/Profibus_ISR.obj" "./src/Python_Diagnostics.obj" "./src/
Python_Init_c.obj" "./src/Python_c.obj" "./src/RamFunctions.obj" "./src/Resolver
.obj" "./src/SCIRXTX_ISR.obj" "./src/SCIbRXTX_ISR.obj" "./src/ScaleFactors.obj"
"./src/SpeedPos_ISR.obj" "./src/Version.obj" "./src/WAKEINT_ISR.obj" "./src/Xint
f_Config.obj" "./src/datalog.obj" "./src/eeprom.obj" "./src/spi.obj" --library=r
ts2800_ml.lib --library="H:/Projects/PW-87xxx/Software/PythonLib/Release/PythonL
ib.out" "../cmd/Flash.cmd"
<Linking>

  • Paul Moore75 said:
    CCS7 forms the link command like below and linking fails -->

    It is due to a typo in the command:

    --library=rts2800_ml.lib --library="H:/Projects/PW-87xxx/Software/PythonLib/Release/PythonLib.out "../cmd/Flash.cmd"

    The second --library option is missing the end quotes. Please check how you have this set under CCS Project Properties->Build->Linker->File Search Path option.

  • Missing quotes are from my bad typing.

    If I copy/paste the CCS link command line at a command prompt, the link fails because it can't find pythonlib.out.

    If I copy/paste the CCS link command line at a command prompt, but move the ../cmd/flash.cmd portion to the end of the line, all compiles well.

    I have an example project I can send you but I don't know how this is done.  You could see for yourself.

    Building target: TI_Linker_Test.out'

    'Invoking: C2000 Linker'

    "C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/bin/cl2000" --diag_warning=225 --display_error_number --large_memory_model --silicon_version=28 --unified_memory --opt_level=2 -z --rom_model --heap_size=1 --map_file="TI_Linker_Test.map" --reread_libs --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/lib" --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/include" --stack_size=1024 --warn_sections --xml_link_info="TI_Linker_Test_linkInfo.xml" -o "TI_Linker_Test.out" "./src/Python_c.obj" "./src/RamFunctions.obj" "../cmd/Flash.cmd"  --library="C:/Users/moorep/Documents/Code Composer/TI_Linker_Test/lib/PythonLib.out"

    <Linking>

    >> Flash.cmd:   error: system error, can't open file 'PythonLib.out' for input:

                          No such file or directory

    >> Compilation failure

    =====================================================

    =====================================================

    "C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/bin/cl2000" --diag_warning=225 --display_error_number --large_memory_model --silicon_version=28 --unified_memory --opt_level=2 -z --rom_model --heap_size=1 --map_file="TI_Linker_Test.map" --reread_libs --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/lib" --search_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_5.0.2/include" --stack_size=1024 --warn_sections --xml_link_info="TI_Linker_Test_linkInfo.xml" -o "TI_Linker_Test.out" "./src/Python_c.obj" "./src/RamFunctions.obj"  --library="C:/Users/moorep/Documents/Code Composer/TI_Linker_Test/lib/PythonLib.out" "../cmd/Flash.cmd"

    Compile success

  • OK, now I get it.

    Based on this message:

    >> Flash.cmd:   error: system error, can't open file 'PythonLib.out' for input:

                        No such file or directory

    my guess is that Flash.cmd has some reference to PythonLib.out but at the point in time that the linker is reading the .cmd file it is not aware of the path for PythonLib.out. 

    You can fix this in a couple of ways:

    1) Instead of specifying the full path in the --library option, add the path "C:/Users/moorep/Documents/Code Composer/TI_Linker_Test/lib" to the --search_path linker option and set the --library option to just be PythonLib.out. This way it will know the search path prior to the file reference in the .cmd file.

    OR

    2) You can change the order in which these two files are passed to the linker. Go to Project Properties->Build->Link Order tab. There you can add the Flash.cmd and PythonLib.out to the order list and control the order such that Flash.cmd comes last.

    Hope this helps. Let us know if the issue is still unresolved.

  • You led me to the source of the problem.
    In C2000 Linker - General Options, I have the libraries listed in "Include library..." including the pythonlib.out with a workspace relative path.
    These libraries need to be listed here so that they may be 'ordered' along with the .objs in the CCS Build - Link Order tab.
    I have the obj's, the libraries , and the cmd file all ordered the way I need them in CCS Build - Link Order.
    Only libraries that are included in the project show up in the "Add..." menu of Link Order. I successfully added the pythonlib.out this way.
    Unfortunately, Link Order puts the library in the list using an 'absolute' path (not one relative to workspace. Installing the project in another directory or computer now causes a problem. Pythonlib.out cannot be found because of the absolute path that no longer exists.
    There is no way to correct this action that I can see. The file shows up in the 'Add..' list, you click it, the link order file now has an absolute path.
    I have a work around by deleting and re-adding the file to the link order. This is not good though. Somewhere I wiil have to explain how to check out the project and repair it so it can be rebuilt.