cancel
Showing results for 
Search instead for 
Did you mean: 

MotionEC_Initialize generates an error when it is called

AMais.1
Associate

Hello,

It seems that the library MotionMC_CM7F_wc32_ot_hard.a is missing the called function, here the error :

c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ../Middlewares/ST/STM32_MotionMC_Library/Lib\MotionMC_CM7F_wc32_ot_hard.a(motion_mc.o): in function `MotionMC_Initialize':

motion_mc.c:(.text.MotionMC_Initialize+0xde): undefined reference to `MotionMC_SaveCalInNVM'

c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: motion_mc.c:(.text.MotionMC_Initialize+0x1fc): undefined reference to `MotionMC_LoadCalFromNVM'

I'm just doing like the example, I erased and reinstalled MEMS and this library at the previous version but nothing changes, can you help me ?

Here the call :

#define VERSION_STR_LENGTH 35

#define SAMPLE_TIME 20

/* Magnetometer calibration API initialization function */

MotionMC_Initialize(SAMPLE_TIME, 1);

1 ACCEPTED SOLUTION

Accepted Solutions
Miroslav BATEK
ST Employee

Please add following function in your code.

// NOTE: Must be implemented for each platform separately, because its implementation

//    is platform dependent. No need to call this function, library call this

//    function automatically.

/**

 * @brief Load the calibration parameters from storage

 * @param dataSize size of data

 * @param data pointer to data

 * @retval Will return 0 the if it is success and 1 if it is failure

 */

char MotionMC_LoadCalFromNVM(unsigned short int datasize, unsigned int *data)

{

 return 1; /* FAILURE: Read from NVM not implemented. */

}

// NOTE: Must be implemented for each platform separately, because its implementation

//    is platform dependent. No need to call this function, library call this

//    function automatically.

/**

 * @brief Save the calibration parameters in storage

 * @param dataSize size of data

 * @param data pointer to data

 * @retval Will return 0 the if it is success and 1 if it is failure

 */

char MotionMC_SaveCalInNVM(unsigned short int datasize, unsigned int *data)

{

 return 1; /* FAILURE: Write to NVM not implemented. */

}

View solution in original post

2 REPLIES 2
Miroslav BATEK
ST Employee

Please add following function in your code.

// NOTE: Must be implemented for each platform separately, because its implementation

//    is platform dependent. No need to call this function, library call this

//    function automatically.

/**

 * @brief Load the calibration parameters from storage

 * @param dataSize size of data

 * @param data pointer to data

 * @retval Will return 0 the if it is success and 1 if it is failure

 */

char MotionMC_LoadCalFromNVM(unsigned short int datasize, unsigned int *data)

{

 return 1; /* FAILURE: Read from NVM not implemented. */

}

// NOTE: Must be implemented for each platform separately, because its implementation

//    is platform dependent. No need to call this function, library call this

//    function automatically.

/**

 * @brief Save the calibration parameters in storage

 * @param dataSize size of data

 * @param data pointer to data

 * @retval Will return 0 the if it is success and 1 if it is failure

 */

char MotionMC_SaveCalInNVM(unsigned short int datasize, unsigned int *data)

{

 return 1; /* FAILURE: Write to NVM not implemented. */

}

AMais.1
Associate

Thank you, it works.