There was an error adding I2C to nrf9160

Hi:

HW:

PCA10090

Exmple:

mqtt_simple

Config:

Add i2c:

arduino_i2c: &i2c2 {
	compatible = "nordic,nrf-twim";
	status = "okay";
	sda-pin = <13>;
	scl-pin = <14>;
};

Build error:

error: static assertion failed: "/soc/peripheral@40000000/i2c@a000 has legacy *-pin properties defined although PINCTRL is enabled"

This is the source code:

4760.mqtt_simple.zip

  • Hello,

    We started to use "Pin control" in SDK v2.0.0 which meant you had to change the way you assigned pins to peripherals in the device tree.

    Please try with this overlay instead:

    &pinctrl {
    	i2c2_default: i2c2_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 14)>,
    				<NRF_PSEL(TWIM_SCL, 0, 13)>;
    		};
    	};
    
    	i2c2_sleep: i2c2_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 14)>,
    				<NRF_PSEL(TWIM_SCL, 0, 13)>;
    			low-power-enable;
    		};
    	};
    
    };

    Best regards,

    Vidar

Related