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.
Tool/software: Code Composer Studio
Hi ,
we made a macro file for sine cosine encoder .When we are using "atan2f " function we are getting an error as follows
"Description Resource Path Location Type
symbol "_atan2" redefined: first defined in symbol "_atan2" redefined: first defined in PM_Sensorless C/C++ Problem"
then we changed the "atan2f "to "atan2" the program is building successfully .What can be the problem??
here is the code :
/* * sincos_f.h * * Created on: May 27, 2017 * Author: Indra */ #ifndef SINCOS_F_H_ #define SINCOS_F_H_ #include"math.h" #include<stdlib.h> typedef struct { float sin; //input sine float cos; //input cosine float atan; float angle_const; float mechTheta; // parameter float ElecTheta; // output electrical angle float Direction; // output float OldElecTheta; // }sincos_f; typedef sincos_f *psin_cos_f; #define sin_cos_default_vf {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0} #define SCEN_MACROF(v) \ v.angle_const =57.2975; \ v.atan = atan2f(v.sin, v.cos); \ v.mechTheta = (v.atan * v.angle_const); \ v.ElecTheta = (v.mechTheta +180.0)*5; \ if(v.OldElecTheta > v.ElecTheta) \ { \ v.Direction = 1; \ } \ else v.Direction = 0; \ // v.ElecTheta = (v.ElecTheta/1800); #endif /* SINCOS_F_H_ */
thank you
Based upon a similar error in the thread CCS5.5 symbol "redefined" when only one file linked suspect a conflict between libraries.SHAMEER N said:symbol "_atan2" redefined: first defined in symbol "_atan2" redefined: first defined in PM_Sensorless C/C++ Problem"
Can you show the complete output from the CCS build Console when the error occurs, so that can see the exact linker command line.
That linker command shows:SHAMEER N said:'Building target: PM_Sensorless_DRV8301_F2806x.out'
'Invoking: C2000 Linker'
"D:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/bin/cl2000" --silicon_version=28 -g --define="_DEBUG" --define="DRV8301" --define="LARGE_MODEL" --define="FLOATING_MATH" --quiet --diag_warning=225 --large_memory_model --cla_support=cla0 --float_support=fpu32 -z -m"PM_Sensorless_DRV8301_F2806x.map" --stack_size=0x380 --warn_sections -i"D:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/lib" -i"D:/ti/controlSUITE/libs/math/FPUfastRTS/V100/lib" -i"D:/ti/controlSUITE/libs/math/IQmath/v15c/lib" -i"C:/Users/shameer/Desktop/new1/new1" -i"D:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include" --reread_libs --xml_link_info="PM_Sensorless_DRV8301_F2806x_linkInfo.xml" --rom_model -o "PM_Sensorless_DRV8301_F2806x.out" "../rts2800_fpu32_fast_supplement.lib" -lrts2800_fpu32.lib "../IQmath_fpu32.lib" "./DLOG4CHC.obj" "./DRV8301_SPI.obj" "./F2806x_CodeStartBranch.obj" "./F2806x_GlobalVariableDefs.obj" "./F2806x_usDelay.obj" "./PM_Sensorless-DevInit_F2806x.obj" "./PM_Sensorless.obj" "./filterfloat.obj" "../F2806x_Headers_nonBIOS.cmd" "../F2806x_RAM_PM_Sensorless.CMD"
a) The --reread_libs option used, which allows the linker to make multiple reads of the libraries to resolve references.
b) The linker set to use the rts2800_fpu32.lib run time library rather, than making an automatic selection.
Based on other forum threads think this combination of options may be triggering the problem.
On the assumption that your project is based upon the modified controlSUITE PM Sensorless example for a DRV8301-HC-C2-KIT can you try:
1) In the Project Properties under Build -> C2000 Linker -> File Search Path untick the "Reread libraries; resolve backward references (--reread_libs, -X)" option:
2) In the Project Properties under General change the Runtime Support Library option to "<automatic>":
If the above suggested changes don't resolve the error, can you zip up and attach your complete project?