Skip to content

Commit a3d9d75

Browse files
kkasperczyk-noArekBalysNordic
authored andcommitted
doc: Added documentation about DFU compression for Matter template
* Added information about internal configuration to Matter template readme * Added section about image compression to the bootloader documentation * Modified sample.yml to build the variant for release with internal configuration * Created new partition layout description * Updated missing section about external flash partitions layout for nrf54l15 Signed-off-by: Kamil Kasperczyk <[email protected]>
1 parent 235ede3 commit a3d9d75

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed

doc/nrf/protocols/matter/end_product/bootloader.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ Downgrade protection
131131
The :ref:`downgrade protection <ug_fw_update_image_versions_mcuboot_downgrade>` mechanism makes it impossible for an attacker to trick a user to install a firmware image older than the currently installed one.
132132
The attacker might want to do this to reintroduce old security vulnerabilities that have already been fixed in newer firmware revisions.
133133
You should enable the downgrade protection mechanism if you choose to enable MCUboot's ``SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY`` Kconfig option, which disables the fallback recovery in case of a faulty upgrade.
134+
135+
.. _ug_matter_device_bootloader_image_compression:
136+
137+
Image compression
138+
*****************
139+
140+
The :ref:`MCUboot image compression <mcuboot_image_compression>` feature allows you to reduce the size of the firmware image that is being installed.
141+
This is done by compressing the image before it is written to the secondary slot.
142+
143+
Thanks to the compression, the secondary slot can be smaller than the primary one.
144+
This is especially useful when you do not want to use external flash for the secondary slot, and you need to place the new image in the internal memory.
145+
146+
You can enable this feature by setting the following Kconfig options in your application's sysbuild configuration file:
147+
148+
* :kconfig:option:`SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY` to ``y``
149+
* :kconfig:option:`SB_CONFIG_MCUBOOT_COMPRESSED_IMAGE_SUPPORT` to ``y``
150+
151+
If your application has used external flash for the secondary slot and you want to stop using it, disable the following Kconfig options in your application's sysbuild configuration file:
152+
153+
* :kconfig:option:`SB_CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK` to ``n``
154+
* :kconfig:option:`SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY` to ``n``

