You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edited the structure of bootloader_partitioning page to mention
memory reports of the VSC extension alongside partition_manager_report.
Fixed some formatting and structure issues and typos.
VSC-2712.
Signed-off-by: Grzegorz Ferenc <[email protected]>
(cherry picked from commit a3a1f46)
Copy file name to clipboardExpand all lines: doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_partitioning.rst
+54-16Lines changed: 54 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,48 @@ Partitioning device memory is a crucial aspect of managing how a device's storag
11
11
By default, the Partition Manager in the system dynamically generates a partition map, which is suitable for most applications that do not use Device Firmware Upgrades (DFU).
12
12
For scenarios involving DFU, read the following sections.
13
13
14
+
.. _bootloader_partitioning_partitions_file:
15
+
16
+
Partition map file
17
+
******************
18
+
19
+
After you enable the Partition Manager, it will :ref:`start generating <pm_build_system>` the :file:`partitions.yml` file in the build folder directory.
20
+
In this file, you will see detailed information about the memory layout used for the build.
21
+
22
+
The :file:`partitions.yml` file is present also if the Partition Manager generates the partition map dynamically.
23
+
You can use this file as a base for your static partition map.
After building the application, you can print a report of how the partitioning has been handled for a bootloader, or combination of bootloaders, by using partition memory reports.
31
+
32
+
Depending on your development environment, you can use one of the following options:
33
+
34
+
.. tabs::
35
+
36
+
.. group-tab:: nRF Connect for VS Code
37
+
38
+
Use the extension's `Memory report`_ feature, which shows the size and percentage of memory that each symbol uses on your device for RAM, ROM, and partitions.
39
+
Click the :guilabel:`Memory report` button in the :guilabel:`Actions View` to generate the report.
40
+
The partition map is available in the :guilabel:`Partitions` tab.
41
+
42
+
Alternatively, you can also use the `Memory Explorer <How to work with the Memory Explorer_>`_ feature of the extension's nRF Debug to check memory sections for the partitions.
43
+
This feature requires `enabling debugging in the build configuration <How to debug_>`_ and providing the partition addresses manually.
44
+
45
+
.. group-tab:: Command line
46
+
47
+
Use the Partition Manager's :ref:`pm_partition_reports` feature.
48
+
Run the following command:
49
+
50
+
.. code-block:: console
51
+
52
+
west build -t partition_manager_report
53
+
54
+
This command generates an output in ASCII with the addresses and sizes of each partition.
55
+
14
56
.. _ug_bootloader_flash_static_requirement:
15
57
16
58
Static partition requirement for DFU
@@ -22,13 +64,6 @@ This is important also when you use a precompiled HEX file as a child image (sub
22
64
In such cases, the newly generated application images may no longer use a partition map that is compatible with the partition map used by the bootloader.
23
65
As a result, the newly built application image may not be bootable by the bootloader.
24
66
25
-
.. note::
26
-
For detailed information about the memory layout used for the build, see the partition configuration in the :file:`partitions.yml` file, located in the build folder directory, or run ``ninja partition_manager_report``.
27
-
You must enable the Partition Manager to make the :file:`partitions.yml` file and the ``partition_manager_report`` target available.
28
-
29
-
The :file:`partitions.yml` file is present also if the Partition Manager generates the partition map dynamically.
30
-
You can use this file as a base for your static partition map.
31
-
32
67
The memory partitions that must be defined in the static partition map depend on the selected bootloader chain.
33
68
For details, see :ref:`ug_bootloader_flash`.
34
69
@@ -39,7 +74,7 @@ Flash memory partitions
39
74
40
75
Each bootloader handles flash memory partitioning differently.
41
76
42
-
After building the application, you can print a report of how the flash partitioning has been handled for a bootloader, or combination of bootloaders, by using :ref:`pm_partition_reports`.
77
+
After building the application, you can print a report of how the flash partitioning has been handled for a bootloader, or combination of bootloaders, by using :ref:`bootloader_partitioning_partitions_file_report`.
43
78
44
79
.. _ug_bootloader_flash_b0:
45
80
@@ -64,7 +99,7 @@ This is particularly useful in memory-constrained devices to avoid providing spa
64
99
See the *Image Slots* section in the :doc:`MCUboot documentation <mcuboot:design>` for more information.
65
100
66
101
The |NCS| variant of MCUboot uses the :ref:`partition_manager` to configure the flash memory partitions for these image slots.
67
-
In the default configuration, defined in :file:`bootloader/mcuboot/boot/zephyr/pm.yml`, the partition manager dynamically sets up the partitions as required for MCUboot.
102
+
In the default configuration, defined in :file:`bootloader/mcuboot/boot/zephyr/pm.yml`, the Partition Manager dynamically sets up the partitions as required for MCUboot.
68
103
For example, the partition layout for :file:`zephyr/samples/hello_world` using MCUboot on the ``nrf52840dk`` board would look like the following:
69
104
70
105
.. code-block:: console
@@ -82,16 +117,11 @@ For example, the partition layout for :file:`zephyr/samples/hello_world` using M
82
117
You can also store secondary slot images in external flash memory when using MCUboot.
83
118
See :ref:`ug_bootloader_external_flash` for more information.
84
119
85
-
86
120
.. _ug_bootloader_external_flash:
87
121
88
122
Using external flash memory partitions
89
123
**************************************
90
124
91
-
.. contents::
92
-
:local:
93
-
:depth: 2
94
-
95
125
When using MCUboot, you can store the storage partition for the secondary slot in the external flash memory, using a driver for the external flash memory that supports the following features:
96
126
97
127
* Single-byte read and write.
@@ -112,7 +142,7 @@ To enable external flash with MCUboot, complete the following steps:
112
142
113
143
.. note::
114
144
115
-
The :ref:`partition_manager` will only support run-time access to flash partitions defined in regions placed on external flash devices that have drivers compiled in.
145
+
The Partition Manager will only support run-time access to flash partitions defined in regions placed on external flash devices that have drivers compiled in.
116
146
The Partition Manager cannot determine which partitions will be used at runtime, but only those that have drivers enabled, and those are included into the partition map.
117
147
Lack of partition access will cause MCUboot to fail at runtime.
118
148
For more details on configuring and enabling access to external flash devices, see :ref:`pm_external_flash`.
@@ -126,6 +156,11 @@ See also :ref:`ug_multi_image_variables` for more details on how to pass configu
126
156
Troubleshooting
127
157
***************
128
158
159
+
This section describes some of the issues you might come across when partitioning device memory.
160
+
161
+
MCUboot failure
162
+
===============
163
+
129
164
MCUboot could fail, reporting the following error:
130
165
131
166
.. code-block:: console
@@ -139,7 +174,7 @@ MCUboot could fail, reporting the following error:
139
174
140
175
This error could be caused by the following issues:
141
176
142
-
* The external flash driver for the application image partitions used by MCUboot is not enabled or an incorrect Kconfig option has been given to the ``DEFAULT_DRIVER_KCONFIG`` of the partition manager external region definition.
177
+
* The external flash driver for the application image partitions used by MCUboot is not enabled or an incorrect Kconfig option has been given to the ``DEFAULT_DRIVER_KCONFIG`` of the Partition Manager external region definition.
143
178
See :ref:`pm_external_flash` for details.
144
179
145
180
* An out-of-tree external flash driver is not selecting :kconfig:option:`CONFIG_PM_EXTERNAL_FLASH_HAS_DRIVER`, resulting in partitions for images located in the external flash memory being not accessible.
@@ -148,6 +183,9 @@ This error could be caused by the following issues:
148
183
* Insufficient value set for the ``CONFIG_BOOT_MAX_IMG_SECTORS`` Kconfig option, as MCUboot typically increases slot sizes when external flash is enabled.
149
184
See `MCUboot's Kconfig options used in Zephyr <https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/Kconfig#L370>`_ for details.
150
185
186
+
Compilation failure
187
+
===================
188
+
151
189
The compilation could fail, reporting a linker error similar to following:
.. _`How to debug`: https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/debug_use.html
875
875
.. _`How to debug applications for a multi-core System on Chip`: https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/debug_use.html#how-to-debug-applications-for-a-multi-core-system-on-chip
876
+
.. _`How to work with the Memory Explorer`: https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/debug_mem_explorer.html
876
877
.. _`source control with west`: https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/west_about.html
Copy file name to clipboardExpand all lines: scripts/partition_manager/partition_manager.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -565,8 +565,6 @@ After the ``nordic,pm-ext-flash`` value is set, you can place partitions in the
565
565
566
566
See :ref:`ug_bootloader_external_flash` for more details on using external flash memory with MCUboot.
567
567
568
-
.. _pm_build_system:
569
-
570
568
A partition can be accessible at runtime only if the flash device where it resides has its driver enabled at compile time.
571
569
Partition manager ignores partitions that are located in a region without its driver enabled.
572
570
To let partition manager know which Kconfig option ensures the existence of the driver, the option ``DEFAULT_DRIVER_KCONFIG`` is used.
@@ -592,6 +590,8 @@ As partition manager does not know if partitions are used at runtime, consider t
592
590
When using an application configured with an MCUboot child image, both images use the same partition manager configuration, which means that the app and MCUboot have exactly the same partition maps.
593
591
The accessibility at runtime of flash partitions depends on the configurations of both the application and MCUboot and the values they give to the ``DEFAULT_DRIVER_KCONFIG`` option of the partition manager region specification.
0 commit comments