firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
FreeRTOSConfig.h
Go to the documentation of this file.
1/*
2 * FreeRTOS Kernel V10.3.1
3 * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy of
7 * this software and associated documentation files (the "Software"), to deal in
8 * the Software without restriction, including without limitation the rights to
9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10 * the Software, and to permit persons to whom the Software is furnished to do so,
11 * subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 *
23 * http://www.FreeRTOS.org
24 * http://aws.amazon.com/freertos
25 *
26 * 1 tab == 4 spaces!
27 */
28
29#ifndef FREERTOS_CONFIG_H
30#define FREERTOS_CONFIG_H
31
32// #include "main.h"
33// #include "stm32h7xx_hal.h"
34#include "freertos_utils.h"
35
36/*-----------------------------------------------------------
37 * Application specific definitions.
38 *
39 * These definitions should be adjusted for your particular hardware and
40 * application requirements.
41 *
42 * These parameters and more are described within the 'configuration' section of the
43 * FreeRTOS API documentation available on the FreeRTOS.org web site.
44 *
45 * See http://www.freertos.org/a00110.html
46 *----------------------------------------------------------*/
47
48/* Ensure definitions are only used by the compiler, and not by the assembler. */
49#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
50 #include <stdint.h>
51extern uint32_t SystemCoreClock;
52#endif
53#ifndef CMSIS_device_header
54 #define CMSIS_device_header "stm32h7xx.h"
55#endif /* CMSIS_device_header */
56
57#define configENABLE_FPU 1
58#define configENABLE_MPU 0
59
60// This config option needs to be enabled for fully reentrant stdlib calls
61// (newlib is the C standard library implementation used by arm-none-eabi-gcc).
62// Do not disable!
63#define configUSE_NEWLIB_REENTRANT 1
64
65#define configUSE_PREEMPTION 1
66#define configSUPPORT_STATIC_ALLOCATION 1
67#define configSUPPORT_DYNAMIC_ALLOCATION 1
68#define configUSE_IDLE_HOOK 0
69#define configUSE_TICK_HOOK 0
70#define configCPU_CLOCK_HZ (SystemCoreClock)
71#define configTICK_RATE_HZ ((TickType_t)1000)
72#define configMAX_PRIORITIES (8)
73#define configMINIMAL_STACK_SIZE ((StackType_t)512) // Value is in words - 256 words = 1024 bytes = 1KB
74#define configTOTAL_HEAP_SIZE ((size_t)0x10000) // Value is in bytes - 64kb total heap size
75#define configMAX_TASK_NAME_LEN (32)
76
77// #ifndef configUSE_TRACE_FACILITY
78// #define configUSE_TRACE_FACILITY 0
79// #endif
80
81#define configUSE_16_BIT_TICKS 0
82#define configUSE_MUTEXES 1
83#define configQUEUE_REGISTRY_SIZE 8
84#define configUSE_RECURSIVE_MUTEXES 1
85#define configUSE_COUNTING_SEMAPHORES 1
86#define configUSE_TASK_NOTIFICATIONS 1
87#define configTASK_NOTIFICATION_ARRAY_ENTRIES 4
88// #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
89/* Defaults to size_t for backward compatibility, but can be changed
90 if lengths will always be less than the number of bytes in a size_t. */
91#define configMESSAGE_BUFFER_LENGTH_TYPE uint8_t // Message lengths will always be <255 bytes
92#define configKERNEL_PROVIDED_STATIC_MEMORY 1
93#define configUSE_STATS_FORMATTING_FUNCTIONS 1
94
95// For runtime statistics
97
98#define configGENERATE_RUN_TIME_STATS 1
99#define configRUN_TIME_COUNTER_TYPE uint32_t
100#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() freertos_stats_timer_start()
101#define portGET_RUN_TIME_COUNTER_VALUE() freertos_stats_timer_get()
102#define configRECORD_STACK_HIGH_ADDRESS 1
103
104/* Co-routine definitions. */
105#define configUSE_CO_ROUTINES 0
106#define configMAX_CO_ROUTINE_PRIORITIES (2)
107
108/* Software timer definitions. */
109#define configUSE_TIMERS 1
110// TODO
111#define configTIMER_TASK_PRIORITY 5 // PRIO_LUDICROUS
112#define configTIMER_QUEUE_LENGTH 50
113#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE)
114
115/* Set the following definitions to 1 to include the API function, or zero
116to exclude the API function. */
117#define INCLUDE_vTaskPrioritySet 1
118#define INCLUDE_uxTaskPriorityGet 1
119#define INCLUDE_vTaskDelete 1
120#define INCLUDE_vTaskCleanUpResources 0
121#define INCLUDE_vTaskSuspend 1
122#define INCLUDE_xTaskDelayUntil 1
123#define INCLUDE_vTaskDelay 1
124#define INCLUDE_xTaskGetSchedulerState 1
125#define INCLUDE_xTimerPendFunctionCall 1
126#define INCLUDE_xQueueGetMutexHolder 1
127#define INCLUDE_uxTaskGetStackHighWaterMark 1
128#define INCLUDE_xTaskGetCurrentTaskHandle 1
129#define INCLUDE_eTaskGetState 1
130#define INCLUDE_ulTaskGetRunTimePercent 1
131#define INCLUDE_xTaskDelayUntil 1
132
133/* Cortex-M specific definitions. */
134#ifdef __NVIC_PRIO_BITS
135 /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
136 #define configPRIO_BITS __NVIC_PRIO_BITS
137#else
138 #define configPRIO_BITS 4
139#endif
140
141// Map FreeRTOS interrupt handlers to CMSIS equivalents
142#define vPortSVCHandler SVC_Handler
143#define xPortPendSVHandler PendSV_Handler
144#define xPortSysTickHandler SysTick_Handler
145
146/* The lowest interrupt priority that can be used in a call to a "set priority"
147function. */
148#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
149
150/* The highest interrupt priority that can be used by any interrupt service
151routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
152INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
153PRIORITY THAN THIS! (higher priorities are lower numeric values. */
154#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 1
155
156/* Interrupt priorities used by the kernel port layer itself. These are generic
157to all Cortex-M ports, and do not rely on any particular library functions. */
158#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
159/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
160See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
161#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
162
163// This should be more than big enough, adjust if needed
164#define configSTATS_BUFFER_MAX_LENGTH 0x400
165
166/* Normal assert() semantics without relying on the provision of an assert.h header file. */
167#define configASSERT(x) \
168 if ((x) == 0) { \
169 taskDISABLE_INTERRUPTS(); \
170 for (;;); \
171 }
172
173#if defined(configUSE_TRACE_FACILITY) && configUSE_TRACE_FACILITY == 1
174 #include "trcRecorder.h"
175#endif
176
177#endif /* FREERTOS_CONFIG_H */
void freertos_runtime_stats_start(void)
FreeRTOS utility functions.
uint32_t SystemCoreClock
Definition system_stm32h7xx.c:163