Kconfig 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. menu "FreeRTOS"
  2. # This is actually also handled in the ESP32 startup code, not only in FreeRTOS.
  3. config FREERTOS_UNICORE
  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. choice FREERTOS_CORETIMER
  12. prompt "Xtensa timer to use as the FreeRTOS tick source"
  13. default CONFIG_FREERTOS_CORETIMER_0
  14. help
  15. FreeRTOS needs a timer with an associated interrupt to use as
  16. the main tick source to increase counters, run timers and do
  17. pre-emptive multitasking with. There are multiple timers available
  18. to do this, with different interrupt priorities. Check
  19. config FREERTOS_CORETIMER_0
  20. bool "Timer 0 (int 6, level 1)"
  21. help
  22. Select this to use timer 0
  23. config FREERTOS_CORETIMER_1
  24. bool "Timer 1 (int 15, level 3)"
  25. help
  26. Select this to use timer 1
  27. endchoice
  28. config FREERTOS_HZ
  29. int "Tick rate (Hz)"
  30. range 1 1000
  31. default 100
  32. help
  33. Select the tick rate at which FreeRTOS does pre-emptive context switching.
  34. config FREERTOS_ASSERT_ON_UNTESTED_FUNCTION
  35. bool "Halt when an SMP-untested function is called"
  36. default y
  37. help
  38. Some functions in FreeRTOS have not been thoroughly tested yet when moving to
  39. the SMP implementation of FreeRTOS. When this option is enabled, these fuctions
  40. will throw an assert().
  41. choice FREERTOS_CHECK_STACKOVERFLOW
  42. prompt "Check for stack overflow"
  43. default FREERTOS_CHECK_STACKOVERFLOW_CANARY
  44. help
  45. FreeRTOS can check for stack overflows in threads and trigger an user function
  46. called vApplicationStackOverflowHook when this happens.
  47. config FREERTOS_CHECK_STACKOVERFLOW_NONE
  48. bool "No checking"
  49. help
  50. Do not check for stack overflows (configCHECK_FOR_STACK_OVERFLOW=0)
  51. config FREERTOS_CHECK_STACKOVERFLOW_PTRVAL
  52. bool "Check by stack pointer value"
  53. help
  54. Check for stack overflows on each context switch by checking if
  55. the stack pointer is in a valid range. Quick but does not detect
  56. stack overflows that happened between context switches
  57. (configCHECK_FOR_STACK_OVERFLOW=1)
  58. config FREERTOS_CHECK_STACKOVERFLOW_CANARY
  59. bool "Check using canary bytes"
  60. help
  61. Places some magic bytes at the end of the stack area and on each
  62. context switch, check if these bytes are still intact. More thorough
  63. than just checking the pointer, but also slightly slower.
  64. (configCHECK_FOR_STACK_OVERFLOW=2)
  65. endchoice
  66. config FREERTOS_WATCHPOINT_END_OF_STACK
  67. bool "Set a debug watchpoint as a stack overflow check"
  68. default n
  69. help
  70. FreeRTOS can check if a stack has overflown its bounds by checking either the value of
  71. the stack pointer or by checking the integrity of canary bytes. (See FREERTOS_CHECK_STACKOVERFLOW
  72. for more information.) These checks only happen on a context switch, and the situation that caused
  73. the stack overflow may already be long gone by then. This option will use the debug memory
  74. watchpoint 1 (the second one) to allow breaking into the debugger (or panic'ing) as soon as any
  75. of the last 32 bytes on the stack of a task are overwritten. The side effect is that using gdb, you
  76. effectively only have one watchpoint; the 2nd one is overwritten as soon as a task switch happens.
  77. This check only triggers if the stack overflow writes within 4 bytes of the end of the stack, rather than
  78. overshooting further, so it is worth combining this approach with one of the other stack overflow check methods.
  79. When this watchpoint is hit, gdb will stop with a SIGTRAP message. When no OCD is attached, esp-idf
  80. will panic on an unhandled debug exception.
  81. config FREERTOS_THREAD_LOCAL_STORAGE_POINTERS
  82. int "Number of thread local storage pointers"
  83. range 0 256 if !(WIFI_ENABLED || ETHERNET)
  84. range 1 256 if WIFI_ENABLED || ETHERNET
  85. default 1
  86. help
  87. FreeRTOS has the ability to store per-thread pointers in the task
  88. control block. This controls the number of pointers available.
  89. Value 0 turns off this functionality.
  90. If using the LWIP TCP/IP stack (with WiFi or Ethernet), this value must be at least 1. See the
  91. LWIP_THREAD_LOCAL_STORAGE_INDEX config item in LWIP configuration to determine which thread-local-storage
  92. pointer is reserved for LWIP.
  93. choice FREERTOS_ASSERT
  94. prompt "FreeRTOS assertions"
  95. default FREERTOS_ASSERT_FAIL_ABORT
  96. help
  97. Failed FreeRTOS configASSERT() assertions can be configured to
  98. behave in different ways.
  99. config FREERTOS_ASSERT_FAIL_ABORT
  100. bool "abort() on failed assertions"
  101. help
  102. If a FreeRTOS configASSERT() fails, FreeRTOS will abort() and
  103. halt execution. The panic handler can be configured to handle
  104. the outcome of an abort() in different ways.
  105. config FREERTOS_ASSERT_FAIL_PRINT_CONTINUE
  106. bool "Print and continue failed assertions"
  107. help
  108. If a FreeRTOS assertion fails, print it out and continue.
  109. config FREERTOS_ASSERT_DISABLE
  110. bool "Disable FreeRTOS assertions"
  111. help
  112. FreeRTOS configASSERT() will not be compiled into the binary.
  113. endchoice
  114. config FREERTOS_BREAK_ON_SCHEDULER_START_JTAG
  115. bool "Stop program on scheduler start when JTAG/OCD is detected"
  116. depends on ESP32_DEBUG_OCDAWARE
  117. default y
  118. help
  119. If JTAG/OCD is connected, stop execution when the scheduler is started and the first
  120. task is executed.
  121. menuconfig ENABLE_MEMORY_DEBUG
  122. bool "Enable heap memory debug"
  123. default n
  124. help
  125. Enable this option to show malloc heap block and memory crash detect
  126. config FREERTOS_ISR_STACKSIZE
  127. int "ISR stack size"
  128. range 1536 32768
  129. default 1536
  130. help
  131. The interrupt handlers have their own stack. The size of the stack can be defined here.
  132. Each processor has its own stack, so the total size occupied will be twice this.
  133. config FREERTOS_LEGACY_HOOKS
  134. bool "Use FreeRTOS legacy hooks"
  135. default n
  136. help
  137. FreeRTOS offers a number of hooks/callback functions that are called when a timer
  138. tick happens, the idle thread runs etc. esp-idf replaces these by runtime registerable
  139. hooks using the esp_register_freertos_xxx_hook system, but for legacy reasons the old
  140. hooks can also still be enabled. Please enable this only if you have code that for some
  141. reason can't be migrated to the esp_register_freertos_xxx_hook system.
  142. if FREERTOS_LEGACY_HOOKS
  143. config FREERTOS_LEGACY_IDLE_HOOK
  144. bool "Enable legacy idle hook"
  145. default n
  146. help
  147. If enabled, FreeRTOS will call a function called vApplicationIdleHook when the idle thread
  148. on a CPU is running. Please make sure your code defines such a function.
  149. config FREERTOS_LEGACY_TICK_HOOK
  150. bool "Enable legacy tick hook"
  151. default n
  152. help
  153. If enabled, FreeRTOS will call a function called vApplicationTickHook when a FreeRTOS
  154. tick is executed. Please make sure your code defines such a function.
  155. endif #FREERTOS_LEGACY_HOOKS
  156. config FREERTOS_MAX_TASK_NAME_LEN
  157. int "Maximum task name length"
  158. range 1 256
  159. default 16
  160. help
  161. Changes the maximum task name length. Each task allocated will
  162. include this many bytes for a task name. Using a shorter value
  163. saves a small amount of RAM, a longer value allows more complex
  164. names.
  165. For most uses, the default of 16 is OK.
  166. config SUPPORT_STATIC_ALLOCATION
  167. bool "Enable FreeRTOS static allocation API"
  168. default n
  169. help
  170. FreeRTOS gives the application writer the ability to instead provide the memory
  171. themselves, allowing the following objects to optionally be created without any
  172. memory being allocated dynamically:
  173. - Tasks
  174. - Software Timers
  175. - Queues
  176. - Event Groups
  177. - Binary Semaphores
  178. - Counting Semaphores
  179. - Recursive Semaphores
  180. - Mutexes
  181. Whether it is preferable to use static or dynamic memory allocation is dependent on
  182. the application, and the preference of the application writer. Both methods have pros
  183. and cons, and both methods can be used within the same RTOS application.
  184. Creating RTOS objects using statically allocated RAM has the benefit of providing the
  185. application writer with more control: RTOS objects can be placed at specific memory locations.
  186. The maximum RAM footprint can be determined at link time, rather than run time.
  187. The application writer does not need to concern themselves with graceful handling of memory allocation failures.
  188. It allows the RTOS to be used in applications that simply don't allow any dynamic memory allocation
  189. (although FreeRTOS includes allocation schemes that can overcome most objections).
  190. config ENABLE_STATIC_TASK_CLEAN_UP_HOOK
  191. bool "Enable static task clean up hook"
  192. depends on SUPPORT_STATIC_ALLOCATION
  193. default n
  194. help
  195. Enable this option to make FreeRTOS call the static task clean up hook when a task is deleted.
  196. Bear in mind that if this option is enabled you will need to implement the following function:
  197. void vPortCleanUpTCB ( void *pxTCB ) {
  198. // place clean up code here
  199. }
  200. config TIMER_TASK_PRIORITY
  201. int "FreeRTOS timer task priority"
  202. range 1 25
  203. default 1
  204. help
  205. The timer service task (primarily) makes use of existing FreeRTOS features, allowing timer
  206. functionality to be added to an application with minimal impact on the size of the application's
  207. executable binary.
  208. Use this constant to define the priority that the timer task will run at.
  209. config TIMER_TASK_STACK_DEPTH
  210. int "FreeRTOS timer task stack size"
  211. range 1536 32768
  212. default 2048
  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 size (in bytes) of the stack allocated for the timer task.
  218. config TIMER_QUEUE_LENGTH
  219. int "FreeRTOS timer queue length"
  220. range 5 20
  221. default 10
  222. help
  223. FreeRTOS provides a set of timer related API functions. Many of these functions use a standard
  224. FreeRTOS queue to send commands to the timer service task. The queue used for this purpose is
  225. called the 'timer command queue'. The 'timer command queue' is private to the FreeRTOS timer
  226. implementation, and cannot be accessed directly.
  227. For most uses the default value of 10 is OK.
  228. menuconfig FREERTOS_DEBUG_INTERNALS
  229. bool "Debug FreeRTOS internals"
  230. default n
  231. help
  232. Enable this option to show the menu with internal FreeRTOS debugging features.
  233. This option does not change any code by itself, it just shows/hides some options.
  234. if FREERTOS_DEBUG_INTERNALS
  235. config FREERTOS_PORTMUX_DEBUG
  236. bool "Debug portMUX portENTER_CRITICAL/portEXIT_CRITICAL"
  237. depends on FREERTOS_DEBUG_INTERNALS
  238. default n
  239. help
  240. If enabled, debug information (including integrity checks) will be printed
  241. to UART for the port-specific MUX implementation.
  242. if !FREERTOS_UNICORE
  243. config FREERTOS_PORTMUX_DEBUG_RECURSIVE
  244. bool "Debug portMUX Recursion"
  245. depends on FREERTOS_PORTMUX_DEBUG
  246. default n
  247. help
  248. If enabled, additional debug information will be printed for recursive
  249. portMUX usage.
  250. endif #FREERTOS_UNICORE
  251. endif # FREERTOS_DEBUG_INTERNALS
  252. endmenu