1Tracealyzer Stream Port for TCP/IP (lwIP example)
2Percepio AB
3www.percepio.com
4-------------------------------------------------
5
6This directory contains a "stream port" for the Tracealyzer recorder library,
7i.e., the specific code needed to use a particular interface for streaming a
8Tracealyzer RTOS trace. The stream port is defined by a set of macros in
9trcStreamingPort.h, found in the "include" directory.
10
11This particular stream port targets TCP/IP. This example assumes lwIP but is
12easy to modify for other TCP/IP stacks.
13
14Instructions:
15
161. Integrate the trace recorder and configure it for streaming, as described
17   in the Tracealyzer User Manual. For FreeRTOS this is found at:
18   https://percepio.com/docs/FreeRTOS/manual/index.html#Creating_and_Loading_Traces___Introduction
19
202. Make sure all .c and .h files from this stream port folder is included in
21   your build, and that no other variant of trcStreamingPort.h is included.
22
233. In lwipopts.h, make sure you have this line:
24
25   #define LWIP_SOCKET 1
26
274. Make sure that vTraceEnable(TRC_INIT) is called during the startup, before
28   any RTOS calls are made.
29
305. In Tracealyzer, open File -> Settings -> PSF Streaming Settings and
31   select Target Connection: TCP. Enter the IP address of the target system
32   and the port number (by default 12000).
33
346. Start your target system, wait a few seconds to ensure that the lwIP is operational,
35   then select Start Recording in Tracealyzer.
36
37Troubleshooting:
38
39- If the tracing suddenly stops, check the "errno" value in trcSocketSend (trcStreamingPort.c).
40You can see the error code definitions in lwip/errno.h. If errno is ENOMEM, may you need to
41increase MEM_SIZE in lwipopts.h.
42
43- Since lwIP performs a lot of semaphore and mutex operations, we recommend filtering out
44such events from the trace, at least those caused by the transmission of trace data in the
45TzCtrl task. This can be done using vTraceSetFilterGroup() and vTraceSetFilterMask().
46
47Note that lwIP is not included in the stream port, but assumed to exist in the project already.
48
49See also http://percepio.com/2016/10/05/rtos-tracing.
50