Orin NX BMI088 driver

Hi,
I read below wiki but still not sure how to modify the device tree file. BMI088 IMU Driver — Jetson Linux Developer Guide documentation

Looks like I only need to add below code to my dts file (tegra234-p3767-0001-p3768-0000-a0.dts), is it correct?

bmi088@69 {
compatible = “bmi,bmi088”;
accel_i2c_addr = <0x19>;
status = “okay”;
reg = <0x69>;
accel_irq_gpio = <&tegra_aon_gpio TEGRA_AON_GPIO(BB, 0) GPIO_ACTIVE_HIGH>;
gyro_irq_gpio = <&tegra_aon_gpio TEGRA_AON_GPIO(BB, 1) GPIO_ACTIVE_HIGH>;
accel_matrix = [01 00 00 00 01 00 00 00 01];
gyro_matrix = [01 00 00 00 01 00 00 00 01];
accel_reg_0x53 = <0x0A>;
gyro_reg_0x16 = <0x01>;
gyro_reg_0x18 = <0x01>;
};

And also add i2c address above it?
i2c@c240000{
status = “okay”;

Thanks for your suggestions.

Hi zt_minto,

Are you using the devkit or custom board for Orin NX?
What’s your Jetpack version in use?

Could you build kernel image and dtb successfully?
Have you configured the pinmux dtsi for I2C interface?

Hi Kevin,

It’s custom board. The Jetpack version is Jetpack 5.1.1 - Linux 35.3.1.
I can build kernel image and dtb successfully.
I didn’t change pinmux i2c as I copied the devkit i2c, and use its I2C1_SCL and I2C1_SDA for BMI088.

Do you mean the following 2 pins for I2C1?


If so, they have been configured for I2C by default.

Could you share the dtb in use(/boot/dtb/kernel_XXX.dtb on your board) for further check?
and also the full dmesg as file here.

Yes, those I2C pins. The I2C works good as I can use i2ctool to detect device.
My question is how to modify the device tree file to enable BMI088 driver in kernel refer to BMI088 IMU Driver — Jetson Linux Developer Guide documentation

You have to refer the following instruction to sync the kernel source.
Kernel Customization — Jetson Linux Developer Guide documentation (nvidia.com)
After applying the device tree change for BMI008 IMU, you should build the kernel image/dtb and re-flash the board.

hi Kevin,
Thanks. I know the process of Kernel Customization.

What I did:
I added below in tegra234-p3768-0000-a0.dtsi. And complie and flash successfully.
i2c@c250000{
status = “okay”;
bmi088@69 {
compatible = “bmi,bmi088”;
accel_i2c_addr = <0x18>;
status = “okay”;
reg = <0x68>;
//accel_irq_gpio = <&tegra_aon_gpio TEGRA234_AON_GPIO(PP, 0) GPIO_ACTIVE_HIGH>;
//gyro_irq_gpio = <&tegra_aon_gpio TEGRA234_AON_GPIO(PP, 1) GPIO_ACTIVE_HIGH>;
accel_matrix = [01 00 00 00 01 00 00 00 01];
gyro_matrix = [01 00 00 00 01 00 00 00 01];
accel_reg_0x53 = <0x0A>;
gyro_reg_0x16 = <0x01>;
gyro_reg_0x18 = <0x01>;
};
};
//accel_irq_gpio and gyro_irq_gpio as the hardware pin didn’t connect.

I can use i2cdetect tool to find BMI088, whose address is 0x18 and 0x68. So the hardware is good.

Questions:
1, above action on dts file is correct?
2, where is the bmi088.ko per BMI088 IMU Driver — Jetson Linux Developer Guide documentation

Thanks for your reply.

I don’t have this module to verify locally so that I could not comment on this configuration. You could just using the sample device tree configuration for this IMU module.

Kernel module should be under /lib/modules/5.10.120-tegra/kernel/drivers/, please search that module inside.

Thanks Kevin. I still can’t get the imu data from kernel driver. Then I finally get the imu data from app level with i2c functions.

1 Like

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