1
1
/*
2
- * FreeRTOS Kernel V10.3.1
3
- * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights
4
- * Reserved. Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights
5
- * Reserved.
2
+ * FreeRTOS Kernel V10.0.1
3
+ * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
4
*
7
5
* Permission is hereby granted, free of charge, to any person obtaining a copy
8
6
* of this software and associated documentation files (the "Software"), to deal
32
30
#define FREERTOS_CONFIG_H
33
31
34
32
/*-----------------------------------------------------------
35
- * Application specific definitions.
33
+ * this is a template configuration files
36
34
*
37
35
* These definitions should be adjusted for your particular hardware and
38
36
* application requirements.
43
41
* See http://www.freertos.org/a00110.html
44
42
*----------------------------------------------------------*/
45
43
46
- /* Ensure definitions are only used by the compiler, and not by the assembler.
47
- */
44
+ /* Ensure stdint is only used by the compiler, and not the assembler. */
48
45
#if defined(__ICCARM__ ) || defined(__CC_ARM ) || defined(__GNUC__ )
49
46
#include <stdint.h>
50
47
extern uint32_t SystemCoreClock ;
51
48
#endif
52
- #define configENABLE_FPU 0
53
- #define configENABLE_MPU 0
54
49
50
+ /* CMSIS-RTOSv2 defines 56 levels of priorities. To be able to use them
51
+ * all and avoid application misbehavior,
52
+ * configUSE_PORT_OPTIMISED_TASK_SELECTION must be set to 0 and
53
+ * configMAX_PRIORITIES to 56
54
+ *
55
+ */
56
+ /* #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0*/
57
+ /* #define configMAX_PRIORITIES ( 56 ) */
55
58
#define configUSE_PREEMPTION 1
56
- #define configSUPPORT_STATIC_ALLOCATION 1
57
- #define configSUPPORT_DYNAMIC_ALLOCATION 1
58
59
#define configUSE_IDLE_HOOK 0
59
60
#define configUSE_TICK_HOOK 0
61
+ #define configMAX_PRIORITIES (7)
62
+ #define configSUPPORT_STATIC_ALLOCATION 1
60
63
#define configCPU_CLOCK_HZ (SystemCoreClock)
61
64
#define configTICK_RATE_HZ ((TickType_t)1000)
62
- #define configMAX_PRIORITIES (7)
63
65
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
64
- #define configTOTAL_HEAP_SIZE ((size_t)3072 )
66
+ #define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024) )
65
67
#define configMAX_TASK_NAME_LEN (16)
68
+ #define configUSE_TRACE_FACILITY 1
66
69
#define configUSE_16_BIT_TICKS 0
70
+ #define configIDLE_SHOULD_YIELD 1
67
71
#define configUSE_MUTEXES 1
68
72
#define configQUEUE_REGISTRY_SIZE 8
69
- #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
70
- /* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */
71
- /* Defaults to size_t for backward compatibility, but can be changed
72
- if lengths will always be less than the number of bytes in a size_t. */
73
- #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
74
- /* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */
73
+ #define configCHECK_FOR_STACK_OVERFLOW 0
74
+ #define configUSE_RECURSIVE_MUTEXES 1
75
+ #define configUSE_MALLOC_FAILED_HOOK 0
76
+ #define configUSE_APPLICATION_TASK_TAG 0
77
+ #define configUSE_COUNTING_SEMAPHORES 1
78
+ #define configGENERATE_RUN_TIME_STATS 0
79
+ #define configUSE_TASK_NOTIFICATIONS 1
80
+ #define configTASK_NOTIFICATION_ARRAY_ENTRIES 8
75
81
76
82
/* Co-routine definitions. */
77
83
#define configUSE_CO_ROUTINES 0
78
84
#define configMAX_CO_ROUTINE_PRIORITIES (2)
79
85
86
+ /* Software timer definitions. */
87
+ #define configUSE_TIMERS 1
88
+ #define configTIMER_TASK_PRIORITY (2)
89
+ #define configTIMER_QUEUE_LENGTH 10
90
+ #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2)
91
+
80
92
/* Set the following definitions to 1 to include the API function, or zero
81
93
to exclude the API function. */
82
94
#define INCLUDE_vTaskPrioritySet 1
@@ -88,23 +100,48 @@ to exclude the API function. */
88
100
#define INCLUDE_vTaskDelay 1
89
101
#define INCLUDE_xTaskGetSchedulerState 1
90
102
103
+ /*------------- CMSIS-RTOS V2 specific defines -----------*/
104
+ /* When using CMSIS-RTOSv2 set configSUPPORT_STATIC_ALLOCATION to 1
105
+ * is mandatory to avoid compile errors.
106
+ * CMSIS-RTOS V2 implmentation requires the following defines
107
+ *
108
+ #define configSUPPORT_STATIC_ALLOCATION 1 <-- cmsis_os threads are
109
+ created using xTaskCreateStatic() API #define configMAX_PRIORITIES (56) <--
110
+ Priority range in CMSIS-RTOS V2 is [0 .. 56] #define
111
+ configUSE_PORT_OPTIMISED_TASK_SELECTION 0 <-- when set to 1,
112
+ configMAX_PRIORITIES can't be more than 32 which is not suitable for the new
113
+ CMSIS-RTOS v2 priority range
114
+ */
115
+
116
+ /* the CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation
117
+ used
118
+ * by the application thus the correct define need to be enabled from the list
119
+ * below
120
+ *
121
+ //define USE_FreeRTOS_HEAP_1
122
+ //define USE_FreeRTOS_HEAP_2
123
+ //define USE_FreeRTOS_HEAP_3
124
+ //define USE_FreeRTOS_HEAP_4
125
+ //define USE_FreeRTOS_HEAP_5
126
+ */
127
+
91
128
/* Cortex-M specific definitions. */
92
129
#ifdef __NVIC_PRIO_BITS
93
130
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
94
131
#define configPRIO_BITS __NVIC_PRIO_BITS
95
132
#else
96
- #define configPRIO_BITS 4
133
+ #define configPRIO_BITS 4 /* 15 priority levels */
97
134
#endif
98
135
99
136
/* The lowest interrupt priority that can be used in a call to a "set priority"
100
137
function. */
101
- #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
138
+ #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
102
139
103
140
/* The highest interrupt priority that can be used by any interrupt service
104
141
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
105
142
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
106
143
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
107
- #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
144
+ #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 4
108
145
109
146
/* Interrupt priorities used by the kernel port layer itself. These are generic
110
147
to all Cortex-M ports, and do not rely on any particular library functions. */
@@ -117,23 +154,29 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
117
154
118
155
/* Normal assert() semantics without relying on the provision of an assert.h
119
156
header file. */
157
+ #ifdef ASSERTIONS_ENABLED
120
158
121
159
#define configASSERT (x ) \
122
160
if ((x) == 0) { \
123
161
taskDISABLE_INTERRUPTS(); \
124
162
for (;;) \
125
163
; \
126
164
}
165
+ #else
166
+
167
+ #define configASSERT (x ) (void)(x)
168
+
169
+ #endif
127
170
128
171
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
129
- standard names. */
172
+ standard names. */
130
173
#define vPortSVCHandler SVC_Handler
131
174
#define xPortPendSVHandler PendSV_Handler
132
175
133
- /* IMPORTANT: This define is commented when used with STM32Cube firmware, when
134
- the timebase source is SysTick, to prevent overwriting SysTick_Handler
135
- defined within STM32Cube HAL */
136
-
176
+ /* IMPORTANT: FreeRTOS is using the SysTick as internal time base, thus make
177
+ sure the system and peripherials are using a different time base (TIM based
178
+ for example).
179
+ */
137
180
#define xPortSysTickHandler SysTick_Handler
138
181
139
182
#endif /* FREERTOS_CONFIG_H */
0 commit comments