cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Magnetometer calibrartion in ISPU

Amith_lal
Associate III

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

5 REPLIES 5
Federica Bossi
ST Employee

Hi @Amith_lal ,

Are you using the the LIS2MDL as external magnetometer sensor?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Amith_lal
Associate III

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?

leas12
Associate

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

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