This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

static assertion failed: "Only one of the following peripherals can be enabled: SPI2, SPIM2, SPIS2, TWI2, TWIM2, TWIS2, UARTE2. kernel build bug

in nrf9160dk_nrf9160ns.overlay setting
/ {
    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>;
};

&uart2 {
        current-speed = <115200>;
        status = "okay";
        tx-pin = <28>;
        rx-pin = <27>;
        rts-pin = <0xFFFFFFFF>;
        cts-pin = <0xFFFFFFFF>;
};

I can use 3 uart success

and then i add one i2c

/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */
/ {
    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>;
};

&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-pin = < 30 >;
    scl-pin = < 31 >;
        clock-frequency = <I2C_BITRATE_STANDARD>;  
};

when build them will happend

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."

after i change to

/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */
/ {
    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>;
};

&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>;  
};

build success~~~~

Its a kernel problem please solve this problem

Parents Reply Children
No Data
Related