Kconfig 20 KB

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