Thingy53: how to enable bmi270 on board correctly?

Hi community,

ncs-2.6.0 I'm using.

I'm trying to enable bmi270 as I enabled adxl362(is already working), both are connected with SPI.

CONFIG_ADXL362=y
CONFIG_BMI270=y

but it shows me this kind of infomation:

CONFIG_BMI270 was assigned the value y, but got the value n. Missing dependencies:
DT_HAS_BOSCH_BMI270_ENABLED

BMI270 Inertial measurement unit

Type: bool

Value: n

Enable driver for BMI270 I2C-based imu sensor

after check the Kconfig file of BMI270 I find this:

it´s  a little complex for me as a newbie, so how to enable the bmi270 on board of thingy53?


Best regards,

Danny

  • Hi

    Can you show me your devicetree and your prj.conf?

    Regards

    Runar

  • &spi3 {
    	compatible = "nordic,nrf-spim";
    	status = "okay";
    	cs-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>,
    		   <&gpio1 4  GPIO_ACTIVE_LOW>,
    		   <&gpio0 24 GPIO_ACTIVE_LOW>;
    
    	pinctrl-0 = <&spi3_default>;
    	pinctrl-1 = <&spi3_sleep>;
    	pinctrl-names = "default", "sleep";
    	adxl362: spi-dev-adxl362@0 {
    		compatible = "adi,adxl362";
    		spi-max-frequency = <8000000>;
    		reg = <0>;
    		int1-gpios = <&gpio0 19 0>;
    	};
    
    	bmi270: spi-dev-bmi270@1 {
    		compatible = "bosch,bmi270";
    		status = "disabled";
    		spi-max-frequency = <8000000>;
    		reg = <1>;
    	};
    
    	nrf_radio_fem_spi: fem_spi@2 {
    		compatible = "nordic,nrf21540-fem-spi";
    		status = "disabled";
    		reg = <2>;
    		spi-max-frequency = <8000000>;
    	};
    };
    
    in overlay file:
    &spi3{
    	bmi270: spi-dev-bmi270@1 {
    		status = "okay";
    	};
    };
    
    ***************************************
    
    CONFIG_I2C=y
    CONFIG_SPI=y
    # Enable floating point format specifiers
    CONFIG_CBPRINTF_FP_SUPPORT=y
    #custom
    CONFIG_SENSOR=y
    CONFIG_BH1749=y
    CONFIG_BH1749_TRIGGER=y
    
    CONFIG_ADXL362=y
    CONFIG_BMI270=y

  • Thanks

    Did you do a prestine build after changes your prj.conf and overlay?

    I tried with NCS 2.6.1. Which version are you using?

    Build target thingy53_nrf5340_cpuapp_ns

    prj.conf 

    # nothing here
    CONFIG_GPIO=y
    CONFIG_SPI=y
    CONFIG_SENSOR=y
    CONFIG_BMI270=y
    
    

    Overlay

    &spi3{
    	bmi270: spi-dev-bmi270@1 {
    		status = "okay";
    	};
    };

    main

    #include <zephyr/kernel.h>
    
    int main(void)
    {
    	const struct device *sensor = DEVICE_DT_GET_ANY(bmi270);
    
    	if (!device_is_ready(sensor)) 
    	{
    		printk("Sensor device not ready\n");
    		return;
    	}
    	printk("Hello World! %s\n", CONFIG_BOARD);
    	return 0;
    }
    

    And I was not able to replicate your warning 

    Regards

    Runar

  • Hi Runar,

    thanks for your reply!

    after restarting my laptop, everything works fine.

    Best regards

    Danny

Related