Hello,
I'm developing an application which uses the BMI085 IMU sensor in the FIFO mode. Communication is done through SPI interface at 2 Mbit/s. Shuttle Board 2.0 with BMI085 IMU and STM32 Nucleo board is used for the evaluation.
I am able to perform initialization, load configuration file, and retrieve measurements from both accelerometer and gyroscope in polling mode without any problems.
Problems arise when I try to use the IMU in the FIFO mode. I was able to retrieve data from the FIFO in polling mode, where data from the FIFO is read every 50 ms and then is FIFO emptied/reset. However, interrupt behavior is not as expected.
Figures in the attachment show the state of the 2nd interrupt channel (BMI08X_INT_CHANNEL_2) of the accelerometer in the FIFO mode. I presume interrupts are generated every time a new accelerometer measurement is written in the FIFO, and not on the FIFO full or when the data in the FIFO reaches the predefined watermark level. A similar issue with faulty interrupt behavior was reported here, although for a different IMU sensor:
/mems-sensors-forum-jrmujtaw/post/bno055-unstable-interrupt-pin-at-startup-6zan6KXn5NNjSWx
Here are the code snippets which are used for the FIFO interrupt configuration:
//ACCELEROMETER FIFO CONFIGURATION SETUP
bmi08a_set_fifo_wm(BMI08X_ACCEL_FIFO_WATERMARK_LEVEL, &ConfigurationBosch);
imu_bosch_status = bmi08x_accel_fifo_interrupt_config (&ConfigurationBosch);
if (imu_bosch_status != BMI08X_INIT_SUCCESS)
{
//LOG_WriteToLog (Log_Error, "IMU Bosch accel FIFO config fail.");
return BMI08X_INIT_FAIL;
}
accel_fifo_cfg.accel_en = BMI08X_ENABLE;
accel_fifo_cfg.int1_en = BMI08X_ENABLE;
accel_fifo_cfg.int2_en = BMI08X_ENABLE;
accel_fifo_cfg.mode = BMI08X_ENABLE;
imu_bosch_status = bmi08a_set_fifo_config(&accel_fifo_cfg, &ConfigurationBosch);
if (imu_bosch_status != BMI08X_INIT_SUCCESS)
{
//LOG_WriteToLog (Log_Error, "IMU Bosch accel FIFO config fail.");
return BMI08X_INIT_FAIL;
}
//GYROSCOPE FIFO CONFIGURATION
imu_bosch_status = bmi08x_gyro_fifo_interrupt_config (&gyro_int_cfg, &ConfigurationBosch);
gyro_fifo_cfg.mode = BMI08X_GYRO_FIFO_MODE;
gyro_fifo_cfg.tag = BMI08X_GYRO_FIFO_TAG_DISABLED;
imu_bosch_status = bmi08g_set_fifo_config(&gyro_fifo_cfg, &ConfigurationBosch);
where
- ConfigurationBosch is bmi08x_dev struct
- accel_fifo_cfg is bmi08x_accel_fifo_config struct
- gyro_fifo_cfg is bmi08x_gyr_fifo_config
and bmi08x_accel_fifo_interrupt_config and bmi08x_gyro_fifo_interrupt_config are wrapper function which perform the interrupt configuration:
int8_t bmi08x_accel_fifo_interrupt_config (struct bmi08x_dev * bmi08x_dev)
{
struct bmi08x_accel_int_channel_cfg accel_fifo_int = {0};
int8_t status;
accel_fifo_int.int_channel = BMI08X_INT_CHANNEL_2;
accel_fifo_int.int_type = BMI08X_ACCEL_INT_FIFO_WM;
accel_fifo_int.int_pin_cfg.output_mode = BMI08X_INT_MODE_PUSH_PULL;
accel_fifo_int.int_pin_cfg.lvl = BMI08X_INT_ACTIVE_HIGH;
accel_fifo_int.int_pin_cfg.enable_int_pin = BMI08X_ENABLE;
status = bmi08a_set_int_config(&accel_fifo_int, bmi08x_dev);
return status;
}
int8_t bmi08x_gyro_fifo_interrupt_config (struct bmi08x_gyro_int_channel_cfg * gyro_fifo_int, struct bmi08x_dev * bmi08x_dev)
{
int8_t rslt;
gyro_fifo_int -> int_channel = BMI08X_INT_CHANNEL_3;
gyro_fifo_int -> int_type = BMI08X_GYRO_INT_FIFO_FULL;
gyro_fifo_int -> int_pin_cfg.output_mode = BMI08X_INT_MODE_PUSH_PULL;
gyro_fifo_int -> int_pin_cfg.lvl = BMI08X_INT_ACTIVE_HIGH;
gyro_fifo_int -> int_pin_cfg.enable_int_pin = BMI08X_ENABLE;
rslt = bmi08g_set_int_config ((const struct bmi08x_gyro_int_channel_cfg *) gyro_fifo_int, bmi08x_dev);
return rslt;
}
What can be the possible cause of this issue?
Best regards,
Dino.