1 /* --------------------------------------------------------------------------
2 * Copyright (c) 2013-2019 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 * --------------------------------------------------------------------------*/
27 #ifndef FREERTOS_CONFIG_H
28 #define FREERTOS_CONFIG_H
30 /*-----------------------------------------------------------
31 * Application specific definitions.
33 * These definitions should be adjusted for your particular hardware and
34 * application requirements.
36 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
37 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
39 * See http://www.freertos.org/a00110.html
40 *----------------------------------------------------------*/
44 #include "RTE_Components.h"
45 #include CMSIS_device_header
47 //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
49 // <o>Minimal stack size [words] <0-65535>
50 // <i> Stack for idle task and default task stack in words.
52 #define configMINIMAL_STACK_SIZE ((uint16_t)(128))
54 // <o>Total heap size [bytes] <0-0xFFFFFFFF>
55 // <i> Heap memory size in bytes.
57 #define configTOTAL_HEAP_SIZE ((size_t)8192)
59 // <o>Kernel tick frequency [Hz] <0-0xFFFFFFFF>
60 // <i> Kernel tick rate in Hz.
62 #define configTICK_RATE_HZ ((TickType_t)1000)
64 // <o>Timer task stack depth [words] <0-65535>
65 // <i> Stack for timer task in words.
67 #define configTIMER_TASK_STACK_DEPTH 80
69 // <o>Timer task priority <0-56>
70 // <i> Timer task priority.
71 // <i> Default: 40 (High)
72 #define configTIMER_TASK_PRIORITY 40
74 // <o>Timer queue length <0-1024>
75 // <i> Timer command queue length.
77 #define configTIMER_QUEUE_LENGTH 5
79 // <o>Preemption interrupt priority
80 // <i> Maximum priority of interrupts that are safe to call FreeRTOS API.
82 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 16
84 // <q>Use time slicing
85 // <i> Enable setting to use timeslicing.
87 #define configUSE_TIME_SLICING 1
89 // <q>Idle should yield
90 // <i> Control Yield behaviour of the idle task.
92 #define configIDLE_SHOULD_YIELD 1
94 // <o>Check for stack overflow
95 // <0=>Disable <1=>Method one <2=>Method two
96 // <i> Enable or disable stack overflow checking.
97 // <i> Callback function vApplicationStackOverflowHook implementation is required when stack checking is enabled.
99 #define configCHECK_FOR_STACK_OVERFLOW 2
102 // <i> Enable callback function call on each idle task iteration.
103 // <i> Callback function vApplicationIdleHook implementation is required when idle hook is enabled.
105 #define configUSE_IDLE_HOOK 0
108 // <i> Enable callback function call during each tick interrupt.
109 // <i> Callback function vApplicationTickHook implementation is required when tick hook is enabled.
111 #define configUSE_TICK_HOOK 0
113 // <q>Use deamon task startup hook
114 // <i> Enable callback function call when timer service starts.
115 // <i> Callback function vApplicationDaemonTaskStartupHook implementation is required when deamon task startup hook is enabled.
117 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
119 // <q>Use malloc failed hook
120 // <i> Enable callback function call when out of dynamic memory.
121 // <i> Callback function vApplicationMallocFailedHook implementation is required when malloc failed hook is enabled.
123 #define configUSE_MALLOC_FAILED_HOOK 0
125 // <o>Queue registry size
126 // <i> Define maximum number of queue objects registered for debug purposes.
127 // <i> The queue registry is used by kernel aware debuggers to locate queue and semaphore structures and display associated text names.
129 #define configQUEUE_REGISTRY_SIZE 0
131 // <h>Event Recorder configuration
132 // <i> Initialize and setup Event Recorder level filtering.
133 // <i> Settings have no effect when Event Recorder is not present.
135 // <q>Initialize Event Recorder
136 // <i> Initialize Event Recorder before FreeRTOS kernel start.
138 #define configEVR_INITIALIZE 1
140 // <e>Setup recording level filter
141 // <i> Enable configuration of FreeRTOS events recording level
143 #define configEVR_SETUP_LEVEL 1
145 // <o>Tasks functions
146 // <i> Define event recording level bitmask for events generated from Tasks functions.
148 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
149 #define configEVR_LEVEL_TASKS 0x05
151 // <o>Queue functions
152 // <i> Define event recording level bitmask for events generated from Queue functions.
154 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
155 #define configEVR_LEVEL_QUEUE 0x05
157 // <o>Timer functions
158 // <i> Define event recording level bitmask for events generated from Timer functions.
160 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
161 #define configEVR_LEVEL_TIMERS 0x05
163 // <o>Event Groups functions
164 // <i> Define event recording level bitmask for events generated from Event Groups functions.
166 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
167 #define configEVR_LEVEL_EVENTGROUPS 0x05
170 // <i> Define event recording level bitmask for events generated from Heap functions.
172 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
173 #define configEVR_LEVEL_HEAP 0x05
175 // <o>Stream Buffer functions
176 // <i> Define event recording level bitmask for events generated from Stream Buffer functions.
178 // <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
179 #define configEVR_LEVEL_STREAMBUFFER 0x05
183 // <h> Port Specific Features
184 // <i> Enable and configure port specific features.
185 // <i> Check FreeRTOS documentation for definitions that apply for the used port.
187 // <q>Use Floating Point Unit
188 // <i> Using Floating Point Unit (FPU) affects context handling.
189 // <i> Enable FPU when application uses floating point operations.
191 #define configENABLE_FPU 1
193 // <q>Use Memory Protection Unit
194 // <i> Using Memory Protection Unit (MPU) requires detailed memory map definition.
195 // <i> This setting is only releavant for MPU enabled ports.
197 #define configENABLE_MPU 0
199 // <q> Use TrustZone Secure Side Only
200 // <i> This settings prevents FreeRTOS contex switch to Non-Secure side.
201 // <i> Enable this setting when FreeRTOS runs on the Secure side only.
202 #define configRUN_FREERTOS_SECURE_ONLY 0
204 // <q>Use TrustZone Security Extension
205 // <i> Using TrustZone affects context handling.
206 // <i> Enable TrustZone when FreeRTOS runs on the Non-Secure side and calls functions from the Secure side.
208 #define configENABLE_TRUSTZONE 1
210 // <o>Minimal secure stack size [words] <0-65535>
211 // <i> Stack for idle task Secure side context in words.
212 // <i> This setting is only relevant when TrustZone extension is enabled.
214 #define configMINIMAL_SECURE_STACK_SIZE ((uint32_t)128)
217 //------------- <<< end of configuration section >>> ---------------------------
219 /* Defines needed by FreeRTOS to implement CMSIS RTOS2 API. Do not change! */
220 #define configCPU_CLOCK_HZ (SystemCoreClock)
221 #define configSUPPORT_STATIC_ALLOCATION 1
222 #define configSUPPORT_DYNAMIC_ALLOCATION 1
223 #define configUSE_PREEMPTION 1
224 #define configUSE_TIMERS 1
225 #define configUSE_MUTEXES 1
226 #define configUSE_RECURSIVE_MUTEXES 1
227 #define configUSE_COUNTING_SEMAPHORES 1
228 #define configUSE_TASK_NOTIFICATIONS 1
229 #define configUSE_TRACE_FACILITY 1
230 #define configUSE_16_BIT_TICKS 0
231 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
232 #define configMAX_PRIORITIES 56
233 #define configKERNEL_INTERRUPT_PRIORITY 255
235 /* Defines that include FreeRTOS functions which implement CMSIS RTOS2 API. Do not change! */
236 #define INCLUDE_xEventGroupSetBitsFromISR 1
237 #define INCLUDE_xSemaphoreGetMutexHolder 1
238 #define INCLUDE_vTaskDelay 1
239 #define INCLUDE_vTaskDelayUntil 1
240 #define INCLUDE_vTaskDelete 1
241 #define INCLUDE_xTaskGetCurrentTaskHandle 1
242 #define INCLUDE_xTaskGetSchedulerState 1
243 #define INCLUDE_uxTaskGetStackHighWaterMark 1
244 #define INCLUDE_uxTaskPriorityGet 1
245 #define INCLUDE_vTaskPrioritySet 1
246 #define INCLUDE_eTaskGetState 1
247 #define INCLUDE_vTaskSuspend 1
248 #define INCLUDE_xTimerPendFunctionCall 1
250 /* Map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
251 #define xPortPendSVHandler PendSV_Handler
252 #define vPortSVCHandler SVC_Handler
254 /* Ensure Cortex-M port compatibility. */
255 #define SysTick_Handler xPortSysTickHandler
257 /* Include debug event definitions */
258 #include "freertos_evr.h"
260 #endif /* FREERTOS_CONFIG_H */