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.

Compiler/TMS320F28377S: cl2000 --define=TMS320F2837X not known in .cmd file

Genius 5910 points

Part Number: TMS320F28377S

Tool/software: TI C/C++ Compiler

Hi,

I made my cmd file so that the output is according the microcontroller used. Only the arguments given are not known in the cmd file. Can I change that?

Thanks

Example:

I got this in my cmd file

#ifdef TMS320F2837X

#define RAM_START           (0x8000)
#define RAM_END             (0x1BFFF)
#endif

  • yes you can change that, you may need to define the symbol is project configuration.
  • I don't think you understand my question.
    I know I can change --define=TMS320F2837X but I need that define In my cmd file. How is that possible?
  • evs said:
    #ifdef TMS320F2837X

    You would need to define that macro name to the linker using the linker --define option. Please see section 8.4.11 (Linker Command File Preprocessing) of the C2000 Assembly Language Tools User's Guide. 

    If that does not answer your question, please elaborate a bit more on what you are asking.

  • Please see the title of my question. (cl2000 --define=TMS320F2837X)
    And that doesn't work for cmd files.
  • Both the compiler and linker accept --define options. To be recognized by the linker command file, the option needs to be passed to the linker, not the compiler. This is described in the User's Guide section mentioned in my previous post.

    If you are using CCS, make sure to define the macro under the Linker options. Or if using command line to build, pass it after the --run_linker (or -z) option.
  • Maybe I don't understand but the parameter is passed to the linker. See this line of code from the console:

    Building target: "Base.out"
    Invoking: C2000 Linker
    "D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O2 --advice:performance=all --define=HWBOARD=2180102 --define=_INLINE --define=TMS320F2837X --define=FLASH -g --diag_warning=225 --diag_wrap=off --display_error_number -z -m"_Base.map" --heap_size=0x200 --stack_size=0x800 --warn_sections -i"D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/lib" -i"D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="_Base_linkInfo.xml" --rom_model -o "Base.out" "./BTLDdata.obj" "./CO_OD.obj" "./main.obj" and  a lot more *.obj files        "../HAL/C2000/TI memory allocation.cmd"  -l"C:/tiC2000Ware_1_00_06_00_Software/driverlib/f2837xs/driverlib/ccs/Debug/driverlib.lib" -llibc.a

    <Linking>
    Finished building target: "Base.out"

  • evs said:
    Maybe I don't understand but the parameter is passed to the linker.

    Actually it is not. Everything before the "-z" (highlighted below) is only passed to the compiler. The options after "-z" are the ones passed to the linker. 
    It can get a bit confusing because there is just a single invocation of shell (cl2000). The shell internally calls the compiler and linker and the way to differentiate which options are passed to each executable is to look at the options before and after -z.

    "D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -O2 --advice:performance=all --define=HWBOARD=2180102 --define=_INLINE --define=TMS320F2837X --define=FLASH -g --diag_warning=225 --diag_wrap=off --display_error_number -z -m"_Base.map" --heap_size=0x200 --stack_size=0x800 --warn_sections -i"D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/lib" -i"D:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.5.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="_Base_linkInfo.xml" --rom_model -o "Base.out" "./BTLDdata.obj" "./CO_OD.obj" "./main.obj" and  a lot more *.obj files        "../HAL/C2000/TI memory allocation.cmd"  -l"C:/tiC2000Ware_1_00_06_00_Software/driverlib/f2837xs/driverlib/ccs/Debug/driverlib.lib" -llibc.a

    To add this option for the linker, go to the Linker options in CCS and add it under the --define there.