Kconfig 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. menu "FreeRTOS"
  2. config FREERTOS_UNICORE
  3. # This config variable is also checked in the ESP32 startup code, not only in FreeRTOS.
  4. bool "Run FreeRTOS only on first core"
  5. default n
  6. help
  7. This version of FreeRTOS normally takes control of all cores of
  8. the CPU. Select this if you only want to start it on the first core.
  9. This is needed when e.g. another process needs complete control
  10. over the second core.
  11. # This invisible config value sets the value of tskNO_AFFINITY in task.h.
  12. # Intended to be used as a constant from other Kconfig files.
  13. # Value is (32-bit) INT_MAX.
  14. config FREERTOS_NO_AFFINITY
  15. hex
  16. default 0x7FFFFFFF
  17. choice FREERTOS_CORETIMER
  18. prompt "Xtensa timer to use as the FreeRTOS tick source"
  19. default FREERTOS_CORETIMER_0
  20. help
  21. FreeRTOS needs a timer with an associated interrupt to use as
  22. the main tick source to increase counters, run timers and do
  23. pre-emptive multitasking with. There are multiple timers available
  24. to do this, with different interrupt priorities. Check
  25. config FREERTOS_CORETIMER_0
  26. bool "Timer 0 (int 6, level 1)"
  27. help
  28. Select this to use timer 0
  29. config FREERTOS_CORETIMER_1
  30. bool "Timer 1 (int 15, level 3)"
  31. help
  32. Select this to use timer 1
  33. endchoice
  34. config FREERTOS_OPTIMIZED_SCHEDULER
  35. bool "Enable FreeRTOS pĺatform optimized scheduler"
  36. depends on FREERTOS_UNICORE
  37. default y
  38. help
  39. On most platforms there are instructions can speedup the ready task
  40. searching. Enabling this option the FreeRTOS with this instructions
  41. support will be built.
  42. config FREERTOS_HZ
  43. int "Tick rate (Hz)"
  44. range 1 1000
  45. default 100
  46. help
  47. Select the tick rate at which FreeRTOS does pre-emptive context switching.
  48. config FREERTOS_ASSERT_ON_UNTESTED_FUNCTION
  49. bool "Halt when an SMP-untested function is called"
  50. default y
  51. help
  52. Some functions in FreeRTOS have not been thoroughly tested yet when moving to
  53. the SMP implementation of FreeRTOS. When this option is enabled, these fuctions
  54. will throw an assert().
  55. choice FREERTOS_CHECK_STACKOVERFLOW
  56. prompt "Check for stack overflow"
  57. default FREERTOS_CHECK_STACKOVERFLOW_CANARY
  58. help
  59. FreeRTOS can check for stack overflows in threads and trigger an user function
  60. called vApplicationStackOverflowHook when this happens.
  61. config FREERTOS_CHECK_STACKOVERFLOW_NONE
  62. bool "No checking"
  63. help
  64. Do not check for stack overflows (configCHECK_FOR_STACK_OVERFLOW=0)
  65. config FREERTOS_CHECK_STACKOVERFLOW_PTRVAL
  66. bool "Check by stack pointer value"
  67. help
  68. Check for stack overflows on each context switch by checking if
  69. the stack pointer is in a valid range. Quick but does not detect
  70. stack overflows that happened between context switches
  71. (configCHECK_FOR_STACK_OVERFLOW=1)
  72. config FREERTOS_CHECK_STACKOVERFLOW_CANARY
  73. bool "Check using canary bytes"
  74. help
  75. Places some magic bytes at the end of the stack area and on each
  76. context switch, check if these bytes are still intact. More thorough
  77. than just checking the pointer, but also slightly slower.
  78. (configCHECK_FOR_STACK_OVERFLOW=2)
  79. endchoice
  80. config FREERTOS_WATCHPOINT_END_OF_STACK
  81. bool "Set a debug watchpoint as a stack overflow check"
  82. default n
  83. help
  84. FreeRTOS can check if a stack has overflown its bounds by checking either the value of
  85. the stack pointer or by checking the integrity of canary bytes. (See FREERTOS_CHECK_STACKOVERFLOW
  86. for more information.) These checks only happen on a context switch, and the situation that caused
  87. the stack overflow may already be long gone by then. This option will use the debug memory
  88. watchpoint 1 (the second one) to allow breaking into the debugger (or panic'ing) as soon as any
  89. of the last 32 bytes on the stack of a task are overwritten. The side effect is that using gdb, you
  90. effectively only have one watchpoint; the 2nd one is overwritten as soon as a task switch happens.
  91. This check only triggers if the stack overflow writes within 4 bytes of the end of the stack, rather than
  92. overshooting further, so it is worth combining this approach with one of the other stack overflow check
  93. methods.
  94. When this watchpoint is hit, gdb will stop with a SIGTRAP message. When no JTAG OCD is attached, esp-idf
  95. will panic on an unhandled debug exception.
  96. config FREERTOS_INTERRUPT_BACKTRACE
  97. bool "Enable backtrace from interrupt to task context"
  98. default y
  99. help
  100. If this option is enabled, interrupt stack frame will be modified to
  101. point to the code of the interrupted task as its return address.
  102. This helps the debugger (or the panic handler) show a backtrace from
  103. the interrupt to the task which was interrupted. This also works for
  104. nested interrupts: higer level interrupt stack can be traced back to the
  105. lower level interrupt.
  106. This option adds 4 instructions to the interrupt dispatching code.
  107. config FREERTOS_THREAD_LOCAL_STORAGE_POINTERS
  108. int "Number of thread local storage pointers"
  109. range 1 256
  110. default 1
  111. help
  112. FreeRTOS has the ability to store per-thread pointers in the task
  113. control block. This controls the number of pointers available.
  114. This value must be at least 1. Index 0 is reserved for use by the pthreads API
  115. thread-local-storage. Other indexes can be used for any desired purpose.
  116. choice FREERTOS_ASSERT
  117. prompt "FreeRTOS assertions"
  118. default FREERTOS_ASSERT_FAIL_ABORT
  119. help
  120. Failed FreeRTOS configASSERT() assertions can be configured to
  121. behave in different ways.
  122. config FREERTOS_ASSERT_FAIL_ABORT
  123. bool "abort() on failed assertions"
  124. help
  125. If a FreeRTOS configASSERT() fails, FreeRTOS will abort() and
  126. halt execution. The panic handler can be configured to handle
  127. the outcome of an abort() in different ways.
  128. config FREERTOS_ASSERT_FAIL_PRINT_CONTINUE
  129. bool "Print and continue failed assertions"
  130. help
  131. If a FreeRTOS assertion fails, print it out and continue.
  132. config FREERTOS_ASSERT_DISABLE
  133. bool "Disable FreeRTOS assertions"
  134. help
  135. FreeRTOS configASSERT() will not be compiled into the binary.
  136. endchoice
  137. config FREERTOS_IDLE_TASK_STACKSIZE
  138. int "Idle Task stack size"
  139. range 768 32768
  140. default 1536
  141. help
  142. The idle task has its own stack, sized in bytes. The default size is enough for most uses. Size can be
  143. reduced to 768 bytes if no (or simple) FreeRTOS idle hooks are used and pthread local storage or FreeRTOS
  144. local storage cleanup callbacks are not used.
  145. The stack size may need to be increased above the default if the app installs idle or thread local storage
  146. cleanup hooks that use a lot of stack memory.
  147. config FREERTOS_ISR_STACKSIZE
  148. int "ISR stack size"
  149. range 2096 32768 if ESP32_COREDUMP_DATA_FORMAT_ELF
  150. default 2096 if ESP32_COREDUMP_DATA_FORMAT_ELF
  151. range 1536 32768
  152. default 1536
  153. help
  154. The interrupt handlers have their own stack. The size of the stack can be defined here.
  155. Each processor has its own stack, so the total size occupied will be twice this.
  156. config FREERTOS_LEGACY_HOOKS
  157. bool "Use FreeRTOS legacy hooks"
  158. default n
  159. help
  160. FreeRTOS offers a number of hooks/callback functions that are called when a timer
  161. tick happens, the idle thread runs etc. esp-idf replaces these by runtime registerable
  162. hooks using the esp_register_freertos_xxx_hook system, but for legacy reasons the old
  163. hooks can also still be enabled. Please enable this only if you have code that for some
  164. reason can't be migrated to the esp_register_freertos_xxx_hook system.
  165. config FREERTOS_MAX_TASK_NAME_LEN
  166. int "Maximum task name length"
  167. range 1 256
  168. default 16
  169. help
  170. Changes the maximum task name length. Each task allocated will
  171. include this many bytes for a task name. Using a shorter value
  172. saves a small amount of RAM, a longer value allows more complex
  173. names.
  174. For most uses, the default of 16 is OK.
  175. config FREERTOS_SUPPORT_STATIC_ALLOCATION
  176. bool "Enable FreeRTOS static allocation API"
  177. default n
  178. help
  179. FreeRTOS gives the application writer the ability to instead provide the memory
  180. themselves, allowing the following objects to optionally be created without any
  181. memory being allocated dynamically:
  182. - Tasks
  183. - Software Timers (Daemon task is still dynamic. See documentation)
  184. - Queues
  185. - Event Groups
  186. - Binary Semaphores
  187. - Counting Semaphores
  188. - Recursive Semaphores
  189. - Mutexes
  190. Whether it is preferable to use static or dynamic memory allocation is dependent on
  191. the application, and the preference of the application writer. Both methods have pros
  192. and cons, and both methods can be used within the same RTOS application.
  193. Creating RTOS objects using statically allocated RAM has the benefit of providing the application writer
  194. with more control: RTOS objects can be placed at specific memory locations. The maximum RAM footprint can
  195. be determined at link time, rather than run time. The application writer does not need to concern
  196. themselves with graceful handling of memory allocation failures. It allows the RTOS to be used in
  197. applications that simply don't allow any dynamic memory allocation (although FreeRTOS includes allocation
  198. schemes that can overcome most objections).
  199. config FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP
  200. bool "Enable static task clean up hook"
  201. depends on FREERTOS_SUPPORT_STATIC_ALLOCATION
  202. default n
  203. help
  204. Enable this option to make FreeRTOS call the static task clean up hook when a task is deleted.
  205. Bear in mind that if this option is enabled you will need to implement the following function::
  206. void vPortCleanUpTCB ( void *pxTCB ) {
  207. // place clean up code here
  208. }
  209. config FREERTOS_TIMER_TASK_PRIORITY
  210. int "FreeRTOS timer task priority"
  211. range 1 25
  212. default 1
  213. help
  214. The timer service task (primarily) makes use of existing FreeRTOS features, allowing timer
  215. functionality to be added to an application with minimal impact on the size of the application's
  216. executable binary.
  217. Use this constant to define the priority that the timer task will run at.
  218. config FREERTOS_TIMER_TASK_STACK_DEPTH
  219. int "FreeRTOS timer task stack size"
  220. range 1536 32768
  221. default 2048
  222. help
  223. The timer service task (primarily) makes use of existing FreeRTOS features, allowing timer
  224. functionality to be added to an application with minimal impact on the size of the application's
  225. executable binary.
  226. Use this constant to define the size (in bytes) of the stack allocated for the timer task.
  227. config FREERTOS_TIMER_QUEUE_LENGTH
  228. int "FreeRTOS timer queue length"
  229. range 5 20
  230. default 10
  231. help
  232. FreeRTOS provides a set of timer related API functions. Many of these functions use a standard
  233. FreeRTOS queue to send commands to the timer service task. The queue used for this purpose is
  234. called the 'timer command queue'. The 'timer command queue' is private to the FreeRTOS timer
  235. implementation, and cannot be accessed directly.
  236. For most uses the default value of 10 is OK.
  237. config FREERTOS_QUEUE_REGISTRY_SIZE
  238. int "FreeRTOS queue registry size"
  239. range 0 20
  240. default 0
  241. help
  242. FreeRTOS uses the queue registry as a means for kernel aware debuggers to locate queues, semaphores,
  243. and mutexes. The registry allows for a textual name to be associated with a queue for easy identification
  244. within a debugging GUI. A value of 0 will disable queue registry functionality, and a value larger than 0
  245. will specify the number of queues/semaphores/mutexes that the registry can hold.
  246. config FREERTOS_USE_TRACE_FACILITY
  247. bool "Enable FreeRTOS trace facility"
  248. default n
  249. help
  250. If enabled, configUSE_TRACE_FACILITY will be defined as 1 in FreeRTOS.
  251. This will allow the usage of trace facility functions such as
  252. uxTaskGetSystemState().
  253. config FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
  254. bool "Enable FreeRTOS stats formatting functions"
  255. depends on FREERTOS_USE_TRACE_FACILITY
  256. default n
  257. help
  258. If enabled, configUSE_STATS_FORMATTING_FUNCTIONS will be defined as 1 in
  259. FreeRTOS. This will allow the usage of stats formatting functions such
  260. as vTaskList().
  261. config FREERTOS_VTASKLIST_INCLUDE_COREID
  262. bool "Enable display of xCoreID in vTaskList"
  263. depends on FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
  264. default n
  265. help
  266. If enabled, this will include an extra column when vTaskList is called
  267. to display the CoreID the task is pinned to (0,1) or -1 if not pinned.
  268. config FREERTOS_GENERATE_RUN_TIME_STATS
  269. bool "Enable FreeRTOS to collect run time stats"
  270. default n
  271. select FREERTOS_USE_TRACE_FACILITY
  272. select FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
  273. help
  274. If enabled, configGENERATE_RUN_TIME_STATS will be defined as 1 in
  275. FreeRTOS. This will allow FreeRTOS to collect information regarding the
  276. usage of processor time amongst FreeRTOS tasks. Run time stats are
  277. generated using either the ESP Timer or the CPU Clock as the clock
  278. source (Note that run time stats are only valid until the clock source
  279. overflows). The function vTaskGetRunTimeStats() will also be available
  280. if FREERTOS_USE_STATS_FORMATTING_FUNCTIONS and
  281. FREERTOS_USE_TRACE_FACILITY are enabled. vTaskGetRunTimeStats() will
  282. display the run time of each task as a % of the total run time of all
  283. CPUs (task run time / no of CPUs) / (total run time / 100 )
  284. choice FREERTOS_RUN_TIME_STATS_CLK
  285. prompt "Choose the clock source for run time stats"
  286. depends on FREERTOS_GENERATE_RUN_TIME_STATS
  287. default FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
  288. help
  289. Choose the clock source for FreeRTOS run time stats. Options are CPU0's
  290. CPU Clock or the ESP Timer. Both clock sources are 32 bits. The CPU
  291. Clock can run at a higher frequency hence provide a finer resolution
  292. but will overflow much quicker. Note that run time stats are only valid
  293. until the clock source overflows.
  294. config FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
  295. bool "Use ESP TIMER for run time stats"
  296. help
  297. ESP Timer will be used as the clock source for FreeRTOS run time stats.
  298. The ESP Timer runs at a frequency of 1MHz regardless of Dynamic
  299. Frequency Scaling. Therefore the ESP Timer will overflow in
  300. approximately 4290 seconds.
  301. config FREERTOS_RUN_TIME_STATS_USING_CPU_CLK
  302. bool "Use CPU Clock for run time stats"
  303. help
  304. CPU Clock will be used as the clock source for the generation of run
  305. time stats. The CPU Clock has a frequency dependent on
  306. ESP32_DEFAULT_CPU_FREQ_MHZ and Dynamic Frequency Scaling (DFS).
  307. Therefore the CPU Clock frequency can fluctuate between 80 to 240MHz.
  308. Run time stats generated using the CPU Clock represents the number of
  309. CPU cycles each task is allocated and DOES NOT reflect the amount of
  310. time each task runs for (as CPU clock frequency can change). If the CPU
  311. clock consistently runs at the maximum frequency of 240MHz, it will
  312. overflow in approximately 17 seconds.
  313. endchoice
  314. config FREERTOS_USE_TICKLESS_IDLE
  315. bool "Tickless idle support"
  316. depends on PM_ENABLE
  317. default n
  318. help
  319. If power management support is enabled, FreeRTOS will be able to put
  320. the system into light sleep mode when no tasks need to run for a number
  321. of ticks. This number can be set using FREERTOS_IDLE_TIME_BEFORE_SLEEP option.
  322. This feature is also known as "automatic light sleep".
  323. Note that timers created using esp_timer APIs may prevent the system from
  324. entering sleep mode, even when no tasks need to run.
  325. If disabled, automatic light sleep support will be disabled.
  326. config FREERTOS_IDLE_TIME_BEFORE_SLEEP
  327. int "Minimum number of ticks to enter sleep mode for"
  328. depends on FREERTOS_USE_TICKLESS_IDLE
  329. default 3
  330. range 2 4294967295
  331. # Minimal value is 2 because of a check in FreeRTOS.h (search configEXPECTED_IDLE_TIME_BEFORE_SLEEP)
  332. help
  333. FreeRTOS will enter light sleep mode if no tasks need to run for this number
  334. of ticks.
  335. config FREERTOS_TASK_FUNCTION_WRAPPER
  336. bool "Enclose all task functions in a wrapper function"
  337. depends on COMPILER_OPTIMIZATION_DEFAULT
  338. default y
  339. help
  340. If enabled, all FreeRTOS task functions will be enclosed in a wrapper function.
  341. If a task function mistakenly returns (i.e. does not delete), the call flow will
  342. return to the wrapper function. The wrapper function will then log an error and
  343. abort the application. This option is also required for GDB backtraces and C++
  344. exceptions to work correctly inside top-level task functions.
  345. config FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER
  346. bool "Check that mutex semaphore is given by owner task"
  347. default y
  348. help
  349. If enabled, assert that when a mutex semaphore is given, the task giving the
  350. semaphore is the task which is currently holding the mutex.
  351. config FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE
  352. bool "Tests compliance with Vanilla FreeRTOS port*_CRITICAL calls"
  353. default n
  354. help
  355. If enabled, context of port*_CRITICAL calls (ISR or Non-ISR)
  356. would be checked to be in compliance with Vanilla FreeRTOS.
  357. e.g Calling port*_CRITICAL from ISR context would cause assert failure
  358. config FREERTOS_DEBUG_OCDAWARE
  359. bool
  360. help
  361. Hidden option, gets selected by CONFIG_ESPxx_DEBUG_OCDAWARE
  362. config FREERTOS_FPU_IN_ISR
  363. bool "Allow use of float inside Level 1 ISR (EXPERIMENTAL)"
  364. depends on IDF_TARGET_ESP32
  365. default n
  366. help
  367. When enabled, the usage of float type is allowed inside Level 1
  368. ISRs.
  369. endmenu