nRF54LM20 I2C Communication issue

Hi Team,

I am trying BMI270 Sample using nRF54LM20 DK. But the problem here is it getting exited after checking the device is ready section. 

/* ---------------- PIN CONTROL ---------------- */
&pinctrl {

    i2c20_default_alt: i2c20_default_alt {
        group1 {
            psels = <
                NRF_PSEL(TWIM_SDA, 1, 17)
                NRF_PSEL(TWIM_SCL, 1, 16)
            >;
        };
    };

    i2c20_sleep_alt: i2c20_sleep_alt {
        group1 {
            psels = <
                NRF_PSEL(TWIM_SDA, 1, 17)
                NRF_PSEL(TWIM_SCL, 1, 16)
            >;
            low-power-enable;
        };
    };

};

/* ---------------- USB ---------------- */
&zephyr_udc0 {
    cdc_acm_uart0: cdc_acm_uart0 {
        compatible = "zephyr,cdc-acm-uart";
    };

    cdc_acm_uart1: cdc_acm_uart1 {
        compatible = "zephyr,cdc-acm-uart";
    };
};

/* ---------------- I2C + BMI270 ---------------- */

&i2c20 {
    status = "okay";

    pinctrl-0 = <&i2c20_default_alt>;
    pinctrl-1 = <&i2c20_sleep_alt>;
    pinctrl-names = "default", "sleep";

    clock-frequency = <I2C_BITRATE_STANDARD>;

    bmi270: bmi270@69 {
        compatible = "bosch,bmi270";
        reg = <0x69>;
        status = "okay";
    };
};


&uart20 {
    status = "disabled";
};


/* ---------------- BUZZER ---------------- */
 / {
    aliases {
        bmi270 = &bmi270;

    };

};


Added my overlay file for your reference.

Thanks and regards,

Vinay

