Kconfig 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. menu "ESP System Settings"
  2. choice ESP_SYSTEM_PANIC
  3. prompt "Panic handler behaviour"
  4. default ESP_SYSTEM_PANIC_PRINT_REBOOT
  5. help
  6. If FreeRTOS detects unexpected behaviour or an unhandled exception, the panic handler is
  7. invoked. Configure the panic handler's action here.
  8. config ESP_SYSTEM_PANIC_PRINT_HALT
  9. bool "Print registers and halt"
  10. help
  11. Outputs the relevant registers over the serial port and halt the
  12. processor. Needs a manual reset to restart.
  13. config ESP_SYSTEM_PANIC_PRINT_REBOOT
  14. bool "Print registers and reboot"
  15. help
  16. Outputs the relevant registers over the serial port and immediately
  17. reset the processor.
  18. config ESP_SYSTEM_PANIC_SILENT_REBOOT
  19. bool "Silent reboot"
  20. help
  21. Just resets the processor without outputting anything
  22. config ESP_SYSTEM_PANIC_GDBSTUB
  23. bool "GDBStub on panic"
  24. select ESP_GDBSTUB_ENABLED
  25. help
  26. Invoke gdbstub on the serial port, allowing for gdb to attach to it to do a postmortem
  27. of the crash.
  28. config ESP_SYSTEM_GDBSTUB_RUNTIME
  29. bool "GDBStub at runtime"
  30. select FREERTOS_UNICORE
  31. select ESP_GDBSTUB_ENABLED
  32. help
  33. Invoke gdbstub on the serial port, allowing for gdb to attach to it and to do a debug on runtime.
  34. This feature will switch system to single core mode.
  35. endchoice
  36. config ESP_SYSTEM_SINGLE_CORE_MODE
  37. bool
  38. default n
  39. help
  40. Only initialize and use the main core.
  41. config ESP_SYSTEM_RTC_EXT_XTAL
  42. # This is a High Layer Kconfig option, invisible, can be selected by other Kconfig option
  43. # e.g. It will be selected on when ESP32_RTC_CLK_SRC_EXT_CRYS is on
  44. bool
  45. default n
  46. config ESP_SYSTEM_RTC_EXT_XTAL_BOOTSTRAP_CYCLES
  47. int "Bootstrap cycles for external 32kHz crystal"
  48. depends on ESP_SYSTEM_RTC_EXT_XTAL
  49. default 5 if IDF_TARGET_ESP32
  50. default 0
  51. range 0 32768
  52. help
  53. To reduce the startup time of an external RTC crystal,
  54. we bootstrap it with a 32kHz square wave for a fixed number of cycles.
  55. Setting 0 will disable bootstrapping (if disabled, the crystal may take
  56. longer to start up or fail to oscillate under some conditions).
  57. If this value is too high, a faulty crystal may initially start and then fail.
  58. If this value is too low, an otherwise good crystal may not start.
  59. To accurately determine if the crystal has started,
  60. set a larger "Number of cycles for RTC_SLOW_CLK calibration" (about 3000).
  61. config ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK
  62. bool
  63. default y if IDF_TARGET_ESP32 && FREERTOS_UNICORE
  64. default y if IDF_TARGET_ESP32S2
  65. default y if IDF_TARGET_ESP32C3
  66. default y if IDF_TARGET_ESP32S3
  67. default y if IDF_TARGET_ESP32H2
  68. config ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
  69. bool "Enable RTC fast memory for dynamic allocations"
  70. default y if IDF_TARGET_ESP32
  71. default y if IDF_TARGET_ESP32S2
  72. default y if IDF_TARGET_ESP32C3
  73. default n if IDF_TARGET_ESP32S3 # TODO
  74. default y if IDF_TARGET_ESP32H2
  75. depends on ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK
  76. help
  77. This config option allows to add RTC fast memory region to system heap with capability
  78. similar to that of DRAM region but without DMA. This memory will be consumed first per
  79. heap initialization order by early startup services and scheduler related code. Speed
  80. wise RTC fast memory operates on APB clock and hence does not have much performance impact.
  81. menu "Memory protection"
  82. config ESP_SYSTEM_MEMPROT_FEATURE
  83. bool "Enable memory protection"
  84. depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32H2
  85. default "y"
  86. help
  87. If enabled, the permission control module watches all the memory access and fires the panic handler
  88. if a permission violation is detected. This feature automatically splits
  89. the SRAM memory into data and instruction segments and sets Read/Execute permissions
  90. for the instruction part (below given splitting address) and Read/Write permissions
  91. for the data part (above the splitting address). The memory protection is effective
  92. on all access through the IRAM0 and DRAM0 buses.
  93. config ESP_SYSTEM_MEMPROT_FEATURE_LOCK
  94. depends on ESP_SYSTEM_MEMPROT_FEATURE
  95. bool "Lock memory protection settings"
  96. default "y"
  97. help
  98. Once locked, memory protection settings cannot be changed anymore.
  99. The lock is reset only on the chip startup.
  100. endmenu # Memory protection
  101. config ESP_SYSTEM_EVENT_QUEUE_SIZE
  102. int "System event queue size"
  103. default 32
  104. help
  105. Config system event queue size in different application.
  106. config ESP_SYSTEM_EVENT_TASK_STACK_SIZE
  107. int "Event loop task stack size"
  108. default 2304
  109. help
  110. Config system event task stack size in different application.
  111. config ESP_MAIN_TASK_STACK_SIZE
  112. int "Main task stack size"
  113. default 3584
  114. help
  115. Configure the "main task" stack size. This is the stack of the task
  116. which calls app_main(). If app_main() returns then this task is deleted
  117. and its stack memory is freed.
  118. choice ESP_MAIN_TASK_AFFINITY
  119. prompt "Main task core affinity"
  120. default ESP_MAIN_TASK_AFFINITY_CPU0
  121. help
  122. Configure the "main task" core affinity. This is the used core of the task
  123. which calls app_main(). If app_main() returns then this task is deleted.
  124. config ESP_MAIN_TASK_AFFINITY_CPU0
  125. bool "CPU0"
  126. config ESP_MAIN_TASK_AFFINITY_CPU1
  127. bool "CPU1"
  128. depends on !FREERTOS_UNICORE
  129. config ESP_MAIN_TASK_AFFINITY_NO_AFFINITY
  130. bool "No affinity"
  131. endchoice
  132. config ESP_MAIN_TASK_AFFINITY
  133. hex
  134. default 0x0 if ESP_MAIN_TASK_AFFINITY_CPU0
  135. default 0x1 if ESP_MAIN_TASK_AFFINITY_CPU1
  136. default FREERTOS_NO_AFFINITY if ESP_MAIN_TASK_AFFINITY_NO_AFFINITY
  137. config ESP_MINIMAL_SHARED_STACK_SIZE
  138. int "Minimal allowed size for shared stack"
  139. default 2048
  140. help
  141. Minimal value of size, in bytes, accepted to execute a expression
  142. with shared stack.
  143. choice ESP_CONSOLE_UART
  144. prompt "Channel for console output"
  145. default ESP_CONSOLE_UART_DEFAULT
  146. help
  147. Select where to send console output (through stdout and stderr).
  148. - Default is to use UART0 on pre-defined GPIOs.
  149. - If "Custom" is selected, UART0 or UART1 can be chosen,
  150. and any pins can be selected.
  151. - If "None" is selected, there will be no console output on any UART, except
  152. for initial output from ROM bootloader. This ROM output can be suppressed by
  153. GPIO strapping or EFUSE, refer to chip datasheet for details.
  154. - On chips with USB OTG peripheral, "USB CDC" option redirects output to the
  155. CDC port. This option uses the CDC driver in the chip ROM.
  156. This option is incompatible with TinyUSB stack.
  157. - On chips with an USB serial/JTAG debug controller, selecting the option
  158. for that redirects output to the CDC/ACM (serial port emulation) component
  159. of that device.
  160. config ESP_CONSOLE_UART_DEFAULT
  161. bool "Default: UART0"
  162. config ESP_CONSOLE_USB_CDC
  163. bool "USB CDC"
  164. # The naming is confusing: USB_ENABLED means that TinyUSB driver is enabled, not USB in general.
  165. # && !USB_ENABLED is because the ROM CDC driver is currently incompatible with TinyUSB.
  166. depends on (IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3) && !USB_ENABLED
  167. config ESP_CONSOLE_USB_SERIAL_JTAG
  168. bool "USB Serial/JTAG Controller"
  169. select ESPTOOLPY_NO_STUB if IDF_TARGET_ESP32S3 #ESPTOOL-251
  170. select ESPTOOLPY_NO_STUB if IDF_TARGET_ESP32C3 #ESPTOOL-252
  171. depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
  172. config ESP_CONSOLE_UART_CUSTOM
  173. bool "Custom UART"
  174. config ESP_CONSOLE_NONE
  175. bool "None"
  176. endchoice
  177. # Internal option, indicates that console UART is used (and not USB, for example)
  178. config ESP_CONSOLE_UART
  179. bool
  180. default y if ESP_CONSOLE_UART_DEFAULT || ESP_CONSOLE_UART_CUSTOM
  181. config ESP_CONSOLE_MULTIPLE_UART
  182. bool
  183. default y if !IDF_TARGET_ESP32C3 && !IDF_TARGET_ESP32H2
  184. choice ESP_CONSOLE_UART_NUM
  185. prompt "UART peripheral to use for console output (0-1)"
  186. depends on ESP_CONSOLE_UART_CUSTOM && ESP_CONSOLE_MULTIPLE_UART
  187. default ESP_CONSOLE_UART_CUSTOM_NUM_0
  188. help
  189. This UART peripheral is used for console output from the ESP-IDF Bootloader and the app.
  190. If the configuration is different in the Bootloader binary compared to the app binary, UART
  191. is reconfigured after the bootloader exits and the app starts.
  192. Due to an ESP32 ROM bug, UART2 is not supported for console output
  193. via esp_rom_printf.
  194. config ESP_CONSOLE_UART_CUSTOM_NUM_0
  195. bool "UART0"
  196. config ESP_CONSOLE_UART_CUSTOM_NUM_1
  197. bool "UART1"
  198. endchoice
  199. config ESP_CONSOLE_UART_NUM
  200. int
  201. default 0 if ESP_CONSOLE_UART_DEFAULT
  202. default 0 if !ESP_CONSOLE_MULTIPLE_UART
  203. default 0 if ESP_CONSOLE_UART_CUSTOM_NUM_0
  204. default 1 if ESP_CONSOLE_UART_CUSTOM_NUM_1
  205. default -1 if !ESP_CONSOLE_UART
  206. config ESP_CONSOLE_UART_TX_GPIO
  207. int "UART TX on GPIO#"
  208. depends on ESP_CONSOLE_UART_CUSTOM
  209. range 0 46
  210. default 1 if IDF_TARGET_ESP32
  211. default 21 if IDF_TARGET_ESP32C3
  212. default 43
  213. help
  214. This GPIO is used for console UART TX output in the ESP-IDF Bootloader and the app (including
  215. boot log output and default standard output and standard error of the app).
  216. If the configuration is different in the Bootloader binary compared to the app binary, UART
  217. is reconfigured after the bootloader exits and the app starts.
  218. config ESP_CONSOLE_UART_RX_GPIO
  219. int "UART RX on GPIO#"
  220. depends on ESP_CONSOLE_UART_CUSTOM
  221. range 0 46
  222. default 3 if IDF_TARGET_ESP32
  223. default 20 if IDF_TARGET_ESP32C3
  224. default 44
  225. help
  226. This GPIO is used for UART RX input in the ESP-IDF Bootloader and the app (including
  227. default default standard input of the app).
  228. Note: The default ESP-IDF Bootloader configures this pin but doesn't read anything from the UART.
  229. If the configuration is different in the Bootloader binary compared to the app binary, UART
  230. is reconfigured after the bootloader exits and the app starts.
  231. config ESP_CONSOLE_UART_BAUDRATE
  232. int
  233. prompt "UART console baud rate" if ESP_CONSOLE_UART_CUSTOM
  234. depends on ESP_CONSOLE_UART
  235. default 115200
  236. range 1200 4000000 if !PM_ENABLE
  237. range 1200 1000000 if PM_ENABLE
  238. help
  239. This baud rate is used by both the ESP-IDF Bootloader and the app (including
  240. boot log output and default standard input/output/error of the app).
  241. The app's maximum baud rate depends on the UART clock source. If Power Management is disabled,
  242. the UART clock source is the APB clock and all baud rates in the available range will be sufficiently
  243. accurate. If Power Management is enabled, REF_TICK clock source is used so the baud rate is divided
  244. from 1MHz. Baud rates above 1Mbps are not possible and values between 500Kbps and 1Mbps may not be
  245. accurate.
  246. If the configuration is different in the Bootloader binary compared to the app binary, UART
  247. is reconfigured after the bootloader exits and the app starts.
  248. config ESP_CONSOLE_USB_CDC_RX_BUF_SIZE
  249. int "Size of USB CDC RX buffer"
  250. depends on ESP_CONSOLE_USB_CDC
  251. default 64
  252. range 4 16384
  253. help
  254. Set the size of USB CDC RX buffer. Increase the buffer size if your application
  255. is often receiving data over USB CDC.
  256. config ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF
  257. bool "Enable esp_rom_printf / ESP_EARLY_LOG via USB CDC"
  258. depends on ESP_CONSOLE_USB_CDC
  259. default n
  260. help
  261. If enabled, esp_rom_printf and ESP_EARLY_LOG output will also be sent over USB CDC.
  262. Disabling this option saves about 1kB or RAM.
  263. config ESP_INT_WDT
  264. bool "Interrupt watchdog"
  265. default y
  266. help
  267. This watchdog timer can detect if the FreeRTOS tick interrupt has not been called for a certain time,
  268. either because a task turned off interrupts and did not turn them on for a long time, or because an
  269. interrupt handler did not return. It will try to invoke the panic handler first and failing that
  270. reset the SoC.
  271. config ESP_INT_WDT_TIMEOUT_MS
  272. int "Interrupt watchdog timeout (ms)"
  273. depends on ESP_INT_WDT
  274. default 300 if !ESP32_SPIRAM_SUPPORT
  275. default 800 if ESP32_SPIRAM_SUPPORT
  276. range 10 10000
  277. help
  278. The timeout of the watchdog, in miliseconds. Make this higher than the FreeRTOS tick rate.
  279. config ESP_INT_WDT_CHECK_CPU1
  280. bool "Also watch CPU1 tick interrupt"
  281. depends on ESP_INT_WDT && !FREERTOS_UNICORE
  282. default y
  283. help
  284. Also detect if interrupts on CPU 1 are disabled for too long.
  285. config ESP_TASK_WDT
  286. bool "Initialize Task Watchdog Timer on startup"
  287. default y
  288. help
  289. The Task Watchdog Timer can be used to make sure individual tasks are still
  290. running. Enabling this option will cause the Task Watchdog Timer to be
  291. initialized automatically at startup. The Task Watchdog timer can be
  292. initialized after startup as well (see Task Watchdog Timer API Reference)
  293. config ESP_TASK_WDT_PANIC
  294. bool "Invoke panic handler on Task Watchdog timeout"
  295. depends on ESP_TASK_WDT
  296. default n
  297. help
  298. If this option is enabled, the Task Watchdog Timer will be configured to
  299. trigger the panic handler when it times out. This can also be configured
  300. at run time (see Task Watchdog Timer API Reference)
  301. config ESP_TASK_WDT_TIMEOUT_S
  302. int "Task Watchdog timeout period (seconds)"
  303. depends on ESP_TASK_WDT
  304. range 1 60
  305. default 5
  306. help
  307. Timeout period configuration for the Task Watchdog Timer in seconds.
  308. This is also configurable at run time (see Task Watchdog Timer API Reference)
  309. config ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0
  310. bool "Watch CPU0 Idle Task"
  311. depends on ESP_TASK_WDT
  312. default y
  313. help
  314. If this option is enabled, the Task Watchdog Timer will watch the CPU0
  315. Idle Task. Having the Task Watchdog watch the Idle Task allows for detection
  316. of CPU starvation as the Idle Task not being called is usually a symptom of
  317. CPU starvation. Starvation of the Idle Task is detrimental as FreeRTOS household
  318. tasks depend on the Idle Task getting some runtime every now and then.
  319. config ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1
  320. bool "Watch CPU1 Idle Task"
  321. depends on ESP_TASK_WDT && !FREERTOS_UNICORE
  322. default y
  323. help
  324. If this option is enabled, the Task Wtachdog Timer will wach the CPU1
  325. Idle Task.
  326. config ESP_IPC_TASK_STACK_SIZE
  327. int "Inter-Processor Call (IPC) task stack size"
  328. range 512 65536 if !APPTRACE_ENABLE
  329. range 2048 65536 if APPTRACE_ENABLE
  330. default 2048 if APPTRACE_ENABLE
  331. default 1024
  332. help
  333. Configure the IPC tasks stack size. One IPC task runs on each core
  334. (in dual core mode), and allows for cross-core function calls.
  335. See IPC documentation for more details.
  336. The default stack size should be enough for most common use cases.
  337. It can be shrunk if you are sure that you do not use any custom
  338. IPC functionality.
  339. config ESP_IPC_USES_CALLERS_PRIORITY
  340. bool "IPC runs at caller's priority"
  341. default y
  342. depends on !FREERTOS_UNICORE
  343. help
  344. If this option is not enabled then the IPC task will keep behavior
  345. same as prior to that of ESP-IDF v4.0, and hence IPC task will run
  346. at (configMAX_PRIORITIES - 1) priority.
  347. config ESP_PANIC_HANDLER_IRAM
  348. bool "Place panic handler code in IRAM"
  349. default n
  350. help
  351. If this option is disabled (default), the panic handler code is placed in flash not IRAM.
  352. This means that if ESP-IDF crashes while flash cache is disabled, the panic handler will
  353. automatically re-enable flash cache before running GDB Stub or Core Dump. This adds some minor
  354. risk, if the flash cache status is also corrupted during the crash.
  355. If this option is enabled, the panic handler code (including required UART functions) is placed
  356. in IRAM. This may be necessary to debug some complex issues with crashes while flash cache is
  357. disabled (for example, when writing to SPI flash) or when flash cache is corrupted when an exception
  358. is triggered.
  359. config ESP_DEBUG_STUBS_ENABLE
  360. bool
  361. default COMPILER_OPTIMIZATION_LEVEL_DEBUG
  362. depends on !ESP32_TRAX && !ESP32S2_TRAX
  363. help
  364. Debug stubs are used by OpenOCD to execute pre-compiled onboard code
  365. which does some useful debugging stuff, e.g. GCOV data dump.
  366. endmenu # ESP System Settings