From f0dce30c952e814c6d71c9fccefa9b78400de540 Mon Sep 17 00:00:00 2001 From: Pete Skeggs Date: Wed, 28 Aug 2024 14:55:03 -0700 Subject: [PATCH] samples: cellular: nrf_cloud_multi_service: Thingy91:X Wi-Fi Merge overlay and config info from ATv2 and 7002EK shield to get MSS with Wi-Fi scanning to build and run. Jira: IRIS-9637 Signed-off-by: Pete Skeggs --- .../releases/release-notes-changelog.rst | 1 + .../nrf_cloud_multi_service/Kconfig.sysbuild | 10 +++ .../nrf_cloud_multi_service/README.rst | 8 +- .../boards/thingy91x_nrf9151_ns.conf | 74 +++++++++++++++++++ .../boards/thingy91x_nrf9151_ns.overlay | 19 ++++- 5 files changed, 105 insertions(+), 7 deletions(-) create mode 100644 samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index a2f0cdb7e22..5a9b5518931 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -375,6 +375,7 @@ Cellular samples * The :kconfig:option:`CONFIG_TEST_COUNTER_MULTIPLIER` Kconfig option to multiply the number of test counter messages sent, for testing purposes. * A handler for new nRF Cloud event type ``NRF_CLOUD_EVT_RX_DATA_DISCON`` to stop sensors and location services. * A call to the :c:func:`nrf_cloud_print_details` function and removed redundant logging. + * Board support files to enable Wi-Fi scanning for the Thingy:91 X. * Updated: diff --git a/samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild b/samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild new file mode 100644 index 00000000000..29af9c4a9ee --- /dev/null +++ b/samples/cellular/nrf_cloud_multi_service/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config WIFI_NRF700X + default y if BOARD_THINGY91X_NRF9151_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/cellular/nrf_cloud_multi_service/README.rst b/samples/cellular/nrf_cloud_multi_service/README.rst index a25f5ea8f18..6bafb368596 100644 --- a/samples/cellular/nrf_cloud_multi_service/README.rst +++ b/samples/cellular/nrf_cloud_multi_service/README.rst @@ -791,10 +791,10 @@ The device is identified using its UUID rather than its IMEI, since both overlay .. _nrf_cloud_multi_service_building_wifi_scan: -Building with nRF7002 EK Wi-Fi scanning support (for nRF91 Series DK) -===================================================================== +Building with nRF7002 Wi-Fi scanning support +============================================ -To build the sample with nRF7002 EK Wi-Fi scanning support, use the ``-DSHIELD=nrf7002ek``, ``-DSB_CONF_FILE=sysbuild_nrf700x-wifi-scan.conf``, and ``-DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only`` options. +To build the sample with Wi-Fi scanning support for the nRF7002 EK shield attached to an nRF91xx DK, use the ``-DSHIELD=nrf7002ek``, ``-DSB_CONF_FILE=sysbuild_nrf700x-wifi-scan.conf``, and ``-DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only`` options. This enables the Wi-Fi location tracking method automatically. @@ -805,6 +805,8 @@ This enables the Wi-Fi location tracking method automatically. |board_target| +For the Thingy:91 X, which contains both an nRF9151 System-in-Package and the nRF7002 Companion IC, Wi-Fi scanning support is enabled by default. + See also :ref:`the paragraphs on the Wi-Fi location tracking method `. Once the sample is built and flashed, proceed to :ref:`nrf_cloud_multi_service_standard_onboarding` for instructions on how to onboard your device. diff --git a/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.conf b/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.conf index fe0f6989686..77d4fe8062b 100644 --- a/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.conf +++ b/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.conf @@ -1 +1,75 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Configuration file for Thingy:91 X. +# This file is merged with prj.conf in the application folder, and options +# set here will take precedence if they are present in both files. + +# BME680 - Temperature and humidity sensor. +CONFIG_BME680=y + +# configs for 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 +CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=10 + +# Wi-Fi location +CONFIG_LOCATION_TRACKING_WIFI=y +CONFIG_LOCATION_METHOD_WIFI=y +CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_FIRST_GNSS=y +CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_SECOND_WIFI=y +CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_THIRD_CELLULAR=y + +# Align this with CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT +CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=10 +CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192 + +# Not for LTE throughput testing +CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE=4096 +CONFIG_NRF_MODEM_LIB_SHMEM_RX_SIZE=4096 + +# 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_IPV4=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 + +# We need 2 to ensure nrf9x_socket gets an IP address regardless of order of net_if array +CONFIG_NET_IF_MAX_IPV4_COUNT=2 +CONFIG_NET_IF_MAX_IPV6_COUNT=2 + +# 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_HEAP_MEM_POOL_SIZE=34000 +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_NET_MGMT_EVENT_STACK_SIZE=2048 + +# Enable external flash +CONFIG_SPI_NOR_SFDP_DEVICETREE=y +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y diff --git a/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay b/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay index 09fb6dc375e..9a58d144af7 100644 --- a/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay +++ b/samples/cellular/nrf_cloud_multi_service/boards/thingy91x_nrf9151_ns.overlay @@ -1,16 +1,27 @@ -/* Copyright (c) 2024 Nordic Semiconductor ASA +/* + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +#include + / { aliases { temp-sensor = &bme680; + ext-flash = &flash_ext; }; -}; -&i2c2 { - bme680: bme680@76 { + nordic_wlan0: nordic_wlan0 { + compatible = "nordic,wlan0"; status = "okay"; }; + + chosen { + zephyr,wifi = &nordic_wlan0; + }; +}; + +&bme680 { + status = "okay"; };