Hello mehmetbekir,
Sorry, you could read interrupt status register 0x36 value, bit0 is host status. Previous attachment reference code work well on my side with STM32F4, could you try to only run the reference code?
/* wait until the interrupt fires */
/* unless we already know there are bytes remaining in the fifo */
while (!bhi160b_get_int_status() && !bytes_remaining);
int bhi160b_get_int_status()
{
uint8_t value;
bhy_read_reg(BHY_I2C_REG_INT_STATUS_ADDR, &value, 1);
return(value&0x01);
}
I don't use external sensors. I just use the BHI160 chip. Could it have something to do with it not working?
Hello mehmetbekir,
This is the code to access the BHI160 register, not the external sensor.
I have a similar problem.
All initialization steps pass with BHY_SUCCESS. Read product ID: 0x83. I receive the first interrupt. Then, I receive 10 bytes in the FIFO decoded as follows:
bhy_meta_event_type_t: BHY_META_EVENT_TYPE_ERROR
bhy_data_meta_event_t.meta_event_id: 254
bhy_data_meta_event_t.event_number: 4
bhy_data_meta_event_t.sensor_type: 33
bhy_data_meta_event_t.event_specific: 21
Then no interrupt, and FIFO always has zero bytes_remaining.
I am using BHI160B, the latest standalone firmware (Bosch_PCB_7183_di03_BMI160-7183_di03.2.1.11824). STM32L4 MCU. I am running the rotation_vector_example.c code.
SOLVED:
It turned out our electrical hardware designer missed the pull-up resistors for the auxiliary I2C bus.
Good news.