]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace(streaming)/trcConfig.h
Update FreeRTOS+Trace recorder library to v3.0.2
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-Trace(streaming) / trcConfig.h
1 /*******************************************************************************\r
2  * Trace Recorder Library for Tracealyzer v3.0.2\r
3  * Percepio AB, www.percepio.com\r
4  *\r
5  * trcConfig.h\r
6  *\r
7  * Configuration parameters for the streaming version trace recorder library.\r
8  * Before using the trace recorder library, please check that the default\r
9  * settings are appropriate for your system, and if necessary adjust these.\r
10  *\r
11  * Terms of Use\r
12  * This software (the "Tracealyzer Recorder Library") is the intellectual\r
13  * property of Percepio AB and may not be sold or in other ways commercially\r
14  * redistributed without explicit written permission by Percepio AB.\r
15  *\r
16  * Separate conditions applies for the SEGGER branded source code included.\r
17  *\r
18  * The recorder library is free for use together with Percepio products.\r
19  * You may distribute the recorder library in its original form, but public\r
20  * distribution of modified versions require approval by Percepio AB.\r
21  *\r
22  * Disclaimer\r
23  * The trace tool and recorder library is being delivered to you AS IS and\r
24  * Percepio AB makes no warranty as to its use or performance. Percepio AB does\r
25  * not and cannot warrant the performance or results you may obtain by using the\r
26  * software or documentation. Percepio AB make no warranties, express or\r
27  * implied, as to noninfringement of third party rights, merchantability, or\r
28  * fitness for any particular purpose. In no event will Percepio AB, its\r
29  * technology partners, or distributors be liable to you for any consequential,\r
30  * incidental or special damages, including any lost profits or lost savings,\r
31  * even if a representative of Percepio AB has been advised of the possibility\r
32  * of such damages, or for any claim by any third party. Some jurisdictions do\r
33  * not allow the exclusion or limitation of incidental, consequential or special\r
34  * damages, or the exclusion of implied warranties or limitations on how long an\r
35  * implied warranty may last, so the above limitations may not apply to you.\r
36  *\r
37  * Tabs are used for indent in this file (1 tab = 4 spaces)\r
38  *\r
39  * Copyright Percepio AB, 2015.\r
40  * www.percepio.com\r
41  ******************************************************************************/\r
42 \r
43 #ifndef TRC_CONFIG_H\r
44 #define TRC_CONFIG_H\r
45 \r
46 #ifdef __cplusplus\r
47 extern \93C\94 {\r
48 #endif\r
49 \r
50 /*******************************************************************************\r
51  * Configuration Macro: TRC_RECORDER_HARDWARE_PORT\r
52  *\r
53  * Specify what hardware is used.\r
54  *\r
55  * See trcHardwarePort.h for available ports, or to define your own.\r
56  ******************************************************************************/\r
57 #define TRC_RECORDER_HARDWARE_PORT TRC_PORT_ARM_Cortex_M\r
58 \r
59 /******************************************************************************\r
60  * BSP and other project specific includes\r
61  * \r
62  * Include the necessary header files.\r
63  *****************************************************************************/\r
64 #include "board.h"\r
65 \r
66 /******************************************************************************\r
67  * TRC_FREERTOS_VERSION\r
68  * \r
69  * Specify what version of FreeRTOS that is used. This is necessary compensate \r
70  * for renamed symbols in the FreeRTOS kernel (does not build if incorrect).\r
71  * \r
72  * TRC_FREERTOS_VERSION_7_3_OR_7_4 (= 1)                If using FreeRTOS v7.3.0 - v7.4.2\r
73  * TRC_FREERTOS_VERSION_7_5_OR_7_6 (= 2)                If using FreeRTOS v7.5.0 - v7.6.0\r
74  * TRC_FREERTOS_VERSION_8_0_OR_LATER (= 3)              If using FreeRTOS v8.0.0 or later\r
75  *****************************************************************************/\r
76 #define TRC_FREERTOS_VERSION_NOT_SET                    0\r
77 #define TRC_FREERTOS_VERSION_7_3_OR_7_4                 1\r
78 #define TRC_FREERTOS_VERSION_7_5_OR_7_6                 2\r
79 #define TRC_FREERTOS_VERSION_8_0_OR_LATER               3\r
80 \r
81 #define TRC_FREERTOS_VERSION    TRC_FREERTOS_VERSION_8_0_OR_LATER\r
82 \r
83 /*******************************************************************************\r
84  * Configuration Macro: TRC_SYMBOL_TABLE_SLOTS\r
85  *\r
86  * The maximum number of symbols names that can be stored. This includes:\r
87  * - Task names\r
88  * - Named ISRs (vTraceSetISRProperties)\r
89  * - Named kernel objects (vTraceStoreKernelObjectName)\r
90  * - User event channels (vTraceStoreUserEventChannelName)\r
91  *\r
92  * If this value is too small, not all symbol names will be stored and the\r
93  * trace display will be affected. In that case, there will be warnings\r
94  * (as User Events) from TzCtrl task, that monitors this.\r
95  ******************************************************************************/\r
96 #define TRC_SYMBOL_TABLE_SLOTS 30\r
97 \r
98 /*******************************************************************************\r
99  * Configuration Macro: TRC_SYMBOL_MAX_LENGTH\r
100  *\r
101  * The maximum length of symbol names, including:\r
102  * - Task names\r
103  * - Named ISRs (vTraceSetISRProperties)\r
104  * - Named kernel objects (vTraceStoreKernelObjectName)\r
105  * - User event channel names (vTraceStoreUserEventChannelName)\r
106  *\r
107  * If longer symbol names are used, they will be truncated by the recorder,\r
108  * which will affect the trace display. In that case, there will be warnings\r
109  * (as User Events) from TzCtrl task, that monitors this.\r
110  ******************************************************************************/\r
111 #define TRC_SYMBOL_MAX_LENGTH 25\r
112 \r
113 /*******************************************************************************\r
114  * Configuration Macro: TRC_OBJECT_DATA_SLOTS\r
115  *\r
116  * The maximum number of object data entries (used for task priorities) that can\r
117  * be stored at the same time. Must be sufficient for all tasks, otherwise there\r
118  * will be warnings (as User Events) from TzCtrl task, that monitors this.\r
119  ******************************************************************************/\r
120 #define TRC_OBJECT_DATA_SLOTS 20\r
121 \r
122 /*******************************************************************************\r
123  * Configuration Macro: TRC_RTT_UP_BUFFER_INDEX\r
124  *\r
125  * Defines the RTT buffer to use for writing the trace data. Make sure that\r
126  * the PC application has the same setting (File->Settings).\r
127  *\r
128  ******************************************************************************/\r
129 #define TRC_RTT_UP_BUFFER_INDEX 0\r
130 \r
131 /*******************************************************************************\r
132  * Configuration Macro: TRC_RTT_DOWN_BUFFER_INDEX\r
133  *\r
134  * Defines the RTT buffer to use for reading the trace data. Make sure that\r
135  * the PC application has the same setting (File->Settings).\r
136  *\r
137  ******************************************************************************/\r
138 #define TRC_RTT_DOWN_BUFFER_INDEX 0\r
139 \r
140 /*******************************************************************************\r
141  * Configuration Macro: TRC_CTRL_TASK_STACK_SIZE\r
142  *\r
143  * The stack size of the TzCtrl task, that receive commands.\r
144  * We are aiming to remove this extra task in future versions.\r
145  ******************************************************************************/\r
146 #define TRC_CTRL_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)\r
147 \r
148 /*******************************************************************************\r
149  * Configuration Macro: TRC_CTRL_TASK_PRIORITY\r
150  *\r
151  * The priority of the TzCtrl task, that receive commands from.\r
152  * We are aiming to remove this extra task in future versions.\r
153  ******************************************************************************/\r
154 #define TRC_CTRL_TASK_PRIORITY 1\r
155 \r
156 /*******************************************************************************\r
157  * Configuration Macro: TRC_CTRL_TASK_DELAY\r
158  *\r
159  * The delay between every loop of the TzCtrl task. A high delay will reduce the\r
160  * CPU load, but may cause missed events if the TzCtrl task is performing the \r
161  * trace transfer.\r
162  ******************************************************************************/\r
163 #define TRC_CTRL_TASK_DELAY ((10 * configTICK_RATE_HZ) / 1000)\r
164 \r
165 /*******************************************************************************\r
166  * Configuration Macro: TRC_MEASURE_BLOCKING_TIME\r
167  *\r
168  * If using SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL, this activates detection and\r
169  * warnings in case of blocking in SEGGER_RTT_Write (if too small buffer).\r
170  *\r
171  * If enabling this option (set to 1) warnings are given as User Events if\r
172  * blocking occurs, including the longest blocking time. These warnings are\r
173  * given on the channel "Blocking on trace buffer".\r
174  *\r
175  * Note: If you get such warnings, you can study the blocking time in the User\r
176  * Event Signal Plot to get an overview of the magnitude of the blocking and\r
177  * decide if acceptable.\r
178  *\r
179  * To eliminate or at least reduce occurrences of blocking:\r
180  *\r
181  * - Verify the J-Link Speed in the Settings dialog of the PC application.\r
182  *   Default is 4 MHz, but can be increased a lot depending on your J-Link.\r
183  *\r
184  *   Note: If you set the speed higher than your J-Link can manage, the J-Link\r
185  *   driver will instead use the fastest supported speed. The actual speed used\r
186  *   is shown in the title of the trace receiver window.\r
187  *\r
188  * - Increase the buffer size (BUFFER_SIZE_UP in SEGGER_RTT_Conf.h).\r
189  *\r
190  * - Reduce the amount of data produced, e.g., by removing frequent User Events.\r
191  ******************************************************************************/\r
192 #define TRC_MEASURE_BLOCKING_TIME 0\r
193 \r
194 /*******************************************************************************\r
195  * Configuration Macro: TRC_BLOCKING_MIN_CYCLES\r
196  *\r
197  * Threshold value for deciding if SEGGER_RTT_Write has blocked. Most events\r
198  * take 200-300 cycles on ARM Cortex-M MCUs, so anything above 500 cycles should\r
199  * be due to blocking on a full buffer (i.e., waiting for the debugger to read\r
200  * the RTT buffer data and make room for more...).\r
201  ******************************************************************************/\r
202 #define TRC_BLOCKING_MIN_CYCLES 500\r
203 \r
204 /*******************************************************************************\r
205  * Configuration Macro: TRC_RECORDER_BUFFER_ALLOCATION\r
206  *\r
207  * Specifies how the recorder buffer is allocated.\r
208  *\r
209  * Values:\r
210  * TRC_RECORDER_BUFFER_ALLOCATION_STATIC\r
211  * TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC\r
212  ******************************************************************************/\r
213 #define TRC_RECORDER_BUFFER_ALLOCATION TRC_RECORDER_BUFFER_ALLOCATION_STATIC\r
214 \r
215 /*******************************************************************************\r
216  * Configuration Macro: TRC_RECORDER_TRANSFER_METHOD\r
217  *\r
218  * Specifies what type of transfer method is used.\r
219  *\r
220  * Values:\r
221  * TRC_RECORDER_TRANSFER_METHOD_JLINK_RTT_BLOCK\r
222  * TRC_RECORDER_TRANSFER_METHOD_JLINK_RTT_NOBLOCK\r
223  * TRC_RECORDER_TRANSFER_METHOD_TCPIP\r
224  * TRC_RECORDER_TRANSFER_METHOD_CUSTOM\r
225  ******************************************************************************/\r
226 #define TRC_RECORDER_TRANSFER_METHOD TRC_RECORDER_TRANSFER_METHOD_JLINK_RTT_BLOCK\r
227 \r
228 /*******************************************************************************\r
229  * Configuration Macro: TRC_STREAM_CUSTOM_BLOCKING_TRANSFER\r
230  *\r
231  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
232  *\r
233  * Specifies how the custom transfer method handles full buffers.\r
234  *\r
235  * Values:\r
236  * 0 - The custom transfer method skips sending the data if the buffer is full.\r
237  * 1 - The custom transfer method blocks on send if the buffer is full.\r
238  ******************************************************************************/\r
239  #define TRC_STREAM_CUSTOM_BLOCKING_TRANSFER \r
240 \r
241 /*******************************************************************************\r
242  * Configuration Macro: TRC_STREAM_CUSTOM_ALLOCATE_FIELDS\r
243  *\r
244  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
245  *\r
246  * Macro that should allocate any buffers needed for the transfer method.\r
247  * See trcStreamPort.h for examples.\r
248  ******************************************************************************/\r
249 #define TRC_STREAM_CUSTOM_ALLOCATE_FIELDS() \r
250 \r
251 /*******************************************************************************\r
252  * Configuration Macro: TRC_STREAM_CUSTOM_INIT\r
253  *\r
254  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
255  *\r
256  * Used to initialize and set up the transfer method.\r
257  * See trcStreamPort.h for examples.\r
258  ******************************************************************************/\r
259 #define TRC_STREAM_CUSTOM_INIT() \r
260 \r
261 /*******************************************************************************\r
262  * Configuration Macro: TRC_STREAM_CUSTOM_ALLOCATE_EVENT\r
263  *\r
264  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
265  *\r
266  * Specifies how the trace events that should be sent using the transfer method\r
267  * are allocated first.\r
268  * See trcStreamPort.h for examples.\r
269  ******************************************************************************/\r
270 #define TRC_STREAM_CUSTOM_ALLOCATE_EVENT(_type, _ptr, _size) \r
271 \r
272 /*******************************************************************************\r
273  * Configuration Macro: TRC_STREAM_CUSTOM_COMMIT_EVENT\r
274  *\r
275  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
276  *\r
277  * Specifies how trace events are sent/written.\r
278  * See trcStreamPort.h for examples.\r
279  ******************************************************************************/\r
280 #define TRC_STREAM_CUSTOM_COMMIT_EVENT(_ptr, _size) \r
281 \r
282 /*******************************************************************************\r
283  * Configuration Macro: TRC_STREAM_CUSTOM_READ_DATA\r
284  *\r
285  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
286  *\r
287  * Specifies how data is read using the transfer method.\r
288  * See trcStreamPort.h for examples.\r
289  ******************************************************************************/\r
290 #define TRC_STREAM_CUSTOM_READ_DATA(_ptrData, _size, _ptrBytesRead) \r
291 \r
292 /*******************************************************************************\r
293  * Configuration Macro: TRC_STREAM_CUSTOM_PERIODIC_SEND_DATA\r
294  *\r
295  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
296  *\r
297  * Specifies how data is sent periodically. Used by certain transfer methods.\r
298  * See trcStreamPort.h for examples.\r
299  ******************************************************************************/\r
300 #define TRC_STREAM_CUSTOM_PERIODIC_SEND_DATA(_ptrBytesSent) \r
301 \r
302 /*******************************************************************************\r
303  * Configuration Macro: TRC_STREAM_CUSTOM_ON_TRACE_BEGIN\r
304  *\r
305  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
306  *\r
307  * Called on tracing is started. Use this to perform any necessary steps to \r
308  * properly start the trace, such as clearing buffers.\r
309  ******************************************************************************/\r
310 #define TRC_STREAM_CUSTOM_ON_TRACE_BEGIN() \r
311 \r
312 /*******************************************************************************\r
313  * Configuration Macro: TRC_STREAM_CUSTOM_ON_TRACE_END\r
314  *\r
315  * Note: Only active if TRC_RECORDER_TRANSFER_METHOD_CUSTOM is used.\r
316  *\r
317  * Called when tracing is disabled. Use this to perform any necessary steps to \r
318  * properly shut down the tracing, such as clearing buffers.\r
319  ******************************************************************************/\r
320 #define TRC_STREAM_CUSTOM_ON_TRACE_END() \r
321 \r
322 #ifdef __cplusplus\r
323 }\r
324 #endif\r
325 \r
326 #endif /* TRC_CONFIG_H */\r