README.rst
1.. zephyr:code-sample:: coresight_stm_sample
2 :name: Coresight STM benchmark
3 :relevant-api: log_api
4
5Overview
6********
7
8This sample presents how to enable STM logging on nRF54H20 platform.
9
10Also, it prints timing for different log messages.
11Thus, performance of different loggers can be compared.
12
13There are three sample configurations in the :file:`sample.yaml`.
14
15* **sample.boards.nrf.coresight_stm.local_uart**
16
17 This configuration doesn't use STM.
18 Logs are printed on local console.
19
20* **sample.boards.nrf.coresight_stm**
21
22 This configuration use STM.
23 Application, Radio, PPR and FLPR cores send logs to an ETR buffer.
24 Proxy (Application core) gets logs from the ETR buffer, decodes STPv2 data
25 and prints human readable logs on UART.
26
27* **sample.boards.nrf.coresight_stm.dict**
28
29 This sample uses STM logging in dictionary mode.
30 Application, Radio, PPR and FLPR cores send logs to the ETR buffer.
31 Proxy (Application core) forwards data from the ETR to the host using UART.
32 Host tool is needed to decode the logs.
33
34Requirements
35************
36
37This application uses nRF54H20 DK board for the demo.
38
39**sample.boards.nrf.coresight_stm.dict** requires host tool like ``nrfutil trace``
40to decode the traces.
41
42Building and running
43********************
44
45To build the sample, use configuration setups from the :file:`sample.yaml` using the ``-T`` option.
46See the example:
47
48nRF54H20 DK
49
50 .. code-block:: console
51
52 west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.boards.nrf.coresight_stm .
53
54Sample Output
55=============
56
57.. code-block:: console
58
59 *** Using Zephyr OS v3.6.99-5bb7bb0af17c ***
60 (...)
61 [00:00:00.227,264] <inf> app/app: test with one argument 100
62 [00:00:00.227,265] <inf> app/app: test with one argument 100
63 (...)
64 [00:00:00.585,558] <inf> rad/app: test with one argument 100
65 [00:00:00.585,569] <inf> rad/app: test with one argument 100
66 (...)
67 [00:00:00.624,408] <inf> ppr/app: test with one argument 100
68 [00:00:00.624,433] <inf> ppr/app: test with one argument 100
69 (...)
70 [00:00:00.625,249] <inf> flpr/app: test with one argument 100
71 [00:00:00.625,251] <inf> flpr/app: test with one argument 100
72 (...)
73 rad: Timing for log message with 0 arguments: 5.10us
74 rad: Timing for log message with 1 argument: 6.10us
75 rad: Timing for log message with 2 arguments: 6.0us
76 rad: Timing for log message with 3 arguments: 6.40us
77 rad: Timing for log_message with string: 7.10us
78 rad: Timing for tracepoint: 0.5us
79 rad: Timing for tracepoint_d32: 0.5us
80 flpr: Timing for log message with 0 arguments: 1.20us
81 flpr: Timing for log message with 1 argument: 1.20us
82 flpr: Timing for log message with 2 arguments: 1.20us
83 flpr: Timing for log message with 3 arguments: 1.30us
84 flpr: Timing for log_message with string: 3.0us
85 flpr: Timing for tracepoint: 0.0us
86 flpr: Timing for tracepoint_d32: 0.0us
87 app: Timing for log message with 0 arguments: 1.80us
88 app: Timing for log message with 1 argument: 2.0us
89 app: Timing for log message with 2 arguments: 2.0us
90 app: Timing for log message with 3 arguments: 2.10us
91 app: Timing for log_message with string: 4.40us
92 app: Timing for tracepoint: 0.10us
93 app: Timing for tracepoint_d32: 0.10us
94 ppr: Timing for log message with 0 arguments: 25.20us
95 ppr: Timing for log message with 1 argument: 26.20us
96 ppr: Timing for log message with 2 arguments: 26.90us
97 ppr: Timing for log message with 3 arguments: 27.40us
98 ppr: Timing for log_message with string: 64.80us
99 ppr: Timing for tracepoint: 0.30us
100 ppr: Timing for tracepoint_d32: 0.25us
101
102For logging on NRF54H20 using ARM Coresight STM see :ref:`logging_cs_stm`.
103