Refer sample code (bma456an_examples/fifo_watermark_headerless_mode/) BMA456-Sensor-API/fifo_watermark_headerless_mode.c at master · boschsensortec/BMA456-Sensor-API · GitHub I use the below setting to enable the BMA456 fifo interrupt: // Set Accel Config (0x40) bma456_cfg.bandwidth = BMA4_ACCEL_NORMAL_AVG4; bma456_cfg.odr = BMA4_OUTPUT_DATA_RATE_50HZ; bma456_cfg.perf_mode = BMA4_CONTINUOUS_MODE; bma456_cfg.range = BMA4_ACCEL_RANGE_2G; rslt = bma4_set_accel_config(&bma456_cfg, &bma456_dev); // Enable the accelerometer rslt = bma4_set_accel_enable(BMA4_ENABLE, &bma456_dev); //Clear FIFO configuration register rslt = bma4_set_fifo_config(BMA4_FIFO_HEADER ,BMA4_DISABLE, &bma456_dev); // Configure Interrupts struct bma4_int_pin_config int_pin_config; int_pin_config.edge_ctrl = BMA4_LEVEL_TRIGGER; int_pin_config.input_en = BMA4_INPUT_DISABLE; int_pin_config.lvl = BMA4_ACTIVE_HIGH; int_pin_config.od = BMA4_PUSH_PULL; int_pin_config.output_en = BMA4_OUTPUT_ENABLE; bma4_set_int_pin_config(&int_pin_config, BMA4_INTR1_MAP, &bma456_dev); // Map INT1 Interrupt to FIFO_WM_INT rslt = bma4_map_interrupt(BMA4_INTR1_MAP, BMA4_FIFO_WM_INT, BMA4_ENABLE, &bma456_dev); //SET watermark rslt = bma4_set_fifo_wm(BMA_FIFO_WATERMARK, &bma456_dev); // Enable the accelerometer FIFO rslt = bma4_set_fifo_config(BMA4_FIFO_ACCEL, BMA4_ENABLE, &bma456_dev); When my device receives interrupt, it will read the int_status and the fifo buffer frame. I suppose the interrupt is received 50 samples (300 bytes) every 1 second (due to the ODR is set to 50Hz). But the log shows the device receives 2 interrupts: - 1st interrupt: status is 0200 (fwm_int) - 2nd interrupt: statis is 0000 I also check interrupt regster: 0x53: 0A 0x54: 00 0x58: 02 == log == [06/03/23 - 17:19:54:819] BMA__IRQ [06/03/23 - 17:19:54:822] int_status: 0200 [06/03/23 - 17:19:54:839] FIFO data bytes available : 300 [06/03/23 - 17:19:54:872] Parsed accelerometer data frames: length = 50 [06/03/23 - 17:19:54:886] BMA__IRQ [06/03/23 - 17:19:54:886] int_status: 0000 [06/03/23 - 17:19:54:894] FIFO data bytes available : 24 [06/03/23 - 17:19:54:919] Parsed accelerometer data frames: length = 4 [06/03/23 - 17:19:55:880] BMA__IRQ [06/03/23 - 17:19:55:886] int_status: 0200 [06/03/23 - 17:19:55:899] FIFO data bytes available : 300 [06/03/23 - 17:19:55:936] Parsed accelerometer data frames: length = 50 [06/03/23 - 17:19:55:949] BMA__IRQ [06/03/23 - 17:19:55:949] int_status: 0000 [06/03/23 - 17:19:55:956] FIFO data bytes available : 24 [06/03/23 - 17:19:55:980] Parsed accelerometer data frames: length = 4 May you kindly help to check the code flow and the log, provide us the possible reason why there is another interrupt (0000)? Is there any method to avoid it? Thanks
... View more