]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/WIN32-MingW/Trace_Recorder_Configuration/trcConfig.h
8da52ca8056d1cb5a9c3c4672732e6808555d011
[freertos] / FreeRTOS / Demo / WIN32-MingW / Trace_Recorder_Configuration / trcConfig.h
1 /*******************************************************************************\r
2  * Trace Recorder Library for Tracealyzer v3.1.2\r
3  * Percepio AB, www.percepio.com\r
4  *\r
5  * trcConfig.h\r
6  *\r
7  * Main configuration parameters for the trace recorder library.\r
8  * More settings can be found in trcStreamingConfig.h and trcSnapshotConfig.h.\r
9  *\r
10  * Read more at http://percepio.com/2016/10/05/rtos-tracing/\r
11  *\r
12  * Terms of Use\r
13  * This file is part of the trace recorder library (RECORDER), which is the\r
14  * intellectual property of Percepio AB (PERCEPIO) and provided under a\r
15  * license as follows.\r
16  * The RECORDER may be used free of charge for the purpose of recording data\r
17  * intended for analysis in PERCEPIO products. It may not be used or modified\r
18  * for other purposes without explicit permission from PERCEPIO.\r
19  * You may distribute the RECORDER in its original source code form, assuming\r
20  * this text (terms of use, disclaimer, copyright notice) is unchanged. You are\r
21  * allowed to distribute the RECORDER with minor modifications intended for\r
22  * configuration or porting of the RECORDER, e.g., to allow using it on a\r
23  * specific processor, processor family or with a specific communication\r
24  * interface. Any such modifications should be documented directly below\r
25  * this comment block.\r
26  *\r
27  * Disclaimer\r
28  * The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty\r
29  * as to its use or performance. PERCEPIO does not and cannot warrant the\r
30  * performance or results you may obtain by using the RECORDER or documentation.\r
31  * PERCEPIO make no warranties, express or implied, as to noninfringement of\r
32  * third party rights, merchantability, or fitness for any particular purpose.\r
33  * In no event will PERCEPIO, its technology partners, or distributors be liable\r
34  * to you for any consequential, incidental or special damages, including any\r
35  * lost profits or lost savings, even if a representative of PERCEPIO has been\r
36  * advised of the possibility of such damages, or for any claim by any third\r
37  * party. Some jurisdictions do not allow the exclusion or limitation of\r
38  * incidental, consequential or special damages, or the exclusion of implied\r
39  * warranties or limitations on how long an implied warranty may last, so the\r
40  * above limitations may not apply to you.\r
41  *\r
42  * Tabs are used for indent in this file (1 tab = 4 spaces)\r
43  *\r
44  * Copyright Percepio AB, 2016.\r
45  * www.percepio.com\r
46  ******************************************************************************/\r
47 \r
48 #ifndef TRC_CONFIG_H\r
49 #define TRC_CONFIG_H\r
50 \r
51 #ifdef __cplusplus\r
52 extern "C" {\r
53 #endif\r
54 \r
55 #include "trcPortDefines.h"\r
56 \r
57 /******************************************************************************\r
58  * Include of processor header file\r
59  *\r
60  * Here you may need to include the header file for your processor. This is\r
61  * required at least for the ARM Cortex-M port, that uses the ARM CMSIS API.\r
62  * Try that in case of build problems. Otherwise, remove the #error line below.\r
63  *****************************************************************************/\r
64 //#error "Trace Recorder: Please include your processor's header file here and remove this line."\r
65 \r
66 /*******************************************************************************\r
67  * Configuration Macro: TRC_CFG_HARDWARE_PORT\r
68  *\r
69  * Specify what hardware port to use (i.e., the "timestamping driver").\r
70  *\r
71  * All ARM Cortex-M MCUs are supported by "TRC_HARDWARE_PORT_ARM_Cortex_M".\r
72  * This port uses the DWT cycle counter for Cortex-M3/M4/M7 devices, which is\r
73  * available on most such devices. In case your device don't have DWT support,\r
74  * you will get an error message opening the trace. In that case, you may\r
75  * force the recorder to use SysTick timestamping instead, using this define:\r
76  *\r
77  * #define TRC_CFG_ARM_CM_USE_SYSTICK\r
78  *\r
79  * For ARM Cortex-M0/M0+ devices, SysTick mode is used automatically.\r
80  *\r
81  * See trcHardwarePort.h for available ports and information on how to\r
82  * define your own port, if not already present.\r
83  ******************************************************************************/\r
84 #define TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_Win32\r
85 \r
86 /*******************************************************************************\r
87  * Configuration Macro: TRC_CFG_RECORDER_MODE\r
88  *\r
89  * Specify what recording mode to use. Snapshot means that the data is saved in\r
90  * an internal RAM buffer, for later upload. Streaming means that the data is\r
91  * transferred continuously to the host PC.\r
92  *\r
93  * For more information, see http://percepio.com/2016/10/05/rtos-tracing/\r
94  * and the Tracealyzer User Manual.\r
95  *\r
96  * Values:\r
97  * TRC_RECORDER_MODE_SNAPSHOT\r
98  * TRC_RECORDER_MODE_STREAMING\r
99  ******************************************************************************/\r
100 #define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_SNAPSHOT\r
101 \r
102 /*******************************************************************************\r
103  * Configuration Macro: TRC_CFG_RECORDER_BUFFER_ALLOCATION\r
104  *\r
105  * Specifies how the recorder buffer is allocated (also in case of streaming, in\r
106  * port using the recorder's internal temporary buffer)\r
107  *\r
108  * Values:\r
109  * TRC_RECORDER_BUFFER_ALLOCATION_STATIC  - Static allocation (internal)\r
110  * TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC - Malloc in vTraceEnable\r
111  * TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM  - Use vTraceSetRecorderDataBuffer\r
112  *\r
113  * Static and dynamic mode does the allocation for you, either in compile time\r
114  * (static) or in runtime (malloc).\r
115  * The custom mode allows you to control how and where the allocation is made,\r
116  * for details see TRC_ALLOC_CUSTOM_BUFFER and vTraceSetRecorderDataBuffer().\r
117  ******************************************************************************/\r
118 #define TRC_CFG_RECORDER_BUFFER_ALLOCATION TRC_RECORDER_BUFFER_ALLOCATION_STATIC\r
119 \r
120 /******************************************************************************\r
121  * TRC_CFG_FREERTOS_VERSION\r
122  *\r
123  * Specify what version of FreeRTOS that is used (don't change unless using the\r
124  * trace recorder library with an older version of FreeRTOS).\r
125  *\r
126  * TRC_FREERTOS_VERSION_7_3_OR_7_4                              If using FreeRTOS v7.3.0 - v7.4.2\r
127  * TRC_FREERTOS_VERSION_7_5_OR_7_6                              If using FreeRTOS v7.5.0 - v7.6.0\r
128  * TRC_FREERTOS_VERSION_8_X                                             If using FreeRTOS v8.X.X\r
129  * TRC_FREERTOS_VERSION_9_X                                             If using FreeRTOS v9.X.X\r
130  *****************************************************************************/\r
131 #define TRC_CFG_FREERTOS_VERSION        TRC_FREERTOS_VERSION_9_X\r
132 \r
133 /******************************************************************************\r
134  * TRC_CFG_MAX_ISR_NESTING\r
135  *\r
136  * Defines how many levels of interrupt nesting the recorder can handle, in\r
137  * case multiple ISRs are traced and ISR nesting is possible. If this\r
138  * is exceeded, the particular ISR will not be traced and the recorder then\r
139  * logs an error message. This setting is used to allocate an internal stack\r
140  * for keeping track of the previous execution context (4 byte per entry).\r
141  *\r
142  * This value must be a non-zero positive constant, at least 1.\r
143  *\r
144  * Default value: 8\r
145  *****************************************************************************/\r
146 #define TRC_CFG_MAX_ISR_NESTING 8\r
147 \r
148 /* Specific configuration, depending on Streaming/Snapshot mode */\r
149 #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_SNAPSHOT)\r
150 #include "trcSnapshotConfig.h"\r
151 #elif (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)\r
152 #include "trcStreamingConfig.h"\r
153 #endif\r
154 \r
155 #ifdef __cplusplus\r
156 }\r
157 #endif\r
158 \r
159 #endif /* _TRC_CONFIG_H */\r