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/TMS320F280049C: Failure to link on FAST Estimator C++ Project when optimization level is set to off (-Ooff)

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

Hi

I am developing a motor controller application for the f280049C and am using the ROM based fast estimator for the sensorless control. My code is based on the C example is07_speed_control lab example under the C2000Ware_MotorControl_SDK_2_00_00_00/solutions.

This example compiles for flash and RAM with the the optimization level set to off or level 2.

I have ported this code to my application and developed a C++ based project that wraps a lot of the required C libraries (clarke / park / iPark etc) in C++ classes. This code compiles and links and runs from flash successfully IF the compiler optimization level set to -O2.  This is great but makes debugging hard as a lot of the code cannot be stepped through or variables are not visible due to compiler optimization.

If I set the the compiler optimization level to off I get the following linker error....

error #10056: symbol "_exit" redefined: first defined in "../src/src_lib/f28004x_fast_rom_symbols_fpu32.lib<F28004x_FAST_ROM_CPU_out__exit_tmp.obj>"; redefined in "/ti/ccs910/ccs/tools/compiler/ti-cgt-c2000_18.12.2.LTS/lib/rts2800_fpu32.lib<exit.c.obj>"

If I remove either one of these libraries I get linker errors for undefined symbols for items present in one or the other which is what you would expect.

It would seem I cannot get past this as I need both but they both seem to define "exit".

The make files for this project have been auto generated by Code Composer.

Has anyone else come across this or is it an issue with using the FAST estimator library in a C++ environment and therefore a tool issue?

Any help would be appreciated.

Cheers

Phil

  • Please conduct the build where this happens ...

    Philip Webb said:
    error #10056: symbol "_exit" redefined: first defined in "../src/src_lib/f28004x_fast_rom_symbols_fpu32.lib<F28004x_FAST_ROM_CPU_out__exit_tmp.obj>"; redefined in "/ti/ccs910/ccs/tools/compiler/ti-cgt-c2000_18.12.2.LTS/lib/rts2800_fpu32.lib<exit.c.obj>"

    Capture everything in the Console (not Problems) view.  Use the icon Copy Build Log to save it to a file.  Use the file extension .txt.  Attach it to your next post.

    Thanks and regards,

    -George

  • Hi George

    Thanks for offering some assistance.

    I have attached the full compiler output for the build below.....

    7612.build_log.txt

    Cheers

    Phil

  • Please add the linker option --emit_references:file="refs" and build again.  In the project properties, it can be found at Build | C2000 Linker | Basic Options.  This will create a text file named refs.txt in the directory AutoMake (the name of the current build configuration).  Please attach that file to your next post.  Do not copy in the contents.  

    This text file shows what sections refer to the symbol _exit.  That should allow us to work out what is going on, or at least ask some better questions.

    Thanks and regards,

    -George

  • Hi George

    Please find attached my refs.txt

    refs.txt

    Hope this is attached correctly. I could only find the insert file option.

    Cheers

    Phil

  • The library f28004x_fast_rom_symbols_fpu32.lib defines many functions that are also defined in the compiler RTS library rts2800_fpu32.lib.  I presume you want all of those functions to come from the fast_rom library.  That being the case, you need to replace the linker option --reread_libs with --priority.  To understand why, please search the C28x assembly tools manual for the sub-chapter titled Exhaustively Read and Search Libraries.

    Thanks and regards,

    -George