ICM42670P sensor_event_cb not firing

By kjseirfitness , 22 May 2024

I am following https://github.com/tdk-invn-oss/motion.arduino.ICM42670P driver example to implement my own version for ICM42670P on my psoc6.

I am able to read/write and see interrupts being triggered. But in the example driver the callback being registered for when i read data from fifo using "inv_imu_get_data_from_fifo(&icm_driver);" is never being triggered.

Here is how I setup the fifo interrupts:
int ICM42670P::enableFifoInterrupt(ICM42670P_irq_handler handler, uint8_t fifo_watermark, ICM42670P_sensor_event_cb event_callback) {
int rc = 0;
uint8_t data;

if(handler == NULL) {
return -1;
}
enable_interrupts(handler);
rc |= inv_imu_configure_fifo(&icm_driver,INV_IMU_FIFO_ENABLED);
rc |= inv_imu_write_reg(&icm_driver, FIFO_CONFIG2, 1, &fifo_watermark);
// Set fifo_wm_int_w generating condition : fifo_wm_int_w generated when counter == threshold
rc |= inv_imu_read_reg(&icm_driver, FIFO_CONFIG5_MREG1, 1, &data);
data &= (uint8_t)~FIFO_CONFIG5_WM_GT_TH_EN;
rc |= inv_imu_write_reg(&icm_driver, FIFO_CONFIG5_MREG1, 1, &data);
// Disable APEX to use 2.25kB of fifo for raw data
data = SENSOR_CONFIG3_APEX_DISABLE_MASK;
rc |= inv_imu_write_reg(&icm_driver, SENSOR_CONFIG3_MREG1, 1, &data);

icm_driver.sensor_event_cb = event_callback;
return rc;
}

mustafayildiri…

1 year 9 months ago

Hello,

Were you able to solve your issue?

phpbb Post ID
45685

mustafayildiri…

1 year 9 months ago

Hi,

This is issue has already been highlighted on GitHub here: https://github.com/tdk-invn-oss/motion.arduino.ICM42670P/issues/12
Let me know if you have any more questions

phpbb Post ID
45702
phpbb Topic ID
45659