]> begriffs open source - cmsis-freertos/blob - Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/FreeRTOSConfig.h
Updated to FreeRTOS V10.0.1
[cmsis-freertos] / Demo / CORTEX_A9_Zynq_ZC702 / RTOSDemo / src / FreeRTOSConfig.h
1 /*
2  * FreeRTOS Kernel V10.0.1
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://www.FreeRTOS.org
23  * http://aws.amazon.com/freertos
24  *
25  * 1 tab == 4 spaces!
26  */
27
28 #ifndef FREERTOS_CONFIG_H
29 #define FREERTOS_CONFIG_H
30
31 #include "xparameters.h"
32
33 /*-----------------------------------------------------------
34  * Application specific definitions.
35  *
36  * These definitions should be adjusted for your particular hardware and
37  * application requirements.
38  *
39  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
40  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
41  *
42  * See http://www.freertos.org/a00110.html.
43  *----------------------------------------------------------*/
44
45 /*
46  * The FreeRTOS Cortex-A port implements a full interrupt nesting model.
47  *
48  * Interrupts that are assigned a priority at or below
49  * configMAX_API_CALL_INTERRUPT_PRIORITY (which counter-intuitively in the ARM
50  * generic interrupt controller [GIC] means a priority that has a numerical
51  * value above configMAX_API_CALL_INTERRUPT_PRIORITY) can call FreeRTOS safe API
52  * functions and will nest.
53  *
54  * Interrupts that are assigned a priority above
55  * configMAX_API_CALL_INTERRUPT_PRIORITY (which in the GIC means a numerical
56  * value below configMAX_API_CALL_INTERRUPT_PRIORITY) cannot call any FreeRTOS
57  * API functions, will nest, and will not be masked by FreeRTOS critical
58  * sections (although it is necessary for interrupts to be globally disabled
59  * extremely briefly as the interrupt mask is updated in the GIC).
60  *
61  * FreeRTOS functions that can be called from an interrupt are those that end in
62  * "FromISR".  FreeRTOS maintains a separate interrupt safe API to enable
63  * interrupt entry to be shorter, faster, simpler and smaller.
64  *
65  * The Zynq implements 256 unique interrupt priorities.  For the purpose of
66  * setting configMAX_API_CALL_INTERRUPT_PRIORITY 255 represents the lowest
67  * priority.
68  */
69 #define configMAX_API_CALL_INTERRUPT_PRIORITY   18
70
71 #define configCPU_CLOCK_HZ                                              100000000UL
72 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
73 #define configUSE_TICKLESS_IDLE                                 0
74 #define configTICK_RATE_HZ                                              ( ( TickType_t ) 1000 )
75 #define configPERIPHERAL_CLOCK_HZ                               ( 33333000UL )
76 #define configUSE_PREEMPTION                                    1
77 #define configUSE_IDLE_HOOK                                             1
78 #define configUSE_TICK_HOOK                                             1
79 #define configMAX_PRIORITIES                                    ( 7 )
80 #define configMINIMAL_STACK_SIZE                                ( ( unsigned short ) 250 ) /* Large in case configUSE_TASK_FPU_SUPPORT is 2 in which case all tasks have an FPU context. */
81 #define configTOTAL_HEAP_SIZE                                   ( 90 * 1024 )
82 #define configMAX_TASK_NAME_LEN                                 ( 10 )
83 #define configUSE_TRACE_FACILITY                                1
84 #define configUSE_16_BIT_TICKS                                  0
85 #define configIDLE_SHOULD_YIELD                                 1
86 #define configUSE_MUTEXES                                               1
87 #define configQUEUE_REGISTRY_SIZE                               8
88 #define configCHECK_FOR_STACK_OVERFLOW                  2
89 #define configUSE_RECURSIVE_MUTEXES                             1
90 #define configUSE_MALLOC_FAILED_HOOK                    1
91 #define configUSE_APPLICATION_TASK_TAG                  0
92 #define configUSE_COUNTING_SEMAPHORES                   1
93 #define configUSE_QUEUE_SETS                                    1
94 #define configSUPPORT_STATIC_ALLOCATION                 1
95
96 /* Include the query-heap CLI command to query the free heap space. */
97 #define configINCLUDE_QUERY_HEAP_COMMAND                1
98
99 /* Co-routine definitions. */
100 #define configUSE_CO_ROUTINES                                   0
101 #define configMAX_CO_ROUTINE_PRIORITIES                 ( 2 )
102
103 /* Software timer definitions. */
104 #define configUSE_TIMERS                                                1
105 #define configTIMER_TASK_PRIORITY                               ( configMAX_PRIORITIES - 1 )
106 #define configTIMER_QUEUE_LENGTH                                5
107 #define configTIMER_TASK_STACK_DEPTH                    ( configMINIMAL_STACK_SIZE * 2 )
108
109 /* If configUSE_TASK_FPU_SUPPORT is set to 1 (or undefined) then each task will
110 be created without an FPU context, and a task must call vTaskUsesFPU() before
111 making use of any FPU registers.  If configUSE_TASK_FPU_SUPPORT is set to 2 then
112 tasks are created with an FPU context by default, and calling vTaskUsesFPU() has
113 no effect. */
114 #define configUSE_TASK_FPU_SUPPORT                              2
115
116 /* Set the following definitions to 1 to include the API function, or zero
117 to exclude the API function. */
118 #define INCLUDE_vTaskPrioritySet                                1
119 #define INCLUDE_uxTaskPriorityGet                               1
120 #define INCLUDE_vTaskDelete                                             1
121 #define INCLUDE_vTaskCleanUpResources                   1
122 #define INCLUDE_vTaskSuspend                                    1
123 #define INCLUDE_vTaskDelayUntil                                 1
124 #define INCLUDE_vTaskDelay                                              1
125 #define INCLUDE_xTimerPendFunctionCall                  1
126 #define INCLUDE_eTaskGetState                                   1
127 #define INCLUDE_xTaskAbortDelay                                 1
128 #define INCLUDE_xTaskGetTaskHandle                              1
129 #define INCLUDE_xTaskGetHandle                                  1
130
131 /* This demo makes use of one or more example stats formatting functions.  These
132 format the raw data provided by the uxTaskGetSystemState() function in to human
133 readable ASCII form.  See the notes in the implementation of vTaskList() within
134 FreeRTOS/Source/tasks.c for limitations. */
135 #define configUSE_STATS_FORMATTING_FUNCTIONS    1
136
137 /* The private watchdog is used to generate run time stats. */
138 #include "xscuwdt.h"
139 extern XScuWdt xWatchDogInstance;
140 extern void vInitialiseTimerForRunTimeStats( void );
141 #define configGENERATE_RUN_TIME_STATS 1
142 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vInitialiseTimerForRunTimeStats()
143 #define portGET_RUN_TIME_COUNTER_VALUE() ( ( 0xffffffffUL - XScuWdt_ReadReg( xWatchDogInstance.Config.BaseAddr, XSCUWDT_COUNTER_OFFSET ) ) >> 1 )
144
145 /* The size of the global output buffer that is available for use when there
146 are multiple command interpreters running at once (for example, one on a UART
147 and one on TCP/IP).  This is done to prevent an output buffer being defined by
148 each implementation - which would waste RAM.  In this case, there is only one
149 command interpreter running. */
150 #define configCOMMAND_INT_MAX_OUTPUT_SIZE 2096
151
152 /* Normal assert() semantics without relying on the provision of an assert.h
153 header file. */
154 void vAssertCalled( const char * pcFile, unsigned long ulLine );
155 #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ );
156
157 /* If configTASK_RETURN_ADDRESS is not defined then a task that attempts to
158 return from its implementing function will end up in a "task exit error"
159 function - which contains a call to configASSERT().  However this can give GCC
160 some problems when it tries to unwind the stack, as the exit error function has
161 nothing to return to.  To avoid this define configTASK_RETURN_ADDRESS to 0.  */
162 #define configTASK_RETURN_ADDRESS       NULL
163
164
165 /****** Hardware specific settings. *******************************************/
166
167 /*
168  * The application must provide a function that configures a peripheral to
169  * create the FreeRTOS tick interrupt, then define configSETUP_TICK_INTERRUPT()
170  * in FreeRTOSConfig.h to call the function.  This file contains a function
171  * that is suitable for use on the Zynq MPU.  FreeRTOS_Tick_Handler() must
172  * be installed as the peripheral's interrupt handler.
173  */
174 void vConfigureTickInterrupt( void );
175 #define configSETUP_TICK_INTERRUPT() vConfigureTickInterrupt()
176
177 void vClearTickInterrupt( void );
178 #define configCLEAR_TICK_INTERRUPT() vClearTickInterrupt()
179
180 /* The following constant describe the hardware, and are correct for the
181 Zynq MPU. */
182 #define configINTERRUPT_CONTROLLER_BASE_ADDRESS                 ( XPAR_PS7_SCUGIC_0_DIST_BASEADDR )
183 #define configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET ( -0xf00 )
184 #define configUNIQUE_INTERRUPT_PRIORITIES                               32
185
186
187
188 /****** Network configuration settings - only used when the lwIP example is
189 built.  See the page that documents this demo on the http://www.FreeRTOS.org
190 website for more information. ***********************************************/
191
192 /* The priority for the task that unblocked by the MAC interrupt to process
193 received packets. */
194 #define configMAC_INPUT_TASK_PRIORITY           ( configMAX_PRIORITIES - 1 )
195
196 /* The priority of the task that runs the lwIP stack. */
197 #define configLWIP_TASK_PRIORITY                        ( configMAX_PRIORITIES - 2 )
198
199 /* The priority of the task that uses lwIP sockets to provide a simple command
200 line interface. */
201 #define configCLI_TASK_PRIORITY                         ( tskIDLE_PRIORITY )
202
203 /* MAC address configuration. */
204 #define configMAC_ADDR0 0x00
205 #define configMAC_ADDR1 0x13
206 #define configMAC_ADDR2 0x14
207 #define configMAC_ADDR3 0x15
208 #define configMAC_ADDR4 0x15
209 #define configMAC_ADDR5 0x16
210
211 /* IP address configuration. */
212 #define configIP_ADDR0          172
213 #define configIP_ADDR1          25
214 #define configIP_ADDR2          218
215 #define configIP_ADDR3          200
216
217 /* Netmask configuration. */
218 #define configNET_MASK0         255
219 #define configNET_MASK1         255
220 #define configNET_MASK2         255
221 #define configNET_MASK3         0
222
223 #endif /* FREERTOS_CONFIG_H */
224