10-19-2020 05:41 PM
I'm using the SPI bus to access the BMI270. The device can reply to the DEVICE_ID register 0 with 0x24. I can monitor the SPI bus and it seems ok and other devices on the same bus function. When I try toload the config_file array from the Github into the BMI270_REG__INIT_DATA register the INTERNAL_STATUS show "Not Init". The INTERNAL_STATUS shows 0x00 (Not Init) and when I read back from the BMI270_REG__INIT_DATA, it is all the same random value for every register (2B, 2B, 2B.. or 1F, 1F, 1F...).
I see that I have to load this 8k file to even get basic accelerometer data.
Does this basic procedure below seem correct?
----------------------------------
//load file to configure
bmi270_writeregister(dev, BMI270_REG__INIT_CTRL, 0);
//set Address to 0
bmi270_writeregister(dev, BMI270_REG__INIT_ADDR_0, 0);
bmi270_writeregister(dev, BMI270_REG__INIT_ADDR_1, 0);
//load array file
bmi270_write(dev, BMI270_REG__INIT_DATA, (uint8_t*)bmi270_config_file, sizeof(bmi270_config_file));
//Write init CTRL to 1 showing config loaded.
bmi270_writeregister(dev, BMI270_REG__INIT_CTRL, 1);
vTaskDelay(300);
bmi270_readregister(dev, BMI270_REG__INTERNAL_STATUS, &val);
----------------------------------
Can I change bmi270_config_file to {1,2,3,4,5,6,7,8};, load it and should I be able to read this 1-8 back as a test to see if I can write to the device? When I do it, I get the same random data, like this register is locked or something.
The INTERNAL_STATUS shows 00, not 02 which is failed to load. What is the difference in status?
Solved! Go to Solution.
10-28-2020 07:09 PM
I have tried adjusting the burst size. While 32, 64 and 128 seem to work 256, 512, 1024, 2048, 4096 and 8192 all fail. Is this expected? It takes >5 seconds to load when using 128 sized bursts. I need to find a way to spped this up. The SPI interface meets your set up and hold requirements.
Can you confirm that you have a system that can load this file in 15-30ms?
10-28-2020 07:41 PM
Hello mullercw,
5s for config file is quite slow. Yes, technically 8192 should work.
However, burst write config file, it requires ca. 6.6 ms at 10 MHz SPI Interface.
Thanks,
10-04-2021 06:34 PM
How to create config file? I want to config gyro with level tigger. Is it way to do that?
10-04-2021 07:43 PM
Hello,
Do you mean that you want to use gyro and hardware interrupt trigger?
Config file and both your reqeusts are seperate.
In terms of gyro, you can check our example, https://github.com/BoschSensortec/BMI270-Sensor-API/tree/master/examples/bmi270
And, level trigger ( assume hardware interrupt pin), please check below code.
struct bmi2_int_pin_config int_pin_config;
/* Interrupt setting */
int_pin_config.pin_type = BMI2_INT1;
int_pin_config.int_latch = BMI2_INT_NON_LATCH;
int_pin_config.pin_cfg[0].output_en = BMI2_INT_OUTPUT_ENABLE; // Output enabled
int_pin_config.pin_cfg[0].od = BMI2_INT_PUSH_PULL; // OpenDrain disabled
int_pin_config.pin_cfg[0].lvl = BMI2_INT_ACTIVE_LOW; // Signal Low Active
int_pin_config.pin_cfg[0].input_en = BMI2_INT_INPUT_DISABLE; // Input Disabled
// INT1 active high, pushpull, output enabled
rslt = bmi2_set_int_pin_config( &int_pin_config, &bmi2_dev);
Thanks,
10-04-2021 08:49 PM
I can get DRDY or ANY_MOTION to hardware interrupt pin.
But:
I want to try get interrupt, if the sensor_data.sens_data.gyr.x > 1000.