Trying to interface the BMI088 IMU with an i2c multiplexer
@Middleware & OS I’m trying to interface the BMI088 IMU with an i2c multiplexer. The BMI088 has two different addresses for the accelerometer and gyroscope which makes it act like 2 different devices entirely. I have the mux on bus0 in my devicetree and I can address it just fine. I put the IMU on channel 2 of the mux and I have read that each channel on the mux is essentially a bus extension. I cannot find any specific information/examples on how to set up the individual BMI088 acc and gyro addresses on the mux channel in my device tree.
Please, I'm making use of STM32 MCU.
Could anyone reference any documentation or examples?
Here's my i2c bus initializing code
Solution:Jump to solution
Also make sure to initialize the I2C multiplexer in your code. After selecting the mux channel, you'll need to address the BMI088's accelerometer and gyroscope accordingly.
7 Replies
Hi this your initialization code is a good starting point for you . Once you configure the device tree with the appropriate select-slave-addr values for each channel, you shouldn't need significant modifications to the core I2C communication logic itself , cus you might just need to adjust the slave address based on the selected channel during communication
Ok Thanks @Marvee Amasi
I will check it out
@UC GEE It sounds like you're trying to set up the BMI088 IMU with an I2C multiplexer, which can be a bit tricky since the IMU has two different addresses. You’ll need to handle the addressing in your device tree by configuring the multiplexer and specifying the channels for the accelerometer and gyroscope separately. I don't have an exact example for your specific setup, but you can refer to how device trees handle I2C multiplexer configurations. Have you checked the STM32 documentation or forums for examples?
No ...I have not check STM32 documentation or Forums @RED HAT ... But I will check it out as you have recommended.
But please @RED HAT
Besides the device tree configuration, are there any other aspects of the code that may need to be adjusted when using the BMI088 with an I2C multiplexer?
@UC GEE you need to define the channels in your device tree by specifying each device under the appropriate mux channel. Here’s an example:
Ensure your mux node in the device tree matches your hardware setup. The addresses 0x18 and 0x68 are examples; you’ll need to use the correct addresses for your BMI088.
Solution
Also make sure to initialize the I2C multiplexer in your code. After selecting the mux channel, you'll need to address the BMI088's accelerometer and gyroscope accordingly.