Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * FreeRTOS Kernel <DEVELOPMENT BRANCH> |
| 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | * |
| 5 | * SPDX-License-Identifier: MIT |
| 6 | * |
| 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 8 | * this software and associated documentation files (the "Software"), to deal in |
| 9 | * the Software without restriction, including without limitation the rights to |
| 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 11 | * the Software, and to permit persons to whom the Software is furnished to do so, |
| 12 | * subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be included in all |
| 15 | * copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 | * |
| 24 | * https://www.FreeRTOS.org |
| 25 | * https://github.com/FreeRTOS |
| 26 | * |
| 27 | */ |
| 28 | |
| 29 | /******************************************************************************* |
| 30 | * This file provides an example FreeRTOSConfig.h header file, inclusive of an |
| 31 | * abbreviated explanation of each configuration item. Online and reference |
| 32 | * documentation provides more information. |
| 33 | * https://www.freertos.org/a00110.html |
| 34 | * |
| 35 | * Constant values enclosed in square brackets ('[' and ']') must be completed |
| 36 | * before this file will build. |
| 37 | * |
| 38 | * Use the FreeRTOSConfig.h supplied with the RTOS port in use rather than this |
| 39 | * generic file, if one is available. |
| 40 | ******************************************************************************/ |
| 41 | |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 42 | #ifndef FREERTOS_CONFIG_H |
| 43 | #define FREERTOS_CONFIG_H |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 44 | |
| 45 | /******************************************************************************/ |
| 46 | /* Hardware description related definitions. **********************************/ |
| 47 | /******************************************************************************/ |
| 48 | |
| 49 | /* In most cases, configCPU_CLOCK_HZ must be set to the frequency of the clock |
| 50 | * that drives the peripheral used to generate the kernels periodic tick interrupt. |
| 51 | * The default value is set to 20MHz and matches the QEMU demo settings. Your |
| 52 | * application will certainly need a different value so set this correctly. |
| 53 | * This is very often, but not always, equal to the main system clock frequency. */ |
| 54 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) |
| 55 | |
| 56 | /* configSYSTICK_CLOCK_HZ is an optional parameter for ARM Cortex-M ports only. |
| 57 | * |
| 58 | * By default ARM Cortex-M ports generate the RTOS tick interrupt from the |
| 59 | * Cortex-M SysTick timer. Most Cortex-M MCUs run the SysTick timer at the same |
| 60 | * frequency as the MCU itself - when that is the case configSYSTICK_CLOCK_HZ is |
| 61 | * not needed and should be left undefined. If the SysTick timer is clocked at a |
| 62 | * different frequency to the MCU core then set configCPU_CLOCK_HZ to the MCU clock |
| 63 | * frequency, as normal, and configSYSTICK_CLOCK_HZ to the SysTick clock |
| 64 | * frequency. Not used if left undefined. |
| 65 | * The default value is undefined (commented out). If you need this value bring it |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 66 | * back and set it to a suitable value. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 67 | |
| 68 | /* |
| 69 | #define configSYSTICK_CLOCK_HZ [Platform specific] |
| 70 | */ |
| 71 | |
| 72 | /******************************************************************************/ |
| 73 | /* Scheduling behaviour related definitions. **********************************/ |
| 74 | /******************************************************************************/ |
| 75 | |
| 76 | /* configTICK_RATE_HZ sets frequency of the tick interrupt in Hz, normally |
| 77 | * calculated from the configCPU_CLOCK_HZ value. */ |
| 78 | #define configTICK_RATE_HZ 100 |
| 79 | |
| 80 | /* Set configUSE_PREEMPTION to 1 to use pre-emptive scheduling. Set |
| 81 | * configUSE_PREEMPTION to 0 to use co-operative scheduling. |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 82 | * See https://www.freertos.org/single-core-amp-smp-rtos-scheduling.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 83 | #define configUSE_PREEMPTION 1 |
| 84 | |
| 85 | /* Set configUSE_TIME_SLICING to 1 to have the scheduler switch between Ready |
| 86 | * state tasks of equal priority on every tick interrupt. Set |
| 87 | * configUSE_TIME_SLICING to 0 to prevent the scheduler switching between Ready |
| 88 | * state tasks just because there was a tick interrupt. See |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 89 | * https://freertos.org/single-core-amp-smp-rtos-scheduling.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 90 | #define configUSE_TIME_SLICING 0 |
| 91 | |
| 92 | /* Set configUSE_PORT_OPTIMISED_TASK_SELECTION to 1 to select the next task to |
| 93 | * run using an algorithm optimised to the instruction set of the target hardware - |
| 94 | * normally using a count leading zeros assembly instruction. Set to 0 to select |
| 95 | * the next task to run using a generic C algorithm that works for all FreeRTOS |
| 96 | * ports. Not all FreeRTOS ports have this option. Defaults to 0 if left |
| 97 | * undefined. */ |
| 98 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 |
| 99 | |
| 100 | /* Set configUSE_TICKLESS_IDLE to 1 to use the low power tickless mode. Set to |
| 101 | * 0 to keep the tick interrupt running at all times. Not all FreeRTOS ports |
| 102 | * support tickless mode. See https://www.freertos.org/low-power-tickless-rtos.html |
| 103 | * Defaults to 0 if left undefined. */ |
| 104 | #define configUSE_TICKLESS_IDLE 0 |
| 105 | |
| 106 | /* configMAX_PRIORITIES Sets the number of available task priorities. Tasks can |
| 107 | * be assigned priorities of 0 to (configMAX_PRIORITIES - 1). Zero is the lowest |
| 108 | * priority. */ |
| 109 | #define configMAX_PRIORITIES 5 |
| 110 | |
| 111 | /* configMINIMAL_STACK_SIZE defines the size of the stack used by the Idle task |
| 112 | * (in words, not in bytes!). The kernel does not use this constant for any other |
| 113 | * purpose. Demo applications use the constant to make the demos somewhat portable |
| 114 | * across hardware architectures. */ |
| 115 | #define configMINIMAL_STACK_SIZE 128 |
| 116 | |
| 117 | /* configMAX_TASK_NAME_LEN sets the maximum length (in characters) of a task's |
| 118 | * human readable name. Includes the NULL terminator. */ |
| 119 | #define configMAX_TASK_NAME_LEN 16 |
| 120 | |
Tony Josi | a8650b9 | 2023-10-23 14:50:41 +0530 | [diff] [blame] | 121 | /* Time is measured in 'ticks' - which is the number of times the tick interrupt |
| 122 | * has executed since the RTOS kernel was started. |
| 123 | * The tick count is held in a variable of type TickType_t. |
| 124 | * |
| 125 | * configTICK_TYPE_WIDTH_IN_BITS controls the type (and therefore bit-width) of TickType_t: |
| 126 | * |
| 127 | * Defining configTICK_TYPE_WIDTH_IN_BITS as TICK_TYPE_WIDTH_16_BITS causes |
| 128 | * TickType_t to be defined (typedef'ed) as an unsigned 16-bit type. |
| 129 | * |
| 130 | * Defining configTICK_TYPE_WIDTH_IN_BITS as TICK_TYPE_WIDTH_32_BITS causes |
| 131 | * TickType_t to be defined (typedef'ed) as an unsigned 32-bit type. |
| 132 | * |
| 133 | * Defining configTICK_TYPE_WIDTH_IN_BITS as TICK_TYPE_WIDTH_64_BITS causes |
| 134 | * TickType_t to be defined (typedef'ed) as an unsigned 64-bit type. */ |
| 135 | #define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_64_BITS |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 136 | |
| 137 | /* Set configIDLE_SHOULD_YIELD to 1 to have the Idle task yield to an |
| 138 | * application task if there is an Idle priority (priority 0) application task that |
| 139 | * can run. Set to 0 to have the Idle task use all of its timeslice. Default to 1 |
| 140 | * if left undefined. */ |
| 141 | #define configIDLE_SHOULD_YIELD 1 |
| 142 | |
| 143 | /* Each task has an array of task notifications. |
| 144 | * configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the array. |
| 145 | * See https://www.freertos.org/RTOS-task-notifications.html Defaults to 1 if |
| 146 | * left undefined. */ |
| 147 | #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1 |
| 148 | |
| 149 | /* configQUEUE_REGISTRY_SIZE sets the maximum number of queues and semaphores |
| 150 | * that can be referenced from the queue registry. Only required when using a |
| 151 | * kernel aware debugger. Defaults to 0 if left undefined. */ |
| 152 | #define configQUEUE_REGISTRY_SIZE 0 |
| 153 | |
| 154 | /* Set configENABLE_BACKWARD_COMPATIBILITY to 1 to map function names and |
| 155 | * datatypes from old version of FreeRTOS to their latest equivalent. Defaults to |
| 156 | * 1 if left undefined. */ |
| 157 | #define configENABLE_BACKWARD_COMPATIBILITY 0 |
| 158 | |
| 159 | /* Each task has its own array of pointers that can be used as thread local |
| 160 | * storage. configNUM_THREAD_LOCAL_STORAGE_POINTERS set the number of indexes in |
| 161 | * the array. See https://www.freertos.org/thread-local-storage-pointers.html |
| 162 | * Defaults to 0 if left undefined. */ |
| 163 | #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 |
| 164 | |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 165 | /* When configUSE_MINI_LIST_ITEM is set to 0, MiniListItem_t and ListItem_t are |
| 166 | * both the same. When configUSE_MINI_LIST_ITEM is set to 1, MiniListItem_t contains |
| 167 | * 3 fewer fields than ListItem_t which saves some RAM at the cost of violating |
| 168 | * strict aliasing rules which some compilers depend on for optimization. Defaults |
| 169 | * to 1 if left undefined. */ |
| 170 | #define configUSE_MINI_LIST_ITEM 1 |
| 171 | |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 172 | /* Sets the type used by the parameter to xTaskCreate() that specifies the stack |
| 173 | * size of the task being created. The same type is used to return information |
| 174 | * about stack usage in various other API calls. Defaults to size_t if left |
| 175 | * undefined. */ |
| 176 | #define configSTACK_DEPTH_TYPE size_t |
| 177 | |
| 178 | /* configMESSAGE_BUFFER_LENGTH_TYPE sets the type used to store the length of |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 179 | * each message written to a FreeRTOS message buffer (the length is also written to |
| 180 | * the message buffer. Defaults to size_t if left undefined - but that may waste |
| 181 | * space if messages never go above a length that could be held in a uint8_t. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 182 | #define configMESSAGE_BUFFER_LENGTH_TYPE size_t |
| 183 | |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 184 | /* If configHEAP_CLEAR_MEMORY_ON_FREE is set to 1, then blocks of memory allocated |
| 185 | * using pvPortMalloc() will be cleared (i.e. set to zero) when freed using |
| 186 | * vPortFree(). Defaults to 0 if left undefined. */ |
| 187 | #define configHEAP_CLEAR_MEMORY_ON_FREE 1 |
| 188 | |
| 189 | /* vTaskList and vTaskGetRunTimeStats APIs take a buffer as a parameter and assume |
| 190 | * that the length of the buffer is configSTATS_BUFFER_MAX_LENGTH. Defaults to |
| 191 | * 0xFFFF if left undefined. |
| 192 | * New applications are recommended to use vTaskListTasks and |
| 193 | * vTaskGetRunTimeStatistics APIs instead and supply the length of the buffer |
| 194 | * explicitly to avoid memory corruption. */ |
| 195 | #define configSTATS_BUFFER_MAX_LENGTH 0xFFFF |
| 196 | |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 197 | /* Set configUSE_NEWLIB_REENTRANT to 1 to have a newlib reent structure |
| 198 | * allocated for each task. Set to 0 to not support newlib reent structures. |
| 199 | * Default to 0 if left undefined. |
| 200 | * |
| 201 | * Note Newlib support has been included by popular demand, but is not used or |
| 202 | * tested by the FreeRTOS maintainers themselves. FreeRTOS is not responsible for |
| 203 | * resulting newlib operation. User must be familiar with newlib and must provide |
| 204 | * system-wide implementations of the necessary stubs. Note that (at the time of |
| 205 | * writing) the current newlib design implements a system-wide malloc() that must |
| 206 | * be provided with locks. */ |
| 207 | #define configUSE_NEWLIB_REENTRANT 0 |
| 208 | |
| 209 | /******************************************************************************/ |
| 210 | /* Software timer related definitions. ****************************************/ |
| 211 | /******************************************************************************/ |
| 212 | |
| 213 | /* Set configUSE_TIMERS to 1 to include software timer functionality in the |
| 214 | * build. Set to 0 to exclude software timer functionality from the build. The |
| 215 | * FreeRTOS/source/timers.c source file must be included in the build if |
| 216 | * configUSE_TIMERS is set to 1. Default to 0 if left undefined. See |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 217 | * https://www.freertos.org/RTOS-software-timer.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 218 | #define configUSE_TIMERS 1 |
| 219 | |
| 220 | /* configTIMER_TASK_PRIORITY sets the priority used by the timer task. Only |
| 221 | * used if configUSE_TIMERS is set to 1. The timer task is a standard FreeRTOS |
| 222 | * task, so its priority is set like any other task. See |
| 223 | * https://www.freertos.org/RTOS-software-timer-service-daemon-task.html Only used |
| 224 | * if configUSE_TIMERS is set to 1. */ |
| 225 | #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) |
| 226 | |
| 227 | /* configTIMER_TASK_STACK_DEPTH sets the size of the stack allocated to the |
| 228 | * timer task (in words, not in bytes!). The timer task is a standard FreeRTOS |
| 229 | * task. See https://www.freertos.org/RTOS-software-timer-service-daemon-task.html |
| 230 | * Only used if configUSE_TIMERS is set to 1. */ |
| 231 | #define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE |
| 232 | |
| 233 | /* configTIMER_QUEUE_LENGTH sets the length of the queue (the number of discrete |
| 234 | * items the queue can hold) used to send commands to the timer task. See |
| 235 | * https://www.freertos.org/RTOS-software-timer-service-daemon-task.html Only used |
| 236 | * if configUSE_TIMERS is set to 1. */ |
| 237 | #define configTIMER_QUEUE_LENGTH 10 |
| 238 | |
| 239 | /******************************************************************************/ |
| 240 | /* Memory allocation related definitions. *************************************/ |
| 241 | /******************************************************************************/ |
| 242 | |
| 243 | /* Set configSUPPORT_STATIC_ALLOCATION to 1 to include FreeRTOS API functions |
| 244 | * that create FreeRTOS objects (tasks, queues, etc.) using statically allocated |
| 245 | * memory in the build. Set to 0 to exclude the ability to create statically |
| 246 | * allocated objects from the build. Defaults to 0 if left undefined. See |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 247 | * https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 248 | #define configSUPPORT_STATIC_ALLOCATION 1 |
| 249 | |
| 250 | /* Set configSUPPORT_DYNAMIC_ALLOCATION to 1 to include FreeRTOS API functions |
| 251 | * that create FreeRTOS objects (tasks, queues, etc.) using dynamically allocated |
| 252 | * memory in the build. Set to 0 to exclude the ability to create dynamically |
| 253 | * allocated objects from the build. Defaults to 1 if left undefined. See |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 254 | * https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 255 | #define configSUPPORT_DYNAMIC_ALLOCATION 1 |
| 256 | |
| 257 | /* Sets the total size of the FreeRTOS heap, in bytes, when heap_1.c, heap_2.c |
| 258 | * or heap_4.c are included in the build. This value is defaulted to 4096 bytes but |
| 259 | * it must be tailored to each application. Note the heap will appear in the .bss |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 260 | * section. See https://www.freertos.org/a00111.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 261 | #define configTOTAL_HEAP_SIZE 4096 |
| 262 | |
| 263 | /* Set configAPPLICATION_ALLOCATED_HEAP to 1 to have the application allocate |
| 264 | * the array used as the FreeRTOS heap. Set to 0 to have the linker allocate the |
| 265 | * array used as the FreeRTOS heap. Defaults to 0 if left undefined. */ |
| 266 | #define configAPPLICATION_ALLOCATED_HEAP 0 |
| 267 | |
| 268 | /* Set configSTACK_ALLOCATION_FROM_SEPARATE_HEAP to 1 to have task stacks |
| 269 | * allocated from somewhere other than the FreeRTOS heap. This is useful if you |
| 270 | * want to ensure stacks are held in fast memory. Set to 0 to have task stacks |
| 271 | * come from the standard FreeRTOS heap. The application writer must provide |
| 272 | * implementations for pvPortMallocStack() and vPortFreeStack() if set to 1. |
| 273 | * Defaults to 0 if left undefined. */ |
| 274 | #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0 |
| 275 | |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 276 | /* Set configENABLE_HEAP_PROTECTOR to 1 to enable bounds checking and obfuscation |
| 277 | * to internal heap block pointers in heap_4.c and heap_5.c to help catch pointer |
| 278 | * corruptions. Defaults to 0 if left undefined. */ |
| 279 | #define configENABLE_HEAP_PROTECTOR 0 |
| 280 | |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 281 | /******************************************************************************/ |
| 282 | /* Interrupt nesting behaviour configuration. *********************************/ |
| 283 | /******************************************************************************/ |
| 284 | |
| 285 | /* configKERNEL_INTERRUPT_PRIORITY sets the priority of the tick and context |
| 286 | * switch performing interrupts. The default value is set to the highest interrupt |
| 287 | * priority (0). Not supported by all FreeRTOS ports. See |
| 288 | * https://www.freertos.org/RTOS-Cortex-M3-M4.html for information specific to ARM |
| 289 | * Cortex-M devices. */ |
| 290 | #define configKERNEL_INTERRUPT_PRIORITY 0 |
| 291 | |
| 292 | /* configMAX_SYSCALL_INTERRUPT_PRIORITY sets the interrupt priority above which |
| 293 | * FreeRTOS API calls must not be made. Interrupts above this priority are never |
| 294 | * disabled, so never delayed by RTOS activity. The default value is set to the |
| 295 | * highest interrupt priority (0). Not supported by all FreeRTOS ports. |
| 296 | * See https://www.freertos.org/RTOS-Cortex-M3-M4.html for information specific to |
| 297 | * ARM Cortex-M devices. */ |
| 298 | #define configMAX_SYSCALL_INTERRUPT_PRIORITY 0 |
| 299 | |
| 300 | /* Another name for configMAX_SYSCALL_INTERRUPT_PRIORITY - the name used depends |
| 301 | * on the FreeRTOS port. */ |
| 302 | #define configMAX_API_CALL_INTERRUPT_PRIORITY 0 |
| 303 | |
| 304 | /******************************************************************************/ |
| 305 | /* Hook and callback function related definitions. ****************************/ |
| 306 | /******************************************************************************/ |
| 307 | |
| 308 | /* Set the following configUSE_* constants to 1 to include the named hook |
| 309 | * functionality in the build. Set to 0 to exclude the hook functionality from the |
| 310 | * build. The application writer is responsible for providing the hook function |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 311 | * for any set to 1. See https://www.freertos.org/a00016.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 312 | #define configUSE_IDLE_HOOK 0 |
| 313 | #define configUSE_TICK_HOOK 0 |
| 314 | #define configUSE_MALLOC_FAILED_HOOK 0 |
| 315 | #define configUSE_DAEMON_TASK_STARTUP_HOOK 0 |
| 316 | |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 317 | /* Set configUSE_SB_COMPLETED_CALLBACK to 1 to have send and receive completed |
| 318 | * callbacks for each instance of a stream buffer or message buffer. When the |
| 319 | * option is set to 1, APIs xStreamBufferCreateWithCallback() and |
| 320 | * xStreamBufferCreateStaticWithCallback() (and likewise APIs for message |
| 321 | * buffer) can be used to create a stream buffer or message buffer instance |
| 322 | * with application provided callbacks. Defaults to 0 if left undefined. */ |
| 323 | #define configUSE_SB_COMPLETED_CALLBACK 0 |
| 324 | |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 325 | /* Set configCHECK_FOR_STACK_OVERFLOW to 1 or 2 for FreeRTOS to check for a |
| 326 | * stack overflow at the time of a context switch. Set to 0 to not look for a |
| 327 | * stack overflow. If configCHECK_FOR_STACK_OVERFLOW is 1 then the check only |
| 328 | * looks for the stack pointer being out of bounds when a task's context is saved |
| 329 | * to its stack - this is fast but somewhat ineffective. If |
| 330 | * configCHECK_FOR_STACK_OVERFLOW is 2 then the check looks for a pattern written |
| 331 | * to the end of a task's stack having been overwritten. This is slower, but will |
| 332 | * catch most (but not all) stack overflows. The application writer must provide |
| 333 | * the stack overflow callback when configCHECK_FOR_STACK_OVERFLOW is set to 1. |
| 334 | * See https://www.freertos.org/Stacks-and-stack-overflow-checking.html Defaults |
| 335 | * to 0 if left undefined. */ |
| 336 | #define configCHECK_FOR_STACK_OVERFLOW 2 |
| 337 | |
| 338 | /******************************************************************************/ |
| 339 | /* Run time and task stats gathering related definitions. *********************/ |
| 340 | /******************************************************************************/ |
| 341 | |
| 342 | /* Set configGENERATE_RUN_TIME_STATS to 1 to have FreeRTOS collect data on the |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 343 | * processing time used by each task. Set to 0 to not collect the data. The |
| 344 | * application writer needs to provide a clock source if set to 1. Defaults to 0 |
| 345 | * if left undefined. See https://www.freertos.org/rtos-run-time-stats.html. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 346 | #define configGENERATE_RUN_TIME_STATS 0 |
| 347 | |
| 348 | /* Set configUSE_TRACE_FACILITY to include additional task structure members |
| 349 | * are used by trace and visualisation functions and tools. Set to 0 to exclude |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 350 | * the additional information from the structures. Defaults to 0 if left |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 351 | * undefined. */ |
| 352 | #define configUSE_TRACE_FACILITY 0 |
| 353 | |
| 354 | /* Set to 1 to include the vTaskList() and vTaskGetRunTimeStats() functions in |
| 355 | * the build. Set to 0 to exclude these functions from the build. These two |
| 356 | * functions introduce a dependency on string formatting functions that would |
| 357 | * otherwise not exist - hence they are kept separate. Defaults to 0 if left |
| 358 | * undefined. */ |
| 359 | #define configUSE_STATS_FORMATTING_FUNCTIONS 0 |
| 360 | |
| 361 | /******************************************************************************/ |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 362 | /* Co-routine related definitions. ********************************************/ |
| 363 | /******************************************************************************/ |
| 364 | |
| 365 | /* Set configUSE_CO_ROUTINES to 1 to include co-routine functionality in the |
| 366 | * build, or 0 to omit co-routine functionality from the build. To include |
| 367 | * co-routines, croutine.c must be included in the project. Defaults to 0 if left |
| 368 | * undefined. */ |
| 369 | #define configUSE_CO_ROUTINES 0 |
| 370 | |
| 371 | /* configMAX_CO_ROUTINE_PRIORITIES defines the number of priorities available |
| 372 | * to the application co-routines. Any number of co-routines can share the same |
| 373 | * priority. Defaults to 0 if left undefined. */ |
| 374 | #define configMAX_CO_ROUTINE_PRIORITIES 1 |
| 375 | |
| 376 | /******************************************************************************/ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 377 | /* Debugging assistance. ******************************************************/ |
| 378 | /******************************************************************************/ |
| 379 | |
| 380 | /* configASSERT() has the same semantics as the standard C assert(). It can |
| 381 | * either be defined to take an action when the assertion fails, or not defined |
| 382 | * at all (i.e. comment out or delete the definitions) to completely remove |
| 383 | * assertions. configASSERT() can be defined to anything you want, for example |
| 384 | * you can call a function if an assert fails that passes the filename and line |
| 385 | * number of the failing assert (for example, "vAssertCalled( __FILE__, __LINE__ )" |
| 386 | * or it can simple disable interrupts and sit in a loop to halt all execution |
| 387 | * on the failing line for viewing in a debugger. */ |
| 388 | #define configASSERT( x ) \ |
| 389 | if( ( x ) == 0 ) \ |
| 390 | { \ |
| 391 | taskDISABLE_INTERRUPTS(); \ |
| 392 | for( ; ; ) \ |
| 393 | ; \ |
| 394 | } |
| 395 | |
| 396 | /******************************************************************************/ |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 397 | /* FreeRTOS MPU specific definitions. *****************************************/ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 398 | /******************************************************************************/ |
| 399 | |
| 400 | /* If configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS is set to 1 then |
| 401 | * the application writer can provide functions that execute in privileged mode. |
| 402 | * See: https://www.freertos.org/a00110.html#configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS |
| 403 | * Defaults to 0 if left undefined. Only used by the FreeRTOS Cortex-M MPU ports, |
| 404 | * not the standard ARMv7-M Cortex-M port. */ |
| 405 | #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0 |
| 406 | |
| 407 | /* Set configTOTAL_MPU_REGIONS to the number of MPU regions implemented on your |
| 408 | * target hardware. Normally 8 or 16. Only used by the FreeRTOS Cortex-M MPU |
| 409 | * ports, not the standard ARMv7-M Cortex-M port. Defaults to 8 if left |
| 410 | * undefined. */ |
| 411 | #define configTOTAL_MPU_REGIONS 8 |
| 412 | |
| 413 | /* configTEX_S_C_B_FLASH allows application writers to override the default |
| 414 | * values for the for TEX, Shareable (S), Cacheable (C) and Bufferable (B) bits for |
| 415 | * the MPU region covering Flash. Defaults to 0x07UL (which means TEX=000, S=1, |
| 416 | * C=1, B=1) if left undefined. Only used by the FreeRTOS Cortex-M MPU ports, not |
| 417 | * the standard ARMv7-M Cortex-M port. */ |
| 418 | #define configTEX_S_C_B_FLASH 0x07UL |
| 419 | |
| 420 | /* configTEX_S_C_B_SRAM allows application writers to override the default |
| 421 | * values for the for TEX, Shareable (S), Cacheable (C) and Bufferable (B) bits for |
| 422 | * the MPU region covering RAM. Defaults to 0x07UL (which means TEX=000, S=1, C=1, |
| 423 | * B=1) if left undefined. Only used by the FreeRTOS Cortex-M MPU ports, not |
| 424 | * the standard ARMv7-M Cortex-M port. */ |
| 425 | #define configTEX_S_C_B_SRAM 0x07UL |
| 426 | |
| 427 | /* Set configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY to 0 to prevent any privilege |
| 428 | * escalations originating from outside of the kernel code itself. Set to 1 to |
| 429 | * allow application tasks to raise privilege. Defaults to 1 if left undefined. |
| 430 | * Only used by the FreeRTOS Cortex-M MPU ports, not the standard ARMv7-M Cortex-M |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 431 | * port. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 432 | #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 |
| 433 | |
| 434 | /* Set configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS to 1 to allow unprivileged |
| 435 | * tasks enter critical sections (effectively mask interrupts). Set to 0 to |
| 436 | * prevent unprivileged tasks entering critical sections. Defaults to 1 if left |
| 437 | * undefined. Only used by the FreeRTOS Cortex-M MPU ports, not the standard |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 438 | * ARMv7-M Cortex-M port. */ |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 439 | #define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 |
| 440 | |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 441 | /* FreeRTOS Kernel version 10.6.0 introduced a new v2 MPU wrapper, namely |
| 442 | * mpu_wrappers_v2.c. Set configUSE_MPU_WRAPPERS_V1 to 0 to use the new v2 MPU |
| 443 | * wrapper. Set configUSE_MPU_WRAPPERS_V1 to 1 to use the old v1 MPU wrapper |
| 444 | * (mpu_wrappers.c). Defaults to 0 if left undefined. */ |
| 445 | #define configUSE_MPU_WRAPPERS_V1 0 |
| 446 | |
| 447 | /* When using the v2 MPU wrapper, set configPROTECTED_KERNEL_OBJECT_POOL_SIZE to |
| 448 | * the total number of kernel objects, which includes tasks, queues, semaphores, |
| 449 | * mutexes, event groups, timers, stream buffers and message buffers, in your |
| 450 | * application. The application will not be able to have more than |
| 451 | * configPROTECTED_KERNEL_OBJECT_POOL_SIZE kernel objects at any point of |
| 452 | * time. */ |
| 453 | #define configPROTECTED_KERNEL_OBJECT_POOL_SIZE 10 |
| 454 | |
| 455 | /* When using the v2 MPU wrapper, set configSYSTEM_CALL_STACK_SIZE to the size |
| 456 | * of the system call stack in words. Each task has a statically allocated |
| 457 | * memory buffer of this size which is used as the stack to execute system |
| 458 | * calls. For example, if configSYSTEM_CALL_STACK_SIZE is defined as 128 and |
| 459 | * there are 10 tasks in the application, the total amount of memory used for |
| 460 | * system call stacks is 128 * 10 = 1280 words. */ |
| 461 | #define configSYSTEM_CALL_STACK_SIZE 128 |
| 462 | |
| 463 | /* When using the v2 MPU wrapper, set configENABLE_ACCESS_CONTROL_LIST to 1 to |
| 464 | * enable Access Control List (ACL) feature. When ACL is enabled, an |
| 465 | * unprivileged task by default does not have access to any kernel object other |
| 466 | * than itself. The application writer needs to explicitly grant the |
| 467 | * unprivileged task access to the kernel objects it needs using the APIs |
| 468 | * provided for the same. Defaults to 0 if left undefined. */ |
| 469 | #define configENABLE_ACCESS_CONTROL_LIST 1 |
| 470 | |
| 471 | /******************************************************************************/ |
| 472 | /* SMP( Symmetric MultiProcessing ) Specific Configuration definitions. *******/ |
| 473 | /******************************************************************************/ |
| 474 | |
| 475 | /* Set configNUMBER_OF_CORES to the number of available processor cores. Defaults |
| 476 | * to 1 if left undefined. */ |
| 477 | |
| 478 | /* |
| 479 | #define configNUMBER_OF_CORES [Num of available cores] |
| 480 | */ |
| 481 | |
| 482 | /* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), set |
| 483 | * configRUN_MULTIPLE_PRIORITIES to 0 to allow multiple tasks to run |
| 484 | * simultaneously only if they do not have equal priority, thereby maintaining |
| 485 | * the paradigm of a lower priority task never running if a higher priority task |
| 486 | * is able to run. If configRUN_MULTIPLE_PRIORITIES is set to 1, multiple tasks |
| 487 | * with different priorities may run simultaneously - so a higher and lower |
| 488 | * priority task may run on different cores at the same time. */ |
| 489 | #define configRUN_MULTIPLE_PRIORITIES 0 |
| 490 | |
| 491 | /* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), set |
| 492 | * configUSE_CORE_AFFINITY to 1 to enable core affinity feature. When core |
| 493 | * affinity feature is enabled, the vTaskCoreAffinitySet and vTaskCoreAffinityGet |
| 494 | * APIs can be used to set and retrieve which cores a task can run on. If |
| 495 | * configUSE_CORE_AFFINITY is set to 0 then the FreeRTOS scheduler is free to |
| 496 | * run any task on any available core. */ |
| 497 | #define configUSE_CORE_AFFINITY 0 |
| 498 | |
| 499 | /* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), if |
| 500 | * configUSE_TASK_PREEMPTION_DISABLE is set to 1, individual tasks can be set to |
| 501 | * either pre-emptive or co-operative mode using the vTaskPreemptionDisable and |
| 502 | * vTaskPreemptionEnable APIs. */ |
| 503 | #define configUSE_TASK_PREEMPTION_DISABLE 0 |
| 504 | |
| 505 | /* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), set |
| 506 | * configUSE_PASSIVE_IDLE_HOOK to 1 to allow the application writer to use |
| 507 | * the passive idle task hook to add background functionality without the overhead |
| 508 | * of a separate task. Defaults to 0 if left undefined. */ |
| 509 | #define configUSE_PASSIVE_IDLE_HOOK 0 |
| 510 | |
| 511 | /* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), |
| 512 | * configTIMER_SERVICE_TASK_CORE_AFFINITY allows the application writer to set |
| 513 | * the core affinity of the RTOS Daemon/Timer Service task. Defaults to |
| 514 | * tskNO_AFFINITY if left undefined. */ |
| 515 | #define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY |
| 516 | |
| 517 | |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 518 | /******************************************************************************/ |
| 519 | /* ARMv8-M secure side port related definitions. ******************************/ |
| 520 | /******************************************************************************/ |
| 521 | |
| 522 | /* secureconfigMAX_SECURE_CONTEXTS define the maximum number of tasks that can |
| 523 | * call into the secure side of an ARMv8-M chip. Not used by any other ports. */ |
Tony Josi | a8650b9 | 2023-10-23 14:50:41 +0530 | [diff] [blame] | 524 | #define secureconfigMAX_SECURE_CONTEXTS 5 |
| 525 | |
| 526 | /* Defines the kernel provided implementation of |
| 527 | * vApplicationGetIdleTaskMemory() and vApplicationGetTimerTaskMemory() |
| 528 | * to provide the memory that is used by the Idle task and Timer task respectively. |
| 529 | * The application can provide it's own implementation of |
| 530 | * vApplicationGetIdleTaskMemory() and vApplicationGetTimerTaskMemory() by |
| 531 | * setting configKERNEL_PROVIDED_STATIC_MEMORY to 0 or leaving it undefined. */ |
| 532 | #define configKERNEL_PROVIDED_STATIC_MEMORY 1 |
Joseph Julicher | 5a9d7c8 | 2023-09-29 19:11:55 -0700 | [diff] [blame] | 533 | |
| 534 | /******************************************************************************/ |
| 535 | /* Definitions that include or exclude functionality. *************************/ |
| 536 | /******************************************************************************/ |
| 537 | |
| 538 | /* Set the following configUSE_* constants to 1 to include the named feature in |
| 539 | * the build, or 0 to exclude the named feature from the build. */ |
| 540 | #define configUSE_TASK_NOTIFICATIONS 1 |
| 541 | #define configUSE_MUTEXES 1 |
| 542 | #define configUSE_RECURSIVE_MUTEXES 1 |
| 543 | #define configUSE_COUNTING_SEMAPHORES 1 |
| 544 | #define configUSE_QUEUE_SETS 0 |
| 545 | #define configUSE_APPLICATION_TASK_TAG 0 |
| 546 | |
| 547 | /* Set the following INCLUDE_* constants to 1 to incldue the named API function, |
| 548 | * or 0 to exclude the named API function. Most linkers will remove unused |
| 549 | * functions even when the constant is 1. */ |
| 550 | #define INCLUDE_vTaskPrioritySet 1 |
| 551 | #define INCLUDE_uxTaskPriorityGet 1 |
| 552 | #define INCLUDE_vTaskDelete 1 |
| 553 | #define INCLUDE_vTaskSuspend 1 |
| 554 | #define INCLUDE_xResumeFromISR 1 |
| 555 | #define INCLUDE_vTaskDelayUntil 1 |
| 556 | #define INCLUDE_vTaskDelay 1 |
| 557 | #define INCLUDE_xTaskGetSchedulerState 1 |
| 558 | #define INCLUDE_xTaskGetCurrentTaskHandle 1 |
| 559 | #define INCLUDE_uxTaskGetStackHighWaterMark 0 |
| 560 | #define INCLUDE_xTaskGetIdleTaskHandle 0 |
| 561 | #define INCLUDE_eTaskGetState 0 |
| 562 | #define INCLUDE_xEventGroupSetBitFromISR 1 |
| 563 | #define INCLUDE_xTimerPendFunctionCall 0 |
| 564 | #define INCLUDE_xTaskAbortDelay 0 |
| 565 | #define INCLUDE_xTaskGetHandle 0 |
| 566 | #define INCLUDE_xTaskResumeFromISR 1 |
| 567 | |
Rahul Kar | 1384c68 | 2023-12-15 10:01:18 +0530 | [diff] [blame] | 568 | #endif /* FREERTOS_CONFIG_H */ |