Kconfig 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. menu "ESP32-specific"
  2. choice ESP32_REV_MIN
  3. prompt "Minimum Supported ESP32 Revision"
  4. default ESP32_REV_MIN_0
  5. help
  6. Minimum revision that ESP-IDF would support.
  7. ESP-IDF performs different strategy on different esp32 revision.
  8. config ESP32_REV_MIN_0
  9. bool "Rev 0"
  10. config ESP32_REV_MIN_1
  11. bool "Rev 1"
  12. config ESP32_REV_MIN_2
  13. bool "Rev 2"
  14. config ESP32_REV_MIN_3
  15. bool "Rev 3"
  16. endchoice
  17. config ESP32_REV_MIN
  18. int
  19. default 0 if ESP32_REV_MIN_0
  20. default 1 if ESP32_REV_MIN_1
  21. default 2 if ESP32_REV_MIN_2
  22. default 3 if ESP32_REV_MIN_3
  23. config ESP32_DPORT_WORKAROUND
  24. bool
  25. default "y" if !FREERTOS_UNICORE && ESP32_REV_MIN < 2
  26. choice ESP32_DEFAULT_CPU_FREQ_MHZ
  27. prompt "CPU frequency"
  28. default ESP32_DEFAULT_CPU_FREQ_160
  29. help
  30. CPU frequency to be set on application startup.
  31. config ESP32_DEFAULT_CPU_FREQ_80
  32. bool "80 MHz"
  33. config ESP32_DEFAULT_CPU_FREQ_160
  34. bool "160 MHz"
  35. config ESP32_DEFAULT_CPU_FREQ_240
  36. bool "240 MHz"
  37. endchoice
  38. config ESP32_DEFAULT_CPU_FREQ_MHZ
  39. int
  40. default 80 if ESP32_DEFAULT_CPU_FREQ_80
  41. default 160 if ESP32_DEFAULT_CPU_FREQ_160
  42. default 240 if ESP32_DEFAULT_CPU_FREQ_240
  43. config ESP32_SPIRAM_SUPPORT
  44. bool "Support for external, SPI-connected RAM"
  45. default "n"
  46. help
  47. This enables support for an external SPI RAM chip, connected in parallel with the
  48. main SPI flash chip.
  49. menu "SPI RAM config"
  50. depends on ESP32_SPIRAM_SUPPORT
  51. config SPIRAM_BOOT_INIT
  52. bool "Initialize SPI RAM when booting the ESP32"
  53. default "y"
  54. help
  55. If this is enabled, the SPI RAM will be enabled during initial boot. Unless you
  56. have specific requirements, you'll want to leave this enabled so memory allocated
  57. during boot-up can also be placed in SPI RAM.
  58. config SPIRAM_IGNORE_NOTFOUND
  59. bool "Ignore PSRAM when not found"
  60. default "n"
  61. depends on SPIRAM_BOOT_INIT && !SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
  62. help
  63. Normally, if psram initialization is enabled during compile time but not found at runtime, it
  64. is seen as an error making the ESP32 panic. If this is enabled, the ESP32 will keep on
  65. running but will not add the (non-existing) RAM to any allocator.
  66. choice SPIRAM_USE
  67. prompt "SPI RAM access method"
  68. default SPIRAM_USE_MALLOC
  69. help
  70. The SPI RAM can be accessed in multiple methods: by just having it available as an unmanaged
  71. memory region in the ESP32 memory map, by integrating it in the ESP32s heap as 'special' memory
  72. needing heap_caps_malloc to allocate, or by fully integrating it making malloc() also able to
  73. return SPI RAM pointers.
  74. config SPIRAM_USE_MEMMAP
  75. bool "Integrate RAM into ESP32 memory map"
  76. config SPIRAM_USE_CAPS_ALLOC
  77. bool "Make RAM allocatable using heap_caps_malloc(..., MALLOC_CAP_SPIRAM)"
  78. config SPIRAM_USE_MALLOC
  79. bool "Make RAM allocatable using malloc() as well"
  80. select FREERTOS_SUPPORT_STATIC_ALLOCATION
  81. endchoice
  82. choice SPIRAM_TYPE
  83. prompt "Type of SPI RAM chip in use"
  84. default SPIRAM_TYPE_AUTO
  85. config SPIRAM_TYPE_AUTO
  86. bool "Auto-detect"
  87. config SPIRAM_TYPE_ESPPSRAM32
  88. bool "ESP-PSRAM32 or IS25WP032"
  89. config SPIRAM_TYPE_ESPPSRAM64
  90. bool "ESP-PSRAM64 or LY68L6400"
  91. endchoice
  92. config SPIRAM_SIZE
  93. int
  94. default -1 if SPIRAM_TYPE_AUTO
  95. default 4194304 if SPIRAM_TYPE_ESPPSRAM32
  96. default 8388608 if SPIRAM_TYPE_ESPPSRAM64
  97. default 0
  98. choice SPIRAM_SPEED
  99. prompt "Set RAM clock speed"
  100. default SPIRAM_SPEED_40M
  101. help
  102. Select the speed for the SPI RAM chip.
  103. If SPI RAM is enabled, we only support three combinations of SPI speed mode we supported now:
  104. 1. Flash SPI running at 40Mhz and RAM SPI running at 40Mhz
  105. 2. Flash SPI running at 80Mhz and RAM SPI running at 40Mhz
  106. 3. Flash SPI running at 80Mhz and RAM SPI running at 80Mhz
  107. Note: If the third mode(80Mhz+80Mhz) is enabled for SPI RAM of type 32MBit, one of the HSPI/VSPI host
  108. will be occupied by the system. Which SPI host to use can be selected by the config item
  109. SPIRAM_OCCUPY_SPI_HOST. Application code should never touch HSPI/VSPI hardware in this case. The
  110. option to select 80MHz will only be visible if the flash SPI speed is also 80MHz.
  111. (ESPTOOLPY_FLASHFREQ_80M is true)
  112. config SPIRAM_SPEED_40M
  113. bool "40MHz clock speed"
  114. config SPIRAM_SPEED_80M
  115. depends on ESPTOOLPY_FLASHFREQ_80M
  116. bool "80MHz clock speed"
  117. endchoice
  118. config SPIRAM_MEMTEST
  119. bool "Run memory test on SPI RAM initialization"
  120. default "y"
  121. depends on SPIRAM_BOOT_INIT
  122. help
  123. Runs a rudimentary memory test on initialization. Aborts when memory test fails. Disable this for
  124. slightly faster startop.
  125. config SPIRAM_CACHE_WORKAROUND
  126. bool "Enable workaround for bug in SPI RAM cache for Rev1 ESP32s"
  127. depends on (SPIRAM_USE_MEMMAP || SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC) && (ESP32_REV_MIN < 3)
  128. default "y"
  129. help
  130. Revision 1 of the ESP32 has a bug that can cause a write to PSRAM not to take place in some situations
  131. when the cache line needs to be fetched from external RAM and an interrupt occurs. This enables a
  132. fix in the compiler (-mfix-esp32-psram-cache-issue) that makes sure the specific code that is
  133. vulnerable to this will not be emitted.
  134. This will also not use any bits of newlib that are located in ROM, opting for a version that is
  135. compiled with the workaround and located in flash instead.
  136. The workaround is not required for ESP32 revision 3 and above.
  137. config SPIRAM_BANKSWITCH_ENABLE
  138. bool "Enable bank switching for >4MiB external RAM"
  139. default y
  140. depends on SPIRAM_USE_MEMMAP || SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
  141. help
  142. The ESP32 only supports 4MiB of external RAM in its address space. The hardware does support larger
  143. memories, but these have to be bank-switched in and out of this address space. Enabling this allows you
  144. to reserve some MMU pages for this, which allows the use of the esp_himem api to manage these banks.
  145. #Note that this is limited to 62 banks, as esp_spiram_writeback_cache needs some kind of mapping of
  146. #some banks below that mark to work. We cannot at this moment guarantee this to exist when himem is
  147. #enabled.
  148. config SPIRAM_BANKSWITCH_RESERVE
  149. int "Amount of 32K pages to reserve for bank switching"
  150. depends on SPIRAM_BANKSWITCH_ENABLE
  151. default 8
  152. range 1 62
  153. help
  154. Select the amount of banks reserved for bank switching. Note that the amount of RAM allocatable with
  155. malloc/esp_heap_alloc_caps will decrease by 32K for each page reserved here.
  156. Note that this reservation is only actually done if your program actually uses the himem API. Without
  157. any himem calls, the reservation is not done and the original amount of memory will be available
  158. to malloc/esp_heap_alloc_caps.
  159. config SPIRAM_MALLOC_ALWAYSINTERNAL
  160. int "Maximum malloc() size, in bytes, to always put in internal memory"
  161. depends on SPIRAM_USE_MALLOC
  162. default 16384
  163. range 0 131072
  164. help
  165. If malloc() is capable of also allocating SPI-connected ram, its allocation strategy will prefer to
  166. allocate chunks less than this size in internal memory, while allocations larger than this will be
  167. done from external RAM. If allocation from the preferred region fails, an attempt is made to allocate
  168. from the non-preferred region instead, so malloc() will not suddenly fail when either internal or
  169. external memory is full.
  170. config SPIRAM_TRY_ALLOCATE_WIFI_LWIP
  171. bool "Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, allocate internal memory"
  172. depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
  173. default "n"
  174. help
  175. Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, try to allocate internal
  176. memory then.
  177. config SPIRAM_MALLOC_RESERVE_INTERNAL
  178. int "Reserve this amount of bytes for data that specifically needs to be in DMA or internal memory"
  179. depends on SPIRAM_USE_MALLOC
  180. default 32768
  181. range 0 262144
  182. help
  183. Because the external/internal RAM allocation strategy is not always perfect, it sometimes may happen
  184. that the internal memory is entirely filled up. This causes allocations that are specifically done in
  185. internal memory, for example the stack for new tasks or memory to service DMA or have memory that's
  186. also available when SPI cache is down, to fail. This option reserves a pool specifically for requests
  187. like that; the memory in this pool is not given out when a normal malloc() is called.
  188. Set this to 0 to disable this feature.
  189. Note that because FreeRTOS stacks are forced to internal memory, they will also use this memory pool;
  190. be sure to keep this in mind when adjusting this value.
  191. Note also that the DMA reserved pool may not be one single contiguous memory region, depending on the
  192. configured size and the static memory usage of the app.
  193. config SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
  194. bool "Allow external memory as an argument to xTaskCreateStatic"
  195. default n
  196. depends on SPIRAM_USE_MALLOC
  197. help
  198. Because some bits of the ESP32 code environment cannot be recompiled with the cache workaround,
  199. normally tasks cannot be safely run with their stack residing in external memory; for this reason
  200. xTaskCreate and friends always allocate stack in internal memory and xTaskCreateStatic will check if
  201. the memory passed to it is in internal memory. If you have a task that needs a large amount of stack
  202. and does not call on ROM code in any way (no direct calls, but also no Bluetooth/WiFi), you can try to
  203. disable this and use xTaskCreateStatic to create the tasks stack in external memory.
  204. config SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
  205. bool "Allow .bss segment placed in external memory"
  206. default n
  207. depends on ESP32_SPIRAM_SUPPORT
  208. help
  209. If enabled the option,and add EXT_RAM_ATTR defined your variable,then your variable will be placed in
  210. PSRAM instead of internal memory, and placed most of variables of lwip,net802.11,pp,bluedroid library
  211. to external memory defaultly.
  212. choice SPIRAM_OCCUPY_SPI_HOST
  213. prompt "SPI host to use for 32MBit PSRAM"
  214. default SPIRAM_OCCUPY_VSPI_HOST
  215. depends on SPIRAM_SPEED_80M
  216. help
  217. When both flash and PSRAM is working under 80MHz, and the PSRAM is of type 32MBit, one of the HSPI/VSPI
  218. host will be used to output the clock. Select which one to use here.
  219. config SPIRAM_OCCUPY_HSPI_HOST
  220. bool "HSPI host (SPI2)"
  221. config SPIRAM_OCCUPY_VSPI_HOST
  222. bool "VSPI host (SPI3)"
  223. config SPIRAM_OCCUPY_NO_HOST
  224. bool "Will not try to use any host, will abort if not able to use the PSRAM"
  225. endchoice
  226. menu "PSRAM clock and cs IO for ESP32-DOWD"
  227. config D0WD_PSRAM_CLK_IO
  228. int "PSRAM CLK IO number"
  229. depends on ESP32_SPIRAM_SUPPORT
  230. range 0 33
  231. default 17
  232. help
  233. The PSRAM CLOCK IO can be any unused GPIO, user can config it based on hardware design. If user use
  234. 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  235. config D0WD_PSRAM_CS_IO
  236. int "PSRAM CS IO number"
  237. depends on ESP32_SPIRAM_SUPPORT
  238. range 0 33
  239. default 16
  240. help
  241. The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design. If user use
  242. 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  243. endmenu
  244. menu "PSRAM clock and cs IO for ESP32-D2WD"
  245. config D2WD_PSRAM_CLK_IO
  246. int "PSRAM CLK IO number"
  247. depends on ESP32_SPIRAM_SUPPORT
  248. range 0 33
  249. default 9
  250. help
  251. User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram,
  252. so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  253. config D2WD_PSRAM_CS_IO
  254. int "PSRAM CS IO number"
  255. depends on ESP32_SPIRAM_SUPPORT
  256. range 0 33
  257. default 10
  258. help
  259. User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram,
  260. so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  261. endmenu
  262. menu "PSRAM clock and cs IO for ESP32-PICO"
  263. config PICO_PSRAM_CS_IO
  264. int "PSRAM CS IO number"
  265. depends on ESP32_SPIRAM_SUPPORT
  266. range 0 33
  267. default 10
  268. help
  269. The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design.
  270. For ESP32-PICO chip, the psram share clock with flash, so user do not need to configure the clock
  271. IO.
  272. For the reference hardware design, please refer to
  273. https://www.espressif.com/sites/default/files/documentation/esp32-pico-d4_datasheet_en.pdf
  274. endmenu
  275. config SPIRAM_SPIWP_SD3_PIN
  276. int "SPI PSRAM WP(SD3) Pin when customising pins via eFuse (read help)"
  277. depends on ESPTOOLPY_FLASHMODE_DIO || ESPTOOLPY_FLASHMODE_DOUT
  278. range 0 33
  279. default 7
  280. help
  281. This value is ignored unless flash mode is set to DIO or DOUT and the SPI flash pins have been
  282. overriden by setting the eFuses SPI_PAD_CONFIG_xxx.
  283. When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka
  284. ESP32 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. And the psram only has QPI
  285. mode, the WP pin is necessary, so we need to configure this value here.
  286. When flash mode is set to QIO or QOUT, the PSRAM WP pin will be set as the value configured in
  287. bootloader.
  288. For ESP32-PICO chip, the default value of this config should be 7.
  289. endmenu # "SPI RAM config"
  290. config ESP32_MEMMAP_TRACEMEM
  291. bool
  292. default "n"
  293. config ESP32_MEMMAP_TRACEMEM_TWOBANKS
  294. bool
  295. default "n"
  296. config ESP32_TRAX
  297. bool "Use TRAX tracing feature"
  298. default "n"
  299. select ESP32_MEMMAP_TRACEMEM
  300. help
  301. The ESP32 contains a feature which allows you to trace the execution path the processor
  302. has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
  303. of memory that can't be used for general purposes anymore. Disable this if you do not know
  304. what this is.
  305. config ESP32_TRAX_TWOBANKS
  306. bool "Reserve memory for tracing both pro as well as app cpu execution"
  307. default "n"
  308. depends on ESP32_TRAX && !FREERTOS_UNICORE
  309. select ESP32_MEMMAP_TRACEMEM_TWOBANKS
  310. help
  311. The ESP32 contains a feature which allows you to trace the execution path the processor
  312. has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
  313. of memory that can't be used for general purposes anymore. Disable this if you do not know
  314. what this is.
  315. # Memory to reverse for trace, used in linker script
  316. config ESP32_TRACEMEM_RESERVE_DRAM
  317. hex
  318. default 0x8000 if ESP32_MEMMAP_TRACEMEM && ESP32_MEMMAP_TRACEMEM_TWOBANKS
  319. default 0x4000 if ESP32_MEMMAP_TRACEMEM && !ESP32_MEMMAP_TRACEMEM_TWOBANKS
  320. default 0x0
  321. choice ESP32_UNIVERSAL_MAC_ADDRESSES
  322. bool "Number of universally administered (by IEEE) MAC address"
  323. default ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
  324. help
  325. Configure the number of universally administered (by IEEE) MAC addresses.
  326. During initialisation, MAC addresses for each network interface are generated or derived from a
  327. single base MAC address.
  328. If the number of universal MAC addresses is four, all four interfaces (WiFi station, WiFi softap,
  329. Bluetooth and Ethernet) receive a universally administered MAC address. These are generated
  330. sequentially by adding 0, 1, 2 and 3 (respectively) to the final octet of the base MAC address.
  331. If the number of universal MAC addresses is two, only two interfaces (WiFi station and Bluetooth)
  332. receive a universally administered MAC address. These are generated sequentially by adding 0
  333. and 1 (respectively) to the base MAC address. The remaining two interfaces (WiFi softap and Ethernet)
  334. receive local MAC addresses. These are derived from the universal WiFi station and Bluetooth MAC
  335. addresses, respectively.
  336. When using the default (Espressif-assigned) base MAC address, either setting can be used. When using
  337. a custom universal MAC address range, the correct setting will depend on the allocation of MAC
  338. addresses in this range (either 2 or 4 per device.)
  339. config ESP32_UNIVERSAL_MAC_ADDRESSES_TWO
  340. bool "Two"
  341. config ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
  342. bool "Four"
  343. endchoice
  344. config ESP32_UNIVERSAL_MAC_ADDRESSES
  345. int
  346. default 2 if ESP32_UNIVERSAL_MAC_ADDRESSES_TWO
  347. default 4 if ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
  348. config ESP32_ULP_COPROC_ENABLED
  349. bool "Enable Ultra Low Power (ULP) Coprocessor"
  350. default "n"
  351. help
  352. Set to 'y' if you plan to load a firmware for the coprocessor.
  353. If this option is enabled, further coprocessor configuration will appear in the Components menu.
  354. config ESP32_ULP_COPROC_RESERVE_MEM
  355. int
  356. prompt "RTC slow memory reserved for coprocessor" if ESP32_ULP_COPROC_ENABLED
  357. default 512 if ESP32_ULP_COPROC_ENABLED
  358. range 32 8192 if ESP32_ULP_COPROC_ENABLED
  359. default 0 if !ESP32_ULP_COPROC_ENABLED
  360. range 0 0 if !ESP32_ULP_COPROC_ENABLED
  361. help
  362. Bytes of memory to reserve for ULP coprocessor firmware & data.
  363. Data is reserved at the beginning of RTC slow memory.
  364. choice ESP32_PANIC
  365. prompt "Panic handler behaviour"
  366. default ESP32_PANIC_PRINT_REBOOT
  367. help
  368. If FreeRTOS detects unexpected behaviour or an unhandled exception, the panic handler is
  369. invoked. Configure the panic handlers action here.
  370. config ESP32_PANIC_PRINT_HALT
  371. bool "Print registers and halt"
  372. help
  373. Outputs the relevant registers over the serial port and halt the
  374. processor. Needs a manual reset to restart.
  375. config ESP32_PANIC_PRINT_REBOOT
  376. bool "Print registers and reboot"
  377. help
  378. Outputs the relevant registers over the serial port and immediately
  379. reset the processor.
  380. config ESP32_PANIC_SILENT_REBOOT
  381. bool "Silent reboot"
  382. help
  383. Just resets the processor without outputting anything
  384. config ESP32_PANIC_GDBSTUB
  385. bool "Invoke GDBStub"
  386. select ESP_GDBSTUB_ENABLED
  387. help
  388. Invoke gdbstub on the serial port, allowing for gdb to attach to it to do a postmortem
  389. of the crash.
  390. endchoice
  391. config ESP32_DEBUG_OCDAWARE
  392. bool "Make exception and panic handlers JTAG/OCD aware"
  393. default y
  394. help
  395. The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and
  396. instead of panicking, have the debugger stop on the offending instruction.
  397. config ESP32_DEBUG_STUBS_ENABLE
  398. bool "OpenOCD debug stubs"
  399. default COMPILER_OPTIMIZATION_LEVEL_DEBUG
  400. depends on !ESP32_TRAX
  401. help
  402. Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging,
  403. e.g. GCOV data dump.
  404. config ESP32_BROWNOUT_DET
  405. #The brownout detector code is disabled (by making it depend on a nonexisting symbol) because the current
  406. #revision of ESP32 silicon has a bug in the brown-out detector, rendering it unusable for resetting the CPU.
  407. bool "Hardware brownout detect & reset"
  408. default y
  409. help
  410. The ESP32 has a built-in brownout detector which can detect if the voltage is lower than
  411. a specific value. If this happens, it will reset the chip in order to prevent unintended
  412. behaviour.
  413. choice ESP32_BROWNOUT_DET_LVL_SEL
  414. prompt "Brownout voltage level"
  415. depends on ESP32_BROWNOUT_DET
  416. default ESP32_BROWNOUT_DET_LVL_SEL_0
  417. help
  418. The brownout detector will reset the chip when the supply voltage is approximately
  419. below this level. Note that there may be some variation of brownout voltage level
  420. between each ESP32 chip.
  421. #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
  422. #of the brownout threshold levels.
  423. config ESP32_BROWNOUT_DET_LVL_SEL_0
  424. bool "2.43V +/- 0.05"
  425. config ESP32_BROWNOUT_DET_LVL_SEL_1
  426. bool "2.48V +/- 0.05"
  427. config ESP32_BROWNOUT_DET_LVL_SEL_2
  428. bool "2.58V +/- 0.05"
  429. config ESP32_BROWNOUT_DET_LVL_SEL_3
  430. bool "2.62V +/- 0.05"
  431. config ESP32_BROWNOUT_DET_LVL_SEL_4
  432. bool "2.67V +/- 0.05"
  433. config ESP32_BROWNOUT_DET_LVL_SEL_5
  434. bool "2.70V +/- 0.05"
  435. config ESP32_BROWNOUT_DET_LVL_SEL_6
  436. bool "2.77V +/- 0.05"
  437. config ESP32_BROWNOUT_DET_LVL_SEL_7
  438. bool "2.80V +/- 0.05"
  439. endchoice
  440. config ESP32_BROWNOUT_DET_LVL
  441. int
  442. default 0 if ESP32_BROWNOUT_DET_LVL_SEL_0
  443. default 1 if ESP32_BROWNOUT_DET_LVL_SEL_1
  444. default 2 if ESP32_BROWNOUT_DET_LVL_SEL_2
  445. default 3 if ESP32_BROWNOUT_DET_LVL_SEL_3
  446. default 4 if ESP32_BROWNOUT_DET_LVL_SEL_4
  447. default 5 if ESP32_BROWNOUT_DET_LVL_SEL_5
  448. default 6 if ESP32_BROWNOUT_DET_LVL_SEL_6
  449. default 7 if ESP32_BROWNOUT_DET_LVL_SEL_7
  450. #Reduce PHY TX power when brownout reset
  451. config ESP32_REDUCE_PHY_TX_POWER
  452. bool "Reduce PHY TX power when brownout reset"
  453. depends on ESP32_BROWNOUT_DET
  454. default y
  455. help
  456. When brownout reset occurs, reduce PHY TX power to keep the code running
  457. # Note about the use of "FRC1" name: currently FRC1 timer is not used for
  458. # high resolution timekeeping anymore. Instead the esp_timer API, implemented
  459. # using FRC2 timer, is used.
  460. # FRC1 name in the option name is kept for compatibility.
  461. choice ESP32_TIME_SYSCALL
  462. prompt "Timers used for gettimeofday function"
  463. default ESP32_TIME_SYSCALL_USE_RTC_FRC1
  464. help
  465. This setting defines which hardware timers are used to
  466. implement 'gettimeofday' and 'time' functions in C library.
  467. - If both high-resolution and RTC timers are used, timekeeping will
  468. continue in deep sleep. Time will be reported at 1 microsecond
  469. resolution. This is the default, and the recommended option.
  470. - If only high-resolution timer is used, gettimeofday will
  471. provide time at microsecond resolution.
  472. Time will not be preserved when going into deep sleep mode.
  473. - If only RTC timer is used, timekeeping will continue in
  474. deep sleep, but time will be measured at 6.(6) microsecond
  475. resolution. Also the gettimeofday function itself may take
  476. longer to run.
  477. - If no timers are used, gettimeofday and time functions
  478. return -1 and set errno to ENOSYS.
  479. - When RTC is used for timekeeping, two RTC_STORE registers are
  480. used to keep time in deep sleep mode.
  481. config ESP32_TIME_SYSCALL_USE_RTC_FRC1
  482. bool "RTC and high-resolution timer"
  483. config ESP32_TIME_SYSCALL_USE_RTC
  484. bool "RTC"
  485. config ESP32_TIME_SYSCALL_USE_FRC1
  486. bool "High-resolution timer"
  487. config ESP32_TIME_SYSCALL_USE_NONE
  488. bool "None"
  489. endchoice
  490. choice ESP32_RTC_CLK_SRC
  491. prompt "RTC clock source"
  492. default ESP32_RTC_CLK_SRC_INT_RC
  493. help
  494. Choose which clock is used as RTC clock source.
  495. - "Internal 150kHz oscillator" option provides lowest deep sleep current
  496. consumption, and does not require extra external components. However
  497. frequency stability with respect to temperature is poor, so time may
  498. drift in deep/light sleep modes.
  499. - "External 32kHz crystal" provides better frequency stability, at the
  500. expense of slightly higher (1uA) deep sleep current consumption.
  501. - "External 32kHz oscillator" allows using 32kHz clock generated by an
  502. external circuit. In this case, external clock signal must be connected
  503. to 32K_XP pin. Amplitude should be <1.2V in case of sine wave signal,
  504. and <1V in case of square wave signal. Common mode voltage should be
  505. 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude.
  506. Additionally, 1nF capacitor must be connected between 32K_XN pin and
  507. ground. 32K_XN pin can not be used as a GPIO in this case.
  508. - "Internal 8.5MHz oscillator divided by 256" option results in higher
  509. deep sleep current (by 5uA) but has better frequency stability than
  510. the internal 150kHz oscillator. It does not require external components.
  511. config ESP32_RTC_CLK_SRC_INT_RC
  512. bool "Internal 150kHz RC oscillator"
  513. config ESP32_RTC_CLK_SRC_EXT_CRYS
  514. bool "External 32kHz crystal"
  515. config ESP32_RTC_CLK_SRC_EXT_OSC
  516. bool "External 32kHz oscillator at 32K_XP pin"
  517. config ESP32_RTC_CLK_SRC_INT_8MD256
  518. bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)"
  519. endchoice
  520. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT
  521. bool "Additional current for external 32kHz crystal"
  522. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  523. default "n"
  524. help
  525. Choose which additional current is used for rtc external crystal.
  526. - With some 32kHz crystal configurations, the X32N and X32P pins may not
  527. have enough drive strength to keep the crystal oscillating during deep sleep.
  528. If this option is enabled, additional current from touchpad 9 is provided
  529. internally to drive the 32kHz crystal. If this option is enabled, deep sleep current
  530. is slightly higher (4-5uA) and the touchpad and ULP wakeup sources are not available.
  531. config ESP32_RTC_CLK_CAL_CYCLES
  532. int "Number of cycles for RTC_SLOW_CLK calibration"
  533. default 3000 if ESP32_RTC_CLK_SRC_EXT_CRYS
  534. default 1024 if ESP32_RTC_CLK_SRC_INT_RC
  535. range 0 27000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256
  536. range 0 32766 if ESP32_RTC_CLK_SRC_INT_RC
  537. help
  538. When the startup code initializes RTC_SLOW_CLK, it can perform
  539. calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
  540. frequency. This option sets the number of RTC_SLOW_CLK cycles measured
  541. by the calibration routine. Higher numbers increase calibration
  542. precision, which may be important for applications which spend a lot of
  543. time in deep sleep. Lower numbers reduce startup time.
  544. When this option is set to 0, clock calibration will not be performed at
  545. startup, and approximate clock frequencies will be assumed:
  546. - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
  547. - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
  548. In case more value will help improve the definition of the launch of the crystal.
  549. If the crystal could not start, it will be switched to internal RC.
  550. config ESP32_RTC_XTAL_BOOTSTRAP_CYCLES
  551. int "Bootstrap cycles for external 32kHz crystal"
  552. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  553. default 5
  554. range 0 32768
  555. help
  556. To reduce the startup time of an external RTC crystal,
  557. we bootstrap it with a 32kHz square wave for a fixed number of cycles.
  558. Setting 0 will disable bootstrapping (if disabled, the crystal may take
  559. longer to start up or fail to oscillate under some conditions).
  560. If this value is too high, a faulty crystal may initially start and then fail.
  561. If this value is too low, an otherwise good crystal may not start.
  562. To accurately determine if the crystal has started,
  563. set a larger "Number of cycles for RTC_SLOW_CLK calibration" (about 3000).
  564. config ESP32_DEEP_SLEEP_WAKEUP_DELAY
  565. int "Extra delay in deep sleep wake stub (in us)"
  566. default 2000
  567. range 0 5000
  568. help
  569. When ESP32 exits deep sleep, the CPU and the flash chip are powered on
  570. at the same time. CPU will run deep sleep stub first, and then
  571. proceed to load code from flash. Some flash chips need sufficient
  572. time to pass between power on and first read operation. By default,
  573. without any extra delay, this time is approximately 900us, although
  574. some flash chip types need more than that.
  575. By default extra delay is set to 2000us. When optimizing startup time
  576. for applications which require it, this value may be reduced.
  577. If you are seeing "flash read err, 1000" message printed to the
  578. console after deep sleep reset, try increasing this value.
  579. choice ESP32_XTAL_FREQ_SEL
  580. prompt "Main XTAL frequency"
  581. default ESP32_XTAL_FREQ_40
  582. help
  583. ESP32 currently supports the following XTAL frequencies:
  584. - 26 MHz
  585. - 40 MHz
  586. Startup code can automatically estimate XTAL frequency. This feature
  587. uses the internal 8MHz oscillator as a reference. Because the internal
  588. oscillator frequency is temperature dependent, it is not recommended
  589. to use automatic XTAL frequency detection in applications which need
  590. to work at high ambient temperatures and use high-temperature
  591. qualified chips and modules.
  592. config ESP32_XTAL_FREQ_40
  593. bool "40 MHz"
  594. config ESP32_XTAL_FREQ_26
  595. bool "26 MHz"
  596. config ESP32_XTAL_FREQ_AUTO
  597. bool "Autodetect"
  598. endchoice
  599. # Keep these values in sync with rtc_xtal_freq_t enum in soc/rtc.h
  600. config ESP32_XTAL_FREQ
  601. int
  602. default 0 if ESP32_XTAL_FREQ_AUTO
  603. default 40 if ESP32_XTAL_FREQ_40
  604. default 26 if ESP32_XTAL_FREQ_26
  605. config ESP32_DISABLE_BASIC_ROM_CONSOLE
  606. bool "Permanently disable BASIC ROM Console"
  607. default n
  608. help
  609. If set, the first time the app boots it will disable the BASIC ROM Console
  610. permanently (by burning an eFuse).
  611. Otherwise, the BASIC ROM Console starts on reset if no valid bootloader is
  612. read from the flash.
  613. (Enabling secure boot also disables the BASIC ROM Console by default.)
  614. config ESP32_NO_BLOBS
  615. bool "No Binary Blobs"
  616. depends on !BT_ENABLED
  617. default n
  618. help
  619. If enabled, this disables the linking of binary libraries in the application build. Note
  620. that after enabling this Wi-Fi/Bluetooth will not work.
  621. config ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS
  622. bool "App compatible with bootloaders before IDF v2.1"
  623. default n
  624. help
  625. Bootloaders before IDF v2.1 did less initialisation of the
  626. system clock. This setting needs to be enabled to build an app
  627. which can be booted by these older bootloaders.
  628. If this setting is enabled, the app can be booted by any bootloader
  629. from IDF v1.0 up to the current version.
  630. If this setting is disabled, the app can only be booted by bootloaders
  631. from IDF v2.1 or newer.
  632. Enabling this setting adds approximately 1KB to the app's IRAM usage.
  633. config ESP32_RTCDATA_IN_FAST_MEM
  634. bool "Place RTC_DATA_ATTR and RTC_RODATA_ATTR variables into RTC fast memory segment"
  635. default n
  636. depends on FREERTOS_UNICORE
  637. help
  638. This option allows to place .rtc_data and .rtc_rodata sections into
  639. RTC fast memory segment to free the slow memory region for ULP programs.
  640. This option depends on the CONFIG_FREERTOS_UNICORE option because RTC fast memory
  641. can be accessed only by PRO_CPU core.
  642. config ESP32_USE_FIXED_STATIC_RAM_SIZE
  643. bool "Use fixed static RAM size"
  644. default n
  645. help
  646. If this option is disabled, the DRAM part of the heap starts right after the .bss section,
  647. within the dram0_0 region. As a result, adding or removing some static variables
  648. will change the available heap size.
  649. If this option is enabled, the DRAM part of the heap starts right after the dram0_0 region,
  650. where its length is set with ESP32_FIXED_STATIC_RAM_SIZE
  651. config ESP32_FIXED_STATIC_RAM_SIZE
  652. hex "Fixed Static RAM size"
  653. default 0x1E000
  654. range 0 0x2c200
  655. depends on ESP32_USE_FIXED_STATIC_RAM_SIZE
  656. help
  657. RAM size dedicated for static variables (.data & .bss sections).
  658. Please note that the actual length will be reduced by BT_RESERVE_DRAM if Bluetooth
  659. controller is enabled.
  660. config ESP32_DPORT_DIS_INTERRUPT_LVL
  661. int "Disable the interrupt level for the DPORT workarounds"
  662. default 5
  663. help
  664. To prevent interrupting DPORT workarounds,
  665. need to disable interrupt with a maximum used level in the system.
  666. endmenu # ESP32-Specific
  667. menu "Power Management"
  668. config PM_ENABLE
  669. bool "Support for power management"
  670. default n
  671. help
  672. If enabled, application is compiled with support for power management.
  673. This option has run-time overhead (increased interrupt latency,
  674. longer time to enter idle state), and it also reduces accuracy of
  675. RTOS ticks and timers used for timekeeping.
  676. Enable this option if application uses power management APIs.
  677. config PM_DFS_INIT_AUTO
  678. bool "Enable dynamic frequency scaling (DFS) at startup"
  679. depends on PM_ENABLE
  680. default n
  681. help
  682. If enabled, startup code configures dynamic frequency scaling.
  683. Max CPU frequency is set to CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ setting,
  684. min frequency is set to XTAL frequency.
  685. If disabled, DFS will not be active until the application
  686. configures it using esp_pm_configure function.
  687. config PM_USE_RTC_TIMER_REF
  688. bool "Use RTC timer to prevent time drift (EXPERIMENTAL)"
  689. depends on PM_ENABLE && (ESP32_TIME_SYSCALL_USE_RTC || ESP32_TIME_SYSCALL_USE_RTC_FRC1)
  690. default n
  691. help
  692. When APB clock frequency changes, high-resolution timer (esp_timer)
  693. scale and base value need to be adjusted. Each adjustment may cause
  694. small error, and over time such small errors may cause time drift.
  695. If this option is enabled, RTC timer will be used as a reference to
  696. compensate for the drift.
  697. It is recommended that this option is only used if 32k XTAL is selected
  698. as RTC clock source.
  699. config PM_PROFILING
  700. bool "Enable profiling counters for PM locks"
  701. depends on PM_ENABLE
  702. default n
  703. help
  704. If enabled, esp_pm_* functions will keep track of the amount of time
  705. each of the power management locks has been held, and esp_pm_dump_locks
  706. function will print this information.
  707. This feature can be used to analyze which locks are preventing the chip
  708. from going into a lower power state, and see what time the chip spends
  709. in each power saving mode. This feature does incur some run-time
  710. overhead, so should typically be disabled in production builds.
  711. config PM_TRACE
  712. bool "Enable debug tracing of PM using GPIOs"
  713. depends on PM_ENABLE
  714. default n
  715. help
  716. If enabled, some GPIOs will be used to signal events such as RTOS ticks,
  717. frequency switching, entry/exit from idle state. Refer to pm_trace.c
  718. file for the list of GPIOs.
  719. This feature is intended to be used when analyzing/debugging behavior
  720. of power management implementation, and should be kept disabled in
  721. applications.
  722. endmenu # "Power Management"