High Resolution Timer - Espressif ESP32-S2 Programming Manual

Table of Contents

Advertisement

Chapter 2. API Reference
esp_err_t
heap_trace_get(size_t index,
Return a raw record from the heap trace buffer.
Note It is safe to call this function while heap tracing is running, however in HEAP_TRACE_LEAK mode
record indexing may skip entries unless heap tracing is stopped first.
Return
• ESP_ERR_NOT_SUPPORTED Project was compiled without heap tracing enabled in menuconfig.
• ESP_ERR_INVALID_STATE Heap tracing was not initialised.
• ESP_ERR_INVALID_ARG Index is out of bounds for current heap trace record count.
• ESP_OK Record returned successfully.
Parameters
• index: Index (zero-based) of the record to return.
• [out] record: Record where the heap trace record will be copied.
void heap_trace_dump(void)
Dump heap trace record data to stdout.
Note It is safe to call this function while heap tracing is running, however in HEAP_TRACE_LEAK mode
the dump may skip entries unless heap tracing is stopped first.
Structures
struct heap_trace_record_t
Trace record data type. Stores information about an allocated region of memory.
Public Members
uint32_t ccount
CCOUNT of the CPU when the allocation was made. LSB (bit value 1) is the CPU number (0 or 1).
void *address
Address which was allocated.
size_t size
Size of the allocation.
void *alloced_by[CONFIG_HEAP_TRACING_STACK_DEPTH]
Call stack of the caller which allocated the memory.
void *freed_by[CONFIG_HEAP_TRACING_STACK_DEPTH]
Call stack of the caller which freed the memory (all zero if not freed.)
Macros
CONFIG_HEAP_TRACING_STACK_DEPTH
Enumerations
enum heap_trace_mode_t
Values:
HEAP_TRACE_ALL
HEAP_TRACE_LEAKS

2.6.14 High Resolution Timer

Overview
Although FreeRTOS provides software timers, these timers have a few limitations:
• Maximum resolution is equal to RTOS tick period
Espressif Systems
heap_trace_record_t
993
Submit Document Feedback
*record)
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