1 /* --------------------------------------------------------------------------
2 * Copyright (c) 2013-2018 Arm Limited. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
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
10 * www.apache.org/licenses/LICENSE-2.0
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.
18 * --------------------------------------------------------------------------
22 * Project: CMSIS-FreeRTOS
23 * Title: FreeRTOS configuration definitions
25 * --------------------------------------------------------------------------*/
28 #ifndef FREERTOS_CONFIG_H
29 #define FREERTOS_CONFIG_H
31 /*-----------------------------------------------------------
32 * Application specific definitions.
34 * These definitions should be adjusted for your particular hardware and
35 * application requirements.
37 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
38 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
40 * See http://www.freertos.org/a00110.html.
41 *----------------------------------------------------------*/
45 #include "RTE_Components.h"
46 #include CMSIS_device_header
48 //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
50 // <o>Minimal stack size [words] <0-65535>
51 // <i> Stack for idle task and default task stack in words.
53 #define configMINIMAL_STACK_SIZE ((uint16_t)(128))
55 // <o>Total heap size [bytes] <0-0xFFFFFFFF>
56 // <i> Heap memory size in bytes.
58 #define configTOTAL_HEAP_SIZE ((size_t)8192)
60 // <o>Kernel tick frequency [Hz] <0-0xFFFFFFFF>
61 // <i> Kernel tick rate in Hz.
63 #define configTICK_RATE_HZ ((TickType_t)1000)
65 // <o>Timer task stack depth [words] <0-65535>
66 // <i> Stack for timer task in words.
68 #define configTIMER_TASK_STACK_DEPTH 80
70 // <o>Timer task priority <0-56>
71 // <i> Timer task priority.
72 // <i> Default: 40 (High)
73 #define configTIMER_TASK_PRIORITY 40
75 // <o>Timer queue length <0-1024>
76 // <i> Timer command queue length.
78 #define configTIMER_QUEUE_LENGTH 5
80 // <o>Preemption interrupt priority
81 // <i> Maximum priority of interrupts that are safe to call FreeRTOS API.
83 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 16
85 // <q>Use time slicing
86 // <i> Enable setting to use timeslicing.
88 #define configUSE_TIME_SLICING 1
90 // <q>Idle should yield
91 // <i> Control Yield behaviour of the idle task.
93 #define configIDLE_SHOULD_YIELD 1
95 // <o>Check for stack overflow
96 // <0=>Disable <1=>Method one <2=>Method two
97 // <i> Enable or disable stack overflow checking.
98 // <i> Callback function vApplicationStackOverflowHook implementation is required when stack checking is enabled.
100 #define configCHECK_FOR_STACK_OVERFLOW 2
103 // <i> Enable callback function call on each idle task iteration.
104 // <i> Callback function vApplicationIdleHook implementation is required when idle hook is enabled.
106 #define configUSE_IDLE_HOOK 0
109 // <i> Enable callback function call during each tick interrupt.
110 // <i> Callback function vApplicationTickHook implementation is required when tick hook is enabled.
112 #define configUSE_TICK_HOOK 0
114 // <q>Use deamon task startup hook
115 // <i> Enable callback function call when timer service starts.
116 // <i> Callback function vApplicationDaemonTaskStartupHook implementation is required when deamon task startup hook is enabled.
118 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
120 // <q>Use malloc failed hook
121 // <i> Enable callback function call when out of dynamic memory.
122 // <i> Callback function vApplicationMallocFailedHook implementation is required when malloc failed hook is enabled.
124 #define configUSE_MALLOC_FAILED_HOOK 0
126 // <o>Queue registry size
127 // <i> Define maximum number of queue objects registered for debug purposes.
128 // <i> The queue registry is used by kernel aware debuggers to locate queue and semaphore structures and display associated text names.
130 #define configQUEUE_REGISTRY_SIZE 0
132 // <h>Event Recorder configuration
133 // <i> Initialize and setup Event Recorder level filtering.
134 // <i> Settings have no effect when Event Recorder is not present.
136 // <q>Initialize Event Recorder
137 // <i> Initialize Event Recorder before FreeRTOS kernel start.
139 #define configEVR_INITIALIZE 1
141 // <e>Setup recording level filter
142 // <i> Enable configuration of FreeRTOS events recording level
144 #define configEVR_SETUP_LEVEL 1
146 // <o>Tasks functions
147 // <i> Define event recording level bitmask for events generated from Tasks functions.
149 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
150 #define configEVR_LEVEL_TASKS 0x05
152 // <o>Queue functions
153 // <i> Define event recording level bitmask for events generated from Queue functions.
155 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
156 #define configEVR_LEVEL_QUEUE 0x05
158 // <o>Timer functions
159 // <i> Define event recording level bitmask for events generated from Timer functions.
161 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
162 #define configEVR_LEVEL_TIMERS 0x05
164 // <o>Event Groups functions
165 // <i> Define event recording level bitmask for events generated from Event Groups functions.
167 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
168 #define configEVR_LEVEL_EVENTGROUPS 0x05
171 // <i> Define event recording level bitmask for events generated from Heap functions.
173 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
174 #define configEVR_LEVEL_HEAP 0x05
176 // <o>Stream Buffer functions
177 // <i> Define event recording level bitmask for events generated from Stream Buffer functions.
179 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
180 #define configEVR_LEVEL_STREAMBUFFER 0x05
184 //------------- <<< end of configuration section >>> ---------------------------
186 /* Defines needed by FreeRTOS to implement CMSIS RTOS2 API. Do not change! */
187 #define configCPU_CLOCK_HZ (SystemCoreClock)
188 #define configSUPPORT_STATIC_ALLOCATION 1
189 #define configSUPPORT_DYNAMIC_ALLOCATION 1
190 #define configUSE_PREEMPTION 1
191 #define configUSE_TIMERS 1
192 #define configUSE_MUTEXES 1
193 #define configUSE_RECURSIVE_MUTEXES 1
194 #define configUSE_COUNTING_SEMAPHORES 1
195 #define configUSE_TASK_NOTIFICATIONS 1
196 #define configUSE_TRACE_FACILITY 1
197 #define configUSE_16_BIT_TICKS 0
198 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
199 #define configMAX_PRIORITIES 56
200 #define configKERNEL_INTERRUPT_PRIORITY 255
202 /* Defines that include FreeRTOS functions which implement CMSIS RTOS2 API. Do not change! */
203 #define INCLUDE_xEventGroupSetBitsFromISR 1
204 #define INCLUDE_xSemaphoreGetMutexHolder 1
205 #define INCLUDE_vTaskDelay 1
206 #define INCLUDE_vTaskDelayUntil 1
207 #define INCLUDE_vTaskDelete 1
208 #define INCLUDE_xTaskGetCurrentTaskHandle 1
209 #define INCLUDE_xTaskGetSchedulerState 1
210 #define INCLUDE_uxTaskGetStackHighWaterMark 1
211 #define INCLUDE_uxTaskPriorityGet 1
212 #define INCLUDE_vTaskPrioritySet 1
213 #define INCLUDE_eTaskGetState 1
214 #define INCLUDE_vTaskSuspend 1
215 #define INCLUDE_xTimerPendFunctionCall 1
217 /* Map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
218 #define xPortPendSVHandler PendSV_Handler
219 #define vPortSVCHandler SVC_Handler
221 /* Include debug event definitions */
222 #include "freertos_evr.h"
224 #endif /* FREERTOS_CONFIG_H */