cancel
Showing results for 
Search instead for 
Did you mean: 

More info on MotionMC function MotionMC_SaveCalInNVM

Léon
Associate

Dear Community,

I've been using the MotionMC library on a stm32f401 with quite some succes, but there are 2 functions that remain somewhat mysterious:

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

and

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

These functions are used for reading/writing calibration data from/to non-volatile memory (NVM), that much is clear. But there is no real documentation available, and I found no actual implementation examples. I can just implement something that writes/ reads the data, but I have been trying to figure out how they function with library, and that raised a question.

The first function tries to load the data from NVM, and gets called during initialization, but I haven't seen the library ever call the save function to write the data. Not even after the calibration quality goes to MMC_CALQSTATUSGOOD.

So: when does the function MotionMC_SaveCalInNVM get called? Is there something I forgot to implement / set to get this to work?

Thanks for any help / pointers in the right direction!

Léon

2 REPLIES 2
Miroslav BATEK
ST Employee

The MotionMC_SaveCalInNVM is called when you disable the magnetometer calibration algorithm by calling: MotionMC_Initialize(sampletime, 0);

Léon
Associate

Thanks for the answer! This makes sense, and got me on my way to a solution again!😀