doc/nrf/protocols/matter/getting_started/hw_requirements.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,50 @@ For more information about configuration of memory layouts in Matter, see :ref:`
668668
| Static RAM (sram_primary) | 0kB (0x0) | 256kB (0x40000) |- |- |- |
669669
+-----------------------------------------------+---------------------+-------------------+---------------------+-----------------+-----------------+
670670

671+
External flash (size: 0x800000 = 8192kB)
672+
+-----------------------------------------+------------------+-------------------+---------------------+-----------------+-----------------+
673+
| Partition | Offset | Size | Partition elements | Element offset | Element size |
674+
+=========================================+==================+===================+=====================+=================+=================+
675+
| Application DFU (mcuboot_secondary) | 0kB (0x0) | 1428kB (0x165000) |- |- |- |
676+
+-----------------------------------------+------------------+-------------------+---------------------+-----------------+-----------------+
677+
| Free space (external_flash) | 1428kB (0x165000)| 6764kB (0x69B000) |- |- |- |
678+
+-----------------------------------------+------------------+-------------------+---------------------+-----------------+-----------------+
679+
680+
.. tab:: nRF54L15 DK with internal memory only
681+
682+
The following memory map is valid for Matter applications running on the :ref:`nRF54L15 DK <programming_board_names>` (:ref:`nrf54l15dk/nrf54l15/cpuapp <zephyr:nrf54l15dk_nrf54l15>`).
683+
You can use this DK with any application.
684+
However, it is currently integrated only by the :ref:`Matter Template sample <matter_template_sample>`.
685+
686+
Application core flash (size: 0x17D000 = 1524kB)
687+
688+
+-----------------------------------------+---------------------+-------------------+-----------------------+-----------------+-------------------+
689+
| Partition | Offset | Size | Partition elements | Element offset | Element size |
690+
+=========================================+=====================+===================+=======================+=================+===================+
691+
| Bootloader (mcuboot) | 0kB (0x0) | 52kB (0xD000) |- |- |- |
692+
+-----------------------------------------+---------------------+-------------------+-----------------------+-----------------+-------------------+
693+
| Application (mcuboot_primary/app) | 52kB (0xD000) | 864kB (0xD8000) | mcuboot_pad | 52kB (0xD000) | 2048B (0x800) |
694+
| | | +-----------------------+-----------------+-------------------+
695+
| | | | mcuboot_primary_app | 54kB (0xD800) | 862kB (0xD7800) |
696+
+-----------------------------------------+---------------------+-------------------+-----------------------+-----------------+-------------------+
697+
| Application DFU (mcuboot_secondary) | 916kB (0xE5000) | 564kB (0x8D000) | mcuboot_secondary_pad | 916kB (0xE5000) | 2048B (0x800) |
698+
| | | +-----------------------+-----------------+-------------------+
699+
| | | | mcuboot_secondary_app | 918kB (0xE5800) | 562kB (0x8C800) |
700+
+-----------------------------------------+---------------------+-------------------+-----------------------+-----------------+-------------------+
701+
| Factory data (factory_data) | 1480kB (0xE5000) | 4kB (0x1000) |- |- |- |
702+
+-----------------------------------------+---------------------+-------------------+-----------------------+-----------------+-------------------+
703+
| Non-volatile storage (settings_storage) | 1484kB (0x173000) | 40kB (0xA000) |- |- |- |
704+
+-----------------------------------------+---------------------+-------------------+-----------------------+-----------------+-------------------+
705+
706+
Application core SRAM primary (size: 0x40000 = 256kB)
707+
SRAM is located at the address ``0x20000000`` in the memory address space of the application.
708+
709+
+-----------------------------------------------+---------------------+-------------------+---------------------+-----------------+-----------------+
710+
| Partition | Offset | Size | Partition elements | Element offset | Element size |
711+
+===============================================+=====================+===================+=====================+=================+=================+
712+
| Static RAM (sram_primary) | 0kB (0x0) | 256kB (0x40000) |- |- |- |
713+
+-----------------------------------------------+---------------------+-------------------+---------------------+-----------------+-----------------+
714+
671715
.. tab:: nRF54L15 DK with TF-M
672716

673717
The following table lists memory requirements for samples running on the :ref:`nRF54L15 DK with CMSE enabled <app_boards_spe_nspe_cpuapp_ns>` (:ref:`nrf54l15dk/nrf54l15/cpuapp/ns <zephyr:nrf54l15dk_nrf54l15>`).

samples/matter/template/README.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,32 @@ For example:
130130

131131
.. include:: /includes/advanced_conf_matter.txt
132132

133+
Matter template using only internal memory
134+
==========================================
135+
136+
For the nRF54L15 DK, you can configure the sample to use only the internal RRAM for storage.
137+
It applies to the DFU as well, which means that both the currently running firmware and the new firmware to be updated will be stored within the device's internal RRAM memory.
138+
See the Device Firmware Upgrade support section above for information about the DFU process.
139+
140+
The DFU image can fit in the internal flash memory thanks to the usage of :ref:`MCUboot image compression<ug_matter_device_bootloader_image_compression>`.
141+
142+
This configuration is disabled by default for the Matter template sample.
143+
To enable it, set the ``FILE_SUFFIX`` CMake option to ``internal``.
144+
145+
The following is an example command to build the sample for the nRF54L15 DK with support for Matter OTA DFU and DFU over Bluetooth SMP, and using internal RRAM only:
146+
147+
.. code-block:: console
148+
149+
west build -p -b nrf54l15dk/nrf54l15/cpuapp -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y -DFILE_SUFFIX=internal
150+
151+
To build the sample for the same purpose, but in the ``release`` configuration, use the following command:
152+
153+
.. code-block:: console
154+
155+
west build -p -b nrf54l15dk/nrf54l15/cpuapp -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y -DFILE_SUFFIX=internal -Dtemplate_EXTRA_CONF_FILE=prj_release.conf
156+
157+
In this case, the size of the MCUboot secondary partition used for storing the new application image is approximately 30%-40% smaller than it would be when using a configuration with external flash memory support.
158+
133159
User interface
134160
**************
135161

samples/matter/template/sample.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,27 @@ tests:
7070
tags:
7171
- sysbuild
7272
- ci_samples_matter
73+
sample.matter.template.release.internal:
74+
sysbuild: true
75+
build_only: true
76+
extra_args:
77+
- FILE_SUFFIX=internal
78+
- CONFIG_NCS_SAMPLE_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS=y
79+
- template_EXTRA_CONF_FILE=prj_release.conf
80+
integration_platforms:
81+
- nrf54l15dk/nrf54l15/cpuapp
82+
platform_allow: nrf54l15dk/nrf54l15/cpuapp
83+
tags:
84+
- sysbuild
85+
- ci_samples_matter
7386
sample.matter.template.release.internal.smp_dfu:
7487
sysbuild: true
7588
build_only: true
7689
extra_args:
7790
- FILE_SUFFIX=internal
7891
- CONFIG_CHIP_DFU_OVER_BT_SMP=y
7992
- CONFIG_NCS_SAMPLE_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS=y
93+
- template_EXTRA_CONF_FILE=prj_release.conf
8094
integration_platforms:
8195
- nrf54l15dk/nrf54l15/cpuapp
8296
platform_allow: nrf54l15dk/nrf54l15/cpuapp

0 commit comments

Comments
 (0)