Skip to content

Commit 93deb64

Browse files
greg-ferrlubos
authored andcommitted
doc: tfm: generalize info about UART
Edited tfm_logging.rst page not to mention UART0 as the only peripheral that can be used for logging. NCSDK-33550. Signed-off-by: Grzegorz Ferenc <[email protected]>
1 parent c565d39 commit 93deb64

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Security
120120

121121
* Added the new section about :ref:`ug_crypto_index`.
122122
The new section includes pages about :ref:`ug_crypto_architecture` (new page) and :ref:`crypto_drivers` (moved from :ref:`nrf_security` library).
123+
* Updated the :ref:`ug_tfm_logging` page with more details about how to configure logging on the same UART instance as the application for nRF5340 and nRF91 Series devices.
123124

124125
Protocols
125126
=========

doc/nrf/security/tfm/tfm_logging.rst

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,43 @@ TF-M logging
99
:depth: 2
1010

1111
TF-M employs two UART interfaces for logging: one for the :ref:`Secure Processing Environment<app_boards_spe_nspe>` (including MCUboot and TF-M), and one for the :ref:`Non-Secure Processing Environment<app_boards_spe_nspe>` (including user application).
12-
By default, the logs arrive on different COM ports on the host PC.
1312

14-
Configuring logging
15-
*******************
13+
By default, the logs from Nordic Semiconductor's Development Kits (DKs) arrive on different COM ports on the host PC.
14+
The UART instances can vary by device family:
1615

17-
You can configure the TF-M to connect to the same UART as the application with the :kconfig:option:`CONFIG_TFM_SECURE_UART0` Kconfig option.
18-
Setting this Kconfig option makes TF-M logs visible on the application's VCOM, without manual connection.
16+
* nRF5340 and nRF91 Series: The application typically uses the UART instance ``0`` (``uart0``), and TF-M uses the UART instance ``1`` (``uart1``) by default.
17+
* nRF54L Series: The application typically uses the UART instance ``20`` (``uart20``), and TF-M uses the UART instance ``30`` (``uart30``) by default.
1918

20-
The UART instance used by the application is ``0`` by default, and the TF-M UART instance is ``1``.
21-
To change the TF-M UART instance to the same as that of the application's, use the :kconfig:option:`CONFIG_TFM_SECURE_UART0` Kconfig option.
19+
For more information about the logging in the |NCS|, see :ref:`ug_logging`.
2220

23-
When building TF-M with logging enabled, UART1 must be disabled in the non-secure application, otherwise the non-secure application will fail to run.
24-
The recommended way to do this is to copy the :file:`.overlay` file from the :ref:`tfm_hello_world` sample.
21+
Configuring logging to the same UART as the application
22+
*******************************************************
2523

2624
.. note::
27-
When the TF-M and the user application use the same UART, the TF-M disables logging after it has booted and re-enables it again only to log a fatal error.
25+
This option is not available to nRF54L Series devices.
26+
27+
For nRF5340 and nRF91 Series devices, you can configure TF-M to connect to the same UART as the application.
28+
Setting the appropriate Kconfig option makes TF-M logs automatically visible on the application's UART.
29+
30+
To configure TF-M to connect to the same UART as the application, you can use the ``CONFIG_TFM_SECURE_UART`` Kconfig options, for example :kconfig:option:`CONFIG_TFM_SECURE_UART0` for the example above.
31+
32+
When building TF-M with logging enabled, UART instance used by TF-M must be disabled in the non-secure application, otherwise the non-secure application will fail to run.
33+
The recommended way to do this is by setting it in an :file:`.overlay` file.
34+
For example, assuming TF-M uses the ``uart1`` instance and :kconfig:option:`CONFIG_TFM_SECURE_UART0` is set, you can disable TF-M's UART instance in the devicetree overlay file like this:
35+
36+
.. code-block:: dts
37+
38+
&uart1 {
39+
status = "disabled";
40+
};
41+
42+
See :ref:`zephyr:set-devicetree-overlays` in the Zephyr documentation for more information about configuring devicetree overlays and :ref:`cmake_options` in the |NCS| documentation for how to provide overlay files to the build system.
43+
44+
.. note::
45+
When TF-M and the user application use the same UART, TF-M disables logging after it has booted and re-enables it again only to log a fatal error.
2846

2947
Disabling logging
30-
=================
48+
*****************
3149

3250
To disable logging, enable the :kconfig:option:`CONFIG_TFM_LOG_LEVEL_SILENCE` option.
3351

doc/nrf/security/tfm/tfm_supported_services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ These are the main differences:
188188
* Logging:
189189

190190
* The |NCS| provides enhanced :ref:`logging capabilities <ug_tfm_logging>` with options to configure UART instances.
191-
* The |NCS| allows TF-M and the application to share the same UART for logging.
191+
For nRF5340 and nRF91 Series devices, the |NCS| allows TF-M and the application to share the same UART for logging.
192192

193193
* Security features:
194194

0 commit comments

Comments
 (0)