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
modules: memfault-firmware-sdk: migrate coredump from PM to devicetree
Enable support for device-tree allocated "memfault_coredump_partition"
for Memfault coredump storage.
Maintain support for PM-assigned partition.
Partition name matches what's used in the recent memfault-firmware-sdk
RRAM/MRAM backends.
Add a "memfault-coredump" snippet that supplies per-board overlays for
nRF52, nRF53, nRF91 DKs and Thingy:91 / Thingy:91 X, so users can enable
flash-backed coredumps without writing DTS boilerplate, and instructions
describing how to use the snippet or a manual overlay.
Verified with:
# Partition Manager (default)
west build -p -b nrf9160dk/nrf9160/ns samples/debug/memfault
# Devicetree (no PM) via snippet
west build -p -b nrf9160dk/nrf9160/ns -S memfault-coredump \
samples/debug/memfault
# Same on nRF52840 DK
west build -p -b nrf52840dk/nrf52840 -S memfault-coredump \
samples/debug/memfault
Note: RRAM/MRAM chips (nRF54L, nRF54H, nRF92) should use the upstream
memfault-firmware-sdk backends, so this patch only covers chips that
currently use the PM-managed internal flash backend.
Signed-off-by: Noah Pendleton <noah.pendleton@nordicsemi.no>
When the :kconfig:option:`CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP` Kconfig option is enabled, the storage region is resolved at build time using one of the following sources:
146
+
147
+
* **Partition Manager** (legacy): When :kconfig:option:`CONFIG_PARTITION_MANAGER_ENABLED` is ``y``, a ``MEMFAULT_STORAGE`` partition is generated automatically.
148
+
The size defaults to 64 kB, and you can override it with :kconfig:option:`CONFIG_PM_PARTITION_SIZE_MEMFAULT_STORAGE`.
149
+
* **Devicetree** (|NCS| v3.4.0 or later recommended): When Partition Manager is disabled, the backend locates a fixed partition labeled ``memfault_coredump_partition`` under the internal flash controller.
150
+
151
+
The easiest way to enable the devicetree path is the :ref:`snippet-memfault-coredump` snippet that supplies a board-specific overlay defining the partition:
152
+
153
+
.. code-block:: console
154
+
155
+
west build -b <board> -S memfault-coredump <application>
156
+
157
+
For boards not covered by the snippet, add a node similar to the following to your application overlay:
158
+
159
+
.. code-block:: dts
160
+
161
+
&flash0 {
162
+
partitions {
163
+
memfault_coredump_partition: partition@fc000 {
164
+
compatible = "zephyr,mapped-partition";
165
+
label = "memfault_coredump_partition";
166
+
reg = <0x000fc000 0x4000>;
167
+
};
168
+
};
169
+
};
170
+
140
171
The |NCS| integration of `Memfault SDK`_ provides default values for some metadata that is required to identify the firmware when it is sent to Memfault cloud.
141
172
You can control the defaults by using the configuration options below:
Copy file name to clipboardExpand all lines: doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -804,7 +804,11 @@ Edge Impulse integration
804
804
Memfault integration
805
805
--------------------
806
806
807
-
|no_changes_yet_note|
807
+
* Added:
808
+
809
+
* Devicetree support for the internal flash coredump backend (:kconfig:option:`CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP`).
810
+
The backend now locates its storage from a fixed partition labeled ``memfault_coredump_partition`` when Partition Manager is disabled, while continuing to support Partition Manager when enabled.
811
+
* The :ref:`snippet-memfault-coredump` snippet that supplies a board-specific partition overlay for flash-backed coredump storage on common DKs and Thingy:91 or Thingy:91 X.
If :kconfig:option:`CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP` is enabled, :kconfig:option:`CONFIG_PM_PARTITION_SIZE_MEMFAULT_STORAGE` can be used to set the flash partition size for the flash storage.
140
+
If :kconfig:option:`CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP` is enabled, you can use :kconfig:option:`CONFIG_PM_PARTITION_SIZE_MEMFAULT_STORAGE` to set the flash partition size for the flash storage when Partition Manager is in use.
141
+
142
+
When building without Partition Manager (|NCS| v3.4.0 or later), enable the :ref:`snippet-memfault-coredump` snippet to supply the coredump partition using devicetree:
143
+
144
+
.. code-block:: console
145
+
146
+
west build -b <board> -S memfault-coredump samples/debug/memfault
This snippet enables flash-backed Memfault coredump storage without requiring Partition Manager.
14
+
It sets the :kconfig:option:`CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP` Kconfig option and applies a board-specific devicetree overlay that defines a ``memfault_coredump_partition`` node within internal flash and sets the ``nordic,memfault-coredump-partition`` chosen property to point at it.
15
+
16
+
Supported boards
17
+
****************
18
+
19
+
* ``nrf52840dk/nrf52840``
20
+
* ``nrf5340dk/nrf5340/cpuapp`` and ``nrf5340dk/nrf5340/cpuapp/ns``
21
+
* ``nrf9160dk/nrf9160/ns``
22
+
* ``nrf9151dk/nrf9151/ns``
23
+
* ``nrf9161dk/nrf9161/ns``
24
+
* ``thingy91/nrf9160/ns``
25
+
* ``thingy91x/nrf9151/ns``
26
+
27
+
For other boards, add a ``zephyr,mapped-partition`` node under the internal flash controller in your overlay file and set the ``nordic,memfault-coredump-partition`` chosen property to point at it, ensuring the size is aligned to a multiple of the flash erase block (typically 4 kB).
28
+
29
+
Notes
30
+
*****
31
+
32
+
Set the :kconfig:option:`SB_CONFIG_PARTITION_MANAGER` Kconfig option to ``n`` (for example, using a ``Kconfig.sysbuild`` fragment in your application) to disable Partition Manager.
33
+
34
+
The nRF91 ``ns`` overlays redefine the full flash and modem-shared SRAM layout because disabling Partition Manager removes the TF-M and modem partition generation that the |NCS| would otherwise generate.
35
+
The layouts mirror those used by the :ref:`at_client_sample` sample.
0 commit comments