]> begriffs open source - cmsis-freertos/blob - CMSIS/RTOS2/FreeRTOS/Config/ARMCM/FreeRTOSConfig.h
"Secure Only" config option added for Armv8M port
[cmsis-freertos] / CMSIS / RTOS2 / FreeRTOS / Config / ARMCM / FreeRTOSConfig.h
1 /* --------------------------------------------------------------------------
2  * Copyright (c) 2013-2019 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.2.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 #include <stdint.h>
43
44 #include "RTE_Components.h"
45 #include CMSIS_device_header
46
47 //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
48
49 //  <o>Minimal stack size [words] <0-65535>
50 //  <i> Stack for idle task and default task stack in words.
51 //  <i> Default: 128
52 #define configMINIMAL_STACK_SIZE                ((uint16_t)(128))
53
54 //  <o>Total heap size [bytes] <0-0xFFFFFFFF>
55 //  <i> Heap memory size in bytes.
56 //  <i> Default: 8192
57 #define configTOTAL_HEAP_SIZE                   ((size_t)8192)
58
59 //  <o>Kernel tick frequency [Hz] <0-0xFFFFFFFF>
60 //  <i> Kernel tick rate in Hz.
61 //  <i> Default: 1000
62 #define configTICK_RATE_HZ                      ((TickType_t)1000)
63
64 //  <o>Timer task stack depth [words] <0-65535>
65 //  <i> Stack for timer task in words.
66 //  <i> Default: 80
67 #define configTIMER_TASK_STACK_DEPTH            80
68
69 //  <o>Timer task priority <0-56>
70 //  <i> Timer task priority.
71 //  <i> Default: 40 (High)
72 #define configTIMER_TASK_PRIORITY               40
73
74 //  <o>Timer queue length <0-1024>
75 //  <i> Timer command queue length.
76 //  <i> Default: 5
77 #define configTIMER_QUEUE_LENGTH                5
78
79 //  <o>Preemption interrupt priority
80 //  <i> Maximum priority of interrupts that are safe to call FreeRTOS API.
81 //  <i> Default: 16
82 #define configMAX_SYSCALL_INTERRUPT_PRIORITY    16
83
84 //  <q>Use time slicing
85 //  <i> Enable setting to use timeslicing.
86 //  <i> Default: 1
87 #define configUSE_TIME_SLICING                  1
88
89 //  <q>Idle should yield
90 //  <i> Control Yield behaviour of the idle task.
91 //  <i> Default: 1
92 #define configIDLE_SHOULD_YIELD                 1
93
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.
98 //  <i> Default: 0
99 #define configCHECK_FOR_STACK_OVERFLOW          2
100
101 //  <q>Use idle hook
102 //  <i> Enable callback function call on each idle task iteration.
103 //  <i> Callback function vApplicationIdleHook implementation is required when idle hook is enabled.
104 //  <i> Default: 0
105 #define configUSE_IDLE_HOOK                     0
106
107 //  <q>Use tick hook
108 //  <i> Enable callback function call during each tick interrupt.
109 //  <i> Callback function vApplicationTickHook implementation is required when tick hook is enabled.
110 //  <i> Default: 0
111 #define configUSE_TICK_HOOK                     0
112
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.
116 //  <i> Default: 0
117 #define configUSE_DAEMON_TASK_STARTUP_HOOK      0
118
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.
122 //  <i> Default: 0
123 #define configUSE_MALLOC_FAILED_HOOK            0
124
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.
128 //  <i> Default: 0
129 #define configQUEUE_REGISTRY_SIZE               0
130
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.
134
135 //  <q>Initialize Event Recorder
136 //  <i> Initialize Event Recorder before FreeRTOS kernel start.
137 //  <i> Default: 1
138 #define configEVR_INITIALIZE                    1
139
140 //  <e>Setup recording level filter
141 //  <i> Enable configuration of FreeRTOS events recording level
142 //  <i> Default: 1
143 #define configEVR_SETUP_LEVEL                   1
144
145 //  <o>Tasks functions
146 //  <i> Define event recording level bitmask for events generated from Tasks functions.
147 //  <i> Default: 0x05
148 //    <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
149 #define configEVR_LEVEL_TASKS                   0x05
150
151 //  <o>Queue functions
152 //  <i> Define event recording level bitmask for events generated from Queue functions.
153 //  <i> Default: 0x05
154 //    <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
155 #define configEVR_LEVEL_QUEUE                   0x05
156
157 //  <o>Timer functions
158 //  <i> Define event recording level bitmask for events generated from Timer functions.
159 //  <i> Default: 0x05
160 //    <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
161 #define configEVR_LEVEL_TIMERS                  0x05
162
163 //  <o>Event Groups functions
164 //  <i> Define event recording level bitmask for events generated from Event Groups functions.
165 //  <i> Default: 0x05
166 //    <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
167 #define configEVR_LEVEL_EVENTGROUPS             0x05
168
169 //  <o>Heap functions
170 //  <i> Define event recording level bitmask for events generated from Heap functions.
171 //  <i> Default: 0x05
172 //    <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
173 #define configEVR_LEVEL_HEAP                    0x05
174
175 //  <o>Stream Buffer functions
176 //  <i> Define event recording level bitmask for events generated from Stream Buffer functions.
177 //  <i> Default: 0x05
178 //    <0x00=>Off <0x01=>Errors <0x05=>Errors + Operation <0x0F=>All
179 #define configEVR_LEVEL_STREAMBUFFER            0x05
180 //  </e>
181 // </h>
182
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.
186
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.
190 //  <i> Default: 1
191 #define configENABLE_FPU                      1
192
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.
196 //  <i> Default: 0
197 #define configENABLE_MPU                      0
198
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
203
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.
207 //  <i> Default: 1
208 #define configENABLE_TRUSTZONE                1
209
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.
213 //  <i> Default: 128
214 #define configMINIMAL_SECURE_STACK_SIZE       ((uint32_t)128)
215 // </h>
216
217 //------------- <<< end of configuration section >>> ---------------------------
218
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
234
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
249
250 /* Map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
251 #define xPortPendSVHandler                      PendSV_Handler
252 #define vPortSVCHandler                         SVC_Handler
253
254 /* Ensure Cortex-M port compatibility. */
255 #define SysTick_Handler                         xPortSysTickHandler
256
257 /* Include debug event definitions */
258 #include "freertos_evr.h"
259
260 #endif /* FREERTOS_CONFIG_H */