Skip to content

Commit 26369d9

Browse files
Merge branch 'main' into fixMissingportYIELD_FROM_ISRComment
2 parents d254149 + 1384c68 commit 26369d9

File tree

1 file changed

+146
-21
lines changed

1 file changed

+146
-21
lines changed

examples/sample_configuration/FreeRTOSConfig.h

Lines changed: 146 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
* generic file, if one is available.
4040
******************************************************************************/
4141

42-
#ifndef __FREERTOS_CONFIG_H__
43-
#define __FREERTOS_CONFIG_H__
42+
#ifndef FREERTOS_CONFIG_H
43+
#define FREERTOS_CONFIG_H
4444

4545
/******************************************************************************/
4646
/* Hardware description related definitions. **********************************/
@@ -63,7 +63,7 @@
6363
* frequency, as normal, and configSYSTICK_CLOCK_HZ to the SysTick clock
6464
* frequency. Not used if left undefined.
6565
* The default value is undefined (commented out). If you need this value bring it
66-
* back and set it to a suitable value */
66+
* back and set it to a suitable value. */
6767

6868
/*
6969
#define configSYSTICK_CLOCK_HZ [Platform specific]
@@ -79,14 +79,14 @@
7979

8080
/* Set configUSE_PREEMPTION to 1 to use pre-emptive scheduling. Set
8181
* configUSE_PREEMPTION to 0 to use co-operative scheduling.
82-
* See https://www.freertos.org/single-core-amp-smp-rtos-scheduling.html */
82+
* See https://www.freertos.org/single-core-amp-smp-rtos-scheduling.html. */
8383
#define configUSE_PREEMPTION 1
8484

8585
/* Set configUSE_TIME_SLICING to 1 to have the scheduler switch between Ready
8686
* state tasks of equal priority on every tick interrupt. Set
8787
* configUSE_TIME_SLICING to 0 to prevent the scheduler switching between Ready
8888
* state tasks just because there was a tick interrupt. See
89-
* https://freertos.org/single-core-amp-smp-rtos-scheduling.html */
89+
* https://freertos.org/single-core-amp-smp-rtos-scheduling.html. */
9090
#define configUSE_TIME_SLICING 0
9191

9292
/* Set configUSE_PORT_OPTIMISED_TASK_SELECTION to 1 to select the next task to
@@ -162,18 +162,38 @@
162162
* Defaults to 0 if left undefined. */
163163
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
164164

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+
165172
/* Sets the type used by the parameter to xTaskCreate() that specifies the stack
166173
* size of the task being created. The same type is used to return information
167174
* about stack usage in various other API calls. Defaults to size_t if left
168175
* undefined. */
169176
#define configSTACK_DEPTH_TYPE size_t
170177

171178
/* configMESSAGE_BUFFER_LENGTH_TYPE sets the type used to store the length of
172-
* each message written to a FreeRTOS message buffer (the length is also written to
173-
* the message buffer. Defaults to size_t if left undefined - but that may waste
174-
* space if messages never go above a length that could be held in a uint8_t. */
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. */
175182
#define configMESSAGE_BUFFER_LENGTH_TYPE size_t
176183

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+
177197
/* Set configUSE_NEWLIB_REENTRANT to 1 to have a newlib reent structure
178198
* allocated for each task. Set to 0 to not support newlib reent structures.
179199
* Default to 0 if left undefined.
@@ -194,7 +214,7 @@
194214
* build. Set to 0 to exclude software timer functionality from the build. The
195215
* FreeRTOS/source/timers.c source file must be included in the build if
196216
* configUSE_TIMERS is set to 1. Default to 0 if left undefined. See
197-
* https://www.freertos.org/RTOS-software-timer.html */
217+
* https://www.freertos.org/RTOS-software-timer.html. */
198218
#define configUSE_TIMERS 1
199219

200220
/* configTIMER_TASK_PRIORITY sets the priority used by the timer task. Only
@@ -224,20 +244,20 @@
224244
* that create FreeRTOS objects (tasks, queues, etc.) using statically allocated
225245
* memory in the build. Set to 0 to exclude the ability to create statically
226246
* allocated objects from the build. Defaults to 0 if left undefined. See
227-
* https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html */
247+
* https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html. */
228248
#define configSUPPORT_STATIC_ALLOCATION 1
229249

230250
/* Set configSUPPORT_DYNAMIC_ALLOCATION to 1 to include FreeRTOS API functions
231251
* that create FreeRTOS objects (tasks, queues, etc.) using dynamically allocated
232252
* memory in the build. Set to 0 to exclude the ability to create dynamically
233253
* allocated objects from the build. Defaults to 1 if left undefined. See
234-
* https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html */
254+
* https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html. */
235255
#define configSUPPORT_DYNAMIC_ALLOCATION 1
236256

