Espressif ESP32-S2 Programming Manual page 1268

Table of Contents

Advertisement

Chapter 4. API Guides
it is possible situation that user data preparation process is not completed at the moment when that chunk is read
by the host. To handle such conditions tracing module prepends all user data chunks with header which contains
allocated user buffer size (2 bytes) and length of actually written data (2 bytes). So total length of the header is 4
bytes. OpenOCD command which reads trace data reports error when it reads incomplete user data chunk, but in
any case it puts contents of the whole user chunk (including unfilled area) to output file.
Below is the description of available OpenOCD application tracing commands.
Note: Currently OpenOCD does not provide commands to send arbitrary user data to the target.
Command usage:
esp apptrace [start <options>] | [stop] | [status] | [dump <cores_num>
<outfile>]
Sub-commands:
start Start tracing (continuous streaming).
stop Stop tracing.
status Get tracing status.
dump Dump all data from (post-mortem dump).
Start command syntax:
start
<outfile>
[skip_size]]]]
outfile Path to file to save data from both CPUs. This argument should have the following format: file://
path/to/file.
poll_period Data polling period (in ms) for available trace data. If greater than 0 then command runs in non-
blocking mode. By default 1 ms.
trace_size Maximum size of data to collect (in bytes). Tracing is stopped after specified amount of data is
received. By default -1 (trace size stop trigger is disabled).
stop_tmo Idle timeout (in sec). Tracing is stopped if there is no data for specified period of time. By default -1
(disable this stop trigger). Optionally set it to value longer than longest pause between tracing commands from
target.
wait4halt If 0 start tracing immediately, otherwise command waits for the target to be halted (after reset, by
breakpoint etc.) and then automatically resumes it and starts tracing. By default 0.
skip_size Number of bytes to skip at the start. By default 0.
Note: If poll_period is 0, OpenOCD telnet command line will not be available until tracing is stopped. You
must stop it manually by resetting the board or pressing Ctrl+C in OpenOCD window (not one with the telnet session).
Another option is to set trace_size and wait until this size of data is collected. At this point tracing stops
automatically.
Command usage examples:
1. Collect 2048 bytes of tracing data to a file"trace.log". The file will be saved in"openocd-esp32"directory.
esp apptrace start file://trace.log 1 2048 5 0 0
The tracing data will be retrieved and saved in non-blocking mode. This process will stop automatically after
2048 bytes are collected, or if no data are available for more than 5 seconds.
Note: Tracing data is buffered before it is made available to OpenOCD. If you see"Data timeout!" message,
then the target is likely sending not enough data to empty the buffer to OpenOCD before expiration of time-
out. Either increase the timeout or use a function esp_apptrace_flush() to flush the data on specific
intervals.
2. Retrieve tracing data indefinitely in non-blocking mode.
Espressif Systems
[poll_period
[trace_size
1257
Submit Document Feedback
[stop_tmo
[wait4halt
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF