Hi Bosch Sensortec Community,
I'm using the BMI270 with the latest BMI270-Sensor-API from github.
My goal is to configure the FIFO to buffer only accelerometer and gyroscope data with identical data rates, reading the available buffer size and extracting all currently available measurements.
The problem is that when reading the FIFO_CONFIG registers the response is not the same as the set configuration value.
uint16_t config = BMI2_FIFO_ACC_EN | BMI2_FIFO_GYR_EN
1100 0000 0000 0000
1101 0000 0000 0010
get_fifo_config indicates that fifo_header_en and fifo_time_en bits are set while they havent been configured in set_fifo_config.
If you look at the implementation of bmi2_set_fifo_config(), this function first reads back the current configuration from the register map, then applies a mask to add (or substract based on the enable flag) the bits from your config argument to the existing configuration.
Therefore you will need to manually disable the default configuration (or any unwanted bits) with another bmi2_set_fifo_config() call.