Required BMI270+BMM150 Drivers

Hi Team,

We have BMI270 Shuttle Board 3.0 where BMM150 Mounted on it. We are getting BMI270 Raw Data but Not getting BMM150 Data. We are using SPI as primary interface for BMI270 data. Same time we configured as Auxilary Interface of BMI270 which enables BMM150 as secondary interface using indirect addressing mode but BMM150 (Mag) Data is not getting. May be configuration issue for BMM150.

Can any one help me on single Arduino driver which gives both BMI270 and BMM150 Raw Data.?

Any help would be very thankful.

You forgot to post your code.

Thank you for the reply @pylon ,

Please go through the attached code. Which I was testing. Present getting only Acc, Gyro Raw data. Though we done indirect addressing mode for BMM150 to get mag data, unable to get that. Please help us to get Mag data.

Any help would be very thankful.

BMI270_BMM150_Copy.ino (26.0 KB)
bmi2.h (68.0 KB)
bmi2_defs.h (101.4 KB)
bmi270.h (5.9 KB)
bmm150.h (16.6 KB)
bmm150_common.h (3.8 KB)
bmm150_defs.h (24.7 KB)

Any one reply to get Mag data using above files.

Thank you.

There's still code missing. The bmi2_* functions are not implemented.

You should check the return value of the bmi2_read_aux_man_mode() call!

The ASDx and ASCx are at the pins and is in between the sensors. You could attach a logic analyzer there to see if something happens.

Hi @Koepel,

Thank you for the reply,

We are trying in indirect addressing mode. Also we observed that they are high(3v level) but, no data on ASCx, ASDx (I2C) lines which goes to BMM150 while sending or reading.
What else might be the problem.?

Any help would be very thankful.

Hi @pylon,

We are using Indirect addressing mode to set BMM150 in Setup mode and Data mode. Can you please suggest Any Arduino driver for reading Acc, Gyr, Mag data ?

Any help would be very thankful.

In the Arduino world there are no "drivers", there are libraries.

No, i cannot suggest any libraries but I tried to check if your code is doing what it should but you didn't post the complete code so my try failed.

Thank you for the reply,

Now I'm getting Acc, Gyro Data as expected but not getting Mag Data. BMI270 was not set in Data mode to get Mag Data. I have used indirect addressing mode as per BMI270 data sheet to set BMI270 in Auxilary configuration(Setup Mode + Data Mode). Please refer below files & help me to set auxilary configuration for BMI270.

Any help would be very thankful.

bmi270.h (5.9 KB)
BMI270_BMM150_Copy.ino (15.6 KB)
bmm150.h (16.6 KB)
bmm150_common.h (3.8 KB)
bmm150_defs.h (24.7 KB)
bmi2.h (68.0 KB)
bmi2_defs.h (101.4 KB)

Still not the complete code! Where are the bmi2* functions implemented?

Sorry @pylon ,
I could not upload .c files. I am attaching link of those files please don't hesitate to look into it.

https://github.com/BoschSensortec/BMI270-Sensor-API

From the above link I found that example provided by Bosch are not intended to work in Arduino so I took only .h and .c files.

Any help would be very thankful.

Thank you.

Your code is horribly formatted. The IDE offers support (Ctrl-T) if you're unable to do it yourself.

Remove the routines bmm150_user_i2c_reg_read, bmm150_user_i2c_reg_write and bmm150_interface_selection as they are unused and wrong anyway.

As you do set the manual mode yourself, you should set the corresponding flag (bmi2.aux_man_en = 1) otherwise the bmi2_read_aux_man_mode will return without doing anything. You should check the result codes you get to know what might have gone wrong.

Thank you for the reply @pylon ,

Please continue in the other thread I will close this thread.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.