237257
/* Sets the total size of the FreeRTOS heap, in bytes, when heap_1.c, heap_2.c
238258
* or heap_4.c are included in the build. This value is defaulted to 4096 bytes but
239259
* it must be tailored to each application. Note the heap will appear in the .bss
240-
* section. See https://www.freertos.org/a00111.html */
260+
* section. See https://www.freertos.org/a00111.html. */
241261
#define configTOTAL_HEAP_SIZE 4096
242262

243263
/* Set configAPPLICATION_ALLOCATED_HEAP to 1 to have the application allocate
@@ -253,6 +273,11 @@
253273
* Defaults to 0 if left undefined. */
254274
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
255275

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+
256281
/******************************************************************************/
257282
/* Interrupt nesting behaviour configuration. *********************************/
258283
/******************************************************************************/
@@ -283,12 +308,20 @@
283308
/* Set the following configUSE_* constants to 1 to include the named hook
284309
* functionality in the build. Set to 0 to exclude the hook functionality from the
285310
* build. The application writer is responsible for providing the hook function
286-
* for any set to 1. See https://www.freertos.org/a00016.html */
311+
* for any set to 1. See https://www.freertos.org/a00016.html. */
287312
#define configUSE_IDLE_HOOK 0
288313
#define configUSE_TICK_HOOK 0
289314
#define configUSE_MALLOC_FAILED_HOOK 0
290315
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
291316

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+
292325
/* Set configCHECK_FOR_STACK_OVERFLOW to 1 or 2 for FreeRTOS to check for a
293326
* stack overflow at the time of a context switch. Set to 0 to not look for a
294327
* stack overflow. If configCHECK_FOR_STACK_OVERFLOW is 1 then the check only
@@ -307,14 +340,14 @@
307340
/******************************************************************************/
308341

309342
/* Set configGENERATE_RUN_TIME_STATS to 1 to have FreeRTOS collect data on the
310-
* processing time used by each task. Set to 0 to not collect the data. The
311-
* application writer needs to provide a clock source if set to 1. Defaults to 0
312-
* if left undefined. See https://www.freertos.org/rtos-run-time-stats.html */
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. */
313346
#define configGENERATE_RUN_TIME_STATS 0
314347

315348
/* Set configUSE_TRACE_FACILITY to include additional task structure members
316349
* are used by trace and visualisation functions and tools. Set to 0 to exclude
317-
* the additional information from the structures. Defaults to 0 if left
350+
* the additional information from the structures. Defaults to 0 if left
318351
* undefined. */
319352
#define configUSE_TRACE_FACILITY 0
320353

@@ -325,6 +358,21 @@
325358
* undefined. */
326359
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
327360

361+
/******************************************************************************/
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+
328376
/******************************************************************************/
329377
/* Debugging assistance. ******************************************************/
330378
/******************************************************************************/
@@ -346,7 +394,7 @@
346394
}
347395

348396
/******************************************************************************/
349-
/* Cortex-M MPU specific definitions. *****************************************/
397+
/* FreeRTOS MPU specific definitions. *****************************************/
350398
/******************************************************************************/
351399

352400
/* If configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS is set to 1 then
@@ -380,16 +428,93 @@
380428
* escalations originating from outside of the kernel code itself. Set to 1 to
381429
* allow application tasks to raise privilege. Defaults to 1 if left undefined.
382430
* Only used by the FreeRTOS Cortex-M MPU ports, not the standard ARMv7-M Cortex-M
383-
* port.*/
431+
* port. */
384432
#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1
385433

386434
/* Set configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS to 1 to allow unprivileged
387435
* tasks enter critical sections (effectively mask interrupts). Set to 0 to
388436
* prevent unprivileged tasks entering critical sections. Defaults to 1 if left
389437
* undefined. Only used by the FreeRTOS Cortex-M MPU ports, not the standard
390-
* ARMv7-M Cortex-M port.*/
438+
* ARMv7-M Cortex-M port. */
391439
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0
392440

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+
393518
/******************************************************************************/
394519
/* ARMv8-M secure side port related definitions. ******************************/
395520
/******************************************************************************/
@@ -440,4 +565,4 @@
440565
#define INCLUDE_xTaskGetHandle 0
441566
#define INCLUDE_xTaskResumeFromISR 1
442567

443-
#endif /* __FREERTOS_CONFIG_H__ */
568+
#endif /* FREERTOS_CONFIG_H */

0 commit comments

Comments
 (0)