10-25-2023 12:20 AM
Hello all,
I modified the bmi270 api accel examples to make it work in STM32F205 and successfully read the accel data,
but with problems that:
1) The accelerometer data is out by factor of 4
x=0.02 m/ss
y=2.37 m/ss (anticipate it close to 1G, 9.8m/ss)
z=-0.4 m/ss
2) Changing the range made no difference to the data (double checked Register (0x41) ACC_RANGE and sure the change was wrote the register correctly)
During my self debug, I narrow down the problem is getting BMI2_E_ACC_INVALID_CFG error in set_accel_config()
But I got all BMI2_OK in other settings and BMI2_E_ACC_INVALID_CFG error doest not tell me more details except my ACCEL configuration should have problem.
My code is mostly the accel example from BMI270-Sensor-API
https://github.com/boschsensortec/BMI270-Sensor-API/tree/master/bmi270_examples/accel
with following changes to make it work with stm32
1) redefine bmi2_interface_init() with
https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BMI270-accel-data-anomily/td-p/15622
Unfortunately, this post does not give out the details how the problem was finally solved
10-25-2023 01:00 AM
Hi Jichen,
Could you share your acc configuration?
Address 0x40, 0x41.
Thank you.
10-25-2023 06:32 AM
Hi Minhwan,
Thanks for reply.
My 0x40 read is 0x00
and 0x41 read is 0xA9
10-27-2023 03:47 AM
Hi Minhwan,
What do you think my setting value in 0x40 and 0x41?
Are they look right?
Thanks!
11-09-2023 11:12 PM
Hi @jichen ,
Sorry for late response.
I checked the value and your register value is wrong.
Your ODR setting is "reserved" if you set 0x00 in reg 0x40. Please check our datasheet.
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmi270-ds000.pdf
If you are using our API, it shouldn't do that.
Are you really using our API? Then, could you share your whole source?
Thank you.