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
lib: nrf_modem: Create new module for modem traces
Created a new module that handles starting, stopping and forwarding of
modem traces to selected (compile time) transport.
This is created for the purpose of separating the tracing functionality
from the nrf_modem_os.c glue layer and also making future improvements
like deferred trace processing in a dedicated thread/work queue.
Fixes CIA-454.
Signed-off-by: Balaji Srinivasan <[email protected]>
Copy file name to clipboardExpand all lines: doc/nrf/libraries/modem/nrf_modem_lib.rst
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Modem library integration layer
9
9
10
10
11
11
The Modem library integration layer handles the integration of the Modem library into |NCS|.
12
-
The integration layer is constituted by the library wrapper and functionalities like socket offloading, OS abstraction, memory reservation by the Partition manager, and diagnostics.
12
+
The integration layer is constituted by the library wrapper and functionalities like socket offloading, OS abstraction, memory reservation by the Partition manager, handling modem traces, and diagnostics.
13
13
14
14
Library wrapper
15
15
***************
@@ -31,6 +31,8 @@ If your application performs an update of the nRF9160 modem firmware, you must d
31
31
The library wrapper also coordinates the shutdown operation among different parts of the application that use the Modem library.
32
32
This is done by the :c:func:`nrf_modem_lib_shutdown` function call, by waking the sleeping threads when the modem is being shut down.
33
33
34
+
When :kconfig:`CONFIG_NRF_MODEM_LIB_TRACE_ENABLED` Kconfig option is enabled, the library wrapper enables proprietary modem traces and forwards it to the `Modem trace module`_.
35
+
34
36
When using the Modem library in |NCS|, the library should be initialized and shutdown using the :c:func:`nrf_modem_lib_init` and :c:func:`nrf_modem_lib_shutdown` function calls, respectively.
35
37
36
38
Socket offloading
@@ -62,6 +64,23 @@ The behavior of the functions in the OS abstraction layer is dependent on the |N
62
64
This is relevant for functions such as :c:func:`nrf_modem_os_shm_tx_alloc`, which uses :ref:`Zephyr's Heap implementation <zephyr:heap_v2>` to dynamically allocate memory.
63
65
In this case, the characteristics of the allocations made by these functions depend on the heap implementation by Zephyr.
64
66
67
+
Modem trace module
68
+
******************
69
+
The modem trace module is implemented in :file:`nrf\\lib\\nrf_modem_lib\\nrf_modem_lib_trace.c`.
70
+
71
+
The module provides the functionality for starting, stopping, and forwarding of modem traces to a transport medium that can be set by enabling any one of the following Kconfig options:
72
+
73
+
* :kconfig:`CONFIG_NRF_MODEM_LIB_TRACE_MEDIUM_UART` to send modem traces over UARTE1
74
+
* :kconfig:`CONFIG_NRF_MODEM_LIB_TRACE_MEDIUM_RTT` to send modem traces over SEGGER RTT
75
+
76
+
When :kconfig:`CONFIG_NRF_MODEM_LIB_TRACE_ENABLED` Kconfig option is enabled, :c:func:`nrf_modem_lib_init` sends the trace memory configuration to the modem.
77
+
When this happens, the modem starts sending startup trace data.
78
+
If the application wants the trace data, :c:func:`nrf_modem_lib_trace_init` must be called before :c:func:`nrf_modem_lib_init`.
79
+
This is done automatically when using the OS Abstraction layer.
80
+
If the application wants to stop an ongoing trace session, it can use the :c:func:`nrf_modem_lib_trace_stop` function.
81
+
The :c:func:`nrf_modem_lib_trace_start` function supports activating a subset of traces or all traces.
82
+
It is also possible to use this function to run a trace session either for a specific time interval or until a given amount of trace data is received.
83
+
65
84
.. _partition_mgr_integration:
66
85
67
86
Partition manager integration
@@ -125,9 +144,13 @@ The report will be printed by a dedicated work queue that is distinct from the s
Copy file name to clipboardExpand all lines: doc/nrf/releases/release-notes-changelog.rst
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,10 @@ Modem libraries
226
226
227
227
* Can now parse AT command responses containing the response result, for example, ``OK`` or ``ERROR``.
228
228
229
+
* :ref:`nrf_modem_lib_readme`:
230
+
231
+
* The modem trace handling is moved from :file:`nrf_modem_os.c` to a new file :file:`nrf_modem_lib_trace.c`, which also provides the API for starting a trace session for a given time interval or until a given size of trace data is received.
0 commit comments