Skip to content

Commit 533f31c

Browse files
snippets: matter: Added snippet for matter debug purposes
Utilizing this snippet: - Extended log buffer size - Increased UART speed to 1M - Eabled OpenThread debug - Disabled log size optimization - Switched to log mode deferred. Signed-off-by: Arkadiusz Balys <[email protected]>
1 parent e3026d6 commit 533f31c

File tree

10 files changed

+121
-0
lines changed

10 files changed

+121
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@
693693
/snippets/sdp/ @nrfconnect/ncs-ll-ursus
694694
/snippets/hw-flow-control/ @nrfconnect/ncs-low-level-test @miha-nordic
695695
/snippets/matter-diagnostic-logs/ @nrfconnect/ncs-matter
696+
/snippets/matter-debug/ @nrfconnect/ncs-matter
696697
/snippets/nordic-bt-rpc/ @ppryga-nordic
697698
/snippets/nrf70-driver-debug/ @krish2718 @sachinthegreen
698699
/snippets/nrf70-driver-verbose-debug/ @krish2718 @sachinthegreen

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,31 @@ Example for the ``nrf52840dk/nrf52840`` board target and the :ref:`matter_lock_s
326326
:class: highlight
327327
328328
west build -b nrf52840dk/nrf52840 -- -Dlock_SNIPPET=matter-diagnostic-logs
329+
330+
.. _ug_matter_debug_snippet:
331+
332+
Debug snippet
333+
=============
334+
335+
The Matter debug snippet allows you to enable additional debug features while using Matter samples.
336+
337+
The following features are enabled when using this snippet:
338+
339+
* UART speed is increased to 1 Mbit/s.
340+
* Log buffer size is set to high value to allow showing all logs.
341+
* Deferred mode of logging.
342+
* Increased verbosity of Matter logs.
343+
* Openthread is built from sources.
344+
* Openthread shell is enabled.
345+
* Openthread logging level is set to INFO.
346+
* Full shell functionalities.
347+
* Logging source code location on VerifyOrDie failure that occurs in the Matter stack.
348+
349+
To use the snippet when building a sample, add ``-D<project_name>_SNIPPET=matter-debug`` to the west arguments list.
350+
351+
For example, for the ``nrf52840dk/nrf52840`` board target and the :ref:`matter_lock_sample` sample, use the following command:
352+
353+
.. parsed-literal::
354+
:class: highlight
355+
356+
west build -b nrf52840dk/nrf52840 -- -Dlock_SNIPPET=matter-debug

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Matter
141141
* Added a new documentation page :ref:`ug_matter_group_communication` in the :ref:`ug_matter_intro_overview`.
142142

143143
* Disabled the :ref:`mpsl` before performing factory reset to speed up the process.
144+
* Added :ref:`ug_matter_debug_snippet`.
144145

145146
Matter fork
146147
+++++++++++
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Copyright (c) 2025 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
&uart0 {
7+
current-speed = <1000000>;
8+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Copyright (c) 2025 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
&uart0 {
7+
current-speed = <1000000>;
8+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Copyright (c) 2025 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
&uart136 {
7+
current-speed = <1000000>;
8+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Copyright (c) 2025 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
&uart20 {
7+
current-speed = <1000000>;
8+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Copyright (c) 2025 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
&uart0 {
7+
current-speed = <1000000>;
8+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# Enable OpenThread debug logs
8+
CONFIG_OPENTHREAD_SOURCES=y
9+
CONFIG_OPENTHREAD_DEBUG=y
10+
CONFIG_OPENTHREAD_LOG_LEVEL_INFO=y
11+
CONFIG_OPENTHREAD_SHELL=y
12+
13+
# Deferred mode of logging
14+
CONFIG_LOG=y
15+
CONFIG_LOG_MODE_DEFERRED=y
16+
CONFIG_LOG_BUFFER_SIZE=40960
17+
CONFIG_LOG_SPEED=y
18+
CONFIG_LOG_BLOCK_IN_THREAD=y
19+
CONFIG_LOG_BLOCK_IN_THREAD_TIMEOUT_MS=50
20+
21+
# Enable shell features
22+
CONFIG_SHELL_MINIMAL=n
23+
24+
# Increase verbosity of Matter logs
25+
CONFIG_CHIP_LOG_SIZE_OPTIMIZATION=n
26+
27+
# Enable logging source code location on VerifyOrDie failure
28+
CONFIG_CHIP_LOG_VERIFY_OR_DIE=y

snippets/matter-debug/snippet.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: matter-debug
2+
append:
3+
EXTRA_CONF_FILE: matter_debug.conf
4+
5+
boards:
6+
/.*nrf52840.*/:
7+
append:
8+
EXTRA_DTC_OVERLAY_FILE: boards/nrf52840dk_nrf52840.overlay
9+
/.*nrf5340.*/:
10+
append:
11+
EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay
12+
nrf7002dk/nrf5340/cpuapp:
13+
append:
14+
EXTRA_DTC_OVERLAY_FILE: boards/nrf7002dk_nrf5340_cpuapp.overlay
15+
thingy53/nrf5340/cpuapp:
16+
append:
17+
EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay
18+
/.*nrf54l.*/:
19+
append:
20+
EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay
21+
/.*nrf54h20.*/:
22+
append:
23+
EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay

0 commit comments

Comments
 (0)