Skip to content

Commit

Permalink
samples: matter: Enabled DFU compression for the template sample
Browse files Browse the repository at this point in the history
Enabled DFU compression for the internal configuration
of a template sample to save some flash for the application.

Signed-off-by: Kamil Kasperczyk <[email protected]>
  • Loading branch information
kkasperczyk-no committed Nov 15, 2024
1 parent 1f06433 commit 6b870a4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------
Expand Down
4 changes: 2 additions & 2 deletions samples/matter/template/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <matter_template_custom_configs>`.
This configuration is by default available for the :ref:`debug configuration <matter_template_custom_configs>`.

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=<absolute_path_to_the_template_sample>/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf -Dmcuboot_EXTRA_DTC_OVERLAY_FILE=<absolute_path_to_the_template_sample>/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=<absolute_path_to_the_template_sample>/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf -Dmcuboot_EXTRA_DTC_OVERLAY_FILE=<absolute_path_to_the_template_sample>/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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions samples/matter/template/sysbuild_internal.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6b870a4

Please sign in to comment.