From e5f5868c671371b8e9f664b9010890ac7baf744a Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 5 Oct 2024 20:25:07 +0530 Subject: [PATCH 1/6] manifest: sdk-zephyr: Pull ext flash support for nRF70 FW patches This is used by Matter samples to save internal flash memory. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4bf30cdfa7bf..2a5a358ca641 100644 --- a/west.yml +++ b/west.yml @@ -72,7 +72,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 3bedb2dfd9d68d08d5bf9405ce92c7e2bf11d4e7 + revision: fe339b14b3effd069458f5e4710f17cda8295229 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above From 9b5d8b1d12bec72325c85ad39cc9dd73fb157bfd Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 2 Oct 2024 23:38:13 +0300 Subject: [PATCH 2/6] net: Add a module to manage nRF70 firmware in external flash This module implements the necessary handling for store and use nRF70 firmware patches from the external flash, as this uses NCS tooling, this is carved out from nRF70 driver as a separate module. Implements SHEL-2988 partially. Signed-off-by: Chaitanya Tata --- subsys/net/lib/CMakeLists.txt | 1 + subsys/net/lib/Kconfig | 1 + subsys/net/lib/nrf70_fw_ext/CMakeLists.txt | 13 + subsys/net/lib/nrf70_fw_ext/Kconfig | 97 +++++++ subsys/net/lib/nrf70_fw_ext/ext_fw_load.c | 269 ++++++++++++++++++ subsys/net/lib/nrf70_fw_ext/rpu_fw_patches.ld | 51 ++++ sysbuild/CMakeLists.txt | 4 + 7 files changed, 436 insertions(+) create mode 100644 subsys/net/lib/nrf70_fw_ext/CMakeLists.txt create mode 100644 subsys/net/lib/nrf70_fw_ext/Kconfig create mode 100644 subsys/net/lib/nrf70_fw_ext/ext_fw_load.c create mode 100644 subsys/net/lib/nrf70_fw_ext/rpu_fw_patches.ld diff --git a/subsys/net/lib/CMakeLists.txt b/subsys/net/lib/CMakeLists.txt index 4210ec022851..c58764ef3835 100644 --- a/subsys/net/lib/CMakeLists.txt +++ b/subsys/net/lib/CMakeLists.txt @@ -35,3 +35,4 @@ add_subdirectory_ifdef(CONFIG_WIFI_READY_LIB wifi_ready) add_subdirectory_ifdef(CONFIG_MQTT_HELPER mqtt_helper) add_subdirectory_ifdef(CONFIG_NRF_PROVISIONING nrf_provisioning) add_subdirectory_ifdef(CONFIG_NRF_MCUMGR_SMP_CLIENT mcumgr_smp_client) +add_subdirectory_ifdef(CONFIG_WIFI_NRF70 nrf70_fw_ext) diff --git a/subsys/net/lib/Kconfig b/subsys/net/lib/Kconfig index 1c062a10b239..6a653344a719 100644 --- a/subsys/net/lib/Kconfig +++ b/subsys/net/lib/Kconfig @@ -47,5 +47,6 @@ rsource "wifi_ready/Kconfig" rsource "mqtt_helper/Kconfig" rsource "nrf_provisioning/Kconfig" rsource "mcumgr_smp_client/Kconfig" +rsource "nrf70_fw_ext/Kconfig" endmenu diff --git a/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt new file mode 100644 index 000000000000..257f0beac01a --- /dev/null +++ b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2023 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if(NOT CONFIG_NRF_WIFI_PATCHES_BUILTIN) + zephyr_library_sources(ext_fw_load.c) + if(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP) + # Run patches from the external flash (XIP). No need to copy. + zephyr_code_relocate(FILES ext_fw_load.c LOCATION EXTFLASH_RODATA NOCOPY) + endif() +endif() diff --git a/subsys/net/lib/nrf70_fw_ext/Kconfig b/subsys/net/lib/nrf70_fw_ext/Kconfig new file mode 100644 index 000000000000..bbc274e95fa9 --- /dev/null +++ b/subsys/net/lib/nrf70_fw_ext/Kconfig @@ -0,0 +1,97 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if WIFI_NRF70 && !NRF_WIFI_BUILD_ONLY_MODE + +choice NRF_WIFI_PATCHES_EXT_FLASH_SUPPORT + bool "Store nRF700x FW patches in external flash" + help + Select this option to store nRF700x FW patches in external flash. + This option helps to reduce the code memory size of the application, but + requires external memory to be available for storing the FW patches. + +config NRF_WIFI_PATCHES_EXT_FLASH_DISABLED + bool "Store nRF700x FW patches in RAM" + select NRF_WIFI_PATCHES_BUILTIN + +config NRF_WIFI_PATCHES_EXT_FLASH_XIP + bool "Relocate nRF700x FW patches to external memory and execute from there" + # nRF7002 supports SPI based external flash access with no XIP + depends on !BOARD_NRF7002DK_NRF5340_CPUAPP && !BOARD_NRF7002DK_NRF5340_CPUAPP_NS + # Disable until Matter DFU changes are ready + # default y if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840 + # For accessing external flash + select FLASH + # For relocation code to external flash + select XIP + select NORDIC_QSPI_NOR + select BUILD_NO_GAP_FILL + select CODE_DATA_RELOCATION + select HAVE_CUSTOM_LINKER_SCRIPT + +config NRF_WIFI_PATCHES_EXT_FLASH_STORE + bool "Store nRF700x FW patches in external memory but execute from RAM" + # nRF7002 supports SPI based external memory access but missing tools support + # TODO: Enable when tools support is available (NRFJPROG-157) + depends on !BOARD_NRF7002DK_NRF5340_CPUAPP && !BOARD_NRF7002DK_NRF5340_CPUAPP_NS + select FLASH + select FLASH_MAP +endchoice + +if NRF_WIFI_PATCHES_EXT_FLASH_STORE +config NRF_WIFI_FW_FLASH_CHUNK_SIZE + int "Chunk size for nRF70 FW patches to be read from external flash" + default 8192 + help + Chunk size for nRF70 FW patches to be read from external flash. + This option impacts the loading time of the nRF70 FW patches and + RAM usage (heap) of the application. + +config NRF_WIFI_FW_PATCH_INTEGRITY_CHECK + bool "Enable integrity check of nRF70 FW patches" + select FLASH_AREA_CHECK_INTEGRITY + default y + help + Select this option to enable integrity check of nRF70 FW patches using + SHA-256 verification algorithm.This option impacts the loading time of the + nRF70 FW patches but protects against corrupted FW patches. + +config NRF_WIFI_FW_PATCH_DFU + bool "Direct Firmware Update of nRF70 FW patch" + depends on PARTITION_MANAGER_ENABLED + depends on BOOTLOADER_MCUBOOT + depends on !XIP_SPLIT_IMAGE + help + Enabling this option adds support for Device Firmware Update (DFU) + for the nRF70 Series Firmware Patch. + + This feature requires the addition of an MCUBoot partition pair: + a primary and a secondary partition. These partitions are used to + store the new firmware patch. The specific partition numbers to be used + depend on the number of partitions already in use. + + The "nrf70_wifi_fw" partition must be added to the newly created + MCUBoot primary partition. Once this Kconfig option is enabled, + the nRF70.hex file will be signed by MCUBoot. The signed image + will then be merged with the application image and flashed onto + the target board. + + Ensure that the required MCUBoot partitions are properly configured + before enabling this option. Refer to the documentation for detailed + instructions on partition configuration and the DFU process. + +# TC is the default but Wi-Fi uses MbedTLS, so, to avoid loading another library. +if NRF_WIFI_FW_PATCH_INTEGRITY_CHECK +choice FLASH_AREA_CHECK_INTEGRITY_BACKEND + default FLASH_AREA_CHECK_INTEGRITY_MBEDTLS +endchoice +endif +endif + +config CUSTOM_LINKER_SCRIPT + string "Custom linker script for nRF70 FW patches in external flash" + default "${ZEPHYR_BASE}/../nrf/subsys/net/lib/nrf70_fw_ext/rpu_fw_patches.ld" +endif diff --git a/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c b/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c new file mode 100644 index 000000000000..9743ec7aab98 --- /dev/null +++ b/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** + * @brief File containing FW load functions for Zephyr. + */ +#include +#include + +#include +#include +#if defined(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP) && defined(CONFIG_NORDIC_QSPI_NOR) +#include +#endif /* CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP */ + +#include +#if defined(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP) && defined(CONFIG_NORDIC_QSPI_NOR) +/* For NRF QSPI NOR special handling is needed for this file as all RODATA of + * this file is stored in external flash, so, any use of RODATA has to be protected + * by disabling XIP and enabling it again after use. This means no LOG_* macros + * (buffered) or buffered printk can be used in this file, else it will crash. + */ +LOG_MODULE_DECLARE(wifi_nrf, LOG_LEVEL_NONE); +#else +LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); +#endif /* CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP */ + +#include + +#ifdef CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP +static const char nrf70_fw_patch[] = { + #include +}; +#endif /* CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP */ + +#ifdef CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE +#include +#include + +#include "hal_api.h" + +#include + +#if USE_PARTITION_MANAGER +#include +#define NRF70_FW_PATCH_ID PM_NRF70_WIFI_FW_ID +#else +#define NRF70_FW_PATCH_ID FIXED_PARTITION_ID(nrf70_fw_partition) +#endif +static const struct flash_area *fa; + +static int nrf_wifi_read_and_download_chunk(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, + const struct flash_area *fa, + unsigned int image_id, + char *fw_chunk, + unsigned int offset, + unsigned int rpu_addr_offset, + unsigned int len) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + const struct nrf70_fw_addr_info *addr_info; + struct nrf_wifi_fmac_fw_chunk_info fw_chunk_info = { 0 }; + int err; + + LOG_DBG("Reading chunk of size %d from offset %d", len, offset); + + /* Read the chunk from Flash */ + err = flash_area_read(fa, offset, fw_chunk, len); + if (err < 0) { + LOG_ERR("Failed to read patch chunk offset:%d from flash: %d", offset, err); + goto out; + } + + switch (image_id) { + case NRF70_IMAGE_LMAC_PRI: + addr_info = &nrf70_fw_addr_info[0]; + break; + case NRF70_IMAGE_LMAC_SEC: + addr_info = &nrf70_fw_addr_info[1]; + break; + case NRF70_IMAGE_UMAC_PRI: + addr_info = &nrf70_fw_addr_info[2]; + break; + case NRF70_IMAGE_UMAC_SEC: + addr_info = &nrf70_fw_addr_info[3]; + break; + default: + LOG_ERR("Invalid image id: %d\n", image_id); + goto out; + } + + fw_chunk_info.dest_addr = addr_info->dest_addr + rpu_addr_offset; + memcpy(fw_chunk_info.id_str, addr_info->name, sizeof(addr_info->name)); + fw_chunk_info.data = fw_chunk; + fw_chunk_info.size = len; + + status = nrf_wifi_fmac_fw_chunk_load(fmac_dev_ctx, + addr_info->rpu_proc, + &fw_chunk_info); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("Failed to load patch chunk, %s", addr_info->name); + } + +out: + return status; +} + +enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + struct nrf70_fw_image_info patch_hdr; + unsigned int image_id; + int err; + unsigned int offset = 0, rpu_addr_offset; + struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = rpu_ctx; + unsigned int max_chunk_size = CONFIG_NRF_WIFI_FW_FLASH_CHUNK_SIZE; + char *fw_chunk = NULL; +#ifdef CONFIG_NRF_WIFI_FW_PATCH_INTEGRITY_CHECK + struct flash_area_check nrf70_fw_patch_check = { 0 }; + char *fw_patch_check_buf = NULL; +#endif /* NRF_WIFI_FW_PATCH_INTEGRITY_CHECK */ + + err = flash_area_open(NRF70_FW_PATCH_ID, &fa); + if (err < 0) { + LOG_ERR("Failed to open flash area: %d", err); + goto out; + } + + LOG_DBG("Flash area opened with size: %d, offset: %ld", fa->fa_size, fa->fa_off); + + /* Read the Header from Flash */ + err = flash_area_read(fa, 0, &patch_hdr, sizeof(patch_hdr)); + if (err < 0) { + LOG_ERR("Failed to read patch header from flash: %d", err); + goto out; + } + offset += sizeof(patch_hdr); + + status = nrf_wifi_validate_fw_header(rpu_ctx, &patch_hdr); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("Failed to validate patch header: %d", status); + goto out; + } + +#ifdef CONFIG_NRF_WIFI_FW_PATCH_INTEGRITY_CHECK + fw_patch_check_buf = k_malloc(max_chunk_size); + if (!fw_patch_check_buf) { + LOG_ERR("Failed to allocate memory for patch data size: %d", patch_hdr.len); + goto out; + } + nrf70_fw_patch_check.match = (uint8_t *)patch_hdr.hash; + nrf70_fw_patch_check.clen = patch_hdr.len; + nrf70_fw_patch_check.off = offset; + nrf70_fw_patch_check.rbuf = fw_patch_check_buf; + nrf70_fw_patch_check.rblen = max_chunk_size; + /* Check the integrity of the patch */ + err = flash_area_check_int_sha256(fa, &nrf70_fw_patch_check); + if (err < 0) { + LOG_ERR("Patch integrity check failed: %d", err); + status = NRF_WIFI_STATUS_FAIL; + k_free(fw_patch_check_buf); + goto out; + } + k_free(fw_patch_check_buf); +#endif /* NRF_WIFI_FW_PATCH_INTEGRITY_CHECK */ + + status = nrf_wifi_fmac_fw_reset(rpu_ctx); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("Failed to reset FMAC: %d", status); + goto out; + } + + fw_chunk = k_malloc(max_chunk_size); + if (!fw_chunk) { + LOG_ERR("Failed to allocate memory for patch chunk size: %d", max_chunk_size); + goto out; + } + + for (image_id = 0; image_id < patch_hdr.num_images; image_id++) { + struct nrf70_fw_image image; + unsigned int num_chunks; + unsigned int chunk_id; + + rpu_addr_offset = 0; + + /* Read sub-header */ + err = flash_area_read(fa, offset, &image, sizeof(image)); + if (err < 0) { + LOG_ERR("Failed to read patch image from flash: %d", err); + goto out; + } + offset += sizeof(image); + + num_chunks = image.len / max_chunk_size + + (image.len % max_chunk_size ? 1 : 0); + LOG_DBG("Processing image %d, len: %d, num_chunks: %d", + image_id, image.len, num_chunks); + for (chunk_id = 0; chunk_id < num_chunks; chunk_id++) { + unsigned int chunk_size = image.len - chunk_id * max_chunk_size; + + if (chunk_size > max_chunk_size) { + chunk_size = max_chunk_size; + } + + LOG_DBG("Processing chunk %d-%d, size: %d", image_id, chunk_id, chunk_size); + status = nrf_wifi_read_and_download_chunk(fmac_dev_ctx, + fa, image_id, fw_chunk, offset, rpu_addr_offset, + chunk_size); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("Failed to read and download patch %d-%d", + image_id, chunk_id); + goto out; + } + offset += chunk_size; + rpu_addr_offset += chunk_size; + } + } + + status = nrf_wifi_fmac_fw_boot(rpu_ctx); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("Failed to boot FMAC: %d", status); + goto out; + } + +out: + if (fw_chunk) { + k_free(fw_chunk); + } + flash_area_close(fa); + return status; +} +#elif CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP +enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + struct nrf_wifi_fmac_fw_info fw_info = { 0 }; +#if defined(CONFIG_NORDIC_QSPI_NOR) + const struct device *flash_dev = DEVICE_DT_GET(DT_INST(0, nordic_qspi_nor)); +#endif /* CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP */ + +#if defined(CONFIG_NORDIC_QSPI_NOR) + nrf_qspi_nor_xip_enable(flash_dev, true); +#endif /* CONFIG_NRF_WIFI */ + + status = nrf_wifi_fmac_fw_parse(rpu_ctx, + nrf70_fw_patch, + sizeof(nrf70_fw_patch), + &fw_info); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: nrf_wifi_fmac_fw_parse failed", __func__); + return status; + } + /* Load the FW patches to the RPU */ + status = nrf_wifi_fmac_fw_load(rpu_ctx, &fw_info); + + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: nrf_wifi_fmac_fw_load failed", __func__); + } + +#if defined(CONFIG_NORDIC_QSPI_NOR) + nrf_qspi_nor_xip_enable(flash_dev, false); +#endif /* CONFIG_NRF_WIFI */ + + return status; +} +#endif /* NRF_WIFI_PATCHES_EXT_FLASH_STORE */ diff --git a/subsys/net/lib/nrf70_fw_ext/rpu_fw_patches.ld b/subsys/net/lib/nrf70_fw_ext/rpu_fw_patches.ld new file mode 100644 index 000000000000..e2a6fdd50c69 --- /dev/null +++ b/subsys/net/lib/nrf70_fw_ext/rpu_fw_patches.ld @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** + * @file + * @brief Custom Linker command/script file + * + * Custom Linker script for the Cortex-M platforms. + */ + +#include +#include + +#include +#include + +#if CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF52840DK_NRF52840 +/* + * nRF53/52 series ship an external flash that can be used for XIP using QSPI/SPI. + * + * Note: In nRF7002 external flash using is accessible only using SPI but there is no + * support for XIP, so, relocation cannot be used. + */ +#if CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP +#define EXTFLASH_BASE_ADDR 0x10000000 +#define EXTFLASH_SIZE 0x800000 +#elif CONFIG_BOARD_NRF52840DK_NRF52840 +#define EXTFLASH_BASE_ADDR 0x12000000 +#define EXTFLASH_SIZE 0x800000 +#endif /* CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP */ + +#if USE_PARTITION_MANAGER && PM_EXTERNAL_FLASH_ADDRESS +#include +#define EXTFLASH_ADDRESS (EXTFLASH_BASE_ADDR + PM_EXTERNAL_FLASH_ADDRESS) +#undef EXTFLASH_SIZE +#define EXTFLASH_SIZE (PM_EXTERNAL_FLASH_SIZE) +#else +#define EXTFLASH_ADDRESS (EXTFLASH_BASE_ADDR) +#endif /* USE_PARTITION_MANAGER && PM_EXTERNAL_FLASH_ADDRESS */ + +MEMORY +{ + EXTFLASH (wx) : ORIGIN = EXTFLASH_ADDRESS, LENGTH = EXTFLASH_SIZE +} + +#endif /* CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF52840DK_NRF52840 */ + +#include diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index cefa364b3cc5..aa6405d9aca8 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -446,6 +446,10 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) endif() endforeach() + if(NOT DEFINED SB_CONFIG_WIFI_PATCHES_EXT_FLASH_DISABLED) + set_config_bool(${DEFAULT_IMAGE} CONFIG_NRF_WIFI_PATCHES_BUILTIN n) + endif() + foreach(config NRF700X_SYSTEM_MODE NRF700X_SCAN_ONLY NRF700X_RADIO_TEST NRF700X_SYSTEM_WITH_RAW_MODES) if(${SB_CONFIG_WIFI_${config}}) From f4cfbb7ef7f1140ab92fffbd60c30af12b63b162 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 8 Oct 2024 18:24:05 +0530 Subject: [PATCH 3/6] sysbuild: Fix nRF70 Firmware bins path The firmware bins now are part of hal_nordic fetched using west blobs. Signed-off-by: Chaitanya Tata --- cmake/sysbuild/nrf700x.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/sysbuild/nrf700x.cmake b/cmake/sysbuild/nrf700x.cmake index cab2389dba80..740e7d9349c0 100644 --- a/cmake/sysbuild/nrf700x.cmake +++ b/cmake/sysbuild/nrf700x.cmake @@ -8,16 +8,16 @@ function(setup_nrf700x_xip_data) sysbuild_dt_nodelabel(qspi_nodelabel IMAGE ${DEFAULT_IMAGE} NODELABEL "qspi") sysbuild_dt_reg_addr(qspi_xip_address IMAGE ${DEFAULT_IMAGE} PATH "${qspi_nodelabel}" NAME "qspi_mm") - set(OS_AGNOSTIC_BASE ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_wifi) + set(NRF70_FW_BINS ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/zephyr/blobs/wifi_fw_bins/) if(SB_CONFIG_WIFI_NRF70_SYSTEM_MODE) - set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/default/nrf70.bin) + set(NRF70_PATCH ${NRF70_FW_BINS}/default/nrf70.bin) elseif(SB_CONFIG_WIFI_NRF70_RADIO_TEST) - set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/radio_test/nrf70.bin) + set(NRF70_PATCH ${NRF70_FW_BINS}/radio_test/nrf70.bin) elseif(SB_CONFIG_WIFI_NRF70_SCAN_ONLY) - set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/scan_only/nrf70.bin) + set(NRF70_PATCH ${NRF70_FW_BINS}/scan_only/nrf70.bin) elseif(SB_CONFIG_WIFI_NRF70_SYSTEM_WITH_RAW_MODES) - set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/system_with_raw/nrf70.bin) + set(NRF70_PATCH ${NRF70_FW_BINS}/system_with_raw/nrf70.bin) else() # Error message(FATAL_ERROR "Unsupported nRF70 patch configuration") From 17ca99c8b309117468965ed060c0bef54bb60262 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 8 Oct 2024 22:26:30 +0530 Subject: [PATCH 4/6] Revert "scripts: quarantine: quarantine Matter samples" This reverts commit 0c274474800140132f4765bf53f63ebfd7e11708 partially i.e., except for Zigbee weather station, rest of Matter samples are reinstated as now Matter over Wi-Fi is working. Signed-off-by: Chaitanya Tata --- scripts/quarantine.yaml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml index a929e70a2789..16a1a7171117 100644 --- a/scripts/quarantine.yaml +++ b/scripts/quarantine.yaml @@ -39,23 +39,6 @@ - net.lib.wifi_credentials_backend_psa comment: "Fix not known at time of upmerge, temporarily excluded to be fixed after upmerge" -- scenarios: - - sample.matter.lock.smp_dfu - - sample.matter.light_bulb.aws - platforms: - - nrf7002dk/nrf5340/cpuapp - comment: "Flash or RAM overflow, temporarily excluded" - -- scenarios: - - sample.matter.lock.thread_wifi_switched.lto.smp_dfu - platforms: - - nrf5340dk/nrf5340/cpuapp - comment: "Flash or RAM overflow, temporarily excluded" - -- scenarios: - - applications.matter_bridge.lto.nrf5340.wifi - comment: "nRF7002EK is not support in the upstream nRF70 driver yet" - - scenarios: - applications.zigbee_weather_station - applications.zigbee_weather_station.debug From f670705cf01cabf48f3440a2ab864c0733a0f639 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 11 Oct 2024 19:51:24 +0530 Subject: [PATCH 5/6] net: nrf70_fw_ext: Disable flash integrity check This option depends on MbedTLS SHA256 configuration in Zephyr, but that option cannot be enabled with nRF security and there is no easy way to resolve this dependency. Disable this option by default for now. Signed-off-by: Chaitanya Tata --- subsys/net/lib/nrf70_fw_ext/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/lib/nrf70_fw_ext/Kconfig b/subsys/net/lib/nrf70_fw_ext/Kconfig index bbc274e95fa9..24e0890f2081 100644 --- a/subsys/net/lib/nrf70_fw_ext/Kconfig +++ b/subsys/net/lib/nrf70_fw_ext/Kconfig @@ -53,7 +53,7 @@ config NRF_WIFI_FW_FLASH_CHUNK_SIZE config NRF_WIFI_FW_PATCH_INTEGRITY_CHECK bool "Enable integrity check of nRF70 FW patches" select FLASH_AREA_CHECK_INTEGRITY - default y + # TODO: Fix MbedTLS dependency issues to enable this option help Select this option to enable integrity check of nRF70 FW patches using SHA-256 verification algorithm.This option impacts the loading time of the From 39cfa1e7ba1242f6be35eda1b0addf1966b47b60 Mon Sep 17 00:00:00 2001 From: Arkadiusz Balys Date: Thu, 10 Oct 2024 15:28:51 +0200 Subject: [PATCH 6/6] samples: matter: Enable LTO for all nRF7002 DK variants. We need to use Link Time Optimization to fit the code into the FLASH memory space. Signed-off-by: Arkadiusz Balys --- samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp.conf | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp.conf diff --git a/samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp.conf b/samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..6523d50e60d6 --- /dev/null +++ b/samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Enable LTO to decrease the flash usage. +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y