Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMI085 FIFO interrupt not working as configured

    BMI085 FIFO interrupt not working as configured



    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:

    The identical behavior can be observed for the gyroscope as well. 


    Here are the code snippets which are used for the FIFO interrupt configuration:


    	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;
    	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);



    • 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,


    2 REPLIES 2

    Community Moderator
    Community Moderator

    Hi dcindric28,

    1.Compared your code and accel_fifo_watermark.c code on github, your code didn't set water mark level, please refer acc FIFO example code on github.

    /* Set water mark level */
    rslt = bmi08a_set_fifo_wm(BMI08X_ACC_FIFO_WATERMARK_LEVEL, &bmi08xdev);
    bmi08x_error_codes_print_result("bmi08a_set_fifo_wm", rslt);

    /* Update FIFO structure */ = fifo_data;
    fifo_frame.length = BMI08X_ACC_FIFO_RAW_DATA_USER_LENGTH;

    config.accel_en = BMI08X_ENABLE;

    /* Set FIFO configuration by enabling accelerometer */
    rslt = bmi08a_set_fifo_config(&config, &bmi08xdev);

    2.You also need to ensure your host has read the FIFO data completely after interrupt received.


    Thank you for your response. As you can see in the code snippets I provided, I've already perfomed all of the steps you suggested and followed through the provided example for both accelerometer and gyroscope FIFO watermark application.


    The problem was not in the firmware, but in the hardware - combination of logic analyzer settings and wiring issues on the prototyping board/breadboard were problematic. Now it is working as expected. This topic can be closed.


    Best regards,