Skip to main content
Visitor II
February 23, 2018
Question

MotionFX blocked in MFX_MAGCALUNKNOWN state

  • February 23, 2018
  • 3 replies
  • 2814 views
Posted on February 23, 2018 at 16:00

Hi,

I'm trying to use the MotionFX library with the LSM9DS1. I can initialise the library and I start to send updates using the MotionFX_MagCal_run method then I get the params with MotionFX_MagCal_getParams but the cal_quality is always 0, I tried multiple times. Also, I double checked that I set the sample time and timestamp correctly.

Not sure what I'm missing, is there any way to debug the behaviour of the library?

Regards,

Gabriel

    This topic has been closed for replies.

    3 replies

    ST Employee
    February 23, 2018
    Posted on February 23, 2018 at 16:16

    Please check this thread firts

    https://community.st.com/0D50X00009XkWhLSAV

    If you are able to plot X, Y, Z during sensor rotation it would be helpful.

    Visitor II
    February 26, 2018
    Posted on February 26, 2018 at 14:57

    Thanks again for the quick response!

    Here's the magnetometer data that I send using the MotionMC_Update function:

    https://gist.github.com/gpgabriel/c0f55be9f32c0d548629d0525e79450e

     

    The data above is calculated as follows:

    calcMag(mx) * 1000 * FROM_MGAUSS_TO_UT50

    where calcMag returns Gs.

    I'm still blocked in the MFX_MAGCALUNKNOWN state. I'll try to add a video with an actual plot asap.

    Visitor II
    November 23, 2018

    Hi to all

    I exactly have the same problem.

    I use MPU9250 and I update the library in the main function, (I do not use any RTOS), and also my code is blocked in MMC_CALQSTATUSUNKNOWN state. I do not use MotionFX, I only use MotionMC, my compass data is correct. what happens is that the library always report MMC_CALQSTATUSUNKNOWN and after moving my compass in a 3D 8 shape path, the library hangs and I have to reset my micro controller.

    I also appreciate it if we could solve this problem.

    Visitor II
    November 23, 2018

    Ow I just go the answer!

    make sure of three notes:

    1- calibration must be run for at least 5 seconds. before this time you always get the default values.

    2- you should duplicate the heap and stack size in the assembly file, for the library probably uses dynamic memory.

    3- you can use HAL_GetTick as the timestamp.

    also take a look at this topic:

    https://community.st.com/s/question/0D50X00009XkWyASAV/motionmc-calibration-fails-all-params-have-default-value