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