I'm trying to set up the any motion feature for the BMI270. The sensor is set up correctly and I can read data from the accelerometer and gyroscope. I added the any motion feature to the struct used for the bmi2_set_sensor_config function in the API. There are no errors, but the hardware interrupt never triggers. I tried reading the INT_STATUS_0 register, and it did set the corresponding bit high at some point. But I made some changed since then, and it's not working anymore. I'm not sure how to get to that point again.
I attached the functions used for the sensor configuration. The read/write functions etc. all work as desired.
Thanks in advance 🙂
Solved! Go to Solution.
I think you missed interrupt map. 🙂
I attached my example for any motion feature.
As you also use API, so you can easily apply it.
Please check below functions in my code 🙂
"/* Enable the selected sensors. */
rslt = bmi2_sensor_enable(sens_list, 2, &bmi2_dev);
/* Set feature configurations for any-motion. */
rslt = set_feature_config(&bmi2_dev);
/* Map the feature interrupt for any-motion. */
rslt = bmi2_map_feat_int(&sens_int, 1, &bmi2_dev);
Please let me know if you have further questions 🙂
Hello again Minhwan,
Thanks for the quick reply. 🙂
I have the bmi2_map_feat_int function at the end of the bmi2_accel_gyro_set_config, which is called in the IMU_init. Are there any functions in the API which can cause a conflict with the mapping function?
I tried uploading your example, but it's not initializiting correctly. Had to change from SPI to I2C communication, since my SPI bus is full with other sensor data. I've attached the modified version of your example, are you willing to check if I've missed something?