Skip to content

Commit

Permalink
[nrf fromlist] samples: boards: nordic: coresight_stm: Test STM dicti…
Browse files Browse the repository at this point in the history
…onary mode

Extend STM logger test.
Use nrfutil trace to decode STM logs in dictionary mode.

Upstream PR: zephyrproject-rtos/zephyr#78947

Signed-off-by: Sebastian Głąb <[email protected]>
  • Loading branch information
nordic-segl committed Sep 30, 2024
1 parent ce408aa commit 74a299a
Show file tree
Hide file tree
Showing 3 changed files with 440 additions and 24 deletions.
224 changes: 224 additions & 0 deletions samples/boards/nrf/coresight_stm/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
.. _nrf-coresight-stm-sample:

Coresight STM demo
##################

Overview
********

This sample presents how to enable STM logging on nRF54H20 platform.
Also, it prints timing for different log messages.
Thus, performance of different loggers can be compared.

Sample has three configurations:
#. 'sample.boards.nrf.coresight_stm.local_uart'
This configuration doesn't use STM. Logs are printed on local console.
#. 'sample.boards.nrf.coresight_stm'
This configuration use STM. Application and Radio cores send logs to ETR buffer.
Proxy (Application core) gets logs from the ETR buffer, decodes STPv2 data
and prints human readable logs on UART.
#. 'sample.boards.nrf.coresight_stm.dict'
This sample uses STM logging in dictionary mode. Application and Radio cores
send logs to ETR buffer. Proxy (Application core) forwards data from ETR to
the host using UART. Host tool is needed to decode the logs.

Requirements
************

This application uses nRF54H20 DK board for the demo.

Building and running
********************

To build the sample, use configuration setups from :file:`sample.yaml` using the ``-T`` option.
See the following examples:

nRF54H20 DK
You can build the test for application and radio cores as follows:

.. code-block:: console
west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.boards.nrf.coresight_stm .
Sample Output
=============

.. code-block:: console
*** Using Zephyr OS v3.6.99-5bb7bb0af17c ***
[00:00:00.385,817] <inf> rad/app: test with one argument 100
[00:00:00.385,827] <inf> rad/app: test with one argument 100
[00:00:00.385,832] <inf> rad/app: test with one argument 100
[00:00:00.385,836] <inf> rad/app: test with one argument 100
[00:00:00.385,841] <inf> rad/app: test with one argument 100
[00:00:00.385,846] <inf> rad/app: test with one argument 100
[00:00:00.385,851] <inf> rad/app: test with one argument 100
[00:00:00.385,856] <inf> rad/app: test with one argument 100
[00:00:00.385,860] <inf> rad/app: test with one argument 100
[00:00:00.385,865] <inf> rad/app: test with one argument 100
[00:00:00.424,091] <inf> app/app: test with one argument 100
[00:00:00.424,094] <inf> app/app: test with one argument 100
[00:00:00.424,096] <inf> app/app: test with one argument 100
[00:00:00.424,097] <inf> app/app: test with one argument 100
[00:00:00.424,099] <inf> app/app: test with one argument 100
[00:00:00.424,100] <inf> app/app: test with one argument 100
[00:00:00.424,102] <inf> app/app: test with one argument 100
[00:00:00.424,104] <inf> app/app: test with one argument 100
[00:00:00.424,105] <inf> app/app: test with one argument 100
[00:00:00.424,108] <inf> app/app: test with one argument 100
[00:00:00.585,056] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,065] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,070] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,075] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,080] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,086] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,091] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,096] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,100] <inf> rad/app: test with two arguments 100 10
[00:00:00.585,105] <inf> rad/app: test with two arguments 100 10
[00:00:00.623,262] <inf> app/app: test with two arguments 100 10
[00:00:00.623,265] <inf> app/app: test with two arguments 100 10
[00:00:00.623,267] <inf> app/app: test with two arguments 100 10
[00:00:00.623,268] <inf> app/app: test with two arguments 100 10
[00:00:00.623,272] <inf> app/app: test with two arguments 100 10
[00:00:00.623,273] <inf> app/app: test with two arguments 100 10
[00:00:00.623,275] <inf> app/app: test with two arguments 100 10
[00:00:00.623,276] <inf> app/app: test with two arguments 100 10
[00:00:00.623,278] <inf> app/app: test with two arguments 100 10
[00:00:00.623,280] <inf> app/app: test with two arguments 100 10
[00:00:00.784,382] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,392] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,398] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,403] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,409] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,414] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,419] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,425] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,430] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.784,436] <inf> rad/app: test with three arguments 100 10 1
[00:00:00.822,484] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,488] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,489] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,491] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,492] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,494] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,497] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,499] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,500] <inf> app/app: test with three arguments 100 10 1
[00:00:00.822,502] <inf> app/app: test with three arguments 100 10 1
[00:00:00.983,660] <inf> rad/app: test with string test string
[00:00:00.983,673] <inf> rad/app: test with string test string
[00:00:00.983,678] <inf> rad/app: test with string test string
[00:00:00.983,684] <inf> rad/app: test with string test string
[00:00:00.983,691] <inf> rad/app: test with string test string
[00:00:00.983,697] <inf> rad/app: test with string test string
[00:00:00.983,702] <inf> rad/app: test with string test string
[00:00:00.983,708] <inf> rad/app: test with string test string
[00:00:00.983,715] <inf> rad/app: test with string test string
[00:00:00.983,720] <inf> rad/app: test with string test string
[00:00:01.021,668] <inf> app/app: test with string test string
[00:00:01.021,678] <inf> app/app: test with string test string
[00:00:01.021,681] <inf> app/app: test with string test string
[00:00:01.021,684] <inf> app/app: test with string test string
[00:00:01.021,688] <inf> app/app: test with string test string
[00:00:01.021,692] <inf> app/app: test with string test string
[00:00:01.021,696] <inf> app/app: test with string test string
[00:00:01.021,699] <inf> app/app: test with string test string
[00:00:01.021,702] <inf> app/app: test with string test string
[00:00:01.021,707] <inf> app/app: test with string test string
[00:00:01.182,876] rad/tp: 5
[00:00:01.182,876] rad/tp: 5
[00:00:01.182,876] rad/tp: 5
[00:00:01.182,876] rad/tp: 5
[00:00:01.182,876] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.182,878] rad/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,788] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.220,790] app/tp: 5
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,048] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.382,049] rad/tp: 6 0000000a
[00:00:01.419,950] app/tp: 6 0000000a
[00:00:01.419,950] app/tp: 6 0000000a
[00:00:01.419,950] app/tp: 6 0000000a
[00:00:01.419,950] app/tp: 6 0000000a
[00:00:01.419,950] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
[00:00:01.419,952] app/tp: 6 0000000a
rad: Timing for log message with 0 arguments: 6.60us
rad: Timing for log message with 1 argument: 5.80us
rad: Timing for log message with 2 arguments: 6.0us
rad: Timing for log message with 3 arguments: 6.40us
rad: Timing for log_message with string: 7.10us
rad: Timing for tracepoint: 0.5us
rad: Timing for tracepoint_d32: 0.5us
app: Timing for log message with 0 arguments: 3.20us
app: Timing for log message with 1 argument: 2.10us
app: Timing for log message with 2 arguments: 2.10us
app: Timing for log message with 3 arguments: 2.0us
app: Timing for log_message with string: 4.50us
app: Timing for tracepoint: 0.10us
app: Timing for tracepoint_d32: 0.10us
See OS Services » Logging » Multi-domain logging using ARM Coresight STM` for details.
Loading

0 comments on commit 74a299a

Please sign in to comment.