Kconfig 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362
  1. menu "ESP32-specific"
  2. # Hidden option to support checking for this specific target in C code and Kconfig files
  3. config IDF_TARGET_ESP32
  4. bool
  5. default "y" if IDF_TARGET="esp32"
  6. default "n"
  7. choice ESP32_DEFAULT_CPU_FREQ_MHZ
  8. prompt "CPU frequency"
  9. default ESP32_DEFAULT_CPU_FREQ_160
  10. help
  11. CPU frequency to be set on application startup.
  12. config ESP32_DEFAULT_CPU_FREQ_80
  13. bool "80 MHz"
  14. config ESP32_DEFAULT_CPU_FREQ_160
  15. bool "160 MHz"
  16. config ESP32_DEFAULT_CPU_FREQ_240
  17. bool "240 MHz"
  18. endchoice
  19. config ESP32_DEFAULT_CPU_FREQ_MHZ
  20. int
  21. default 80 if ESP32_DEFAULT_CPU_FREQ_80
  22. default 160 if ESP32_DEFAULT_CPU_FREQ_160
  23. default 240 if ESP32_DEFAULT_CPU_FREQ_240
  24. config SPIRAM_SUPPORT
  25. bool "Support for external, SPI-connected RAM"
  26. default "n"
  27. help
  28. This enables support for an external SPI RAM chip, connected in parallel with the
  29. main SPI flash chip.
  30. menu "SPI RAM config"
  31. depends on SPIRAM_SUPPORT
  32. config SPIRAM_BOOT_INIT
  33. bool "Initialize SPI RAM when booting the ESP32"
  34. default "y"
  35. help
  36. If this is enabled, the SPI RAM will be enabled during initial boot. Unless you
  37. have specific requirements, you'll want to leave this enabled so memory allocated
  38. during boot-up can also be placed in SPI RAM.
  39. config SPIRAM_IGNORE_NOTFOUND
  40. bool "Ignore PSRAM when not found"
  41. default "n"
  42. depends on SPIRAM_BOOT_INIT && !SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
  43. help
  44. Normally, if psram initialization is enabled during compile time but not found at runtime, it
  45. is seen as an error making the ESP32 panic. If this is enabled, the ESP32 will keep on
  46. running but will not add the (non-existing) RAM to any allocator.
  47. choice SPIRAM_USE
  48. prompt "SPI RAM access method"
  49. default SPIRAM_USE_MALLOC
  50. help
  51. The SPI RAM can be accessed in multiple methods: by just having it available as an unmanaged
  52. memory region in the ESP32 memory map, by integrating it in the ESP32s heap as 'special' memory
  53. needing heap_caps_malloc to allocate, or by fully integrating it making malloc() also able to
  54. return SPI RAM pointers.
  55. config SPIRAM_USE_MEMMAP
  56. bool "Integrate RAM into ESP32 memory map"
  57. config SPIRAM_USE_CAPS_ALLOC
  58. bool "Make RAM allocatable using heap_caps_malloc(..., MALLOC_CAP_SPIRAM)"
  59. config SPIRAM_USE_MALLOC
  60. bool "Make RAM allocatable using malloc() as well"
  61. select SUPPORT_STATIC_ALLOCATION
  62. endchoice
  63. choice SPIRAM_TYPE
  64. prompt "Type of SPI RAM chip in use"
  65. default SPIRAM_TYPE_AUTO
  66. config SPIRAM_TYPE_AUTO
  67. bool "Auto-detect"
  68. config SPIRAM_TYPE_ESPPSRAM32
  69. bool "ESP-PSRAM32 or IS25WP032"
  70. config SPIRAM_TYPE_ESPPSRAM64
  71. bool "ESP-PSRAM64 or LY68L6400"
  72. endchoice
  73. config SPIRAM_SIZE
  74. int
  75. default -1 if SPIRAM_TYPE_AUTO
  76. default 4194304 if SPIRAM_TYPE_ESPPSRAM32
  77. default 8388608 if SPIRAM_TYPE_ESPPSRAM64
  78. default 0
  79. choice SPIRAM_SPEED
  80. prompt "Set RAM clock speed"
  81. default SPIRAM_CACHE_SPEED_40M
  82. help
  83. Select the speed for the SPI RAM chip.
  84. If SPI RAM is enabled, we only support three combinations of SPI speed mode we supported now:
  85. 1. Flash SPI running at 40Mhz and RAM SPI running at 40Mhz
  86. 2. Flash SPI running at 80Mhz and RAM SPI running at 40Mhz
  87. 3. Flash SPI running at 80Mhz and RAM SPI running at 80Mhz
  88. Note: If the third mode(80Mhz+80Mhz) is enabled for SPI RAM of type 32MBit, one of the HSPI/VSPI host
  89. will be occupied by the system. Which SPI host to use can be selected by the config item
  90. SPIRAM_OCCUPY_SPI_HOST. Application code should never touch HSPI/VSPI hardware in this case. The
  91. option to select 80MHz will only be visible if the flash SPI speed is also 80MHz.
  92. (ESPTOOLPY_FLASHFREQ_80M is true)
  93. config SPIRAM_SPEED_40M
  94. bool "40MHz clock speed"
  95. config SPIRAM_SPEED_80M
  96. depends on ESPTOOLPY_FLASHFREQ_80M
  97. bool "80MHz clock speed"
  98. endchoice
  99. config SPIRAM_MEMTEST
  100. bool "Run memory test on SPI RAM initialization"
  101. default "y"
  102. depends on SPIRAM_BOOT_INIT
  103. help
  104. Runs a rudimentary memory test on initialization. Aborts when memory test fails. Disable this for
  105. slightly faster startop.
  106. config SPIRAM_CACHE_WORKAROUND
  107. bool "Enable workaround for bug in SPI RAM cache for Rev1 ESP32s"
  108. depends on SPIRAM_USE_MEMMAP || SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
  109. default "y"
  110. help
  111. Revision 1 of the ESP32 has a bug that can cause a write to PSRAM not to take place in some situations
  112. when the cache line needs to be fetched from external RAM and an interrupt occurs. This enables a
  113. fix in the compiler (-mfix-esp32-psram-cache-issue) that makes sure the specific code that is
  114. vulnerable to this will not be emitted.
  115. This will also not use any bits of newlib that are located in ROM, opting for a version that is
  116. compiled with the workaround and located in flash instead.
  117. config SPIRAM_BANKSWITCH_ENABLE
  118. bool "Enable bank switching for >4MiB external RAM"
  119. default y
  120. depends on SPIRAM_USE_MEMMAP || SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
  121. help
  122. The ESP32 only supports 4MiB of external RAM in its address space. The hardware does support larger
  123. memories, but these have to be bank-switched in and out of this address space. Enabling this allows you
  124. to reserve some MMU pages for this, which allows the use of the esp_himem api to manage these banks.
  125. #Note that this is limited to 62 banks, as esp_spiram_writeback_cache needs some kind of mapping of
  126. #some banks below that mark to work. We cannot at this moment guarantee this to exist when himem is
  127. #enabled.
  128. config SPIRAM_BANKSWITCH_RESERVE
  129. int "Amount of 32K pages to reserve for bank switching"
  130. depends on SPIRAM_BANKSWITCH_ENABLE
  131. default 8
  132. range 1 62
  133. help
  134. Select the amount of banks reserved for bank switching. Note that the amount of RAM allocatable with
  135. malloc/esp_heap_alloc_caps will decrease by 32K for each page reserved here.
  136. Note that this reservation is only actually done if your program actually uses the himem API. Without
  137. any himem calls, the reservation is not done and the original amount of memory will be available
  138. to malloc/esp_heap_alloc_caps.
  139. config SPIRAM_MALLOC_ALWAYSINTERNAL
  140. int "Maximum malloc() size, in bytes, to always put in internal memory"
  141. depends on SPIRAM_USE_MALLOC
  142. default 16384
  143. range 0 131072
  144. help
  145. If malloc() is capable of also allocating SPI-connected ram, its allocation strategy will prefer to
  146. allocate chunks less than this size in internal memory, while allocations larger than this will be
  147. done from external RAM. If allocation from the preferred region fails, an attempt is made to allocate
  148. from the non-preferred region instead, so malloc() will not suddenly fail when either internal or
  149. external memory is full.
  150. config WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  151. bool "Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, allocate internal memory"
  152. depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
  153. default "n"
  154. help
  155. Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, try to allocate internal
  156. memory then.
  157. config SPIRAM_MALLOC_RESERVE_INTERNAL
  158. int "Reserve this amount of bytes for data that specifically needs to be in DMA or internal memory"
  159. depends on SPIRAM_USE_MALLOC
  160. default 32768
  161. range 0 262144
  162. help
  163. Because the external/internal RAM allocation strategy is not always perfect, it sometimes may happen
  164. that the internal memory is entirely filled up. This causes allocations that are specifically done in
  165. internal memory, for example the stack for new tasks or memory to service DMA or have memory that's
  166. also available when SPI cache is down, to fail. This option reserves a pool specifically for requests
  167. like that; the memory in this pool is not given out when a normal malloc() is called.
  168. Set this to 0 to disable this feature.
  169. Note that because FreeRTOS stacks are forced to internal memory, they will also use this memory pool;
  170. be sure to keep this in mind when adjusting this value.
  171. Note also that the DMA reserved pool may not be one single contiguous memory region, depending on the
  172. configured size and the static memory usage of the app.
  173. config SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
  174. bool "Allow external memory as an argument to xTaskCreateStatic"
  175. default n
  176. depends on SPIRAM_USE_MALLOC
  177. help
  178. Because some bits of the ESP32 code environment cannot be recompiled with the cache workaround,
  179. normally tasks cannot be safely run with their stack residing in external memory; for this reason
  180. xTaskCreate and friends always allocate stack in internal memory and xTaskCreateStatic will check if
  181. the memory passed to it is in internal memory. If you have a task that needs a large amount of stack
  182. and does not call on ROM code in any way (no direct calls, but also no Bluetooth/WiFi), you can try to
  183. disable this and use xTaskCreateStatic to create the tasks stack in external memory.
  184. config SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
  185. bool "Allow .bss segment placed in external memory"
  186. default n
  187. depends on SPIRAM_SUPPORT
  188. help
  189. If enabled the option,and add EXT_RAM_ATTR defined your variable,then your variable will be placed in
  190. PSRAM instead of internal memory, and placed most of variables of lwip,net802.11,pp,bluedroid library
  191. to external memory defaultly.
  192. choice SPIRAM_OCCUPY_SPI_HOST
  193. prompt "SPI host to use for 32MBit PSRAM"
  194. default SPIRAM_OCCUPY_VSPI_HOST
  195. depends on SPIRAM_SPEED_80M
  196. help
  197. When both flash and PSRAM is working under 80MHz, and the PSRAM is of type 32MBit, one of the HSPI/VSPI
  198. host will be used to output the clock. Select which one to use here.
  199. config SPIRAM_OCCUPY_HSPI_HOST
  200. bool "HSPI host (SPI2)"
  201. config SPIRAM_OCCUPY_VSPI_HOST
  202. bool "VSPI host (SPI3)"
  203. endchoice
  204. config PICO_PSRAM_CS_IO
  205. int "PSRAM CS IO for ESP32-PICO chip"
  206. depends on SPIRAM_SUPPORT
  207. range 0 33
  208. default 10
  209. help
  210. When ESP32-PICO chip connect a external psram, the clock IO and data IO is fixed, but the CS IO can be
  211. any unused GPIO, user can config it based on hardware design.
  212. endmenu
  213. config MEMMAP_TRACEMEM
  214. bool
  215. default "n"
  216. config MEMMAP_TRACEMEM_TWOBANKS
  217. bool
  218. default "n"
  219. config ESP32_TRAX
  220. bool "Use TRAX tracing feature"
  221. default "n"
  222. select MEMMAP_TRACEMEM
  223. help
  224. The ESP32 contains a feature which allows you to trace the execution path the processor
  225. has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
  226. of memory that can't be used for general purposes anymore. Disable this if you do not know
  227. what this is.
  228. config ESP32_TRAX_TWOBANKS
  229. bool "Reserve memory for tracing both pro as well as app cpu execution"
  230. default "n"
  231. depends on ESP32_TRAX && !FREERTOS_UNICORE
  232. select MEMMAP_TRACEMEM_TWOBANKS
  233. help
  234. The ESP32 contains a feature which allows you to trace the execution path the processor
  235. has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
  236. of memory that can't be used for general purposes anymore. Disable this if you do not know
  237. what this is.
  238. # Memory to reverse for trace, used in linker script
  239. config TRACEMEM_RESERVE_DRAM
  240. hex
  241. default 0x8000 if MEMMAP_TRACEMEM && MEMMAP_TRACEMEM_TWOBANKS
  242. default 0x4000 if MEMMAP_TRACEMEM && !MEMMAP_TRACEMEM_TWOBANKS
  243. default 0x0
  244. choice NUMBER_OF_UNIVERSAL_MAC_ADDRESS
  245. bool "Number of universally administered (by IEEE) MAC address"
  246. default FOUR_UNIVERSAL_MAC_ADDRESS
  247. help
  248. Configure the number of universally administered (by IEEE) MAC addresses.
  249. During initialisation, MAC addresses for each network interface are generated or derived from a
  250. single base MAC address.
  251. If the number of universal MAC addresses is four, all four interfaces (WiFi station, WiFi softap,
  252. Bluetooth and Ethernet) receive a universally administered MAC address. These are generated
  253. sequentially by adding 0, 1, 2 and 3 (respectively) to the final octet of the base MAC address.
  254. If the number of universal MAC addresses is two, only two interfaces (WiFi station and Bluetooth)
  255. receive a universally administered MAC address. These are generated sequentially by adding 0
  256. and 1 (respectively) to the base MAC address. The remaining two interfaces (WiFi softap and Ethernet)
  257. receive local MAC addresses. These are derived from the universal WiFi station and Bluetooth MAC
  258. addresses, respectively.
  259. When using the default (Espressif-assigned) base MAC address, either setting can be used. When using
  260. a custom universal MAC address range, the correct setting will depend on the allocation of MAC
  261. addresses in this range (either 2 or 4 per device.)
  262. config TWO_UNIVERSAL_MAC_ADDRESS
  263. bool "Two"
  264. config FOUR_UNIVERSAL_MAC_ADDRESS
  265. bool "Four"
  266. endchoice
  267. config NUMBER_OF_UNIVERSAL_MAC_ADDRESS
  268. int
  269. default 2 if TWO_UNIVERSAL_MAC_ADDRESS
  270. default 4 if FOUR_UNIVERSAL_MAC_ADDRESS
  271. config SYSTEM_EVENT_QUEUE_SIZE
  272. int "System event queue size"
  273. default 32
  274. help
  275. Config system event queue size in different application.
  276. config SYSTEM_EVENT_TASK_STACK_SIZE
  277. int "Event loop task stack size"
  278. default 2304
  279. help
  280. Config system event task stack size in different application.
  281. config MAIN_TASK_STACK_SIZE
  282. int "Main task stack size"
  283. default 3584
  284. help
  285. Configure the "main task" stack size. This is the stack of the task
  286. which calls app_main(). If app_main() returns then this task is deleted
  287. and its stack memory is freed.
  288. config IPC_TASK_STACK_SIZE
  289. int "Inter-Processor Call (IPC) task stack size"
  290. default 1024
  291. range 512 65536 if !ESP32_APPTRACE_ENABLE
  292. range 2048 65536 if ESP32_APPTRACE_ENABLE
  293. help
  294. Configure the IPC tasks stack size. One IPC task runs on each core
  295. (in dual core mode), and allows for cross-core function calls.
  296. See IPC documentation for more details.
  297. The default stack size should be enough for most common use cases.
  298. It can be shrunk if you are sure that you do not use any custom
  299. IPC functionality.
  300. config TIMER_TASK_STACK_SIZE
  301. int "High-resolution timer task stack size"
  302. default 3584
  303. range 2048 65536
  304. help
  305. Configure the stack size of esp_timer/ets_timer task. This task is used
  306. to dispatch callbacks of timers created using ets_timer and esp_timer
  307. APIs. If you are seing stack overflow errors in timer task, increase
  308. this value.
  309. Note that this is not the same as FreeRTOS timer task. To configure
  310. FreeRTOS timer task size, see "FreeRTOS timer task stack size" option
  311. in "FreeRTOS" menu.
  312. choice NEWLIB_STDOUT_LINE_ENDING
  313. prompt "Line ending for UART output"
  314. default NEWLIB_STDOUT_LINE_ENDING_CRLF
  315. help
  316. This option allows configuring the desired line endings sent to UART
  317. when a newline ('\n', LF) appears on stdout.
  318. Three options are possible:
  319. CRLF: whenever LF is encountered, prepend it with CR
  320. LF: no modification is applied, stdout is sent as is
  321. CR: each occurence of LF is replaced with CR
  322. This option doesn't affect behavior of the UART driver (drivers/uart.h).
  323. config NEWLIB_STDOUT_LINE_ENDING_CRLF
  324. bool "CRLF"
  325. config NEWLIB_STDOUT_LINE_ENDING_LF
  326. bool "LF"
  327. config NEWLIB_STDOUT_LINE_ENDING_CR
  328. bool "CR"
  329. endchoice
  330. choice NEWLIB_STDIN_LINE_ENDING
  331. prompt "Line ending for UART input"
  332. default NEWLIB_STDIN_LINE_ENDING_CR
  333. help
  334. This option allows configuring which input sequence on UART produces
  335. a newline ('\n', LF) on stdin.
  336. Three options are possible:
  337. CRLF: CRLF is converted to LF
  338. LF: no modification is applied, input is sent to stdin as is
  339. CR: each occurence of CR is replaced with LF
  340. This option doesn't affect behavior of the UART driver (drivers/uart.h).
  341. config NEWLIB_STDIN_LINE_ENDING_CRLF
  342. bool "CRLF"
  343. config NEWLIB_STDIN_LINE_ENDING_LF
  344. bool "LF"
  345. config NEWLIB_STDIN_LINE_ENDING_CR
  346. bool "CR"
  347. endchoice
  348. config NEWLIB_NANO_FORMAT
  349. bool "Enable 'nano' formatting options for printf/scanf family"
  350. default n
  351. help
  352. ESP32 ROM contains parts of newlib C library, including printf/scanf family
  353. of functions. These functions have been compiled with so-called "nano"
  354. formatting option. This option doesn't support 64-bit integer formats and C99
  355. features, such as positional arguments.
  356. For more details about "nano" formatting option, please see newlib readme file,
  357. search for '--enable-newlib-nano-formatted-io':
  358. https://sourceware.org/newlib/README
  359. If this option is enabled, build system will use functions available in
  360. ROM, reducing the application binary size. Functions available in ROM run
  361. faster than functions which run from flash. Functions available in ROM can
  362. also run when flash instruction cache is disabled.
  363. If you need 64-bit integer formatting support or C99 features, keep this
  364. option disabled.
  365. choice CONSOLE_UART
  366. prompt "UART for console output"
  367. default CONSOLE_UART_DEFAULT
  368. help
  369. Select whether to use UART for console output (through stdout and stderr).
  370. - Default is to use UART0 on pins GPIO1(TX) and GPIO3(RX).
  371. - If "Custom" is selected, UART0 or UART1 can be chosen,
  372. and any pins can be selected.
  373. - If "None" is selected, there will be no console output on any UART, except
  374. for initial output from ROM bootloader. This output can be further suppressed by
  375. bootstrapping GPIO13 pin to low logic level.
  376. config CONSOLE_UART_DEFAULT
  377. bool "Default: UART0, TX=GPIO1, RX=GPIO3"
  378. config CONSOLE_UART_CUSTOM
  379. bool "Custom"
  380. config CONSOLE_UART_NONE
  381. bool "None"
  382. endchoice
  383. choice CONSOLE_UART_NUM
  384. prompt "UART peripheral to use for console output (0-1)"
  385. depends on CONSOLE_UART_CUSTOM
  386. default CONSOLE_UART_CUSTOM_NUM_0
  387. help
  388. Due of a ROM bug, UART2 is not supported for console output
  389. via ets_printf.
  390. config CONSOLE_UART_CUSTOM_NUM_0
  391. bool "UART0"
  392. config CONSOLE_UART_CUSTOM_NUM_1
  393. bool "UART1"
  394. endchoice
  395. config CONSOLE_UART_NUM
  396. int
  397. default 0 if CONSOLE_UART_DEFAULT || CONSOLE_UART_NONE
  398. default 0 if CONSOLE_UART_CUSTOM_NUM_0
  399. default 1 if CONSOLE_UART_CUSTOM_NUM_1
  400. config CONSOLE_UART_TX_GPIO
  401. int "UART TX on GPIO#"
  402. depends on CONSOLE_UART_CUSTOM
  403. range 0 33
  404. default 19
  405. config CONSOLE_UART_RX_GPIO
  406. int "UART RX on GPIO#"
  407. depends on CONSOLE_UART_CUSTOM
  408. range 0 39
  409. default 21
  410. config CONSOLE_UART_BAUDRATE
  411. int "UART console baud rate"
  412. depends on !CONSOLE_UART_NONE
  413. default 115200
  414. range 1200 4000000
  415. config ULP_COPROC_ENABLED
  416. bool "Enable Ultra Low Power (ULP) Coprocessor"
  417. default "n"
  418. help
  419. Set to 'y' if you plan to load a firmware for the coprocessor.
  420. If this option is enabled, further coprocessor configuration will appear in the Components menu.
  421. config ULP_COPROC_RESERVE_MEM
  422. int
  423. prompt "RTC slow memory reserved for coprocessor" if ULP_COPROC_ENABLED
  424. default 512 if ULP_COPROC_ENABLED
  425. range 32 8192 if ULP_COPROC_ENABLED
  426. default 0 if !ULP_COPROC_ENABLED
  427. range 0 0 if !ULP_COPROC_ENABLED
  428. help
  429. Bytes of memory to reserve for ULP coprocessor firmware & data.
  430. Data is reserved at the beginning of RTC slow memory.
  431. choice ESP32_PANIC
  432. prompt "Panic handler behaviour"
  433. default ESP32_PANIC_PRINT_REBOOT
  434. help
  435. If FreeRTOS detects unexpected behaviour or an unhandled exception, the panic handler is
  436. invoked. Configure the panic handlers action here.
  437. config ESP32_PANIC_PRINT_HALT
  438. bool "Print registers and halt"
  439. help
  440. Outputs the relevant registers over the serial port and halt the
  441. processor. Needs a manual reset to restart.
  442. config ESP32_PANIC_PRINT_REBOOT
  443. bool "Print registers and reboot"
  444. help
  445. Outputs the relevant registers over the serial port and immediately
  446. reset the processor.
  447. config ESP32_PANIC_SILENT_REBOOT
  448. bool "Silent reboot"
  449. help
  450. Just resets the processor without outputting anything
  451. config ESP32_PANIC_GDBSTUB
  452. bool "Invoke GDBStub"
  453. help
  454. Invoke gdbstub on the serial port, allowing for gdb to attach to it to do a postmortem
  455. of the crash.
  456. endchoice
  457. config GDBSTUB_SUPPORT_TASKS
  458. bool "GDBStub: enable listing FreeRTOS tasks"
  459. default y
  460. depends on ESP32_PANIC_GDBSTUB
  461. help
  462. If enabled, GDBStub can supply the list of FreeRTOS tasks to GDB.
  463. Thread list can be queried from GDB using 'info threads' command.
  464. Note that if GDB task lists were corrupted, this feature may not work.
  465. If GDBStub fails, try disabling this feature.
  466. config GDBSTUB_MAX_TASKS
  467. int "GDBStub: maximum number of tasks supported"
  468. default 32
  469. depends on GDBSTUB_SUPPORT_TASKS
  470. help
  471. Set the number of tasks which GDB Stub will support.
  472. config ESP32_DEBUG_OCDAWARE
  473. bool "Make exception and panic handlers JTAG/OCD aware"
  474. default y
  475. help
  476. The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and
  477. instead of panicking, have the debugger stop on the offending instruction.
  478. config ESP32_DEBUG_STUBS_ENABLE
  479. bool "OpenOCD debug stubs"
  480. default OPTIMIZATION_LEVEL_DEBUG
  481. depends on !ESP32_TRAX
  482. help
  483. Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging,
  484. e.g. GCOV data dump.
  485. config INT_WDT
  486. bool "Interrupt watchdog"
  487. default y
  488. help
  489. This watchdog timer can detect if the FreeRTOS tick interrupt has not been called for a certain time,
  490. either because a task turned off interrupts and did not turn them on for a long time, or because an
  491. interrupt handler did not return. It will try to invoke the panic handler first and failing that
  492. reset the SoC.
  493. config INT_WDT_TIMEOUT_MS
  494. int "Interrupt watchdog timeout (ms)"
  495. depends on INT_WDT
  496. default 300 if !SPIRAM_SUPPORT
  497. default 800 if SPIRAM_SUPPORT
  498. range 10 10000
  499. help
  500. The timeout of the watchdog, in miliseconds. Make this higher than the FreeRTOS tick rate.
  501. config INT_WDT_CHECK_CPU1
  502. bool "Also watch CPU1 tick interrupt"
  503. depends on INT_WDT && !FREERTOS_UNICORE
  504. default y
  505. help
  506. Also detect if interrupts on CPU 1 are disabled for too long.
  507. config TASK_WDT
  508. bool "Initialize Task Watchdog Timer on startup"
  509. default y
  510. help
  511. The Task Watchdog Timer can be used to make sure individual tasks are still
  512. running. Enabling this option will cause the Task Watchdog Timer to be
  513. initialized automatically at startup. The Task Watchdog timer can be
  514. initialized after startup as well (see Task Watchdog Timer API Reference)
  515. config TASK_WDT_PANIC
  516. bool "Invoke panic handler on Task Watchdog timeout"
  517. depends on TASK_WDT
  518. default n
  519. help
  520. If this option is enabled, the Task Watchdog Timer will be configured to
  521. trigger the panic handler when it times out. This can also be configured
  522. at run time (see Task Watchdog Timer API Reference)
  523. config TASK_WDT_TIMEOUT_S
  524. int "Task Watchdog timeout period (seconds)"
  525. depends on TASK_WDT
  526. range 1 60
  527. default 5
  528. help
  529. Timeout period configuration for the Task Watchdog Timer in seconds.
  530. This is also configurable at run time (see Task Watchdog Timer API Reference)
  531. config TASK_WDT_CHECK_IDLE_TASK_CPU0
  532. bool "Watch CPU0 Idle Task"
  533. depends on TASK_WDT
  534. default y
  535. help
  536. If this option is enabled, the Task Watchdog Timer will watch the CPU0
  537. Idle Task. Having the Task Watchdog watch the Idle Task allows for detection
  538. of CPU starvation as the Idle Task not being called is usually a symptom of
  539. CPU starvation. Starvation of the Idle Task is detrimental as FreeRTOS household
  540. tasks depend on the Idle Task getting some runtime every now and then.
  541. config TASK_WDT_CHECK_IDLE_TASK_CPU1
  542. bool "Watch CPU1 Idle Task"
  543. depends on TASK_WDT && !FREERTOS_UNICORE
  544. default y
  545. help
  546. If this option is enabled, the Task Wtachdog Timer will wach the CPU1
  547. Idle Task.
  548. config BROWNOUT_DET
  549. #The brownout detector code is disabled (by making it depend on a nonexisting symbol) because the current
  550. #revision of ESP32 silicon has a bug in the brown-out detector, rendering it unusable for resetting the CPU.
  551. bool "Hardware brownout detect & reset"
  552. default y
  553. help
  554. The ESP32 has a built-in brownout detector which can detect if the voltage is lower than
  555. a specific value. If this happens, it will reset the chip in order to prevent unintended
  556. behaviour.
  557. choice BROWNOUT_DET_LVL_SEL
  558. prompt "Brownout voltage level"
  559. depends on BROWNOUT_DET
  560. default BROWNOUT_DET_LVL_SEL_25
  561. help
  562. The brownout detector will reset the chip when the supply voltage is approximately
  563. below this level. Note that there may be some variation of brownout voltage level
  564. between each ESP32 chip.
  565. #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
  566. #of the brownout threshold levels.
  567. config BROWNOUT_DET_LVL_SEL_0
  568. bool "2.43V +/- 0.05"
  569. config BROWNOUT_DET_LVL_SEL_1
  570. bool "2.48V +/- 0.05"
  571. config BROWNOUT_DET_LVL_SEL_2
  572. bool "2.58V +/- 0.05"
  573. config BROWNOUT_DET_LVL_SEL_3
  574. bool "2.62V +/- 0.05"
  575. config BROWNOUT_DET_LVL_SEL_4
  576. bool "2.67V +/- 0.05"
  577. config BROWNOUT_DET_LVL_SEL_5
  578. bool "2.70V +/- 0.05"
  579. config BROWNOUT_DET_LVL_SEL_6
  580. bool "2.77V +/- 0.05"
  581. config BROWNOUT_DET_LVL_SEL_7
  582. bool "2.80V +/- 0.05"
  583. endchoice
  584. config BROWNOUT_DET_LVL
  585. int
  586. default 0 if BROWNOUT_DET_LVL_SEL_0
  587. default 1 if BROWNOUT_DET_LVL_SEL_1
  588. default 2 if BROWNOUT_DET_LVL_SEL_2
  589. default 3 if BROWNOUT_DET_LVL_SEL_3
  590. default 4 if BROWNOUT_DET_LVL_SEL_4
  591. default 5 if BROWNOUT_DET_LVL_SEL_5
  592. default 6 if BROWNOUT_DET_LVL_SEL_6
  593. default 7 if BROWNOUT_DET_LVL_SEL_7
  594. #Reduce PHY TX power when brownout reset
  595. config REDUCE_PHY_TX_POWER
  596. bool "Reduce PHY TX power when brownout reset"
  597. depends on BROWNOUT_DET
  598. default y
  599. help
  600. When brownout reset occurs, reduce PHY TX power to keep the code running
  601. # Note about the use of "FRC1" name: currently FRC1 timer is not used for
  602. # high resolution timekeeping anymore. Instead the esp_timer API, implemented
  603. # using FRC2 timer, is used.
  604. # FRC1 name in the option name is kept for compatibility.
  605. choice ESP32_TIME_SYSCALL
  606. prompt "Timers used for gettimeofday function"
  607. default ESP32_TIME_SYSCALL_USE_RTC_FRC1
  608. help
  609. This setting defines which hardware timers are used to
  610. implement 'gettimeofday' and 'time' functions in C library.
  611. - If both high-resolution and RTC timers are used, timekeeping will
  612. continue in deep sleep. Time will be reported at 1 microsecond
  613. resolution. This is the default, and the recommended option.
  614. - If only high-resolution timer is used, gettimeofday will
  615. provide time at microsecond resolution.
  616. Time will not be preserved when going into deep sleep mode.
  617. - If only RTC timer is used, timekeeping will continue in
  618. deep sleep, but time will be measured at 6.(6) microsecond
  619. resolution. Also the gettimeofday function itself may take
  620. longer to run.
  621. - If no timers are used, gettimeofday and time functions
  622. return -1 and set errno to ENOSYS.
  623. - When RTC is used for timekeeping, two RTC_STORE registers are
  624. used to keep time in deep sleep mode.
  625. config ESP32_TIME_SYSCALL_USE_RTC_FRC1
  626. bool "RTC and high-resolution timer"
  627. config ESP32_TIME_SYSCALL_USE_RTC
  628. bool "RTC"
  629. config ESP32_TIME_SYSCALL_USE_FRC1
  630. bool "High-resolution timer"
  631. config ESP32_TIME_SYSCALL_USE_NONE
  632. bool "None"
  633. endchoice
  634. choice ESP32_RTC_CLOCK_SOURCE
  635. prompt "RTC clock source"
  636. default ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
  637. help
  638. Choose which clock is used as RTC clock source.
  639. - "Internal 150kHz oscillator" option provides lowest deep sleep current
  640. consumption, and does not require extra external components. However
  641. frequency stability with respect to temperature is poor, so time may
  642. drift in deep/light sleep modes.
  643. - "External 32kHz crystal" provides better frequency stability, at the
  644. expense of slightly higher (1uA) deep sleep current consumption.
  645. - "External 32kHz oscillator" allows using 32kHz clock generated by an
  646. external circuit. In this case, external clock signal must be connected
  647. to 32K_XP pin. Amplitude should be <1.2V in case of sine wave signal,
  648. and <1V in case of square wave signal. Common mode voltage should be
  649. 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude.
  650. Additionally, 1nF capacitor must be connected between 32K_XN pin and
  651. ground. 32K_XN pin can not be used as a GPIO in this case.
  652. - "Internal 8.5MHz oscillator divided by 256" option results in higher
  653. deep sleep current (by 5uA) but has better frequency stability than
  654. the internal 150kHz oscillator. It does not require external components.
  655. config ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
  656. bool "Internal 150kHz RC oscillator"
  657. config ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
  658. bool "External 32kHz crystal"
  659. config ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC
  660. bool "External 32kHz oscillator at 32K_XP pin"
  661. config ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256
  662. bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)"
  663. endchoice
  664. config ESP32_RTC_CLK_CAL_CYCLES
  665. int "Number of cycles for RTC_SLOW_CLK calibration"
  666. default 3000 if ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
  667. default 1024 if ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
  668. range 0 27000 if ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL || ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC || ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 # NOERROR
  669. range 0 32766 if ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
  670. help
  671. When the startup code initializes RTC_SLOW_CLK, it can perform
  672. calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
  673. frequency. This option sets the number of RTC_SLOW_CLK cycles measured
  674. by the calibration routine. Higher numbers increase calibration
  675. precision, which may be important for applications which spend a lot of
  676. time in deep sleep. Lower numbers reduce startup time.
  677. When this option is set to 0, clock calibration will not be performed at
  678. startup, and approximate clock frequencies will be assumed:
  679. - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
  680. - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
  681. In case more value will help improve the definition of the launch of the crystal.
  682. If the crystal could not start, it will be switched to internal RC.
  683. config ESP32_RTC_XTAL_BOOTSTRAP_CYCLES
  684. int "Bootstrap cycles for external 32kHz crystal"
  685. depends on ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
  686. default 5
  687. range 0 32768
  688. help
  689. To reduce the startup time of an external RTC crystal,
  690. we bootstrap it with a 32kHz square wave for a fixed number of cycles.
  691. Setting 0 will disable bootstrapping (if disabled, the crystal may take
  692. longer to start up or fail to oscillate under some conditions).
  693. If this value is too high, a faulty crystal may initially start and then fail.
  694. If this value is too low, an otherwise good crystal may not start.
  695. To accurately determine if the crystal has started,
  696. set a larger "Number of cycles for RTC_SLOW_CLK calibration" (about 3000).
  697. config ESP32_DEEP_SLEEP_WAKEUP_DELAY
  698. int "Extra delay in deep sleep wake stub (in us)"
  699. default 2000
  700. range 0 5000
  701. help
  702. When ESP32 exits deep sleep, the CPU and the flash chip are powered on
  703. at the same time. CPU will run deep sleep stub first, and then
  704. proceed to load code from flash. Some flash chips need sufficient
  705. time to pass between power on and first read operation. By default,
  706. without any extra delay, this time is approximately 900us, although
  707. some flash chip types need more than that.
  708. By default extra delay is set to 2000us. When optimizing startup time
  709. for applications which require it, this value may be reduced.
  710. If you are seeing "flash read err, 1000" message printed to the
  711. console after deep sleep reset, try increasing this value.
  712. choice ESP32_XTAL_FREQ_SEL
  713. prompt "Main XTAL frequency"
  714. default ESP32_XTAL_FREQ_40
  715. help
  716. ESP32 currently supports the following XTAL frequencies:
  717. - 26 MHz
  718. - 40 MHz
  719. Startup code can automatically estimate XTAL frequency. This feature
  720. uses the internal 8MHz oscillator as a reference. Because the internal
  721. oscillator frequency is temperature dependent, it is not recommended
  722. to use automatic XTAL frequency detection in applications which need
  723. to work at high ambient temperatures and use high-temperature
  724. qualified chips and modules.
  725. config ESP32_XTAL_FREQ_40
  726. bool "40 MHz"
  727. config ESP32_XTAL_FREQ_26
  728. bool "26 MHz"
  729. config ESP32_XTAL_FREQ_AUTO
  730. bool "Autodetect"
  731. endchoice
  732. # Keep these values in sync with rtc_xtal_freq_t enum in soc/rtc.h
  733. config ESP32_XTAL_FREQ
  734. int
  735. default 0 if ESP32_XTAL_FREQ_AUTO
  736. default 40 if ESP32_XTAL_FREQ_40
  737. default 26 if ESP32_XTAL_FREQ_26
  738. config DISABLE_BASIC_ROM_CONSOLE
  739. bool "Permanently disable BASIC ROM Console"
  740. default n
  741. help
  742. If set, the first time the app boots it will disable the BASIC ROM Console
  743. permanently (by burning an eFuse).
  744. Otherwise, the BASIC ROM Console starts on reset if no valid bootloader is
  745. read from the flash.
  746. (Enabling secure boot also disables the BASIC ROM Console by default.)
  747. config NO_BLOBS
  748. bool "No Binary Blobs"
  749. depends on !BT_ENABLED
  750. default n
  751. help
  752. If enabled, this disables the linking of binary libraries in the application build. Note
  753. that after enabling this Wi-Fi/Bluetooth will not work.
  754. config ESP_TIMER_PROFILING
  755. bool "Enable esp_timer profiling features"
  756. default n
  757. help
  758. If enabled, esp_timer_dump will dump information such as number of times
  759. the timer was started, number of times the timer has triggered, and the
  760. total time it took for the callback to run.
  761. This option has some effect on timer performance and the amount of memory
  762. used for timer storage, and should only be used for debugging/testing
  763. purposes.
  764. config COMPATIBLE_PRE_V2_1_BOOTLOADERS
  765. bool "App compatible with bootloaders before IDF v2.1"
  766. default n
  767. help
  768. Bootloaders before IDF v2.1 did less initialisation of the
  769. system clock. This setting needs to be enabled to build an app
  770. which can be booted by these older bootloaders.
  771. If this setting is enabled, the app can be booted by any bootloader
  772. from IDF v1.0 up to the current version.
  773. If this setting is disabled, the app can only be booted by bootloaders
  774. from IDF v2.1 or newer.
  775. Enabling this setting adds approximately 1KB to the app's IRAM usage.
  776. config ESP_ERR_TO_NAME_LOOKUP
  777. bool "Enable lookup of error code strings"
  778. default "y"
  779. help
  780. Functions esp_err_to_name() and esp_err_to_name_r() return string
  781. representations of error codes from a pre-generated lookup table.
  782. This option can be used to turn off the use of the look-up table in
  783. order to save memory but this comes at the price of sacrificing
  784. distinguishable (meaningful) output string representations.
  785. config ESP32_RTCDATA_IN_FAST_MEM
  786. bool "Place RTC_DATA_ATTR and RTC_RODATA_ATTR variables into RTC fast memory segment"
  787. default n
  788. depends on FREERTOS_UNICORE
  789. help
  790. This option allows to place .rtc_data and .rtc_rodata sections into
  791. RTC fast memory segment to free the slow memory region for ULP programs.
  792. This option depends on the CONFIG_FREERTOS_UNICORE option because RTC fast memory
  793. can be accessed only by PRO_CPU core.
  794. endmenu # ESP32-Specific
  795. menu Wi-Fi
  796. config SW_COEXIST_ENABLE
  797. bool "Software controls WiFi/Bluetooth coexistence"
  798. depends on BT_ENABLED
  799. default y
  800. help
  801. If enabled, WiFi & Bluetooth coexistence is controlled by software rather than hardware.
  802. Recommended for heavy traffic scenarios. Both coexistence configuration options are
  803. automatically managed, no user intervention is required.
  804. If only Bluetooth is used, it is recommended to disable this option to reduce binary file
  805. size.
  806. choice SW_COEXIST_PREFERENCE
  807. prompt "WiFi/Bluetooth coexistence performance preference"
  808. depends on SW_COEXIST_ENABLE
  809. default SW_COEXIST_PREFERENCE_BALANCE
  810. help
  811. Choose Bluetooth/WiFi/Balance for different preference.
  812. If choose WiFi, it will make WiFi performance better. Such, keep WiFi Audio more fluent.
  813. If choose Bluetooth, it will make Bluetooth performance better. Such, keep Bluetooth(A2DP) Audio more
  814. fluent.
  815. If choose Balance, the performance of WiFi and bluetooth will be balance. It's default. Normally, just
  816. choose balance, the A2DP audio can play fluently, too.
  817. Except config preference in menuconfig, you can also call esp_coex_preference_set() dynamically.
  818. config SW_COEXIST_PREFERENCE_WIFI
  819. bool "WiFi"
  820. config SW_COEXIST_PREFERENCE_BT
  821. bool "Bluetooth(include BR/EDR and BLE)"
  822. config SW_COEXIST_PREFERENCE_BALANCE
  823. bool "Balance"
  824. endchoice
  825. config SW_COEXIST_PREFERENCE_VALUE
  826. int
  827. depends on SW_COEXIST_ENABLE
  828. default 0 if SW_COEXIST_PREFERENCE_WIFI
  829. default 1 if SW_COEXIST_PREFERENCE_BT
  830. default 2 if SW_COEXIST_PREFERENCE_BALANCE
  831. config ESP32_WIFI_STATIC_RX_BUFFER_NUM
  832. int "Max number of WiFi static RX buffers"
  833. range 2 25 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  834. range 8 25 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  835. default 10 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  836. default 16 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  837. help
  838. Set the number of WiFi static RX buffers. Each buffer takes approximately 1.6KB of RAM.
  839. The static rx buffers are allocated when esp_wifi_init is called, they are not freed
  840. until esp_wifi_deinit is called.
  841. WiFi hardware use these buffers to receive all 802.11 frames.
  842. A higher number may allow higher throughput but increases memory use. If ESP32_WIFI_AMPDU_RX_ENABLED
  843. is enabled, this value is recommended to set equal or bigger than ESP32_WIFI_RX_BA_WIN in order to
  844. achieve better throughput and compatibility with both stations and APs.
  845. config ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM
  846. int "Max number of WiFi dynamic RX buffers"
  847. range 0 128
  848. default 32
  849. help
  850. Set the number of WiFi dynamic RX buffers, 0 means unlimited RX buffers will be allocated
  851. (provided sufficient free RAM). The size of each dynamic RX buffer depends on the size of
  852. the received data frame.
  853. For each received data frame, the WiFi driver makes a copy to an RX buffer and then delivers
  854. it to the high layer TCP/IP stack. The dynamic RX buffer is freed after the higher layer has
  855. successfully received the data frame.
  856. For some applications, WiFi data frames may be received faster than the application can
  857. process them. In these cases we may run out of memory if RX buffer number is unlimited (0).
  858. If a dynamic RX buffer limit is set, it should be at least the number of static RX buffers.
  859. choice ESP32_WIFI_TX_BUFFER
  860. prompt "Type of WiFi TX buffers"
  861. default ESP32_WIFI_DYNAMIC_TX_BUFFER
  862. help
  863. Select type of WiFi TX buffers:
  864. If "Static" is selected, WiFi TX buffers are allocated when WiFi is initialized and released
  865. when WiFi is de-initialized. The size of each static TX buffer is fixed to about 1.6KB.
  866. If "Dynamic" is selected, each WiFi TX buffer is allocated as needed when a data frame is
  867. delivered to the Wifi driver from the TCP/IP stack. The buffer is freed after the data frame
  868. has been sent by the WiFi driver. The size of each dynamic TX buffer depends on the length
  869. of each data frame sent by the TCP/IP layer.
  870. If PSRAM is enabled, "Static" should be selected to guarantee enough WiFi TX buffers.
  871. If PSRAM is disabled, "Dynamic" should be selected to improve the utilization of RAM.
  872. config ESP32_WIFI_STATIC_TX_BUFFER
  873. bool "Static"
  874. config ESP32_WIFI_DYNAMIC_TX_BUFFER
  875. bool "Dynamic"
  876. depends on !SPIRAM_USE_MALLOC
  877. endchoice
  878. config ESP32_WIFI_TX_BUFFER_TYPE
  879. int
  880. default 0 if ESP32_WIFI_STATIC_TX_BUFFER
  881. default 1 if ESP32_WIFI_DYNAMIC_TX_BUFFER
  882. config ESP32_WIFI_STATIC_TX_BUFFER_NUM
  883. int "Max number of WiFi static TX buffers"
  884. depends on ESP32_WIFI_STATIC_TX_BUFFER
  885. range 6 64
  886. default 16
  887. help
  888. Set the number of WiFi static TX buffers. Each buffer takes approximately 1.6KB of RAM.
  889. The static RX buffers are allocated when esp_wifi_init() is called, they are not released
  890. until esp_wifi_deinit() is called.
  891. For each transmitted data frame from the higher layer TCP/IP stack, the WiFi driver makes a
  892. copy of it in a TX buffer. For some applications especially UDP applications, the upper
  893. layer can deliver frames faster than WiFi layer can transmit. In these cases, we may run out
  894. of TX buffers.
  895. config ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM
  896. int "Max number of WiFi dynamic TX buffers"
  897. depends on ESP32_WIFI_DYNAMIC_TX_BUFFER
  898. range 16 128
  899. default 32
  900. help
  901. Set the number of WiFi dynamic TX buffers. The size of each dynamic TX buffer is not fixed,
  902. it depends on the size of each transmitted data frame.
  903. For each transmitted frame from the higher layer TCP/IP stack, the WiFi driver makes a copy
  904. of it in a TX buffer. For some applications, especially UDP applications, the upper layer
  905. can deliver frames faster than WiFi layer can transmit. In these cases, we may run out of TX
  906. buffers.
  907. config ESP32_WIFI_CSI_ENABLED
  908. bool "WiFi CSI(Channel State Information)"
  909. default n
  910. help
  911. Select this option to enable CSI(Channel State Information) feature. CSI takes about
  912. CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM KB of RAM. If CSI is not used, it is better to disable
  913. this feature in order to save memory.
  914. config ESP32_WIFI_AMPDU_TX_ENABLED
  915. bool "WiFi AMPDU TX"
  916. default y
  917. help
  918. Select this option to enable AMPDU TX feature
  919. config ESP32_WIFI_TX_BA_WIN
  920. int "WiFi AMPDU TX BA window size"
  921. depends on ESP32_WIFI_AMPDU_TX_ENABLED
  922. range 2 32
  923. default 6
  924. help
  925. Set the size of WiFi Block Ack TX window. Generally a bigger value means higher throughput but
  926. more memory. Most of time we should NOT change the default value unless special reason, e.g.
  927. test the maximum UDP TX throughput with iperf etc. For iperf test in shieldbox, the recommended
  928. value is 9~12.
  929. config ESP32_WIFI_AMPDU_RX_ENABLED
  930. bool "WiFi AMPDU RX"
  931. default y
  932. help
  933. Select this option to enable AMPDU RX feature
  934. config ESP32_WIFI_RX_BA_WIN
  935. int "WiFi AMPDU RX BA window size"
  936. depends on ESP32_WIFI_AMPDU_RX_ENABLED
  937. range 2 32 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  938. range 16 32 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  939. default 6 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  940. default 16 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
  941. help
  942. Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput and better
  943. compatibility but more memory. Most of time we should NOT change the default value unless special
  944. reason, e.g. test the maximum UDP RX throughput with iperf etc. For iperf test in shieldbox, the
  945. recommended value is 9~12. If PSRAM is used and WiFi memory is prefered to allocat in PSRAM first,
  946. the default and minimum value should be 16 to achieve better throughput and compatibility with both
  947. stations and APs.
  948. config ESP32_WIFI_NVS_ENABLED
  949. bool "WiFi NVS flash"
  950. default y
  951. help
  952. Select this option to enable WiFi NVS flash
  953. choice ESP32_WIFI_TASK_CORE_ID
  954. depends on !FREERTOS_UNICORE
  955. prompt "WiFi Task Core ID"
  956. default ESP32_WIFI_TASK_PINNED_TO_CORE_0
  957. help
  958. Pinned WiFi task to core 0 or core 1.
  959. config ESP32_WIFI_TASK_PINNED_TO_CORE_0
  960. bool "Core 0"
  961. config ESP32_WIFI_TASK_PINNED_TO_CORE_1
  962. bool "Core 1"
  963. endchoice
  964. config ESP32_WIFI_SOFTAP_BEACON_MAX_LEN
  965. int "Max length of WiFi SoftAP Beacon"
  966. range 752 1256
  967. default 752
  968. help
  969. ESP-MESH utilizes beacon frames to detect and resolve root node conflicts (see documentation). However the
  970. default length of a beacon frame can simultaneously hold only five root node identifier structures,
  971. meaning that a root node conflict of up to five nodes can be detected at one time. In the occurence of
  972. more root nodes conflict involving more than five root nodes, the conflict resolution process will detect
  973. five of the root nodes, resolve the conflict, and re-detect more root nodes. This process will repeat
  974. until all root node conflicts are resolved. However this process can generally take a very long time.
  975. To counter this situation, the beacon frame length can be increased such that more root nodes can be
  976. detected simultaneously. Each additional root node will require 36 bytes and should be added ontop of the
  977. default beacon frame length of
  978. 752 bytes. For example, if you want to detect 10 root nodes simultaneously, you need to set the beacon
  979. frame length as
  980. 932 (752+36*5).
  981. Setting a longer beacon length also assists with debugging as the conflicting root nodes can be identified
  982. more quickly.
  983. config ESP32_WIFI_MGMT_SBUF_NUM
  984. int "WiFi mgmt short buffer number"
  985. range 6 32
  986. default 32
  987. help
  988. Set the number of WiFi management short buffer.
  989. config ESP32_WIFI_DEBUG_LOG_ENABLE
  990. bool "Enable WiFi debug log"
  991. default n
  992. help
  993. Select this option to enable WiFi debug log
  994. choice ESP32_WIFI_DEBUG_LOG_LEVEL
  995. depends on ESP32_WIFI_DEBUG_LOG_ENABLE
  996. prompt "WiFi debug log level"
  997. default ESP32_WIFI_LOG_DEBUG
  998. help
  999. The WiFi log is divided into the following levels: ERROR,WARNING,INFO,DEBUG,VERBOSE.
  1000. The ERROR,WARNING,INFO levels are enabled by default, and the DEBUG,VERBOSE levels can be enabled here.
  1001. config ESP32_WIFI_DEBUG_LOG_DEBUG
  1002. bool "WiFi Debug Log Debug"
  1003. config ESP32_WIFI_DEBUG_LOG_VERBOSE
  1004. bool "WiFi Debug Log Verbose"
  1005. endchoice
  1006. choice ESP32_WIFI_DEBUG_LOG_MODULE
  1007. depends on ESP32_WIFI_DEBUG_LOG_ENABLE
  1008. prompt "WiFi debug log module"
  1009. default ESP32_WIFI_DEBUG_LOG_MODULE_WIFI
  1010. help
  1011. The WiFi log module contains three parts: WIFI,COEX,MESH. The WIFI module indicates the logs related to
  1012. WiFi, the COEX module indicates the logs related to WiFi and BT(or BLE) coexist, the MESH module indicates
  1013. the logs related to Mesh. When ESP32_WIFI_LOG_MODULE_ALL is enabled, all modules are selected.
  1014. config ESP32_WIFI_DEBUG_LOG_MODULE_ALL
  1015. bool "WiFi Debug Log Module All"
  1016. config ESP32_WIFI_DEBUG_LOG_MODULE_WIFI
  1017. bool "WiFi Debug Log Module WiFi"
  1018. config ESP32_WIFI_DEBUG_LOG_MODULE_COEX
  1019. bool "WiFi Debug Log Module Coex"
  1020. config ESP32_WIFI_DEBUG_LOG_MODULE_MESH
  1021. bool "WiFi Debug Log Module Mesh"
  1022. endchoice
  1023. config ESP32_WIFI_DEBUG_LOG_SUBMODULE
  1024. depends on ESP32_WIFI_DEBUG_LOG_ENABLE
  1025. bool "WiFi debug log submodule"
  1026. default n
  1027. help
  1028. Enable this option to set the WiFi debug log submodule.
  1029. Currently the log submodule contains the following parts: INIT,IOCTL,CONN,SCAN.
  1030. The INIT submodule indicates the initialization process.The IOCTL submodule indicates the API calling
  1031. process.
  1032. The CONN submodule indicates the connecting process.The SCAN submodule indicates the scaning process.
  1033. config ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL
  1034. depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE
  1035. bool "WiFi Debug Log Submodule All"
  1036. default n
  1037. help
  1038. When this option is enabled, all debug submodules are selected.
  1039. config ESP32_WIFI_DEBUG_LOG_SUBMODULE_INIT
  1040. depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
  1041. bool "WiFi Debug Log Submodule Init"
  1042. default n
  1043. config ESP32_WIFI_DEBUG_LOG_SUBMODULE_IOCTL
  1044. depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
  1045. bool "WiFi Debug Log Submodule Ioctl"
  1046. default n
  1047. config ESP32_WIFI_DEBUG_LOG_SUBMODULE_CONN
  1048. depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
  1049. bool "WiFi Debug Log Submodule Conn"
  1050. default n
  1051. config ESP32_WIFI_DEBUG_LOG_SUBMODULE_SCAN
  1052. depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
  1053. bool "WiFi Debug Log Submodule Scan"
  1054. default n
  1055. config ESP32_WIFI_IRAM_OPT
  1056. bool "WiFi IRAM speed optimization"
  1057. default y
  1058. help
  1059. Select this option to place frequently called Wi-Fi library functions in IRAM.
  1060. When this option is disabled, more than 10Kbytes of IRAM memory will be saved
  1061. but Wi-Fi throughput will be reduced.
  1062. endmenu # Wi-Fi
  1063. menu PHY
  1064. config ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
  1065. bool "Store phy calibration data in NVS"
  1066. default y
  1067. help
  1068. If this option is enabled, NVS will be initialized and calibration data will be loaded from there.
  1069. PHY calibration will be skipped on deep sleep wakeup. If calibration data is not found, full calibration
  1070. will be performed and stored in NVS. Normally, only partial calibration will be performed.
  1071. If this option is disabled, full calibration will be performed.
  1072. If it's easy that your board calibrate bad data, choose 'n'.
  1073. Two cases for example, you should choose 'n':
  1074. 1.If your board is easy to be booted up with antenna disconnected.
  1075. 2.Because of your board design, each time when you do calibration, the result are too unstable.
  1076. If unsure, choose 'y'.
  1077. config ESP32_PHY_INIT_DATA_IN_PARTITION
  1078. bool "Use a partition to store PHY init data"
  1079. default n
  1080. help
  1081. If enabled, PHY init data will be loaded from a partition.
  1082. When using a custom partition table, make sure that PHY data
  1083. partition is included (type: 'data', subtype: 'phy').
  1084. With default partition tables, this is done automatically.
  1085. If PHY init data is stored in a partition, it has to be flashed there,
  1086. otherwise runtime error will occur.
  1087. If this option is not enabled, PHY init data will be embedded
  1088. into the application binary.
  1089. If unsure, choose 'n'.
  1090. config ESP32_PHY_MAX_WIFI_TX_POWER
  1091. int "Max WiFi TX power (dBm)"
  1092. range 0 20
  1093. default 20
  1094. help
  1095. Set maximum transmit power for WiFi radio. Actual transmit power for high
  1096. data rates may be lower than this setting.
  1097. config ESP32_PHY_MAX_TX_POWER
  1098. int
  1099. default ESP32_PHY_MAX_WIFI_TX_POWER
  1100. endmenu # PHY
  1101. menu "Power Management"
  1102. config PM_ENABLE
  1103. bool "Support for power management"
  1104. default n
  1105. help
  1106. If enabled, application is compiled with support for power management.
  1107. This option has run-time overhead (increased interrupt latency,
  1108. longer time to enter idle state), and it also reduces accuracy of
  1109. RTOS ticks and timers used for timekeeping.
  1110. Enable this option if application uses power management APIs.
  1111. config PM_DFS_INIT_AUTO
  1112. bool "Enable dynamic frequency scaling (DFS) at startup"
  1113. depends on PM_ENABLE
  1114. default n
  1115. help
  1116. If enabled, startup code configures dynamic frequency scaling.
  1117. Max CPU frequency is set to CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ setting,
  1118. min frequency is set to XTAL frequency.
  1119. If disabled, DFS will not be active until the application
  1120. configures it using esp_pm_configure function.
  1121. config PM_USE_RTC_TIMER_REF
  1122. bool "Use RTC timer to prevent time drift (EXPERIMENTAL)"
  1123. depends on PM_ENABLE && (ESP32_TIME_SYSCALL_USE_RTC || ESP32_TIME_SYSCALL_USE_RTC_FRC1)
  1124. default n
  1125. help
  1126. When APB clock frequency changes, high-resolution timer (esp_timer)
  1127. scale and base value need to be adjusted. Each adjustment may cause
  1128. small error, and over time such small errors may cause time drift.
  1129. If this option is enabled, RTC timer will be used as a reference to
  1130. compensate for the drift.
  1131. It is recommended that this option is only used if 32k XTAL is selected
  1132. as RTC clock source.
  1133. config PM_PROFILING
  1134. bool "Enable profiling counters for PM locks"
  1135. depends on PM_ENABLE
  1136. default n
  1137. help
  1138. If enabled, esp_pm_* functions will keep track of the amount of time
  1139. each of the power management locks has been held, and esp_pm_dump_locks
  1140. function will print this information.
  1141. This feature can be used to analyze which locks are preventing the chip
  1142. from going into a lower power state, and see what time the chip spends
  1143. in each power saving mode. This feature does incur some run-time
  1144. overhead, so should typically be disabled in production builds.
  1145. config PM_TRACE
  1146. bool "Enable debug tracing of PM using GPIOs"
  1147. depends on PM_ENABLE
  1148. default n
  1149. help
  1150. If enabled, some GPIOs will be used to signal events such as RTOS ticks,
  1151. frequency switching, entry/exit from idle state. Refer to pm_trace.c
  1152. file for the list of GPIOs.
  1153. This feature is intended to be used when analyzing/debugging behavior
  1154. of power management implementation, and should be kept disabled in
  1155. applications.
  1156. endmenu # "Power Management"