in ~/ncs/zephyr/samples/hello_world/prj.conf
CONFIG_I2C=y
//////////// 2 uart + 2 i2c build OK
in nrf9160dk_nrf9160ns.overlay
/ {
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
};
};
&uart0 {
current-speed = <115200>;
status = "okay";
tx-pin = <1>;
rx-pin = <0>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&uart1 {
current-speed = <115200>;
status = "okay";
tx-pin = <26>;
rx-pin = <25>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&i2c2 {
compatible = "nordic,nrf-twim";
status = "okay";
sda-gpios = < &gpio0 0x0e 0x0 >;
scl-gpios = < &gpio0 0x0f 0x0 >;
clock-frequency = <I2C_BITRATE_STANDARD>;
};
&i2c3 {
compatible = "nordic,nrf-twim";
status = "okay";
sda-gpios = < &gpio0 0x1e 0x0 >;
scl-gpios = < &gpio0 0x1f 0x0 >;
clock-frequency = <I2C_BITRATE_STANDARD>;
};
build OK
//////////// 3 uart + 1 i2c build OK
in nrf9160dk_nrf9160ns.overlay
&uart0 {
current-speed = <115200>;
status = "okay";
tx-pin = <1>;
rx-pin = <0>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&uart1 {
current-speed = <115200>;
status = "okay";
tx-pin = <26>;
rx-pin = <25>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&uart2 {
current-speed = <115200>;
status = "okay";
tx-pin = <28>;
rx-pin = <27>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&i2c2 {
status = "disabled";
sda-gpios = < &gpio0 0xFFFFFFFF 0x0 >;
scl-gpios = < &gpio0 0xFFFFFFFF 0x0 >;
};
&i2c3 {
compatible = "nordic,nrf-twim";
status = "okay";
sda-pin = < 30 >;
scl-pin = < 31 >;
clock-frequency = <I2C_BITRATE_STANDARD>;
};
///////////////////3 uart + 2 i2c build error
&uart0 {
current-speed = <115200>;
status = "okay";
tx-pin = <1>;
rx-pin = <0>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&uart1 {
current-speed = <115200>;
status = "okay";
tx-pin = <26>;
rx-pin = <25>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&uart2 {
current-speed = <115200>;
status = "okay";
tx-pin = <28>;
rx-pin = <27>;
rts-pin = <0xFFFFFFFF>;
cts-pin = <0xFFFFFFFF>;
};
&i2c2 {
compatible = "nordic,nrf-twim";
status = "okay";
sda-gpios = < &gpio0 0x0e 0x0 >;
scl-gpios = < &gpio0 0x0f 0x0 >;
clock-frequency = <I2C_BITRATE_STANDARD>;
};
&i2c3 {
compatible = "nordic,nrf-twim";
status = "okay";
sda-gpios = < &gpio0 0x1e 0x0 >;
scl-gpios = < &gpio0 0x1f 0x0 >;
clock-frequency = <I2C_BITRATE_STANDARD>;
};
error message:
static assertion failed: "Only one of the following peripherals can be enabled: SPI2, SPIM2, SPIS2, TWI2, TWIM2, TWIS2, UARTE2. Check nodes with status \"okay\" in zephyr.dts."
how to make it pass