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

Parents
  • Hi,

    Can you provide complete application log?

    Best regards,
    Dejan

  • Hi,

    Can you provide more information about your board, especially with regard to nrf7002?

    Which application or sample did you use as a starting point for your application?

    Roman Veselskyi said:
    Do you have any guide or a sample how to connect nRF700x to custom board? 

    We have cellular location sample and nRF Cloud multi-service sample. Both samples can be run on nrf9160dk with a wi-fi nrf7002 EK shield. If you want to use wi-fi only for scanning and not for connectivity, you can find more information on determining device location using wi-fi webpage. 

    There is more information about location librarylocation services features and location services guide available in the documentation.

    Best regards,
    Dejan

  • Hello,

    We have designed a custom PCB using the nRF9160 as the main IC and the nRF7000 for Wi-Fi scanning. The schematic and layout were reviewed by Nordic technical support before production.

    To ensure there were no hardware issues and that all connections were correct, I tested the PCB using the Location and Radio_test samples.

    For the Location sample, I built it for the nrf9160dk_nrf9160_ns with the following settings: -DSHIELD="nrf7002ek" and nrf9160dk_nrf9160_ns.overlay.

    (The overlay file is attached in the first message.)

    Here is a screenshot from the log. From what I understand, the Wi-Fi is working, but the signal strength is weak. This might be due to the need for tuning the RF path components.

    For the Location sample, I built it for the nrf9160dk_nrf9160_ns with the following settings: -DSHIELD="nrf7002ek", -DOVERLAY_CONFIG="overlay-nrf7002ek-wifi-scan-only.conf", and nrf9160dk_nrf9160_ns.overlay.

    Below is the log from the Location sample:

    [00:00:00.387,634] <inf> wifi_nrf_bus: SPIM spi@b000: freq = 8 MHz
    [00:00:00.394,714] <inf> wifi_nrf_bus: SPIM spi@b000: latency = 0
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    Location sample started
    
    Connecting to LTE...
    Connected to LTE
    Waiting for current time
    [00:01:31.652,099] <dbg> location: location_core_init: Initialized 'GNSS' method successfully
    [00:01:31.661,651] <dbg> location: location_core_init: Initialized 'Cellular' method successfully
    [00:01:31.671,569] <dbg> location: location_core_init: Initialized 'Wi-Fi' method successfully
    [00:01:31.681,182] <dbg> location: location_core_init: Initialized 'Wi-Fi + Cellular' method successfully
    [00:01:31.691,833] <dbg> location: location_init: Location library initialized
    Requesting Wi-Fi location with GNSS and cellular fallback...
    [00:01:31.705,627] <dbg> location: location_core_config_log: Location configuration:
    [00:01:31.714,324] <dbg> location: location_core_config_log:   Methods count: 2
    [00:01:31.722,595] <dbg> location: location_core_config_log:   Interval: 0
    [00:01:31.730,407] <dbg> location: location_core_config_log:   Timeout: 300000ms
    [00:01:31.738,769] <dbg> location: location_core_config_log:   Mode: 0
    [00:01:31.746,215] <dbg> location: location_core_config_log:   List of methods:
    [00:01:31.754,455] <dbg> location: location_core_config_log:     Method #0
    [00:01:31.762,298] <dbg> location: location_core_config_log:       Method type: Wi-Fi (3)
    [00:01:31.771,484] <dbg> location: location_core_config_log:       Timeout: 30000ms
    [00:01:31.780,120] <dbg> location: location_core_config_log:       Service: Any (0)
    [00:01:31.788,757] <dbg> location: location_core_config_log:     Method #1
    [00:01:31.796,569] <dbg> location: location_core_config_log:       Method type: Cellular (1)
    [00:01:31.806,030] <dbg> location: location_core_config_log:       Timeout: 30000ms
    [00:01:31.814,666] <dbg> location: location_core_config_log:       Service: Any (0)
    [00:01:31.823,333] <dbg> location: location_core_config_log:       Cell count: 4
    [00:01:31.831,695] <inf> location: Wi-Fi and cellular methods combined
    [00:01:31.839,111] <dbg> location: location_request_info_create: Updated location method list:
    [00:01:31.848,754] <dbg> location: location_request_info_create:     Method #0 type: Wi-Fi + Cellular (4)
    [00:01:31.859,405] <dbg> location: location_core_location_get_pos: Requesting location with 'Wi-Fi + Cellular' method
    [00:01:31.871,154] <dbg> location: location_core_location_get_pos: Starting request timer with timeout=300000
    [00:01:31.882,202] <dbg> location: scan_wifi_execute: Triggering start of Wi-Fi scanning
    [00:01:31.902,313] <dbg> location: scan_wifi_execute: Starting Wi-Fi timer with timeout=30000
    [00:01:31.913,482] <dbg> location: scan_cellular_execute: Triggering cell measurements timeout=30000, cell_count=4
    [00:01:31.924,957] <dbg> location: scan_cellular_execute: Starting cellular timer with timeout=30000
    [00:01:31.935,180] <dbg> location: scan_cellular_execute: Normal neighbor search (NCELLMEAS=1)
    [00:01:31.946,441] <dbg> location: scan_cellular_lte_ind_handler: Cell measurements results received: ncells_count=0, gci_cells_count=0, current_cell.id=0x0901B929
    [00:01:31.962,402] <dbg> location: scan_cellular_lte_ind_handler: No neighbor cell information from modem
    [00:01:31.973,022] <dbg> location: scan_cellular_lte_ind_handler: No surrounding cell information from modem
    [00:01:31.983,978] <dbg> location: scan_cellular_execute: RRC already in idle mode
    [00:01:31.992,523] <dbg> location: scan_cellular_execute: GCI history search (NCELLMEAS=3,5)
    [00:01:32.004,547] <dbg> location: scan_cellular_lte_ind_handler: Cell measurements results received: ncells_count=0, gci_cells_count=0, current_cell.id=0x0901B929
    [00:01:32.020,538] <dbg> location: scan_cellular_lte_ind_handler: No neighbor cell information from modem
    [00:01:32.031,158] <dbg> location: scan_cellular_lte_ind_handler: No surrounding cell information from modem
    [00:01:32.042,144] <dbg> location: scan_cellular_execute: GCI regional search (NCELLMEAS=4,4)
    [00:01:32.053,894] <dbg> location: scan_cellular_lte_ind_handler: Cell measurements results received: ncells_count=0, gci_cells_count=0, current_cell.id=0x0901B929
    [00:01:32.069,824] <dbg> location: scan_cellular_lte_ind_handler: No neighbor cell information from modem
    [00:01:32.080,444] <dbg> location: scan_cellular_lte_ind_handler: No surrounding cell information from modem
    [00:01:36.516,601] <dbg> location: scan_wifi_done_handle: Scan request done with 0 Wi-Fi APs
    [00:01:36.526,214] <wrn> location: No Wi-Fi scanning results, using only cellular data
    [00:01:36.535,827] <dbg> location: cloud_service_location_get: Cloud service location parameters:
    [00:01:36.545,715] <dbg> location: cloud_service_location_get:   Service: 0
    [00:01:36.553,619] <dbg> location: cloud_service_location_get:   Timeout: 295324ms
    [00:01:36.562,164] <dbg> location: cloud_service_nrf_pos_get: Sending positioning request (REST)
    [00:01:52.199,890] <dbg> location: location_core_event_cb_fn: Location acquired successfully:


    This is the output log from my application:

    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    [00:00:00.254,638] <inf> app_event_manager: APP_EVT_START
    [00:00:00.486,206] <inf> app_event_manager: MODEM_EVT_INITIALIZED
    [00:00:00.487,335] <dbg> location: location_core_init: Initialized 'Cellular' method successfully
    [00:00:00.487,365] <err> location: No Wi-Fi interface found: nordic_wlan0
    [00:00:00.487,396] <err> location: Failed to initialize 'Wi-Fi' method
    [00:00:00.487,426] <err> location_module: Initializing the Location library failed, error: -14
    [00:00:00.487,426] <err> location_module: setup, error: -1

    The first issue is that in both the Location and Radio_test samples, I see logs related to SPI, but in my application, I don't. I'm not sure if this is due to log settings or if it indicates that SPI isn't working.

    For my application, I used the Assert Tracker v2 as a reference and made some code changes, but I didn’t modify the Location module.

    When I check the device tree viewer, it shows that the nRF7000 is assigned to SPI3, and all the necessary pins are set up correctly.

    The key point is that I am now building for a custom board, not for the nRF9160DK. All the configurations and devicetree changes I made to support the nRF7000 are mentioned in my first message.

    I also noticed that I forget to add CONFIG_SPI but this didn't help. 

    Maybe there is something I need to add for the MCUboot? 

