nRF7000 device tree file for custom nRF9160 board

Hi Team,

I am trying to add the nRF7000 support, for WIFI location, to our nRF9160 custom board. 

This is the lines I add to our device tree:

{
    nordic_wlan0: nordic_wlan0 {
        compatible = "nordic,wlan0";
        status = "okay";
    };

    chosen {
        zephyr,wifi = &nordic_wlan0;
    };

    nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node {
        status = "okay";
        compatible = "nordic,nrf700x-tx-power-ceiling";
        max-pwr-2g-dsss = <0x54>;
        max-pwr-2g-mcs0 = <0x40>;
        max-pwr-2g-mcs7 = <0x40>;
        max-pwr-5g-low-mcs0 = <0x34>;
        max-pwr-5g-low-mcs7 = <0x34>;
        max-pwr-5g-mid-mcs0 = <0x34>;
        max-pwr-5g-mid-mcs7 = <0x34>;
        max-pwr-5g-high-mcs0 = <0x30>;
        max-pwr-5g-high-mcs7 = <0x30>;
    };

};

&spi3 {
    status = "okay";

    pinctrl-0 = <&spi3_default>;
    pinctrl-1 = <&spi3_sleep>;
    pinctrl-names = "default", "sleep";

    cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;

    nrf700x: nrf7000@0 {
        compatible = "nordic,nrf700x-spi";
        status = "okay";
        reg = <0>;
        spi-max-frequency = <DT_FREQ_M(8)>;

        iovdd-ctrl-gpios = <&gpio0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;    /* D0 */
        bucken-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;        /* D1 */
        host-irq-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;     /* D7 */
    };
};

&pinctrl {

    spi3_default: spi3_default {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 12)>,
                    <NRF_PSEL(SPIM_MISO, 0, 14)>,
                    <NRF_PSEL(SPIM_MOSI, 0, 15)>;
            nordic,drive-mode = <NRF_DRIVE_H0H1>;
        };
    };

    spi3_sleep: spi3_sleep {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 12)>,
                    <NRF_PSEL(SPIM_MISO, 0, 14)>,
                    <NRF_PSEL(SPIM_MOSI, 0, 15)>;
            low-power-enable;
        };
    };
}


prj.conf
# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_IPV6=y
CONFIG_NET_IPV4=y

# Location related configuration
CONFIG_LOCATION=y
CONFIG_LOCATION_METHOD_GNSS=n
CONFIG_LOCATION_METHOD_CELLULAR=y
CONFIG_LOCATION_METHOD_WIFI=y
CONFIG_LOCATION_SERVICE_NRF_CLOUD=y
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_FIRST_CELLULAR=y
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_SECOND_WIFI=y
CONFIG_LOCATION_DATA_DETAILS=y
CONFIG_LOCATION_LOG_LEVEL_DBG=y
CONFIG_LOCATION_SERVICE_EXTERNAL=n

# Actual configs for the Wi-Fi
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y
CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y
CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=30
CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=30
CONFIG_WPA_SUPP=n


I am using the Location library to get the location data, but during initialization I get an error:
[00:00:00.488,006] <err> location: No Wi-Fi interface found: nordic_wlan0
[00:00:00.488,067] <err> location: Failed to initialize 'Wi-Fi' method

The hardware connection is correct because I test it with sample code for nrf9160DK with the follow overlay file:

&uart1 {
    status = "disabled";
};

/* Typically we use GPIO extender to resolve these conflicts but the
 * GPIO pin used by extender itself conflicts with Wi-Fi (0.6), so,
  * disable LEDs and Button0/1.
  */
 &led0 {
     status = "disabled";
};

&led1 {
    status = "disabled";
};

&led2 {
    status = "disabled";
};

&led3 {
    status = "disabled";
};

&button0 {
    status = "disabled";
};

&button1 {
    status = "disabled";
};

&button2 {
    status = "disabled";
};

&button3 {
    status = "disabled";
};


&arduino_spi {
    status = "okay";

    cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;

    nrf700x: nrf7002@0 {
        compatible = "nordic,nrf700x-spi";
        status = "okay";
        reg = <0>;
        spi-max-frequency = <DT_FREQ_M(8)>;

        iovdd-ctrl-gpios = <&gpio0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;    /* D0 */
        bucken-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;        /* D1 */
        host-irq-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;     /* D7 */
    };
};

&pinctrl {
    spi3_default: spi3_default {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 12)>,
                    <NRF_PSEL(SPIM_MISO, 0, 14)>,
                    <NRF_PSEL(SPIM_MOSI, 0, 15)>;
            nordic,drive-mode = <NRF_DRIVE_H0H1>;
        };
    };

    spi3_sleep: spi3_sleep {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 12)>,
                    <NRF_PSEL(SPIM_MISO, 0, 14)>,
                    <NRF_PSEL(SPIM_MOSI, 0, 15)>;
            low-power-enable;
        };
    };
};

  •  do you have any suggestions to test or check? We stuck with this issue. 

  • Hi,

    It seems that Wi-FI interface might have failed. Can you please
    1. provide "net iface" output?
    2. enable logging using CONFIG_LOG and provide full log? You could also include driver debug logs using CONFIG_WIFI_NRF700X_LOG_LEVEL_DBG=y.

    Best regards,
    Dejan

  • Hi,

    I was able to fix this issue by just copying the full config for nrf7000 from the asset tracker V2 sample.

    # Disable modem traces as UART1 is disabled
    CONFIG_NRF_MODEM_LIB_TRACE=n
    
    CONFIG_LOCATION_METHOD_WIFI=y
    
    # Align this with CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT.
    # Also see comments for CONFIG_HEAP_MEM_POOL_SIZE.
    CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192
    
    # Actual configs for the Wi-Fi
    CONFIG_WIFI=y
    CONFIG_WIFI_NRF700X=y
    CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y
    # Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT.
    # Also see comments for CONFIG_HEAP_MEM_POOL_SIZE.
    # Wi-Fi shell sample has 25000 heap size. We need a bit more for location request purposes.
    # Heap allocation should be changed when CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT
    # and CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT (which should be the same value) are changed.
    CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=10
    
    # System settings
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    
    # Scan only using offload API
    CONFIG_WPA_SUPP=n
    
    # For nRF9160 the default is socket interface
    CONFIG_NET_DEFAULT_IF_ETHERNET=y
    CONFIG_MBEDTLS=n
    CONFIG_NORDIC_SECURITY_BACKEND=n
    
    # Networking
    CONFIG_NET_L2_ETHERNET=y
    CONFIG_NET_NATIVE=y
    CONFIG_NET_DHCPV4=y
    CONFIG_NET_STATISTICS=y
    CONFIG_NET_STATISTICS_WIFI=y
    CONFIG_NET_STATISTICS_USER_API=y
    CONFIG_NET_CONTEXT_SYNC_RECV=y
    
    # Disable unused networking options
    CONFIG_NET_IPV6=n
    
    # Memory configurations
    CONFIG_NET_BUF_RX_COUNT=8
    CONFIG_NET_BUF_TX_COUNT=8
    CONFIG_NET_PKT_RX_COUNT=1
    CONFIG_NET_PKT_TX_COUNT=1
    CONFIG_NET_TX_STACK_SIZE=4096
    CONFIG_NET_RX_STACK_SIZE=4096
    CONFIG_NET_TC_TX_COUNT=1
    CONFIG_NET_MAX_CONTEXTS=5
    CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024


    The only point I add because of the error was 
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
Related