diff --git a/doc/nrf/security/tfm.rst b/doc/nrf/security/tfm.rst index a55d7f383d63..ea58f088f8b2 100644 --- a/doc/nrf/security/tfm.rst +++ b/doc/nrf/security/tfm.rst @@ -271,10 +271,10 @@ We will decrease the size of the (optional) ``mcuboot_pad`` partition and thus t address: 0x8000 size: 0x4000 -Analyzing TF-M partition size -============================= +Analyzing ``tfm_secure`` partition size +======================================= -The size of the TF-M partition can be analyzed from the build output. +The size of the ``tfm_secure`` partition can be analyzed from the build output. .. code-block:: console @@ -283,12 +283,26 @@ The size of the TF-M partition can be analyzed from the build output. FLASH: 31972 B 256 KB 12.20% RAM: 4804 B 88 KB 5.33% -The example above shows that the TF-M partition :kconfig:option:`CONFIG_PM_PARTITION_SIZE_TFM` is set to 256 kB and the TF-M binary uses 32 kB of the available space. -Similarly the TF-M partition :kconfig:option:`CONFIG_PM_PARTITION_SIZE_TFM_SRAM` is set to 88 kB and the TF-M binary uses 5 kB of the available space. -This information can be used to optimize the size of the TF-M partition, as long as it is within the alignment requirements explained in the previous section. +The example above shows that the ``tfm_secure`` partition :kconfig:option:`CONFIG_PM_PARTITION_SIZE_TFM` is set to 256 kB and the TF-M binary uses 32 kB of the available space. +Similarly the ``tfm_secure`` partition :kconfig:option:`CONFIG_PM_PARTITION_SIZE_TFM_SRAM` is set to 88 kB and the TF-M binary uses 5 kB of the available space. +This information can be used to optimize the size of the TF-M, as long as it is within the alignment requirements explained in the previous section. -To see more detailed information about the memory usage, refer to :ref:`tfm_build_system` documentation. -Build system offers tools like ``tfm_ram_report`` and ``tfm_rom_report`` to analyze the RAM and ROM usage in generated images. +Tools for analyzing the ``tfm_secure`` partition size +----------------------------------------------------- + +TF-M build system provides ``tfm_ram_report`` and ``tfm_rom_report`` targets for analyzing the memory usage of the TF-M partitions inside ``tfm_secure`` partition. + +With |NCS|, the following commands can be used to generate the reports: + + .. code-block:: console + + west build -p -b nrf9151dk/nrf9151/ns samples/tfm/tfm_hello_world + cd build/tfm_hello_world + ninja tfm_ram_report + ninja tfm_rom_report + +Reports can be used to analyze the memory usage of the different TF-M partitions and how changing the Kconfig options affects the memory usage. +For more information about the ``tfm_ram_report`` and ``tfm_rom_report`` targets, refer to the :ref:`tfm_build_system` documentation. .. _tfm_encrypted_its: