Kconfig 39 KB

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