Reply
  • Hello,

    We have designed a custom PCB using the nRF9160 as the main IC and the nRF7000 for Wi-Fi scanning. The schematic and layout were reviewed by Nordic technical support before production.

    To ensure there were no hardware issues and that all connections were correct, I tested the PCB using the Location and Radio_test samples.

    For the Location sample, I built it for the nrf9160dk_nrf9160_ns with the following settings: -DSHIELD="nrf7002ek" and nrf9160dk_nrf9160_ns.overlay.

    (The overlay file is attached in the first message.)

    Here is a screenshot from the log. From what I understand, the Wi-Fi is working, but the signal strength is weak. This might be due to the need for tuning the RF path components.

    For the Location sample, I built it for the nrf9160dk_nrf9160_ns with the following settings: -DSHIELD="nrf7002ek", -DOVERLAY_CONFIG="overlay-nrf7002ek-wifi-scan-only.conf", and nrf9160dk_nrf9160_ns.overlay.

    Below is the log from the Location sample:

    [00:00:00.387,634] <inf> wifi_nrf_bus: SPIM spi@b000: freq = 8 MHz
    [00:00:00.394,714] <inf> wifi_nrf_bus: SPIM spi@b000: latency = 0
    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    Location sample started
    
    Connecting to LTE...
    Connected to LTE
    Waiting for current time
    [00:01:31.652,099] <dbg> location: location_core_init: Initialized 'GNSS' method successfully
    [00:01:31.661,651] <dbg> location: location_core_init: Initialized 'Cellular' method successfully
    [00:01:31.671,569] <dbg> location: location_core_init: Initialized 'Wi-Fi' method successfully
    [00:01:31.681,182] <dbg> location: location_core_init: Initialized 'Wi-Fi + Cellular' method successfully
    [00:01:31.691,833] <dbg> location: location_init: Location library initialized
    Requesting Wi-Fi location with GNSS and cellular fallback...
    [00:01:31.705,627] <dbg> location: location_core_config_log: Location configuration:
    [00:01:31.714,324] <dbg> location: location_core_config_log:   Methods count: 2
    [00:01:31.722,595] <dbg> location: location_core_config_log:   Interval: 0
    [00:01:31.730,407] <dbg> location: location_core_config_log:   Timeout: 300000ms
    [00:01:31.738,769] <dbg> location: location_core_config_log:   Mode: 0
    [00:01:31.746,215] <dbg> location: location_core_config_log:   List of methods:
    [00:01:31.754,455] <dbg> location: location_core_config_log:     Method #0
    [00:01:31.762,298] <dbg> location: location_core_config_log:       Method type: Wi-Fi (3)
    [00:01:31.771,484] <dbg> location: location_core_config_log:       Timeout: 30000ms
    [00:01:31.780,120] <dbg> location: location_core_config_log:       Service: Any (0)
    [00:01:31.788,757] <dbg> location: location_core_config_log:     Method #1
    [00:01:31.796,569] <dbg> location: location_core_config_log:       Method type: Cellular (1)
    [00:01:31.806,030] <dbg> location: location_core_config_log:       Timeout: 30000ms
    [00:01:31.814,666] <dbg> location: location_core_config_log:       Service: Any (0)
    [00:01:31.823,333] <dbg> location: location_core_config_log:       Cell count: 4
    [00:01:31.831,695] <inf> location: Wi-Fi and cellular methods combined
    [00:01:31.839,111] <dbg> location: location_request_info_create: Updated location method list:
    [00:01:31.848,754] <dbg> location: location_request_info_create:     Method #0 type: Wi-Fi + Cellular (4)
    [00:01:31.859,405] <dbg> location: location_core_location_get_pos: Requesting location with 'Wi-Fi + Cellular' method
    [00:01:31.871,154] <dbg> location: location_core_location_get_pos: Starting request timer with timeout=300000
    [00:01:31.882,202] <dbg> location: scan_wifi_execute: Triggering start of Wi-Fi scanning
    [00:01:31.902,313] <dbg> location: scan_wifi_execute: Starting Wi-Fi timer with timeout=30000
    [00:01:31.913,482] <dbg> location: scan_cellular_execute: Triggering cell measurements timeout=30000, cell_count=4
    [00:01:31.924,957] <dbg> location: scan_cellular_execute: Starting cellular timer with timeout=30000
    [00:01:31.935,180] <dbg> location: scan_cellular_execute: Normal neighbor search (NCELLMEAS=1)
    [00:01:31.946,441] <dbg> location: scan_cellular_lte_ind_handler: Cell measurements results received: ncells_count=0, gci_cells_count=0, current_cell.id=0x0901B929
    [00:01:31.962,402] <dbg> location: scan_cellular_lte_ind_handler: No neighbor cell information from modem
    [00:01:31.973,022] <dbg> location: scan_cellular_lte_ind_handler: No surrounding cell information from modem
    [00:01:31.983,978] <dbg> location: scan_cellular_execute: RRC already in idle mode
    [00:01:31.992,523] <dbg> location: scan_cellular_execute: GCI history search (NCELLMEAS=3,5)
    [00:01:32.004,547] <dbg> location: scan_cellular_lte_ind_handler: Cell measurements results received: ncells_count=0, gci_cells_count=0, current_cell.id=0x0901B929
    [00:01:32.020,538] <dbg> location: scan_cellular_lte_ind_handler: No neighbor cell information from modem
    [00:01:32.031,158] <dbg> location: scan_cellular_lte_ind_handler: No surrounding cell information from modem
    [00:01:32.042,144] <dbg> location: scan_cellular_execute: GCI regional search (NCELLMEAS=4,4)
    [00:01:32.053,894] <dbg> location: scan_cellular_lte_ind_handler: Cell measurements results received: ncells_count=0, gci_cells_count=0, current_cell.id=0x0901B929
    [00:01:32.069,824] <dbg> location: scan_cellular_lte_ind_handler: No neighbor cell information from modem
    [00:01:32.080,444] <dbg> location: scan_cellular_lte_ind_handler: No surrounding cell information from modem
    [00:01:36.516,601] <dbg> location: scan_wifi_done_handle: Scan request done with 0 Wi-Fi APs
    [00:01:36.526,214] <wrn> location: No Wi-Fi scanning results, using only cellular data
    [00:01:36.535,827] <dbg> location: cloud_service_location_get: Cloud service location parameters:
    [00:01:36.545,715] <dbg> location: cloud_service_location_get:   Service: 0
    [00:01:36.553,619] <dbg> location: cloud_service_location_get:   Timeout: 295324ms
    [00:01:36.562,164] <dbg> location: cloud_service_nrf_pos_get: Sending positioning request (REST)
    [00:01:52.199,890] <dbg> location: location_core_event_cb_fn: Location acquired successfully:


    This is the output log from my application:

    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    [00:00:00.254,638] <inf> app_event_manager: APP_EVT_START
    [00:00:00.486,206] <inf> app_event_manager: MODEM_EVT_INITIALIZED
    [00:00:00.487,335] <dbg> location: location_core_init: Initialized 'Cellular' method successfully
    [00:00:00.487,365] <err> location: No Wi-Fi interface found: nordic_wlan0
    [00:00:00.487,396] <err> location: Failed to initialize 'Wi-Fi' method
    [00:00:00.487,426] <err> location_module: Initializing the Location library failed, error: -14
    [00:00:00.487,426] <err> location_module: setup, error: -1

    The first issue is that in both the Location and Radio_test samples, I see logs related to SPI, but in my application, I don't. I'm not sure if this is due to log settings or if it indicates that SPI isn't working.

    For my application, I used the Assert Tracker v2 as a reference and made some code changes, but I didn’t modify the Location module.

    When I check the device tree viewer, it shows that the nRF7000 is assigned to SPI3, and all the necessary pins are set up correctly.

    The key point is that I am now building for a custom board, not for the nRF9160DK. All the configurations and devicetree changes I made to support the nRF7000 are mentioned in my first message.

    I also noticed that I forget to add CONFIG_SPI but this didn't help. 

    Maybe there is something I need to add for the MCUboot? 

Children
No Data
Related