I am trying to run DMP on MPU9250 which is already present on CC2650STK. I have downloaded the eMD6.12 embedded motion driver library and trying to compile with Code Composer Studio 6.1.3.0034. I did some changes in some .c and .h files of the library to make it compile without errors. It compiles without errors only when I do not call any function from .lib/.a precompiled library. Here is a sample code
/*Code added in Main File, GNU C Compiler Used */
...
...
...
result = inv_init_mpl();
/* Compute 6-axis and 9-axis quaternions. */
inv_enable_quaternion();
inv_enable_9x_sensor_fusion();
...
...
...
But as soon as I call inv_enable_quaternion() or inv_enable_9x_sensor_fusion() or any other function from precompiled library .a/.lib it compile successfully but gives linking errors. I tried to compile it with TI 15.2.1 compiler as well as GNU C Compiler but errors persisted in both version.
Most of the errors are related to undefined symbols and references.
Please find the attached makefile and error details of GCC compiler.
Errors are as follows for GCC Compiler
/*****************************************************************************************************************************************/
/*After Compilation I am getting following error during Linking Process, For more insight makefile is attached so that you may have look
in compiler settings*/-l:C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/bin/gcc/driverlib.lib -lgcc -lm -lnosys -lc -Wl,--end-group ../liblibmplmpu.a
makefile:170: recipe for target 'uartecho_CC2650STK_GNU_CC2650F128.out' failed
../liblibmplmpu.a(fusion_9axis.o): In function
inv_perform_9x_fusion':C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:247: undefined reference to `cosf'
C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:247: undefined reference to `sinf'
C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:265: undefined reference to `cosf'
C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:268: undefined reference to `sinf'
C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:291: undefined reference to `cosf'
C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:294: undefined reference to `sinf'
C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:299: undefined reference to `cosf'
C:\eclipseWS\libmplmpu\Debug/../mpl/fusion_9axis.c:302: undefined reference to `sinf'
../liblibmplmpu.a(mag_disturb.o): In function `inv_check_magnetic_disturbance':
C:\eclipseWS\libmplmpu\Debug/../mpl/mag_disturb.c:316: undefined reference to `acosf'
C:\eclipseWS\libmplmpu\Debug/../mpl/mag_disturb.c:350: undefined reference to `acosf'
C:\eclipseWS\libmplmpu\Debug/../mpl/mag_disturb.c:351: undefined reference to `acosf'
../liblibmplmpu.a(quaternion_supervisor.o): In function `inv_start_quaternion':
C:\eclipseWS\libmplmpu\Debug/../mpl/quaternion_supervisor.c:513: undefined reference to `mpl_key'
../liblibmplmpu.a(quaternion_supervisor.o): In function `inv_process_dmp_quaternion':
C:\eclipseWS\libmplmpu\Debug/../mpl/quaternion_supervisor.c:272: undefined reference to `cosf'
C:\eclipseWS\libmplmpu\Debug/../mpl/quaternion_supervisor.c:273: undefined reference to `sinf'
collect2.exe: error: ld returned 1 exit status
gmake: *** [uartecho_CC2650STK_GNU_CC2650F128.out] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****`
And Errors are as follows for TI compiler
/*****************************************************************************************************************************************/
/*After Compilation I am getting following error during Linking Process, For more insight makefile is attached so that you may have look
in compiler settings*/-l"C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/bin/ccs/driverlib.lib" -llibc.a
<Linking>
"C:\\Users\\laxmi\\AppData\\Local\\Temp\\353603", line 40: error #10006-D: member "fusion_9axis.o" of archive "../libmpllib.lib" is not a recognized object file
"C:\\Users\\laxmi\\AppData\\Local\\Temp\\353603", line 40: error #10006-D: member "quaternion_supervisor.o" of archive "../libmpllib.lib" is not a recognized object file
"C:\\Users\\laxmi\\AppData\\Local\\Temp\\353603", line 40: error #10006-D: member "fusion_9axis.o" of archive "../libmpllib.lib" is not a recognized object file
"C:\\Users\\laxmi\\AppData\\Local\\Temp\\353603", line 40: error #10006-D: member "quaternion_supervisor.o" of archive "../libmpllib.lib" is not a recognized object file
undefined first referenced
symbol in file
--------- ----------------
inv_enable_9x_sensor_fusion ./main.obj
inv_enable_quaternion ./main.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "uartecho_CC2650STK_TI_CC2650F128.out" not built
>> Compilation failure
makefile:166: recipe for target 'uartecho_CC2650STK_TI_CC2650F128.out' failed
gmake: *** [uartecho_CC2650STK_TI_CC2650F128.out] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****