Skip to main content
Graduate II
June 23, 2025
Question

Saving Magnetometer calibrartion in ISPU

  • June 23, 2025
  • 3 replies
  • 743 views

How can I save the magnetometer calibration offset in ISPU, if  lsm6dso16is is connected to a stm32l4.

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    June 26, 2025

    Hi @Amith_lal ,

    Are you using the the LIS2MDL as external magnetometer sensor?

    Amith_lalAuthor
    Graduate II
    September 23, 2025

    I am developing firmware for the ISPU on the LSM6DSO16IS and have a question regarding communication between the host MCU and the ISPU core.

    My objective is to persist magnetometer calibration data. My intended workflow is:

    1. The ISPU runs the MotionMC_update function and calculates the HI_bias values.

    2. The host MCU reads these HI_bias values from the ISPU's output registers and saves them to non-volatile memory.

    3. On the next device startup, the host MCU writes the saved HI_bias values into the ISPU_DUMMY_CFG registers, intending for the ISPU to use them as initial calibration data.

    I have successfully implemented step 3. I can write to the ISPU_DUMMY_CFG_1 register from my external STM32 host using the lsm6dso16is_ispu_write_dummy_cfg() function, and I can verify the write was successful by reading it back from the host with lsm6dso16is_ispu_read_dummy_cfg().

    The problem occurs when the ISPU firmware itself tries to read this value. When I attempt to read the ISPU_DUMMY_CFG_1 register from within the ISPU code, it always returns 0x0000, not the value written by the host.

    Here is the simplified code snippet from my ISPU algo_00_init function that demonstrates the issue:

    uint16_t read_value = 0;

    read_value = cast_uint16_t(ISPU_DUMMY_CFG_1);

    Since the register is clearly accessible from the external host but not readable by the ISPU core, I suspect there may be a specific initialization step or access permission I am missing within the ISPU firmware to enable this communication path.

    Could you please advise on the correct procedure for the ISPU to read the ISPU_DUMMY_CFG registers after they have been set by a host MCU?

    Amith_lalAuthor
    Graduate II
    June 27, 2025
    Graduate
    September 23, 2025

    Store the offsets in STM32L4 flash (or external NVM), then load them into the ISPU at startup through its registers/memory map.

    Amith_lalAuthor
    Graduate II
    September 23, 2025

    Ya I did that my problem is in reading the input registers from ispu