Device bmi270@68 is not ready when using nrf5340 and the BMI270 sample

I am trying to get the BMI270 working with a nrf5340 DK. I have read Unable to Connect nRF5340DK with BMI270 Over I2C - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com) and Falied to Connect nRF5340DK with BMI270 Over I2C - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com), but neither had an answer. I understand the comment that the BMI270 driver "does a lot of stuff", but that did not seem like a reasonable answer to me considering it seems to work with the nrf52833. I added the:

zephyr,concat-buf-size = <128>;

Which did not solve my issue which was that I ran the sample and got this error message:

Device bmi270@68 is not ready

Parents
  • Hi,

     

    Do you have external pull resistors?

    If not, try to enable internal pull-ups in DT:

    &pinctrl {
    	i2c1_my_default: i2c1_my_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
                bias-pull-up;
    		};
    	};
    
    	i2c1_my_sleep: i2c1_my_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
    			low-power-enable;
    		};
    	};
    };
    
    &i2c1 {
    	compatible = "nordic,nrf-twim";
    	status = "okay";
    	pinctrl-0 = <&i2c1_my_default>;
    	pinctrl-1 = <&i2c1_my_sleep>;
    	pinctrl-names = "default", "sleep";
    	zephyr,concat-buf-size = <128>;
        bmi270@68 {
                compatible = "bosch,bmi270";
                reg = <0x68>;
        };	
    };

     

    Kind regards,

    Håkon

  • I have a board to connect w/the nRF5340 DK with a separate I2C SCL/SDA (currently P0.24 and P0.23 respectively). For the BMI270 INT1 is P0.06 and INT2 is P0.09.

    I replaced the overlay with what you provided but got the same response.

    I did have to add one additional item because there is a SAO address bit for the BMI and I need to make this MCU GPIO Output LOW and it will be BMI270 default i2c address 0b1101000 (0x68).

    &gpio0 {
        status = "okay";
        p0_19_hog: p0_19_hog {
            gpio-hog;
            gpios = <19 GPIO_ACTIVE_HIGH>;
            output-low;
        };
    };

  • Hi,

     

    Could you scope your SDA/SCL lines to see where the communication fails?

     

    Kind regards,

    Håkon

  • I'm not great with the logic analyzer but can try. Would others be having the same problem with the communication?

  • Hi,

     

    The initial steps when adding sensors is to ensure that the communication is up and running, and also check that the sensor is ACKing the messages that comes across.

     

    You can add these to your prj.conf for more verbose printing:

    CONFIG_LOG=y
    CONFIG_SENSOR_LOG_LEVEL_DBG=y
    CONFIG_I2C_LOG_LEVEL_DBG=y

     

    However, if there is no ACK on the I2C lines, you will only get the prompt "Device bmi270@68 is not ready".

     

    Kind regards,

    Håkon

  • With the logging:

    Device bmi270@68 is not ready
    [00:00:00.257,202] <dbg> bmi270: write_config_file: writing config file max_fifo
    [00:00:00.258,880] <err> i2c_nrfx_twim: Need to use the internal driver buffer but its size is insufficient (1 + 256 > 128). Adjust the zephyr,concat-buf-size or zephyr,flash-buf-max-size property (the one with greater value) in the "i2c@c000" node.
    [00:00:00.260,528] <err> i2c_nrfx_twim: Need to use the internal driver buffer but its size is insufficient (1 + 256 > 128). Adjust the zephyr,concat-buf-size or zephyr,flash-buf-max-size property (the one with greater value) in the "i2c@c000" node.
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***

    I'm also curious how this works without specifying INT1 and INT2 anywhere.

  • Got it working thanks to the debug statements! I appreciate your help.

    &i2c3 {
    	compatible = "nordic,nrf-twim";
    	status = "okay";
    	pinctrl-0 = <&i2c3_my_default>;
    	pinctrl-1 = <&i2c3_my_sleep>;
    	pinctrl-names = "default", "sleep";
    	zephyr,concat-buf-size = <257>;
        bmi270@68 {
                compatible = "bosch,bmi270";
                reg = <0x68>;
        };	
    };

Reply
  • Got it working thanks to the debug statements! I appreciate your help.

    &i2c3 {
    	compatible = "nordic,nrf-twim";
    	status = "okay";
    	pinctrl-0 = <&i2c3_my_default>;
    	pinctrl-1 = <&i2c3_my_sleep>;
    	pinctrl-names = "default", "sleep";
    	zephyr,concat-buf-size = <257>;
        bmi270@68 {
                compatible = "bosch,bmi270";
                reg = <0x68>;
        };	
    };

Children
Related