cancel
Showing results for 
Search instead for 
Did you mean: 

Using General-purpose input configuration register for ISPU (LSM6DS016IS)

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.

i refered https://github.com/STMicroelectronics/ispu-examples/blob/1ce408f7837e9afa4a6ffded9daf6376e3a81647/ism330is_lsm6dso16is/sensor_fusion_9x/ispu/src/main.c

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?

1 REPLY 1
Federica Bossi
ST Employee

Hi @Amith_lal ,

 

The description of how to read the ISPU_DUMMY_CFG registers is provided in section 9.5 of the application note. The method you are using to read the first register is correct.

When do you write to the ISPU_DUMMY_CFG registers and perform the readback in relation to loading the ISPU program? Writing the ISPU_DUMMY_CFG registers before loading the program ensures correct functionality.

 

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.