Parents
  • Is there any default pins we have to use for I2C Communication? 

    If yes, please let me know which pin we have to use on nRF54LM20 DK.

    Thanks, and regards,

    Vinay

  • Hello,

    If you look at the silkscreen on the backside of the board, you can see that P1.17 and P1.16 are both connected to the on board debugger (VCOMs). To free these pins, you can use the board configurator app and disable VCOM1: https://docs.nordicsemi.com/bundle/ug_nrf54lm20_dk/page/UG/nRF54LM20_DK/hw_desription/board_control.html 

  • Hi Vidar,

    Thank you for the reply.

    We need to configure 2 I2C master bus in nRF54LM20. Is it possible?

    thanks and regards,

    Vinay

  • Hi Vidar,

    I have used default BMI270 example, which is used for Arduino I2C Node. Is it possible to modify it as per nRF54LM20B dts compliance?

    Please let me know the limitations if not.

    Thanks, and regards,

    Vinay

  • Hi Vinay,

    I would appreciate it if you could follow up on my initial suggestion and let me know whether it fixed the problem. Otherwise it will be difficult for me to help you troubleshoot the problem. 

    From the datasheet you can see that the nRF54LM20 has 6 TWI instances (Note: each instance is shared with SPI/UART, see Peripherals with shared ID)

    Best regards,

    Vidar

  • Hi Vidar,

    I am using I2C21 instance for nRF54LM20 and I have not enabled any other peripheral instances. 
    I have gone through your suggestions and then I had replied previously.
    I have understood your point thats why I had changed the pinmux for I2C Instance I am using. Now its P1.20 and P1.21. I hope thats not been used by any other bus or peripherals. 

    I am trying to communicate with BMI270 Sensor. I am using SDK example BMI270. I observed that the app.overlay is used for Arduino I2C. So using the configuration I have generated overlay for nRF54LM20B. But still when I debug the application I can see its showing device is not ready.

    Adding overlay for your reference.

    /* ---------------- PIN CONTROL ---------------- */
    &pinctrl {
    
        i2c3_my_default: i2c23_default_alt {
            group1 {
                psels = <
                    NRF_PSEL(TWIM_SDA, 1, 21)
                    NRF_PSEL(TWIM_SCL, 1, 20)
                >;
                bias-pull-up;
            };
        };
    
        i2c3_my_sleep: i2c23_sleep_alt {
            group1 {
                psels = <
                    NRF_PSEL(TWIM_SDA, 1, 21)
                    NRF_PSEL(TWIM_SCL, 1, 20)
                >;
                low-power-enable;
            };
        };
    
    };
    
    /* ---------------- USB ---------------- */
    &zephyr_udc0 {
        cdc_acm_uart0: cdc_acm_uart0 {
            compatible = "zephyr,cdc-acm-uart";
        };
    
        cdc_acm_uart1: cdc_acm_uart1 {
            compatible = "zephyr,cdc-acm-uart";
        };
    };
    
    /* ---------------- I2C + BMI270 ---------------- */
    
    &i2c23 {
    	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>;
        };	
    };
    
    &uart20 {
        status = "disabled";
    };
    
    
    /* ---------------- BUZZER ---------------- */
     / {
        aliases {
            bmi270 = &bmi270;
    
        };
    
    };
    
    
    /*
    
    #include <zephyr/dt-bindings/pwm/pwm.h>
    
    / {
    	aliases {
    		pwm-led0 = &pwm_led2;
    	};
    
    	pwmleds {
    		compatible = "pwm-leds";
    
    		pwm_led2: pwm_led_2 {
    			pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
    		};
    	};
    };
    
    &pwm130 {
    	status = "okay";
    	pinctrl-0 = <&pwm130_default>;
    	pinctrl-1 = <&pwm130_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    */

    Thanks and regards,

    Vinay

  • Hi Vinay,

    P1.20 and P1.21 are connected to the 32 KHz crystal by default and are not routed to the pin header: https://docs.nordicsemi.com/bundle/ug_nrf54lm20_dk/page/UG/nRF54LM20_DK/hw_desription/connector_if.html. Try with P1.23 (SDA) and P1.24 (SCL) instead.

    Suggested app.overlay:

    /*
     * Copyright (c) 2021 Bosch Sensortec GmbH
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    &pinctrl {
    	i2c23_default: i2c23_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 23)>,
    				<NRF_PSEL(TWIM_SCL, 1, 24)>;
    			bias-pull-up;
    		};
    	};
    
    	i2c23_sleep: i2c23_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 23)>,
    				<NRF_PSEL(TWIM_SCL, 1, 24)>;
    			low-power-enable;
    		};
    	};
    };
    &i2c23 {
    	status = "okay";
    	pinctrl-0 = <&i2c23_default>;
    	pinctrl-1 = <&i2c23_sleep>;
    	pinctrl-names = "default", "sleep";
        bmi270@68 {
                compatible = "bosch,bmi270";
                reg = <0x68>;
        };	
    };
    
    

    Best regards,

    Vidar

Reply Children
  • Hi Vidar,

    Thank you for your reply.

    Is it possible to suggest me where I can find BMI270 examples because whatever example I am using not detecting the device. 
    I had imported it from zephyr/samples/sensor/bmi270.

    But the overlay file is generated for Arduino_i2c. I had copied overlay elements provided by you. But still its showing device not available

    Thanks and regards,

    Vinay

  • Hi Vinay,

    I had imported it from zephyr/samples/sensor/bmi270

    This sample is a good starting point.

    But the overlay file is generated for Arduino_i2c. I had copied overlay elements provided by you. But still its showing device not available

    The Arduino lable is not relevant. If you tried with the overlay I posted and it still did not work, then my next suggesting would be to go over the connections and if possible probe the bus lines with a logic analyser or oscilloscope. Perhaps you can post picture of your setup so I can see how you have connected the sensor as well.

    Best regards,

    Vidar

Related