I am attempting to set the IMU to connect to the magnetometer as per the data sheet (setting mag mode --> normal , setting mag_if[1](bit 7) --> 0) then reading from the data register, but it doesn't seem to be working.

So I attempted to just read from the device_id register via the mag_if on the imu, this also provided no joy. So then I decided to bypass the imu altogether and address the magnetometer via i2c. The device is recognized on bus 2, address 0x12 as expected. However, when attempting to read from the device registers I get nothing but 0x00 or 0xFF. I am wondering if anyone has experienced this problem before, if I am setting something up incorrectly, or if there is possibly something wrong with the process I am implementing.

In addition to the IMU built into the flight controller (Intel Aero FC or a third party FC), the Intel Aero Compute Board includes a 6-DOF IMU: BMI 160 sensor. This sensor is connected to the Intel Atom processor via its SPI interface on bus 3 (SPI3) chip select 0 (CS0). It can be accessed via spidev as /dev/spidev3.0. The Aero Compute Board also integrates a magnetometer and a pressure sensor on its I2C.

* -b is for spi bus * -c is for chip select * -d is the data value * -w is for number of wordsNote: Users can also follow linux sample program showing an example on how to use spidev interface.

Command to access the Magnetometer SensorIntel Aero Compute Board includes BMM 150 sensor. This sensor is connected to Atom SoC via I2C interface on bus 2 at slave address 0x12. In order to communicate with this sensor, please use below linux i2c commands:

Sorry I must not have explained myself well. I have full control of the IMU sensor BMI160. I am reading the gyro and accelerometer data via a python script I wrote. The BMI150 magnetometer should be able to be accessed through the BMI160 via the MAG_IF register, but it does not respond. So I attempted direct access via the I2C bus. I can ping the bus and see that the magnetometer exists on bus 2 address 0x12. However, reading from register 0x40 (Chip ID) on bus 2, address 0x12 returns 0x00. I wrote a python script to loop through all the registers on the chip and every register returns 0x00 or 0xFF

I'm trying to access data from the magnetometer sensor. Can you provide more specifics of how to access actual data values. For instance, what "DATA-ADDRESS", "VALUE", and "MODE" values should I use to access the magnetometer readings, when I issue the following commands:

So for me it turned that the default register settings where wrong. Specifically you need to write a 1 to register 0x4B (the Power Control Bit). At which point you will have read/write access to the rest of the registers. so for example if you then send a read command:

i2cget -y 2 0x12 [0x40 [r]]

it should return the Chip ID: 0x32.... I should say that I am doing this in python, not from the command line so I cannot guarantee that the above command is the correct syntax