]> begriffs open source - cmsis-freertos/blob - CMSIS/RTOS2/FreeRTOS/Examples/App/Hello/RTE/RTOS/FreeRTOSConfig.h
Rework examples to use csolution layers (#95)
[cmsis-freertos] / CMSIS / RTOS2 / FreeRTOS / Examples / App / Hello / RTE / RTOS / FreeRTOSConfig.h
1 /* --------------------------------------------------------------------------
2  * Copyright (c) 2013-2024 Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the License); you may
7  * not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * --------------------------------------------------------------------------
19  *
20  * $Revision:   V10.6.0
21  *
22  * Project:     CMSIS-FreeRTOS
23  * Title:       FreeRTOS configuration definitions
24  *
25  * --------------------------------------------------------------------------*/
26
27 #ifndef FREERTOS_CONFIG_H
28 #define FREERTOS_CONFIG_H
29
30 /*-----------------------------------------------------------
31  * Application specific definitions.
32  *
33  * These definitions should be adjusted for your particular hardware and
34  * application requirements.
35  *
36  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
37  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
38  *
39  * See http://www.freertos.org/a00110.html
40  *----------------------------------------------------------*/
41
42 #if (defined(__ARMCC_VERSION) || defined(__GNUC__) || defined(__ICCARM__))
43 #include <stdint.h>
44
45 #include "RTE_Components.h"
46 #include CMSIS_device_header
47 #endif
48
49 //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
50
51 //  <o>Minimal stack size [words] <0-65535>
52 //  <i> Stack for idle task and default task stack in words.
53 //  <i> Default: 128
54 #define configMINIMAL_STACK_SIZE                  ((uint16_t)(128))
55
56 //  <o>Total heap size [bytes] <0-0xFFFFFFFF>
57 //  <i> Heap memory size in bytes.
58 //  <i> Default: 8192
59 #define configTOTAL_HEAP_SIZE                     ((size_t)8192)
60
61 //  <o>Kernel tick frequency [Hz] <0-0xFFFFFFFF>
62 //  <i> Kernel tick rate in Hz.
63 //  <i> Default: 1000
64 #define configTICK_RATE_HZ                        ((TickType_t)1000)
65
66 //  <o>Timer task stack depth [words] <0-65535>
67 //  <i> Stack for timer task in words.
68 //  <i> Default: 80
69 #define configTIMER_TASK_STACK_DEPTH              80
70
71 //  <o>Timer task priority <0-56>
72 //  <i> Timer task priority.
73 //  <i> Default: 40 (High)
74 #define configTIMER_TASK_PRIORITY                 40
75
76 //  <o>Timer queue length <0-1024>
77 //  <i> Timer command queue length.
78 //  <i> Default: 5
79 #define configTIMER_QUEUE_LENGTH                  5
80
81 //  <o>Preemption interrupt priority
82 //  <i> Maximum priority of interrupts that are safe to call FreeRTOS API.
83 //  <i> Default: 16
84 #define configMAX_SYSCALL_INTERRUPT_PRIORITY      16
85
86 //  <q>Use time slicing
87 //  <i> Enable setting to use timeslicing.
88 //  <i> Default: 1
89 #define configUSE_TIME_SLICING                    1
90
91 //  <q>Use tickless idle
92 //  <i> Enable low power tickless mode to stop the periodic tick interrupt during idle periods or
93 //  <i> disable it to keep the tick interrupt running at all times.
94 //  <i> Default: 0
95 #define configUSE_TICKLESS_IDLE                   0
96
97 //  <q>Idle should yield
98 //  <i> Control Yield behaviour of the idle task.
99 //  <i> Default: 1
100 #define configIDLE_SHOULD_YIELD                   1
101
102 //  <o>Check for stack overflow
103 //    <0=>Disable <1=>Method one <2=>Method two
104 //  <i> Enable or disable stack overflow checking.
105 //  <i> Callback function vApplicationStackOverflowHook implementation is required when stack checking is enabled.
106 //  <i> Default: 0
107 #define configCHECK_FOR_STACK_OVERFLOW            2
108
109 //  <q>Use idle hook
110 //  <i> Enable callback function call on each idle task iteration.
111 //  <i> Callback function vApplicationIdleHook implementation is required when idle hook is enabled.
112 //  <i> Default: 0
113 #define configUSE_IDLE_HOOK                       0
114
115 //  <q>Use tick hook
116 //  <i> Enable callback function call during each tick interrupt.
117 //  <i> Callback function vApplicationTickHook implementation is required when tick hook is enabled.
118 //  <i> Default: 0
119 #define configUSE_TICK_HOOK                       0
120
121 //  <q>Use deamon task startup hook
122 //  <i> Enable callback function call when timer service starts.
123 //  <i> Callback function vApplicationDaemonTaskStartupHook implementation is required when deamon task startup hook is enabled.
124 //  <i> Default: 0
125 #define configUSE_DAEMON_TASK_STARTUP_HOOK        0
126
127 //  <q>Use malloc failed hook
128 //  <i> Enable callback function call when out of dynamic memory.
129 //  <i> Callback function vApplicationMallocFailedHook implementation is required when malloc failed hook is enabled.
130 //  <i> Default: 0
131 #define configUSE_MALLOC_FAILED_HOOK              0
132
133 //  <o>Queue registry size
134 //  <i> Define maximum number of queue objects registered for debug purposes.
135 //  <i> The queue registry is used by kernel aware debuggers to locate queue and semaphore structures and display associated text names.
136 //  <i> Default: 0
137 #define configQUEUE_REGISTRY_SIZE                 0
138
139 // <h>Memory Allocation Configuration
140 // <i> Enable and configure memory allocation specific features.
141 // <i> To configure FreeRTOS heap size use configTOTAL_HEAP_SIZE.
142
143 //  <q> Support static memory allocation
144 //  <i> Enable or disable static memory allocation.
145 //  <i> When enabled RTOS objects can be created using application provided RAM.
146 //  <i> Default: 1
147 #define configSUPPORT_STATIC_ALLOCATION           1
148
149 //  <q> Support dynamic memory allocation
150 //  <i> Enable or disable dynamic memory allocation.
151 //  <i> When enabled RTOS objects can be created using RAM automatically allocated from the FreeRTOS heap.
152 //  <i> Default: 1
153 #define configSUPPORT_DYNAMIC_ALLOCATION          1
154
155 //  <q>Use kernel provided static memory
156 //  <i> When enabled FreeRTOS kernel provides static memory for Idle and Timer tasks.
157 //  <i> Otherwise user shall provide implementation of:
158 //  <i> - vApplicationGetIdleTaskMemory and vApplicationGetTimerTaskMemory
159 //  <i> - vApplicationGetPassiveIdleTaskMemory (when kernel uses SMP)
160 //  <i> Default: 1
161 #define configKERNEL_PROVIDED_STATIC_MEMORY       1
162
163 //  <q>Use application allocated heap
164 //  <i> Global heap buffer must be provided externally when using application allocated heap.
165 //  <i> The buffer must be declared as: uint8_t ucHeap[ configTOTAL_HEAP_SIZE ].
166 //  <i> Default: 0
167 #define configAPPLICATION_ALLOCATED_HEAP          0
168
169 //  <q>Use separate heap for stack allocation
170 //  <i> Enable or disable stack allocation for any task from a separate heap.
171 //  <i> Thread-safe implementation of pvPortMallocStack and vPortFreeStack is required when using separate heap.
172 //  <i> Default: 0
173 #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
174
175 //  <q>Use heap protector
176 //  <i> Enable or disable bounds checking and obfuscation to heap block pointers.
177 //  <i> This setting only applies to Heap_4 and Heap_5.
178 //  <i> Default: 0
179 #define configENABLE_HEAP_PROTECTOR               0
180 // </h>
181
182 // <h>Event Recorder Configuration
183 // <i> Initialize and setup Event Recorder level filtering.
184 // <i> Settings have no effect when Event Recorder is not present.
185
186 //  <q>Initialize Event Recorder
187 //  <i> Initialize Event Recorder before FreeRTOS kernel start.
188 //  <i> Default: 1
189 #define configEVR_INITIALIZE                      1
190
191 //  <e>Setup recording level filter
192 //  <i> Enable configuration of FreeRTOS events recording level
193 //  <i> Default: 1
194 #define configEVR_SETUP_LEVEL                     1
195
196 //  <o>Tasks functions
197 //  <i> Define event recording level bitmask for events generated from Tasks functions.
198 //  <i> Default: 0x05
199 //    <0x00=>Off <0x01=>Errors <0x03=>Errors + API <0x05=>Errors + Operation <0x07=>Errors + API + Operation <0x0F=>All
200 #define configEVR_LEVEL_TASKS                     0x07
201
202 //  <o>Queue functions
203 //  <i> Define event recording level bitmask for events generated from Queue functions.
204 //  <i> Default: 0x05
205 //    <0x00=>Off <0x01=>Errors <0x03=>Errors + API <0x05=>Errors + Operation <0x07=>Errors + API + Operation <0x0F=>All
206 #define configEVR_LEVEL_QUEUE                     0x07
207
208 //  <o>Timer functions
209 //  <i> Define event recording level bitmask for events generated from Timer functions.
210 //  <i> Default: 0x05
211 //    <0x00=>Off <0x01=>Errors <0x03=>Errors + API <0x05=>Errors + Operation <0x07=>Errors + API + Operation <0x0F=>All
212 #define configEVR_LEVEL_TIMERS                    0x07
213
214 //  <o>Event Groups functions
215 //  <i> Define event recording level bitmask for events generated from Event Groups functions.
216 //  <i> Default: 0x05
217 //    <0x00=>Off <0x01=>Errors <0x03=>Errors + API <0x05=>Errors + Operation <0x07=>Errors + API + Operation <0x0F=>All
218 #define configEVR_LEVEL_EVENTGROUPS               0x07
219
220 //  <o>Heap functions
221 //  <i> Define event recording level bitmask for events generated from Heap functions.
222 //  <i> Default: 0x05
223 //    <0x00=>Off <0x01=>Errors <0x03=>Errors + API <0x05=>Errors + Operation <0x07=>Errors + API + Operation <0x0F=>All
224 #define configEVR_LEVEL_HEAP                      0x07
225
226 //  <o>Stream Buffer functions
227 //  <i> Define event recording level bitmask for events generated from Stream Buffer functions.
228 //  <i> Default: 0x05
229 //    <0x00=>Off <0x01=>Errors <0x03=>Errors + API <0x05=>Errors + Operation <0x07=>Errors + API + Operation <0x0F=>All
230 #define configEVR_LEVEL_STREAMBUFFER              0x07
231 //  </e>
232 // </h>
233
234 // <h> Port Specific Features
235 // <i> Enable and configure port specific features.
236 // <i> Check FreeRTOS documentation for definitions that apply for the used port.
237
238 //  <q>Use Floating Point Unit
239 //  <i> Using Floating Point Unit (FPU) affects context handling.
240 //  <i> Enable FPU when application uses floating point operations.
241 //  <i> Default: 1
242 #define configENABLE_FPU                          0
243
244 //  <q>Use M-Profile Vector Extension
245 //  <i> Using M-Profile Vector Extension (MVE) affects context handling.
246 //  <i> Enable MVE when application uses signal processing and ML algorithms.
247 //  <i> Default: 0
248 #define configENABLE_MVE                          0
249
250 //  <q>Use Memory Protection Unit
251 //  <i> Using Memory Protection Unit (MPU) requires detailed memory map definition.
252 //  <i> This setting is only releavant for MPU enabled ports.
253 //  <i> Default: 0
254 #define configENABLE_MPU                          0
255
256 //  <q> Use TrustZone Secure Side Only
257 //  <i> This settings prevents FreeRTOS contex switch to Non-Secure side.
258 //  <i> Enable this setting when FreeRTOS runs on the Secure side only.
259 #define configRUN_FREERTOS_SECURE_ONLY            0
260
261 //  <q>Use TrustZone Security Extension
262 //  <i> Using TrustZone affects context handling.
263 //  <i> Enable TrustZone when FreeRTOS runs on the Non-Secure side and calls functions from the Secure side.
264 //  <i> Default: 1
265 #define configENABLE_TRUSTZONE                    0
266
267 //  <o>Minimal secure stack size [words] <0-65535>
268 //  <i> Stack for idle task Secure side context in words.
269 //  <i> This setting is only relevant when TrustZone extension is enabled.
270 //  <i> Default: 128
271 #define configMINIMAL_SECURE_STACK_SIZE           ((uint32_t)128)
272 // </h>
273
274 // <h> Symmetric Multiprocessing Configuration
275 // <i> Enable and configure FreeRTOS for Symmetric Multiprocessing (SMP).
276
277 //  <q>Number of processor cores
278 //  <i> Sets the number of available processor cores.
279 //  <i> Default: 1
280 #define configNUMBER_OF_CORES                     1
281
282 //  <q>Use processor core affinity
283 //  <i> Enables the control for task to run on specific processor cores.
284 //  <i> Task that has no processor affinity set may run on any available core.
285 //  <i> Default: 0
286 #define configUSE_CORE_AFFINITY                   0
287
288 //  <q>Use passive idle hook
289 //  <i> Enable callback function call on each idle task iteration.
290 //  <i> Callback function vApplicationPassiveIdleHook implementation is required when idle hook is enabled.
291 //  <i> Default: 0
292 #define configUSE_PASSIVE_IDLE_HOOK               0
293 // </h>
294
295 //------------- <<< end of configuration section >>> ---------------------------
296
297 /* Defines needed by FreeRTOS to implement CMSIS RTOS2 API. Do not change! */
298 #define configCPU_CLOCK_HZ                        (SystemCoreClock)
299 #define configUSE_PREEMPTION                      1
300 #define configUSE_TIMERS                          1
301 #define configUSE_MUTEXES                         1
302 #define configUSE_RECURSIVE_MUTEXES               1
303 #define configUSE_COUNTING_SEMAPHORES             1
304 #define configUSE_TASK_NOTIFICATIONS              1
305 #define configUSE_TRACE_FACILITY                  1
306 #define configUSE_16_BIT_TICKS                    0 
307 #define configUSE_PORT_OPTIMISED_TASK_SELECTION   0
308 #define configMAX_PRIORITIES                      56
309 #define configKERNEL_INTERRUPT_PRIORITY           255
310
311 /* Defines that include FreeRTOS functions which implement CMSIS RTOS2 API. Do not change! */
312 #define INCLUDE_xEventGroupSetBitsFromISR         1
313 #define INCLUDE_xSemaphoreGetMutexHolder          1
314 #define INCLUDE_vTaskDelay                        1
315 #define INCLUDE_xTaskDelayUntil                   1
316 #define INCLUDE_vTaskDelete                       1
317 #define INCLUDE_xTaskGetCurrentTaskHandle         1
318 #define INCLUDE_xTaskGetSchedulerState            1
319 #define INCLUDE_uxTaskGetStackHighWaterMark       1
320 #define INCLUDE_uxTaskPriorityGet                 1
321 #define INCLUDE_vTaskPrioritySet                  1
322 #define INCLUDE_eTaskGetState                     1
323 #define INCLUDE_vTaskSuspend                      1
324 #define INCLUDE_xTaskAbortDelay                   1
325 #define INCLUDE_xTimerPendFunctionCall            1
326
327 /* Map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
328 #define xPortPendSVHandler                        PendSV_Handler
329 #define vPortSVCHandler                           SVC_Handler
330
331 /* Ensure Cortex-M port compatibility. */
332 #define SysTick_Handler                           xPortSysTickHandler
333
334 #if (defined(__ARMCC_VERSION) || defined(__GNUC__) || defined(__ICCARM__))
335 //#define traceENTER_xTaskGetSchedulerState_DISABLE
336 //#define traceRETURN_xTaskGetSchedulerState_DISABLE
337 /* Include debug event definitions */
338 #include "freertos_evr.h"
339 #endif
340
341 #endif /* FREERTOS_CONFIG_H */