From 6b870a4ccc28752db28f10e29124c089d7b67ac8 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Tue, 29 Oct 2024 11:25:47 +0100 Subject: [PATCH] samples: matter: Enabled DFU compression for the template sample Enabled DFU compression for the internal configuration of a template sample to save some flash for the application. Signed-off-by: Kamil Kasperczyk --- .../releases/release-notes-changelog.rst | 4 ++- samples/matter/template/README.rst | 4 +-- .../nrf54l15dk_nrf54l15_cpuapp_internal.conf | 26 ------------------- ...ic_nrf54l15dk_nrf54l15_cpuapp_internal.yml | 26 +++++++++---------- .../matter/template/sysbuild_internal.conf | 4 +++ 5 files changed, 22 insertions(+), 42 deletions(-) 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 34252a3fb285..f62a13cb41e5 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -312,7 +312,9 @@ Keys samples Matter samples -------------- -|no_changes_yet_note| +* :ref:`matter_template_sample` sample: + + * Updated the internal configuration for :ref:`zephyr:nrf54l15dk_nrf54l15` target to use the DFU image compression and provide more memory space for the application. Networking samples ------------------ diff --git a/samples/matter/template/README.rst b/samples/matter/template/README.rst index 6c90b2c18854..aea1c14f145c 100644 --- a/samples/matter/template/README.rst +++ b/samples/matter/template/README.rst @@ -135,13 +135,13 @@ Device Firmware Upgrade support Alternatively, for the nRF54L15 DK, 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 :ref:`release configuration `. +This configuration is by default available for the :ref:`debug configuration `. The following is an example command to build the sample on the nRF54L15 DK with support for Matter OTA DFU and DFU over Bluetooth® SMP, and using internal MRAM only: .. code-block:: console - west build -p -b nrf54l15dk/nrf54l15/cpuapp -- -DFILE_SUFFIX=release -DCONFIG_CHIP_DFU_OVER_BT_SMP=y -DPM_STATIC_YML_FILE=pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml -Dmcuboot_EXTRA_CONF_FILE=/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf -Dmcuboot_EXTRA_DTC_OVERLAY_FILE=/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp_internal.overlay + west build -p -b nrf54l15dk/nrf54l15/cpuapp -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y -DPM_STATIC_YML_FILE=pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml -Dmcuboot_EXTRA_CONF_FILE=/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf -Dmcuboot_EXTRA_DTC_OVERLAY_FILE=/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp_internal.overlay 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. diff --git a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf index 28743cf2e3f7..5a9bff26e66b 100644 --- a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf +++ b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf @@ -20,32 +20,6 @@ CONFIG_NVS=n # Disable SPI CONFIG_CHIP_SPI_NOR=n -# Release Configuration - -# Enable system reset on fatal error -CONFIG_RESET_ON_FATAL_ERROR=y - -# Disable all debug features -CONFIG_NCS_SAMPLE_MATTER_TEST_SHELL=n -CONFIG_CHIP_LIB_SHELL=n -CONFIG_THREAD_NAME=n -CONFIG_MPU_STACK_GUARD=n -CONFIG_CHIP_LIB_SHELL=n -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 - # Enable Watchdog CONFIG_NCS_SAMPLE_MATTER_WATCHDOG=y diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml index 98b2224f68f7..1b34a86cb297 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml @@ -1,46 +1,46 @@ mcuboot: address: 0x0 region: flash_primary - size: 0x7000 + size: 0xa000 mcuboot_pad: - address: 0x7000 + address: 0xa000 region: flash_primary size: 0x800 app: - address: 0x7800 + address: 0xa800 region: flash_primary - size: 0xb4800 + size: 0xd6800 mcuboot_primary: - address: 0x7000 + address: 0xa000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xb5000 + size: 0xd7000 span: *id001 mcuboot_primary_app: - address: 0x7800 + address: 0xa800 orig_span: &id002 - app region: flash_primary - size: 0xb4800 + size: 0xd6800 span: *id002 mcuboot_secondary: - address: 0xbc000 + address: 0xe1000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: flash_primary - size: 0xb5000 + size: 0x90000 span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xbc000 + address: 0xe1000 size: 0x800 mcuboot_secondary_app: region: flash_primary - address: 0xbc800 - size: 0xb4800 + address: 0xe1800 + size: 0x8f800 factory_data: address: 0x171000 region: flash_primary diff --git a/samples/matter/template/sysbuild_internal.conf b/samples/matter/template/sysbuild_internal.conf index 0ed79207df2d..ea4e5b8487f1 100644 --- a/samples/matter/template/sysbuild_internal.conf +++ b/samples/matter/template/sysbuild_internal.conf @@ -7,3 +7,7 @@ SB_CONFIG_MATTER=y SB_CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=n SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n + +# Enable the DFU image compression. +SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y +SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT=y