Kconfig 17 KB

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