Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions cmake/sysbuild/image_signing_nrf700x.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,21 @@ function(nrf7x_signing_tasks input output_hex output_bin dependencies)
)
endif()

# Same imgtool hash/signature options as the main app (image_signing.cmake); required for nRF54L
# ED25519 + SHA512 MCUboot.
set(imgtool_extra)
if(SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE)
list(APPEND imgtool_extra --pure)
elseif(SB_CONFIG_BOOT_IMG_HASH_ALG_SHA512)
list(APPEND imgtool_extra --sha 512)
endif()

if(CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION)
set(imgtool_extra --security-counter ${CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_VALUE})
list(APPEND imgtool_extra --security-counter ${CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_VALUE})
endif()

if(NOT "${keyfile}" STREQUAL "")
set(imgtool_extra -k "${keyfile}" ${imgtool_extra})
list(APPEND imgtool_extra -k "${keyfile}")
endif()

set(imgtool_args ${imgtool_extra})
Expand Down Expand Up @@ -108,13 +117,13 @@ function(nrf7x_signing_tasks input output_hex output_bin dependencies)

add_custom_command(OUTPUT ${output_hex}
COMMAND
${imgtool_sign} ${imgtool_args} ${input} ${output_hex}
${imgtool_sign} ${imgtool_extra} ${input} ${output_hex}
DEPENDS ${input} ${dependencies}
)

add_custom_command(OUTPUT ${output_bin}
COMMAND
${imgtool_sign} ${imgtool_args} ${input} ${output_bin}
${imgtool_sign} ${imgtool_extra} ${input} ${output_bin}
DEPENDS ${input} ${dependencies}
)

Expand All @@ -123,6 +132,6 @@ function(nrf7x_signing_tasks input output_hex output_bin dependencies)
# list(APPEND byproducts ${output}.encrypted.hex)
#
# set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND
# ${imgtool_sign} ${imgtool_args} --encrypt "${keyfile_enc}" ${unconfirmed_args})
# ${imgtool_sign} ${imgtool_extra} --encrypt "${keyfile_enc}" ${unconfirmed_args})
# endif()
endfunction()
25 changes: 21 additions & 4 deletions cmake/sysbuild/nrf700x.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,25 @@
#

function(setup_nrf700x_xip_data)
dt_nodelabel(qspi_nodelabel TARGET ${DEFAULT_IMAGE} NODELABEL "qspi")
dt_reg_addr(qspi_xip_address TARGET ${DEFAULT_IMAGE} PATH "${qspi_nodelabel}" NAME "qspi_mm")
set(interface_xip_address 0)

dt_chosen(pm_ext_flash TARGET ${DEFAULT_IMAGE} PROPERTY "nordic,pm-ext-flash")

if(NOT DEFINED pm_ext_flash)
message(FATAL_ERROR
"nRF WiFi FW patch external flash: chosen node \"nordic,pm-ext-flash\" is not set")
endif()

get_filename_component(interface_path "${pm_ext_flash}" DIRECTORY)
dt_prop(interface_compat TARGET ${DEFAULT_IMAGE} PATH "${interface_path}" PROPERTY "compatible")

if("nordic,nrf-qspi" IN_LIST interface_compat)
dt_reg_addr(interface_xip_address TARGET ${DEFAULT_IMAGE} PATH "${interface_path}" NAME "qspi_mm")
elseif("nordic,nrf-spim" IN_LIST interface_compat)
dt_reg_addr(interface_xip_address TARGET ${DEFAULT_IMAGE} PATH "${interface_path}" NAME "spi_mm")
else()
message(FATAL_ERROR "nRF WiFi FW patch external flash: no compatible interface found")
endif()

set(NRF70_FW_BINS ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_wifi/bin/ncs)

