Skip to main content
Visitor II
November 15, 2018
Question

More info on MotionMC function MotionMC_SaveCalInNVM

  • November 15, 2018
  • 2 replies
  • 1111 views

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

    This topic has been closed for replies.

    2 replies

    ST Employee
    November 15, 2018

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

    LéonAuthor
    Visitor II
    November 15, 2018

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