Percepio Trace Recorder v4.11.0
Loading...
Searching...
No Matches
trcDefines.h
1/*
2 * Trace Recorder for Tracealyzer v4.11.0
3 * Copyright 2025 Percepio AB
4 * www.percepio.com
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 *
8 * Some common defines for the trace recorder.
9 */
10
11#ifndef TRC_DEFINES_H
12#define TRC_DEFINES_H
13
14#define TRC_SUCCESS ((traceResult)0)
15#define TRC_FAIL ((traceResult)1)
16
17#define TRC_FREE_RUNNING_32BIT_INCR 1
18#define TRC_FREE_RUNNING_32BIT_DECR 2
19#define TRC_OS_TIMER_INCR 3
20#define TRC_OS_TIMER_DECR 4
21#define TRC_CUSTOM_TIMER_INCR 5
22#define TRC_CUSTOM_TIMER_DECR 6
23
24#define TRC_STATE_IN_STARTUP 0
25#define TRC_STATE_IN_TASKSWITCH 1
26#define TRC_STATE_IN_APPLICATION 2
27
28/* Start options for vTraceEnable. */
29#define TRC_START_FROM_HOST 0UL
30#define TRC_START 1UL
31#define TRC_START_AWAIT_HOST 2UL
32
33#define TRC_ACKNOWLEDGED (0xABC99123)
34
35/* Command codes for TzCtrl task */
36#define CMD_SET_ACTIVE 1 /* Start (param1 = 1) or Stop (param1 = 0) */
37
38/* The final command code, used to validate commands. */
39#define CMD_LAST_COMMAND 1
40
41#define TRC_RECORDER_BUFFER_ALLOCATION_STATIC (0x00UL)
42#define TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC (0x01UL)
43#define TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM (0x02UL)
44
45#define TRC_OPTION_BIT_SHIFT_IRQ_ORDER 0
46#define TRC_OPTION_BIT_SHIFT_BASE_SIZE 8
47
48/******************************************************************************/
49/*** ERROR AND WARNING CODES (check using xTraceErrorGetLast) *****************/
50/******************************************************************************/
51
52#define TRC_ERROR_NONE 0x00UL
53
54#define TRC_ERROR_ASSERT 0x01UL
55#define TRC_ERROR_EVENT_CODE_TOO_LARGE 0x02UL
56#define TRC_ERROR_ISR_NESTING_OVERFLOW 0x03UL
57#define TRC_ERROR_DWT_NOT_SUPPORTED 0x04UL
58#define TRC_ERROR_DWT_CYCCNT_NOT_SUPPORTED 0x05UL
59#define TRC_ERROR_TZCTRLTASK_NOT_CREATED 0x06UL
60#define TRC_ERROR_STREAM_PORT_WRITE 0x07UL
61
62#define TRC_WARNING_ENTRY_TABLE_SLOTS 0x08UL
63#define TRC_WARNING_ENTRY_SYMBOL_MAX_LENGTH 0x09UL
64#define TRC_WARNING_EVENT_SIZE_TRUNCATED 0x0AUL
65#define TRC_WARNING_STREAM_PORT_READ 0x0BUL
66#define TRC_WARNING_STREAM_PORT_WRITE 0x0CUL
67#define TRC_WARNING_STREAM_PORT_INITIAL_BLOCKING 0x0DUL
68#define TRC_WARNING_STACKMON_NO_SLOTS 0x0EUL
69
70/* Entry Option definitions */
71#define TRC_ENTRY_OPTION_EXCLUDED 0x00000001UL
72#define TRC_ENTRY_OPTION_HEAP 0x80000000UL
73#define TRC_ENTRY_OPTION_EXTENSION 0x40000000UL
74#define TRC_ENTRY_OPTION_STATE_MACHINE 0x20000000UL
75#define TRC_ENTRY_OPTION_STATE_MACHINE_STATE 0x10000000UL
76#define TRC_ENTRY_OPTION_INTERVAL_CHANNEL 0x08000000UL
77#define TRC_ENTRY_OPTION_COUNTER 0x04000000UL
78#define TRC_ENTRY_OPTION_INTERVAL_CHANNEL_SET 0x02000000UL
79#define TRC_ENTRY_OPTION_IDLE_NAME 0x01000000UL
80#define TRC_ENTRY_OPTION_RUNNABLE 0x00800000UL
81#define TRC_ENTRY_OPTION_DEPENDENCY 0x00400000UL
82
83#define TRC_DEPENDENCY_TYPE_ELF 0x00000001UL
84
85#define TRC_RECORDER_COMPONENT_CORE 0x00000001UL
86#define TRC_RECORDER_COMPONENT_ASSERT 0x00000002UL
87#define TRC_RECORDER_COMPONENT_BLOB 0x00000004UL
88#define TRC_RECORDER_COMPONENT_DIAGNOSTICS 0x00000008UL
89#define TRC_RECORDER_COMPONENT_ENTRY 0x00000010UL
90#define TRC_RECORDER_COMPONENT_ERROR 0x00000020UL
91#define TRC_RECORDER_COMPONENT_EVENT 0x00000040UL
92#define TRC_RECORDER_COMPONENT_EVENT_BUFFER 0x00000080UL
93#define TRC_RECORDER_COMPONENT_EXTENSION 0x00000100UL
94#define TRC_RECORDER_COMPONENT_HEAP 0x00000200UL
95#define TRC_RECORDER_COMPONENT_INTERNAL_EVENT_BUFFER 0x00000400UL
96#define TRC_RECORDER_COMPONENT_INTERVAL 0x00000800UL
97#define TRC_RECORDER_COMPONENT_ISR 0x00001000UL
98#define TRC_RECORDER_COMPONENT_MULTI_CORE_EVENT_BUFFER 0x00002000UL
99#define TRC_RECORDER_COMPONENT_OBJECT 0x00004000UL
100#define TRC_RECORDER_COMPONENT_PRINT 0x00008000UL
101#define TRC_RECORDER_COMPONENT_STACK_MONITOR 0x00010000UL
102#define TRC_RECORDER_COMPONENT_STATE_MACHINE 0x00020000UL
103#define TRC_RECORDER_COMPONENT_STATIC_BUFFER 0x00040000UL
104#define TRC_RECORDER_COMPONENT_STRING 0x00080000UL
105#define TRC_RECORDER_COMPONENT_TASK 0x00100000UL
106#define TRC_RECORDER_COMPONENT_TIMESTAMP 0x00200000UL
107#define TRC_RECORDER_COMPONENT_COUNTER 0x00400000UL
108#define TRC_RECORDER_COMPONENT_TASK_MONITOR 0x00800000UL
109
113#define TRC_INTERNAL_EVENT_BUFFER_OPTION_TRANSFER_MODE_ALL (0U)
114#define TRC_INTERNAL_EVENT_BUFFER_OPTION_TRANSFER_MODE_CHUNKED (1U)
115
116/******************************************************************************
117 * Supported ports
118 *
119 * TRC_HARDWARE_PORT_HWIndependent
120 * A hardware independent fallback option for event timestamping. Provides low
121 * resolution timestamps based on the OS tick.
122 * This may be used on the Win32 port, but may also be used on embedded hardware
123 * platforms. All time durations will be truncated to the OS tick frequency,
124 * typically 1 KHz. This means that a task or ISR that executes in less than
125 * 1 ms get an execution time of zero.
126 *
127 * TRC_HARDWARE_PORT_APPLICATION_DEFINED
128 * Allows for defining the port macros in other source code files.
129 *
130 * TRC_HARDWARE_PORT_Win32
131 * "Accurate" timestamping based on the Windows performance counter for Win32
132 * builds. Note that this gives the host machine time, not the kernel time.
133 *
134 * Hardware specific ports
135 * To get accurate timestamping, a hardware timer is necessary. Below are the
136 * available ports. Some of these are "unofficial", meaning that
137 * they have not yet been verified by Percepio but have been contributed by
138 * external developers. They should work, otherwise let us know by emailing
139 * support@percepio.com. Some work on any OS platform, while other are specific
140 * to a certain operating system.
141 *****************************************************************************/
142
143/****** Port Name ************************************* Code ** Official ** OS Platform *********/
144#define TRC_HARDWARE_PORT_APPLICATION_DEFINED 98 /* - - */
145#define TRC_HARDWARE_PORT_NOT_SET 99 /* - - */
146#define TRC_HARDWARE_PORT_HWIndependent 0 /* DEPRECATED */
147#define TRC_HARDWARE_PORT_Win32 1 /* Yes FreeRTOS on Win32 */
148#define TRC_HARDWARE_PORT_Atmel_AT91SAM7 2 /* No Any */
149#define TRC_HARDWARE_PORT_Atmel_UC3A0 3 /* No Any */
150#define TRC_HARDWARE_PORT_ARM_Cortex_M 4 /* Yes Any */
151#define TRC_HARDWARE_PORT_Renesas_RX600 6 /* Yes Any */
152#define TRC_HARDWARE_PORT_MICROCHIP_PIC32 7 /* Yes Any */
153#define TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_TMS570_RM48 8 /* Yes Any */
154#define TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_MSP430 9 /* No Any */
155#define TRC_HARDWARE_PORT_XILINX_PPC405 11 /* No FreeRTOS */
156#define TRC_HARDWARE_PORT_XILINX_PPC440 12 /* No FreeRTOS */
157#define TRC_HARDWARE_PORT_XILINX_MICROBLAZE 13 /* No Any */
158#define TRC_HARDWARE_PORT_XILINX_ZyncUltraScaleR5 14 /* No FreeRTOS */
159#define TRC_HARDWARE_PORT_NXP_LPC210X 15 /* No Any */
160#define TRC_HARDWARE_PORT_ARM_CORTEX_A9 16 /* Yes Any */
161#define TRC_HARDWARE_PORT_POWERPC_Z4 17 /* No FreeRTOS */
162#define TRC_HARDWARE_PORT_Altera_NiosII 18 /* Yes Any (Tested with FreeRTOS) */
163#define TRC_HARDWARE_PORT_ZEPHYR 19 /* Yes Zephyr */
164#define TRC_HARDWARE_PORT_XTensa_LX6 20 /* Yes ESP-IDF FreeRTOS */
165#define TRC_HARDWARE_PORT_XTensa_LX7 21 /* Yes ESP-IDF FreeRTOS */
166#define TRC_HARDWARE_PORT_Win64 22 /* Yes FreeRTOS on Win64 */
167#define TRC_HARDWARE_PORT_XMOS_XCOREAI 23 /* Yes FreeRTOS SMP */
168#define TRC_HARDWARE_PORT_RISCV_RV32I 24 /* Yes FreeRTOS */
169#define TRC_HARDWARE_PORT_CYCLONE_V_HPS 25 /* Yes FreeRTOS */
170#define TRC_HARDWARE_PORT_ARM_Cortex_M_NRF_SD 26 /* Yes FreeRTOS */
171#define TRC_HARDWARE_PORT_ARMv8AR_A32 27 /* Yes Any */
172#define TRC_HARDWARE_PORT_ADSP_SC5XX_SHARC 28 /* No FreeRTOS */
173
174#endif /* TRC_PORTDEFINES_H */