1 /* --------------------------------------------------------------------------
2 * Copyright (c) 2013-2023 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 *----------------------------------------------------------*/
42 #if (defined(__ARMCC_VERSION) || defined(__GNUC__) || defined(__ICCARM__))
45 #include "RTE_Components.h"
46 #include CMSIS_device_header
51 //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
53 // <o>Minimal stack size [words] <0-65535>
54 // <i> Stack for idle task and default task stack in words.
56 #define configMINIMAL_STACK_SIZE ((uint16_t)(128))
58 // <o>Total heap size [bytes] <0-0xFFFFFFFF>
59 // <i> Heap memory size in bytes.
61 #define configTOTAL_HEAP_SIZE ((size_t)8192)
63 // <o>Kernel tick frequency [Hz] <0-0xFFFFFFFF>
64 // <i> Kernel tick rate in Hz.
66 #define configTICK_RATE_HZ ((TickType_t)1000)
68 // <o>Timer task stack depth [words] <0-65535>
69 // <i> Stack for timer task in words.
71 #define configTIMER_TASK_STACK_DEPTH 80
73 // <o>Timer task priority <0-56>
74 // <i> Timer task priority.
75 // <i> Default: 40 (High)
76 #define configTIMER_TASK_PRIORITY 40
78 // <o>Timer queue length <0-1024>
79 // <i> Timer command queue length.
81 #define configTIMER_QUEUE_LENGTH 5
83 // <o>Preemption interrupt priority
84 // <i> Maximum priority of interrupts that are safe to call FreeRTOS API.
86 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 16
88 // <q>Use time slicing
89 // <i> Enable setting to use timeslicing.
91 #define configUSE_TIME_SLICING 1
93 // <q>Idle should yield
94 // <i> Control Yield behaviour of the idle task.
96 #define configIDLE_SHOULD_YIELD 1
98 // <o>Check for stack overflow
99 // <0=>Disable <1=>Method one <2=>Method two
100 // <i> Enable or disable stack overflow checking.
101 // <i> Callback function vApplicationStackOverflowHook implementation is required when stack checking is enabled.
103 #define configCHECK_FOR_STACK_OVERFLOW 2
106 // <i> Enable callback function call on each idle task iteration.
107 // <i> Callback function vApplicationIdleHook implementation is required when idle hook is enabled.
109 #define configUSE_IDLE_HOOK 0
112 // <i> Enable callback function call during each tick interrupt.
113 // <i> Callback function vApplicationTickHook implementation is required when tick hook is enabled.
115 #define configUSE_TICK_HOOK 0
117 // <q>Use deamon task startup hook
118 // <i> Enable callback function call when timer service starts.
119 // <i> Callback function vApplicationDaemonTaskStartupHook implementation is required when deamon task startup hook is enabled.
121 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
123 // <q>Use malloc failed hook
124 // <i> Enable callback function call when out of dynamic memory.
125 // <i> Callback function vApplicationMallocFailedHook implementation is required when malloc failed hook is enabled.
127 #define configUSE_MALLOC_FAILED_HOOK 0
129 // <o>Queue registry size
130 // <i> Define maximum number of queue objects registered for debug purposes.
131 // <i> The queue registry is used by kernel aware debuggers to locate queue and semaphore structures and display associated text names.
133 #define configQUEUE_REGISTRY_SIZE 0
135 // <o>Interrupt controller base address
136 // <i> Must be set to the base address of the ARM Generic Interrupt Controller (GIC).
137 // <i> Default: 0x2C000000
138 #define configINTERRUPT_CONTROLLER_BASE_ADDRESS 0x2C000000UL
140 // <o>Interrupt controller CPU interface offset
141 // <i> Must be set to the offset from interrupt controller base address at which the CPU interface starts.
142 // <i> Default: 0x1000
143 #define configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET 0x00000100UL
145 // <o>Interrupt controller unique priorities
146 // <i> The number of unique priorities that can be specified in the ARM Generic Interrupt Controller (GIC).
148 #define configUNIQUE_INTERRUPT_PRIORITIES 32
150 // <o>Maximum API call interrupt priority
151 // <i> Interrupts assigned a priority at or below this priority can call interrupt safe FreeRTOS API function, and will nest.
152 // <i> Interrupts assigned a priority above this priority will not be effected by RTOS critical sections, and will nest,
153 // <i> but cannot call any FreeRTOS API functions.
155 #define configMAX_API_CALL_INTERRUPT_PRIORITY 32
157 //------------- <<< end of configuration section >>> ---------------------------
159 /* Defines needed by FreeRTOS to implement CMSIS RTOS2 API. Do not change! */
160 #define configCPU_CLOCK_HZ (SystemCoreClock)
161 #define configSUPPORT_STATIC_ALLOCATION 1
162 #define configSUPPORT_DYNAMIC_ALLOCATION 1
163 #define configUSE_PREEMPTION 1
164 #define configUSE_TIMERS 1
165 #define configUSE_MUTEXES 1
166 #define configUSE_RECURSIVE_MUTEXES 1
167 #define configUSE_COUNTING_SEMAPHORES 1
168 #define configUSE_TASK_NOTIFICATIONS 1
169 #define configUSE_TRACE_FACILITY 1
170 #define configUSE_16_BIT_TICKS 0
171 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
172 #define configMAX_PRIORITIES 56
173 #define configKERNEL_INTERRUPT_PRIORITY 255
175 /* Defines that include FreeRTOS functions which implement CMSIS RTOS2 API. Do not change! */
176 #define INCLUDE_xEventGroupSetBitsFromISR 1
177 #define INCLUDE_xSemaphoreGetMutexHolder 1
178 #define INCLUDE_vTaskDelay 1
179 #define INCLUDE_xTaskDelayUntil 1
180 #define INCLUDE_vTaskDelete 1
181 #define INCLUDE_xTaskGetCurrentTaskHandle 1
182 #define INCLUDE_xTaskGetSchedulerState 1
183 #define INCLUDE_uxTaskGetStackHighWaterMark 1
184 #define INCLUDE_uxTaskPriorityGet 1
185 #define INCLUDE_vTaskPrioritySet 1
186 #define INCLUDE_eTaskGetState 1
187 #define INCLUDE_vTaskSuspend 1
188 #define INCLUDE_xTaskAbortDelay 1
189 #define INCLUDE_xTimerPendFunctionCall 1
191 /* Map the FreeRTOS port timer configuration functions to their implementations */
192 #define configSETUP_TICK_INTERRUPT() \
193 OS_Tick_Setup (configTICK_RATE_HZ, FreeRTOS_Tick_Handler); \
196 #define configCLEAR_TICK_INTERRUPT() \
197 OS_Tick_AcknowledgeIRQ()
199 #endif /* FREERTOS_CONFIG_H */