Expand Down Expand Up @@ -58,7 +75,7 @@ function(setup_nrf700x_xip_data)
${NRF70_PATCH}
${CMAKE_BINARY_DIR}/nrf70.hex
$<TARGET_PROPERTY:partition_manager,PM_NRF70_WIFI_FW_OFFSET>
${qspi_xip_address}
${interface_xip_address}
VERBATIM
)
else()
Expand All @@ -75,7 +92,7 @@ function(setup_nrf700x_xip_data)
${NRF70_PATCH}
${CMAKE_BINARY_DIR}/nrf70.hex
${nrf70_wifi_fw_partition_addr}
${qspi_xip_address}
${interface_xip_address}
VERBATIM
)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The partition node must use the node label ``nrf70_wifi_fw_partition`` (see the
#address-cells = <1>;
#size-cells = <1>;

nrf70_wifi_fw_partition: nrf70_fw_partition: partition@0 {
nrf70_wifi_fw_partition: partition@0 {
reg = <0x0 0x20000>;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Ensure that the parent device, partition offsets, and sizes match your complete
#address-cells = <1>;
#size-cells = <1>;

nrf70_wifi_fw_partition: nrf70_fw_partition: partition@12f200 {
nrf70_wifi_fw_partition: partition@12f200 {
reg = <0x12f200 0x20000>;
};
};
Expand Down
15 changes: 15 additions & 0 deletions dts/samples/matter/nrf54lm20_cpuapp_partitions.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,20 @@
label = "image-1";
reg = <0x00000000 DT_SIZE_K(1932)>;
};

slot2_partition: partition@1e3000 {
label = "image-2";
reg = <0x001e3000 DT_SIZE_K(132)>;
};

nrf70_wifi_fw_partition: partition@1e3800 {
label = "nrf70-wifi-fw";
reg = <0x001e3800 DT_SIZE_K(128)>;
};

slot3_partition: partition@203000 {
label = "image-3";
reg = <0x00203000 DT_SIZE_K(132)>;
};
};
};
14 changes: 14 additions & 0 deletions samples/matter/template/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ tests:
platform_allow:
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp
sample.matter.template.nrf7002eb2.smp_dfu.ext_patch:
sysbuild: true
build_only: true
extra_args:
- CONFIG_CHIP_DFU_OVER_BT_SMP=y
- template_SHIELD=nrf7002eb2
- SB_CONFIG_WIFI_NRF70=y
- SB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y
integration_platforms:
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp
platform_allow:
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp
sample.matter.template.release.internal:
sysbuild: true
build_only: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Copyright (c) 2026 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Copyright (c) 2026 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&spi00 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Copyright (c) 2026 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Copyright (c) 2026 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&spi00 {
status = "okay";
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
};

&mx25r64 {
status = "okay";

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

nrf70_wifi_fw_partition: nrf70_fw_partition: partition@0 {
nrf70_wifi_fw_partition: partition@0 {
reg = <0x0 0x20000>;
};
};
Expand Down
6 changes: 6 additions & 0 deletions snippets/nrf70-fw-patch-ext-flash/snippet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ boards:
nrf7002dk/nrf5340/cpuapp:
append:
EXTRA_CONF_FILE: boards/nrf7002dk_nrf5340_cpuapp.conf
nrf54lm20dk/nrf54lm20a/cpuapp:
append:
EXTRA_CONF_FILE: boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf
nrf54lm20dk/nrf54lm20b/cpuapp:
append:
EXTRA_CONF_FILE: boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf
2 changes: 1 addition & 1 deletion subsys/net/lib/nrf70_fw_ext/ext_fw_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static const char nrf70_fw_patch[] = {
#include <pm_config.h>
#define NRF70_FW_PATCH_ID PM_NRF70_WIFI_FW_ID
#else
#define NRF70_FW_PATCH_ID PARTITION_ID(nrf70_fw_partition)
#define NRF70_FW_PATCH_ID PARTITION_ID(nrf70_wifi_fw_partition)
#endif
static const struct flash_area *fa;

Expand Down
6 changes: 3 additions & 3 deletions subsys/net/lib/nrf70_fw_ext/rpu_fw_patches.ld
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <zephyr/linker/linker-defs.h>
#include <zephyr/linker/linker-tool.h>

#if CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF52840DK_NRF52840 || CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP
#if CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF52840DK_NRF52840 || CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF54LM20DK

#if CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP
#if CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF54LM20DK
#define EXTFLASH_BASE_ADDR 0x10000000
#define EXTFLASH_SIZE 0x800000
#elif CONFIG_BOARD_NRF52840DK_NRF52840
Expand All @@ -41,6 +41,6 @@ MEMORY
EXTFLASH (wx) : ORIGIN = EXTFLASH_ADDRESS, LENGTH = EXTFLASH_SIZE
}

#endif /* CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF52840DK_NRF52840 || CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP */
#endif /* CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF52840DK_NRF52840 || CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF54LM20DK */

#include <zephyr/arch/arm/cortex_m/scripts/linker.ld>