From 4c1e8174ba6cbc25a62443f9910e45f05508bf3e Mon Sep 17 00:00:00 2001 From: Marcin Kajor Date: Mon, 3 Jun 2024 11:40:45 +0200 Subject: [PATCH] samples: matter: rework PM static partitions for nRF54L * enabled mx25r64 external flash over SPI for Matter samples * added pm_static* files that configures static memory map with MCUboot secondary slot residing on the external flash * added MCUboot configuration to support DFU * increased the RRAM and SRAM for nrf54L (by default the FLPR consumes 68k of SRAM and 96k of RRAM even if not used) * left the pm_static file with internal flash only for the template sample as a reference for dual bank DFU with no external flash * added support for nRF54L platform in the lock sample * updated documentation to describe supported DFU variants Signed-off-by: Marcin Kajor --- .../releases/release-notes-changelog.rst | 2 - samples/matter/light_bulb/Kconfig.sysbuild | 11 ++-- samples/matter/light_bulb/README.rst | 4 -- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 4 -- .../nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay | 43 +++++--------- .../nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay | 43 +++++--------- ...pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} | 57 ++++++++++--------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 15 +++++ .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 ++++++++ samples/matter/light_switch/Kconfig.sysbuild | 11 ++-- samples/matter/light_switch/README.rst | 4 -- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 4 -- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 43 +++++--------- .../nrf54l15pdk_nrf54l15_cpuapp_release.conf | 20 ------- ...pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} | 57 ++++++++++--------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 27 +++++++++ .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 ++++++++ .../nrf54l15pdk_nrf54l15_cpuapp_release.conf | 12 ---- samples/matter/lock/Kconfig.sysbuild | 14 +---- samples/matter/lock/README.rst | 2 +- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf} | 3 - .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 34 +++++++++++ ...pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} | 57 ++++++++++--------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 27 +++++++++ .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 ++++++++ samples/matter/template/Kconfig.sysbuild | 11 ++-- samples/matter/template/README.rst | 32 ++--------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 4 -- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 43 +++++--------- .../nrf54l15pdk_nrf54l15_cpuapp_release.conf | 20 ------- ...pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} | 57 ++++++++++--------- ..._nrf54l15pdk_nrf54l15_cpuapp_internal.yml} | 0 samples/matter/template/sample.yaml | 2 + .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 15 +++++ .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 ++++++++ .../nrf54l15pdk_nrf54l15_cpuapp_internal.conf | 38 +++++++++++++ ...f54l15pdk_nrf54l15_cpuapp_internal.overlay | 22 +++++++ samples/matter/thermostat/Kconfig.sysbuild | 11 ++-- samples/matter/thermostat/README.rst | 4 -- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 4 -- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 43 +++++--------- .../nrf54l15pdk_nrf54l15_cpuapp_release.conf | 20 ------- .../pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml | 56 ++++++++++++++++++ .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 15 +++++ .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 ++++++++ .../matter/window_covering/Kconfig.sysbuild | 11 ++-- samples/matter/window_covering/README.rst | 4 -- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 4 -- .../nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay | 43 +++++--------- .../nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay | 43 +++++--------- .../nrf54l15pdk_nrf54l15_cpuapp_release.conf | 20 ------- .../pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml | 52 +++++++++++++++++ .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 16 +++++- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 ++++++++ west.yml | 2 +- 55 files changed, 720 insertions(+), 516 deletions(-) rename samples/matter/{template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml => light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} (61%) create mode 100644 samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf rename samples/matter/{thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml => light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} (61%) create mode 100644 samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf create mode 100644 samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf rename samples/matter/{light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf => lock/boards/nrf54l15pdk_nrf54l15_cpuapp.conf} (79%) create mode 100644 samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay rename samples/matter/{light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml => lock/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} (61%) create mode 100644 samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf create mode 100644 samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf rename samples/matter/{window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml => template/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml} (61%) rename samples/matter/{light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml => template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_internal.yml} (100%) create mode 100644 samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay create mode 100644 samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.conf create mode 100644 samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.overlay delete mode 100644 samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf create mode 100644 samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml create mode 100644 samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf create mode 100644 samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml create mode 100644 samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay 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 12c0620ad7a5..ae833f447f1f 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -595,8 +595,6 @@ Matter samples that used :ref:`zephyr:nrf-ieee802154-rpmsg-sample` or :ref:`mult * :ref:`matter_thermostat_sample` sample. * :ref:`matter_window_covering_sample` sample. - DFU support for the nRF54L15 PDK is available only for the ``release`` build type. - * Enabled the Bluetooth® LE Extended Announcement feature for all samples, and increased advertising timeout from 15 minutes to 1 hour. * :ref:`matter_lock_sample` sample: diff --git a/samples/matter/light_bulb/Kconfig.sysbuild b/samples/matter/light_bulb/Kconfig.sysbuild index 699354364cea..32e27ff3770a 100644 --- a/samples/matter/light_bulb/Kconfig.sysbuild +++ b/samples/matter/light_bulb/Kconfig.sysbuild @@ -17,12 +17,9 @@ config MATTER_FACTORY_DATA default y if !BOARD_NRF21540DK choice BOOTLOADER - default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK && !BOARD_NRF54L15PDK_NRF54L15_CPUAPP + default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK endchoice -config PARTITION_MANAGER - default n if BOARD_NRF54L15PDK_NRF54L15_CPUAPP - if BOOTLOADER_MCUBOOT config DFU_MULTI_IMAGE_PACKAGE_BUILD @@ -56,11 +53,11 @@ config NETCORE_APP_UPDATE config DFU_MULTI_IMAGE_PACKAGE_NET default y -endif # BOOTLOADER_MCUBOOT - endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) +endif # BOOTLOADER_MCUBOOT + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP + default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF54L15PDK_NRF54L15_CPUAPP source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/matter/light_bulb/README.rst b/samples/matter/light_bulb/README.rst index c11c164a66ab..4339eb18ddac 100644 --- a/samples/matter/light_bulb/README.rst +++ b/samples/matter/light_bulb/README.rst @@ -115,10 +115,6 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end -.. include:: ../template/README.rst - :start-after: matter_template_nrf54l15_build_with_dfu_start - :end-before: matter_template_nrf54l15_build_with_dfu_end - FEM support =========== diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 1fd21a283a54..4e253b481958 100644 --- a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -7,10 +7,6 @@ # Multirole is the only currently supported role by SoftDevice. CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y -# TODO: Workaround to be removed once DFU and external flash will be supported on nRF54L. -CONFIG_CHIP_OTA_REQUESTOR=n -CONFIG_CHIP_QSPI_NOR=n - CONFIG_FPU=n CONFIG_PM=n CONFIG_HWINFO_NRF=n diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay index b04393e1c6ac..35987f5418f1 100644 --- a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay @@ -5,10 +5,11 @@ */ / { - aliases { - factory-data = &factory_data; - factory-data-memory-region = &cpuapp_rram; + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + aliases { // Configure PWM module for led1 (LED2 on the board) pwm-led1 = &pwm_led1; @@ -24,34 +25,18 @@ }; }; -/delete-node/ &cpuapp_rram; +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; -&rram_controller { - reg = < 0x5004b000 0x17d000 >; +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - erase-block-size = < 0x1000 >; - write-block-size = < 0x10 >; - reg = < 0x0 0x17d000 >; - partitions { - compatible = "fixed-partitions"; - #address-cells = < 0x1 >; - #size-cells = < 0x1 >; - slot0_partition: partition@0 { - label = "image-0"; - reg = < 0x0 0x174000 >; - }; - factory_data: partition@174000 { - label = "factory-data"; - reg = < 0x174000 0x1000 >; - }; - storage_partition: partition@175000 { - label = "storage"; - reg = < 0x175000 0x8000 >; - }; - }; - }; +&mx25r64 { + status = "okay"; }; &pwm20 { diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay index a9a2d4a526db..1571260dc49b 100644 --- a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay @@ -6,10 +6,11 @@ / { - aliases { - factory-data = &factory_data; - factory-data-memory-region = &cpuapp_rram; + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + aliases { // Configure PWM module for led1 (LED2 on the board) pwm-led1 = &pwm_led1; @@ -25,34 +26,18 @@ }; }; -/delete-node/ &cpuapp_rram; +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; -&rram_controller { - reg = < 0x5004b000 0x17d000 >; +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - erase-block-size = < 0x1000 >; - write-block-size = < 0x10 >; - reg = < 0x0 0x17d000 >; - partitions { - compatible = "fixed-partitions"; - #address-cells = < 0x1 >; - #size-cells = < 0x1 >; - slot0_partition: partition@0 { - label = "image-0"; - reg = < 0x0 0x174000 >; - }; - factory_data: partition@174000 { - label = "factory-data"; - reg = < 0x174000 0x1000 >; - }; - storage_partition: partition@175000 { - label = "storage"; - reg = < 0x175000 0x8000 >; - }; - }; - }; +&mx25r64 { + status = "okay"; }; &pwm20 { diff --git a/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml similarity index 61% rename from samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml rename to samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml index a28d1effed5f..6d7e535ebbdb 100644 --- a/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml +++ b/samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml @@ -1,46 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0x7000 + size: 0xc000 mcuboot_pad: - address: 0x7000 + address: 0xc000 region: flash_primary size: 0x800 app: - address: 0x7800 + address: 0xc800 region: flash_primary - size: 0xb6000 + size: 0x167800 mcuboot_primary: - address: 0x7000 orig_span: &id001 - - app - mcuboot_pad - region: flash_primary - size: 0xb6800 + - app span: *id001 + address: 0xc000 + region: flash_primary + size: 0x168000 mcuboot_primary_app: - address: 0x7800 orig_span: &id002 - app - region: flash_primary - size: 0xb6000 span: *id002 -mcuboot_secondary: - address: 0xbd800 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb6800 - span: *id003 -mcuboot_secondary_pad: + address: 0xc800 region: flash_primary - address: 0xbd800 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xbe000 - size: 0xb6000 + size: 0x167800 factory_data: address: 0x174000 region: flash_primary @@ -49,3 +33,24 @@ settings_storage: address: 0x175000 region: flash_primary size: 0x8000 +mcuboot_secondary: + address: 0x0 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: external_flash + size: 0x168000 + span: *id003 +mcuboot_secondary_pad: + region: external_flash + address: 0x0 + size: 0x800 +mcuboot_secondary_app: + region: external_flash + address: 0x800 + size: 0x167800 +external_flash: + address: 0x168000 + size: 0x698000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index da29968217bb..d636bd686f8b 100644 --- a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -10,3 +10,18 @@ CONFIG_FPROTECT=n CONFIG_HW_STACK_PROTECTION=n CONFIG_BOOT_WATCHDOG_FEED=n + +# nRF54L15PDK uses SPI NOR external flash +CONFIG_GPIO=y +CONFIG_SPI=y +CONFIG_SPI_NOR=y +CONFIG_SPI_NOR_SFDP_DEVICETREE=y +CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 + +# required by SPI driver +CONFIG_MULTITHREADING=y + +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y + +# Adjust the maximum sectors to the app image size of ~1.4MB +CONFIG_BOOT_MAX_IMG_SECTORS=512 diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e54f91119944 --- /dev/null +++ b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&mx25r64 { + status = "okay"; +}; diff --git a/samples/matter/light_switch/Kconfig.sysbuild b/samples/matter/light_switch/Kconfig.sysbuild index 699354364cea..32e27ff3770a 100644 --- a/samples/matter/light_switch/Kconfig.sysbuild +++ b/samples/matter/light_switch/Kconfig.sysbuild @@ -17,12 +17,9 @@ config MATTER_FACTORY_DATA default y if !BOARD_NRF21540DK choice BOOTLOADER - default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK && !BOARD_NRF54L15PDK_NRF54L15_CPUAPP + default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK endchoice -config PARTITION_MANAGER - default n if BOARD_NRF54L15PDK_NRF54L15_CPUAPP - if BOOTLOADER_MCUBOOT config DFU_MULTI_IMAGE_PACKAGE_BUILD @@ -56,11 +53,11 @@ config NETCORE_APP_UPDATE config DFU_MULTI_IMAGE_PACKAGE_NET default y -endif # BOOTLOADER_MCUBOOT - endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) +endif # BOOTLOADER_MCUBOOT + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP + default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF54L15PDK_NRF54L15_CPUAPP source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/matter/light_switch/README.rst b/samples/matter/light_switch/README.rst index cce727d59b40..2869f2c15d92 100644 --- a/samples/matter/light_switch/README.rst +++ b/samples/matter/light_switch/README.rst @@ -127,10 +127,6 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end -.. include:: ../template/README.rst - :start-after: matter_template_nrf54l15_build_with_dfu_start - :end-before: matter_template_nrf54l15_build_with_dfu_end - Factory data support ==================== diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 1fd21a283a54..4e253b481958 100644 --- a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -7,10 +7,6 @@ # Multirole is the only currently supported role by SoftDevice. CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y -# TODO: Workaround to be removed once DFU and external flash will be supported on nRF54L. -CONFIG_CHIP_OTA_REQUESTOR=n -CONFIG_CHIP_QSPI_NOR=n - CONFIG_FPU=n CONFIG_PM=n CONFIG_HWINFO_NRF=n diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index f81a37541ae4..24f6e27b93ed 100644 --- a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -6,42 +6,27 @@ / { aliases { - factory-data = &factory_data; - factory-data-memory-region = &cpuapp_rram; - // Use watchdog wdt31 as the application watchdog watchdog0 = &wdt31; }; + + chosen { + nordic,pm-ext-flash = &mx25r64; + }; }; -/delete-node/ &cpuapp_rram; +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; -&rram_controller { - reg = < 0x5004b000 0x17d000 >; +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - erase-block-size = < 0x1000 >; - write-block-size = < 0x10 >; - reg = < 0x0 0x17d000 >; - partitions { - compatible = "fixed-partitions"; - #address-cells = < 0x1 >; - #size-cells = < 0x1 >; - slot0_partition: partition@0 { - label = "image-0"; - reg = < 0x0 0x174000 >; - }; - factory_data: partition@174000 { - label = "factory-data"; - reg = < 0x174000 0x1000 >; - }; - storage_partition: partition@175000 { - label = "storage"; - reg = < 0x175000 0x8000 >; - }; - }; - }; +&mx25r64 { + status = "okay"; }; &wdt31 { diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf deleted file mode 100644 index ad5fd560f555..000000000000 --- a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Multirole is the only currently supported role by SoftDevice. -CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y - -# TODO: Workaround to be removed once external flash will be supported on nRF54L. -CONFIG_CHIP_QSPI_NOR=n - -CONFIG_FPU=n -CONFIG_PM=n -CONFIG_HWINFO_NRF=n - -CONFIG_NRF_802154_TEMPERATURE_UPDATE=n - -# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L -CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml similarity index 61% rename from samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml rename to samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml index a28d1effed5f..6d7e535ebbdb 100644 --- a/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml +++ b/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml @@ -1,46 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0x7000 + size: 0xc000 mcuboot_pad: - address: 0x7000 + address: 0xc000 region: flash_primary size: 0x800 app: - address: 0x7800 + address: 0xc800 region: flash_primary - size: 0xb6000 + size: 0x167800 mcuboot_primary: - address: 0x7000 orig_span: &id001 - - app - mcuboot_pad - region: flash_primary - size: 0xb6800 + - app span: *id001 + address: 0xc000 + region: flash_primary + size: 0x168000 mcuboot_primary_app: - address: 0x7800 orig_span: &id002 - app - region: flash_primary - size: 0xb6000 span: *id002 -mcuboot_secondary: - address: 0xbd800 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb6800 - span: *id003 -mcuboot_secondary_pad: + address: 0xc800 region: flash_primary - address: 0xbd800 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xbe000 - size: 0xb6000 + size: 0x167800 factory_data: address: 0x174000 region: flash_primary @@ -49,3 +33,24 @@ settings_storage: address: 0x175000 region: flash_primary size: 0x8000 +mcuboot_secondary: + address: 0x0 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: external_flash + size: 0x168000 + span: *id003 +mcuboot_secondary_pad: + region: external_flash + address: 0x0 + size: 0x800 +mcuboot_secondary_app: + region: external_flash + address: 0x800 + size: 0x167800 +external_flash: + address: 0x168000 + size: 0x698000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..d636bd686f8b --- /dev/null +++ b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,27 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_BOOT_WATCHDOG_FEED=n + +# nRF54L15PDK uses SPI NOR external flash +CONFIG_GPIO=y +CONFIG_SPI=y +CONFIG_SPI_NOR=y +CONFIG_SPI_NOR_SFDP_DEVICETREE=y +CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 + +# required by SPI driver +CONFIG_MULTITHREADING=y + +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y + +# Adjust the maximum sectors to the app image size of ~1.4MB +CONFIG_BOOT_MAX_IMG_SECTORS=512 diff --git a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e54f91119944 --- /dev/null +++ b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&mx25r64 { + status = "okay"; +}; diff --git a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf deleted file mode 100644 index da29968217bb..000000000000 --- a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround Fprotect is not supported on nRF54l15 yet. -CONFIG_FPROTECT=n -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/samples/matter/lock/Kconfig.sysbuild b/samples/matter/lock/Kconfig.sysbuild index cd9f1a230fc0..0d3b0bd75069 100644 --- a/samples/matter/lock/Kconfig.sysbuild +++ b/samples/matter/lock/Kconfig.sysbuild @@ -53,21 +53,11 @@ config NETCORE_APP_UPDATE config DFU_MULTI_IMAGE_PACKAGE_NET default y -endif # BOOTLOADER_MCUBOOT - endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) -if BOOTLOADER_MCUBOOT && BOARD_NRF52840DK_NRF52840 - -config DFU_MULTI_IMAGE_PACKAGE_BUILD - default y - -config DFU_MULTI_IMAGE_PACKAGE_APP - default y - -endif +endif # BOOTLOADER_MCUBOOT config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || BOARD_NRF54L15PDK_NRF54L15_CPUAPP source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/matter/lock/README.rst b/samples/matter/lock/README.rst index ee60b13f9a25..0a0d3735e96a 100644 --- a/samples/matter/lock/README.rst +++ b/samples/matter/lock/README.rst @@ -216,7 +216,7 @@ Device Firmware Upgrade support .. note:: You can enable over-the-air Device Firmware Upgrade only on hardware platforms that have external flash memory. - Currently only nRF52840 DK, nRF5340 DK and nRF7002 DK support Device Firmware Upgrade feature. + Currently only nRF52840 DK, nRF5340 DK, nRF7002 DK and nRF54L15 PDK support Device Firmware Upgrade feature. The sample supports over-the-air (OTA) device firmware upgrade (DFU) using one of the two following protocols: diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp.conf similarity index 79% rename from samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf rename to samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index ad5fd560f555..4e253b481958 100644 --- a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf +++ b/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -7,9 +7,6 @@ # Multirole is the only currently supported role by SoftDevice. CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y -# TODO: Workaround to be removed once external flash will be supported on nRF54L. -CONFIG_CHIP_QSPI_NOR=n - CONFIG_FPU=n CONFIG_PM=n CONFIG_HWINFO_NRF=n diff --git a/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..24f6e27b93ed --- /dev/null +++ b/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + aliases { + // Use watchdog wdt31 as the application watchdog + watchdog0 = &wdt31; + }; + + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&mx25r64 { + status = "okay"; +}; + +&wdt31 { + status = "okay"; +}; diff --git a/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/lock/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml similarity index 61% rename from samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml rename to samples/matter/lock/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml index a28d1effed5f..6d7e535ebbdb 100644 --- a/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml +++ b/samples/matter/lock/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml @@ -1,46 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0x7000 + size: 0xc000 mcuboot_pad: - address: 0x7000 + address: 0xc000 region: flash_primary size: 0x800 app: - address: 0x7800 + address: 0xc800 region: flash_primary - size: 0xb6000 + size: 0x167800 mcuboot_primary: - address: 0x7000 orig_span: &id001 - - app - mcuboot_pad - region: flash_primary - size: 0xb6800 + - app span: *id001 + address: 0xc000 + region: flash_primary + size: 0x168000 mcuboot_primary_app: - address: 0x7800 orig_span: &id002 - app - region: flash_primary - size: 0xb6000 span: *id002 -mcuboot_secondary: - address: 0xbd800 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb6800 - span: *id003 -mcuboot_secondary_pad: + address: 0xc800 region: flash_primary - address: 0xbd800 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xbe000 - size: 0xb6000 + size: 0x167800 factory_data: address: 0x174000 region: flash_primary @@ -49,3 +33,24 @@ settings_storage: address: 0x175000 region: flash_primary size: 0x8000 +mcuboot_secondary: + address: 0x0 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: external_flash + size: 0x168000 + span: *id003 +mcuboot_secondary_pad: + region: external_flash + address: 0x0 + size: 0x800 +mcuboot_secondary_app: + region: external_flash + address: 0x800 + size: 0x167800 +external_flash: + address: 0x168000 + size: 0x698000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..d636bd686f8b --- /dev/null +++ b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,27 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_BOOT_WATCHDOG_FEED=n + +# nRF54L15PDK uses SPI NOR external flash +CONFIG_GPIO=y +CONFIG_SPI=y +CONFIG_SPI_NOR=y +CONFIG_SPI_NOR_SFDP_DEVICETREE=y +CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 + +# required by SPI driver +CONFIG_MULTITHREADING=y + +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y + +# Adjust the maximum sectors to the app image size of ~1.4MB +CONFIG_BOOT_MAX_IMG_SECTORS=512 diff --git a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e54f91119944 --- /dev/null +++ b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&mx25r64 { + status = "okay"; +}; diff --git a/samples/matter/template/Kconfig.sysbuild b/samples/matter/template/Kconfig.sysbuild index 49136e4adfe2..4b750e2ae6ee 100644 --- a/samples/matter/template/Kconfig.sysbuild +++ b/samples/matter/template/Kconfig.sysbuild @@ -17,12 +17,9 @@ config NETCORE_IPC_RADIO_BT_HCI_IPC default y if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP) choice BOOTLOADER - default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK && !BOARD_NRF54L15PDK_NRF54L15_CPUAPP + default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK endchoice -config PARTITION_MANAGER - default n if BOARD_NRF54L15PDK_NRF54L15_CPUAPP - if BOOTLOADER_MCUBOOT config DFU_MULTI_IMAGE_PACKAGE_BUILD @@ -56,11 +53,11 @@ config NETCORE_APP_UPDATE config DFU_MULTI_IMAGE_PACKAGE_NET default y -endif # BOOTLOADER_MCUBOOT - endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) +endif # BOOTLOADER_MCUBOOT + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP + default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF54L15PDK_NRF54L15_CPUAPP source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/matter/template/README.rst b/samples/matter/template/README.rst index 6d9807cb8c9a..6c6f69ef0b08 100644 --- a/samples/matter/template/README.rst +++ b/samples/matter/template/README.rst @@ -113,37 +113,17 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end -.. matter_template_nrf54l15_build_with_dfu_start +Alternatively, for the nRF54L15 PDK, the DFU can be configured to only use the internal MRAM for storage. +This means that both the currently running firmware and the new firmware to be updated will be stored within the device's internal flash memory. +This configuration is only available for the ``release`` build variant. -The Device Firmware Upgrade (DFU) for the nRF54L15 PDK is exclusively available for the ``release`` build configuration and is limited to using the internal MRAM for storage. -This means that both the currently running firmware and the new firmware to be updated must be stored within the device's internal flash memory. -Currently, there is no support for utilizing external flash memory for this purpose. - -To build the sample with DFU support, use the ``-DFILE_SUFFIX=release`` flag in your CMake build command. - -The following is an example command to build the sample with support for OTA DFU only: - -.. code-block:: console - - west build -b nrf54l15pdk/nrf54l15/cpuapp -- -DFILE_SUFFIX=release - -If you want to build the sample with support for both OTA DFU and SMP DFU, use the following command: +The following is an example command to build the sample on the nRF54L15 PDK with support for Matter OTA DFU and DFU over Bluetooth® SMP, and using internal MRAM only: .. code-block:: console - west build -b nrf54l15pdk/nrf54l15/cpuapp -- -DFILE_SUFFIX=release -DCONFIG_CHIP_DFU_OVER_BT_SMP=y - -You can disable DFU support for the ``release`` build configuration to double available application memory space. -Do this by setting the :kconfig:option:`CONFIG_CHIP_DFU_OVER_BT_SMP` and :kconfig:option:`CONFIG_CHIP_OTA_REQUESTOR` Kconfig options to ``n``, and removing the :file:`pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml` file. - -For example: - -.. code-block:: console - - west build -b nrf54l15pdk/nrf54l15/cpuapp -- -DFILE_SUFFIX=release -DCONFIG_CHIP_DFU_OVER_BT_SMP=n -DCONFIG_CHIP_OTA_REQUESTOR=n - + west build -b nrf54l15pdk_nrf54l15_cpuapp -- -DFILE_SUFFIX=release -DCONFIG_CHIP_DFU_OVER_BT_SMP=y -DPM_STATIC_YML_FILE=pm_static_nrf54l15pdk_nrf54l15_cpuapp_internal.yml -Dmcuboot_EXTRA_CONF_FILE=/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.conf -Dmcuboot_EXTRA_DTC_OVERLAY_FILE=/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.overlay -.. matter_template_nrf54l15_build_with_dfu_end +Note that in this case, the size of the application partition is half of what it would be when using a configuration with external flash memory support. FEM support =========== diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 1fd21a283a54..4e253b481958 100644 --- a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -7,10 +7,6 @@ # Multirole is the only currently supported role by SoftDevice. CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y -# TODO: Workaround to be removed once DFU and external flash will be supported on nRF54L. -CONFIG_CHIP_OTA_REQUESTOR=n -CONFIG_CHIP_QSPI_NOR=n - CONFIG_FPU=n CONFIG_PM=n CONFIG_HWINFO_NRF=n diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index f81a37541ae4..24f6e27b93ed 100644 --- a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -6,42 +6,27 @@ / { aliases { - factory-data = &factory_data; - factory-data-memory-region = &cpuapp_rram; - // Use watchdog wdt31 as the application watchdog watchdog0 = &wdt31; }; + + chosen { + nordic,pm-ext-flash = &mx25r64; + }; }; -/delete-node/ &cpuapp_rram; +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; -&rram_controller { - reg = < 0x5004b000 0x17d000 >; +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - erase-block-size = < 0x1000 >; - write-block-size = < 0x10 >; - reg = < 0x0 0x17d000 >; - partitions { - compatible = "fixed-partitions"; - #address-cells = < 0x1 >; - #size-cells = < 0x1 >; - slot0_partition: partition@0 { - label = "image-0"; - reg = < 0x0 0x174000 >; - }; - factory_data: partition@174000 { - label = "factory-data"; - reg = < 0x174000 0x1000 >; - }; - storage_partition: partition@175000 { - label = "storage"; - reg = < 0x175000 0x8000 >; - }; - }; - }; +&mx25r64 { + status = "okay"; }; &wdt31 { diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf deleted file mode 100644 index ad5fd560f555..000000000000 --- a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Multirole is the only currently supported role by SoftDevice. -CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y - -# TODO: Workaround to be removed once external flash will be supported on nRF54L. -CONFIG_CHIP_QSPI_NOR=n - -CONFIG_FPU=n -CONFIG_PM=n -CONFIG_HWINFO_NRF=n - -CONFIG_NRF_802154_TEMPERATURE_UPDATE=n - -# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L -CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml similarity index 61% rename from samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml rename to samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml index a28d1effed5f..6d7e535ebbdb 100644 --- a/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml +++ b/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml @@ -1,46 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0x7000 + size: 0xc000 mcuboot_pad: - address: 0x7000 + address: 0xc000 region: flash_primary size: 0x800 app: - address: 0x7800 + address: 0xc800 region: flash_primary - size: 0xb6000 + size: 0x167800 mcuboot_primary: - address: 0x7000 orig_span: &id001 - - app - mcuboot_pad - region: flash_primary - size: 0xb6800 + - app span: *id001 + address: 0xc000 + region: flash_primary + size: 0x168000 mcuboot_primary_app: - address: 0x7800 orig_span: &id002 - app - region: flash_primary - size: 0xb6000 span: *id002 -mcuboot_secondary: - address: 0xbd800 - orig_span: &id003 - - mcuboot_secondary_pad - - mcuboot_secondary_app - region: flash_primary - size: 0xb6800 - span: *id003 -mcuboot_secondary_pad: + address: 0xc800 region: flash_primary - address: 0xbd800 - size: 0x800 -mcuboot_secondary_app: - region: flash_primary - address: 0xbe000 - size: 0xb6000 + size: 0x167800 factory_data: address: 0x174000 region: flash_primary @@ -49,3 +33,24 @@ settings_storage: address: 0x175000 region: flash_primary size: 0x8000 +mcuboot_secondary: + address: 0x0 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: external_flash + size: 0x168000 + span: *id003 +mcuboot_secondary_pad: + region: external_flash + address: 0x0 + size: 0x800 +mcuboot_secondary_app: + region: external_flash + address: 0x800 + size: 0x167800 +external_flash: + address: 0x168000 + size: 0x698000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_internal.yml similarity index 100% rename from samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml rename to samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_internal.yml diff --git a/samples/matter/template/sample.yaml b/samples/matter/template/sample.yaml index 7b3c1e24d9f7..910a2f29ba3c 100644 --- a/samples/matter/template/sample.yaml +++ b/samples/matter/template/sample.yaml @@ -50,7 +50,9 @@ tests: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp tags: sysbuild sample.matter.template.mgrt_dac: sysbuild: true diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index da29968217bb..d636bd686f8b 100644 --- a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -10,3 +10,18 @@ CONFIG_FPROTECT=n CONFIG_HW_STACK_PROTECTION=n CONFIG_BOOT_WATCHDOG_FEED=n + +# nRF54L15PDK uses SPI NOR external flash +CONFIG_GPIO=y +CONFIG_SPI=y +CONFIG_SPI_NOR=y +CONFIG_SPI_NOR_SFDP_DEVICETREE=y +CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 + +# required by SPI driver +CONFIG_MULTITHREADING=y + +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y + +# Adjust the maximum sectors to the app image size of ~1.4MB +CONFIG_BOOT_MAX_IMG_SECTORS=512 diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e54f91119944 --- /dev/null +++ b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&mx25r64 { + status = "okay"; +}; diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.conf b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.conf new file mode 100644 index 000000000000..8cd2a45c2cf7 --- /dev/null +++ b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_BOOT_WATCHDOG_FEED=n + +# Disable all debug features +CONFIG_USE_SEGGER_RTT=n +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_ASSERT_NO_FILE_INFO=y +CONFIG_PRINTK=n +CONFIG_PRINTK_SYNC=n +CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Bootloader size optimization to fit into 28 KB partition. +# These options can be safely disabled because in this configuration, +# the secondary slot resides in the internal MRAM, so features +# needed to handle the external flash are not needed. +CONFIG_GPIO=n +CONFIG_SPI_NOR=n +CONFIG_SPI=n +CONFIG_MULTITHREADING=n +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=n diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.overlay b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.overlay new file mode 100644 index 000000000000..a62addcee44a --- /dev/null +++ b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_internal.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + + /* Disable the external flash, as it's not needed + for the configuration with secondary slot residing + in the internal MRAM. */ +&mx25r64 { + status = "disabled"; +}; diff --git a/samples/matter/thermostat/Kconfig.sysbuild b/samples/matter/thermostat/Kconfig.sysbuild index f232c670af98..097241f36647 100644 --- a/samples/matter/thermostat/Kconfig.sysbuild +++ b/samples/matter/thermostat/Kconfig.sysbuild @@ -17,12 +17,9 @@ config MATTER_FACTORY_DATA default y if !BOARD_NRF21540DK choice BOOTLOADER - default BOOTLOADER_MCUBOOT if !BOARD_NRF54L15PDK_NRF54L15_CPUAPP + default BOOTLOADER_MCUBOOT endchoice -config PARTITION_MANAGER - default n if BOARD_NRF54L15PDK_NRF54L15_CPUAPP - if BOOTLOADER_MCUBOOT config DFU_MULTI_IMAGE_PACKAGE_BUILD @@ -56,11 +53,11 @@ config NETCORE_APP_UPDATE config DFU_MULTI_IMAGE_PACKAGE_NET default y -endif # BOOTLOADER_MCUBOOT - endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) +endif # BOOTLOADER_MCUBOOT + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP + default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF54L15PDK_NRF54L15_CPUAPP source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/matter/thermostat/README.rst b/samples/matter/thermostat/README.rst index 63fb863e0e79..393f146dcc0d 100644 --- a/samples/matter/thermostat/README.rst +++ b/samples/matter/thermostat/README.rst @@ -138,10 +138,6 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end -.. include:: ../template/README.rst - :start-after: matter_template_nrf54l15_build_with_dfu_start - :end-before: matter_template_nrf54l15_build_with_dfu_end - .. _matter_thermostat_network_mode: Remote testing in a network diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 1fd21a283a54..4e253b481958 100644 --- a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -7,10 +7,6 @@ # Multirole is the only currently supported role by SoftDevice. CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y -# TODO: Workaround to be removed once DFU and external flash will be supported on nRF54L. -CONFIG_CHIP_OTA_REQUESTOR=n -CONFIG_CHIP_QSPI_NOR=n - CONFIG_FPU=n CONFIG_PM=n CONFIG_HWINFO_NRF=n diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index f81a37541ae4..24f6e27b93ed 100644 --- a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -6,42 +6,27 @@ / { aliases { - factory-data = &factory_data; - factory-data-memory-region = &cpuapp_rram; - // Use watchdog wdt31 as the application watchdog watchdog0 = &wdt31; }; + + chosen { + nordic,pm-ext-flash = &mx25r64; + }; }; -/delete-node/ &cpuapp_rram; +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; -&rram_controller { - reg = < 0x5004b000 0x17d000 >; +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - erase-block-size = < 0x1000 >; - write-block-size = < 0x10 >; - reg = < 0x0 0x17d000 >; - partitions { - compatible = "fixed-partitions"; - #address-cells = < 0x1 >; - #size-cells = < 0x1 >; - slot0_partition: partition@0 { - label = "image-0"; - reg = < 0x0 0x174000 >; - }; - factory_data: partition@174000 { - label = "factory-data"; - reg = < 0x174000 0x1000 >; - }; - storage_partition: partition@175000 { - label = "storage"; - reg = < 0x175000 0x8000 >; - }; - }; - }; +&mx25r64 { + status = "okay"; }; &wdt31 { diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf deleted file mode 100644 index ad5fd560f555..000000000000 --- a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Multirole is the only currently supported role by SoftDevice. -CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y - -# TODO: Workaround to be removed once external flash will be supported on nRF54L. -CONFIG_CHIP_QSPI_NOR=n - -CONFIG_FPU=n -CONFIG_PM=n -CONFIG_HWINFO_NRF=n - -CONFIG_NRF_802154_TEMPERATURE_UPDATE=n - -# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L -CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml b/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml new file mode 100644 index 000000000000..6d7e535ebbdb --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0xc000 +mcuboot_pad: + address: 0xc000 + region: flash_primary + size: 0x800 +app: + address: 0xc800 + region: flash_primary + size: 0x167800 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xc000 + region: flash_primary + size: 0x168000 +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xc800 + region: flash_primary + size: 0x167800 +factory_data: + address: 0x174000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x175000 + region: flash_primary + size: 0x8000 +mcuboot_secondary: + address: 0x0 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: external_flash + size: 0x168000 + span: *id003 +mcuboot_secondary_pad: + region: external_flash + address: 0x0 + size: 0x800 +mcuboot_secondary_app: + region: external_flash + address: 0x800 + size: 0x167800 +external_flash: + address: 0x168000 + size: 0x698000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index da29968217bb..d636bd686f8b 100644 --- a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -10,3 +10,18 @@ CONFIG_FPROTECT=n CONFIG_HW_STACK_PROTECTION=n CONFIG_BOOT_WATCHDOG_FEED=n + +# nRF54L15PDK uses SPI NOR external flash +CONFIG_GPIO=y +CONFIG_SPI=y +CONFIG_SPI_NOR=y +CONFIG_SPI_NOR_SFDP_DEVICETREE=y +CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 + +# required by SPI driver +CONFIG_MULTITHREADING=y + +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y + +# Adjust the maximum sectors to the app image size of ~1.4MB +CONFIG_BOOT_MAX_IMG_SECTORS=512 diff --git a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e54f91119944 --- /dev/null +++ b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&mx25r64 { + status = "okay"; +}; diff --git a/samples/matter/window_covering/Kconfig.sysbuild b/samples/matter/window_covering/Kconfig.sysbuild index 89469c662e03..5d7611225802 100644 --- a/samples/matter/window_covering/Kconfig.sysbuild +++ b/samples/matter/window_covering/Kconfig.sysbuild @@ -17,12 +17,9 @@ config MATTER_FACTORY_DATA default y if !BOARD_NRF21540DK choice BOOTLOADER - default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK && !BOARD_NRF54L15PDK_NRF54L15_CPUAPP + default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK endchoice -config PARTITION_MANAGER - default n if BOARD_NRF54L15PDK_NRF54L15_CPUAPP - if BOOTLOADER_MCUBOOT config DFU_MULTI_IMAGE_PACKAGE_BUILD @@ -56,11 +53,11 @@ config NETCORE_APP_UPDATE config DFU_MULTI_IMAGE_PACKAGE_NET default y -endif # BOOTLOADER_MCUBOOT - endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) +endif # BOOTLOADER_MCUBOOT + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP + default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF54L15PDK_NRF54L15_CPUAPP source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/matter/window_covering/README.rst b/samples/matter/window_covering/README.rst index 4c25c812ead5..720e4d5ac0af 100644 --- a/samples/matter/window_covering/README.rst +++ b/samples/matter/window_covering/README.rst @@ -98,10 +98,6 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end -.. include:: ../template/README.rst - :start-after: matter_template_nrf54l15_build_with_dfu_start - :end-before: matter_template_nrf54l15_build_with_dfu_end - FEM support =========== diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index 1fd21a283a54..4e253b481958 100644 --- a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -7,10 +7,6 @@ # Multirole is the only currently supported role by SoftDevice. CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y -# TODO: Workaround to be removed once DFU and external flash will be supported on nRF54L. -CONFIG_CHIP_OTA_REQUESTOR=n -CONFIG_CHIP_QSPI_NOR=n - CONFIG_FPU=n CONFIG_PM=n CONFIG_HWINFO_NRF=n diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay index 9f38f24d86e5..77f255f88b7f 100644 --- a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay @@ -5,10 +5,11 @@ */ / { - aliases { - factory-data = &factory_data; - factory-data-memory-region = &cpuapp_rram; + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + aliases { // Configure PWM module for led1 (LED2 on the board) pwm-led1 = &pwm_led1; pwm-led2 = &pwm_led2; @@ -28,34 +29,18 @@ }; }; -/delete-node/ &cpuapp_rram; +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; -&rram_controller { - reg = < 0x5004b000 0x17d000 >; +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - erase-block-size = < 0x1000 >; - write-block-size = < 0x10 >; - reg = < 0x0 0x17d000 >; - partitions { - compatible = "fixed-partitions"; - #address-cells = < 0x1 >; - #size-cells = < 0x1 >; - slot0_partition: partition@0 { - label = "image-0"; - reg = < 0x0 0x174000 >; - }; - factory_data: partition@174000 { - label = "factory-data"; - reg = < 0x174000 0x1000 >; - }; - storage_partition: partition@175000 { - label = "storage"; - reg = < 0x175000 0x8000 >; - }; - }; - }; +&mx25r64 { + status = "okay"; }; &pwm20 { diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay index 74eb0b075b6b..53b699485b5f 100644 --- a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay @@ -5,10 +5,11 @@ */ / { - aliases { - factory-data = &factory_data; - factory-data-memory-region = &cpuapp_rram; + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + aliases { // Configure PWM module for led1 (LED2 on the board) pwm-led1 = &pwm_led1; pwm-led2 = &pwm_led2; @@ -28,34 +29,18 @@ }; }; -/delete-node/ &cpuapp_rram; +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; -&rram_controller { - reg = < 0x5004b000 0x17d000 >; +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - erase-block-size = < 0x1000 >; - write-block-size = < 0x10 >; - reg = < 0x0 0x17d000 >; - partitions { - compatible = "fixed-partitions"; - #address-cells = < 0x1 >; - #size-cells = < 0x1 >; - slot0_partition: partition@0 { - label = "image-0"; - reg = < 0x0 0x174000 >; - }; - factory_data: partition@174000 { - label = "factory-data"; - reg = < 0x174000 0x1000 >; - }; - storage_partition: partition@175000 { - label = "storage"; - reg = < 0x175000 0x8000 >; - }; - }; - }; +&mx25r64 { + status = "okay"; }; &pwm20 { diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf deleted file mode 100644 index ad5fd560f555..000000000000 --- a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Multirole is the only currently supported role by SoftDevice. -CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y - -# TODO: Workaround to be removed once external flash will be supported on nRF54L. -CONFIG_CHIP_QSPI_NOR=n - -CONFIG_FPU=n -CONFIG_PM=n -CONFIG_HWINFO_NRF=n - -CONFIG_NRF_802154_TEMPERATURE_UPDATE=n - -# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L -CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml b/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml new file mode 100644 index 000000000000..83210d02cd0b --- /dev/null +++ b/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp.yml @@ -0,0 +1,52 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0xc000 +mcuboot_pad: + address: 0xc000 + region: flash_primary + size: 0x800 +app: + address: 0xc800 + region: flash_primary + size: 0x167800 +mcuboot_primary: + address: 0xc000 + region: flash_primary + size: 0x168000 +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xc800 + region: flash_primary + size: 0x167800 +factory_data: + address: 0x174000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x175000 + region: flash_primary + size: 0x8000 +mcuboot_secondary: + address: 0x0 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: external_flash + size: 0x168000 + span: *id003 +mcuboot_secondary_pad: + region: external_flash + address: 0x0 + size: 0x800 +mcuboot_secondary_app: + region: external_flash + address: 0x800 + size: 0x167800 +external_flash: + address: 0x168000 + size: 0x698000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf index d2992aa2d8a1..d636bd686f8b 100644 --- a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -9,5 +9,19 @@ CONFIG_FPROTECT=n # TODO: Workaround, disable memory guard to avoid false faults in application after boot CONFIG_HW_STACK_PROTECTION=n -CONFIG_SPI_NOR=n CONFIG_BOOT_WATCHDOG_FEED=n + +# nRF54L15PDK uses SPI NOR external flash +CONFIG_GPIO=y +CONFIG_SPI=y +CONFIG_SPI_NOR=y +CONFIG_SPI_NOR_SFDP_DEVICETREE=y +CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 + +# required by SPI driver +CONFIG_MULTITHREADING=y + +CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y + +# Adjust the maximum sectors to the app image size of ~1.4MB +CONFIG_BOOT_MAX_IMG_SECTORS=512 diff --git a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e54f91119944 --- /dev/null +++ b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1524)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 0x40000>; +}; + +&mx25r64 { + status = "okay"; +}; diff --git a/west.yml b/west.yml index 04ae4c9879dd..759748b2922b 100644 --- a/west.yml +++ b/west.yml @@ -160,7 +160,7 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: 28ebd4379d0da0ededb933c3075992ff79589775 + revision: pull/448/head west-commands: scripts/west/west-commands.yml submodules: - name: nlio