Kconfig 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  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 initialization, 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. select ESP_MAC_ADDR_UNIVERSE_WIFI_STA
  329. select ESP_MAC_ADDR_UNIVERSE_BT
  330. config ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
  331. bool "Four"
  332. select ESP_MAC_ADDR_UNIVERSE_WIFI_STA
  333. select ESP_MAC_ADDR_UNIVERSE_WIFI_AP
  334. select ESP_MAC_ADDR_UNIVERSE_BT
  335. select ESP_MAC_ADDR_UNIVERSE_ETH
  336. endchoice
  337. config ESP32_UNIVERSAL_MAC_ADDRESSES
  338. int
  339. default 2 if ESP32_UNIVERSAL_MAC_ADDRESSES_TWO
  340. default 4 if ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
  341. config ESP32_ULP_COPROC_ENABLED
  342. bool "Enable Ultra Low Power (ULP) Coprocessor"
  343. default "n"
  344. help
  345. Set to 'y' if you plan to load a firmware for the coprocessor.
  346. If this option is enabled, further coprocessor configuration will appear in the Components menu.
  347. config ESP32_ULP_COPROC_RESERVE_MEM
  348. int
  349. prompt "RTC slow memory reserved for coprocessor" if ESP32_ULP_COPROC_ENABLED
  350. default 512 if ESP32_ULP_COPROC_ENABLED
  351. range 32 8192 if ESP32_ULP_COPROC_ENABLED
  352. default 0 if !ESP32_ULP_COPROC_ENABLED
  353. range 0 0 if !ESP32_ULP_COPROC_ENABLED
  354. help
  355. Bytes of memory to reserve for ULP coprocessor firmware & data.
  356. Data is reserved at the beginning of RTC slow memory.
  357. config ESP32_DEBUG_OCDAWARE
  358. bool "Make exception and panic handlers JTAG/OCD aware"
  359. default y
  360. select FREERTOS_DEBUG_OCDAWARE
  361. help
  362. The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and
  363. instead of panicking, have the debugger stop on the offending instruction.
  364. config ESP32_BROWNOUT_DET
  365. bool "Hardware brownout detect & reset"
  366. default y
  367. help
  368. The ESP32 has a built-in brownout detector which can detect if the voltage is lower than
  369. a specific value. If this happens, it will reset the chip in order to prevent unintended
  370. behaviour.
  371. choice ESP32_BROWNOUT_DET_LVL_SEL
  372. prompt "Brownout voltage level"
  373. depends on ESP32_BROWNOUT_DET
  374. default ESP32_BROWNOUT_DET_LVL_SEL_0
  375. help
  376. The brownout detector will reset the chip when the supply voltage is approximately
  377. below this level. Note that there may be some variation of brownout voltage level
  378. between each ESP32 chip.
  379. #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
  380. #of the brownout threshold levels.
  381. config ESP32_BROWNOUT_DET_LVL_SEL_0
  382. bool "2.43V +/- 0.05"
  383. config ESP32_BROWNOUT_DET_LVL_SEL_1
  384. bool "2.48V +/- 0.05"
  385. config ESP32_BROWNOUT_DET_LVL_SEL_2
  386. bool "2.58V +/- 0.05"
  387. config ESP32_BROWNOUT_DET_LVL_SEL_3
  388. bool "2.62V +/- 0.05"
  389. config ESP32_BROWNOUT_DET_LVL_SEL_4
  390. bool "2.67V +/- 0.05"
  391. config ESP32_BROWNOUT_DET_LVL_SEL_5
  392. bool "2.70V +/- 0.05"
  393. config ESP32_BROWNOUT_DET_LVL_SEL_6
  394. bool "2.77V +/- 0.05"
  395. config ESP32_BROWNOUT_DET_LVL_SEL_7
  396. bool "2.80V +/- 0.05"
  397. endchoice
  398. config ESP32_BROWNOUT_DET_LVL
  399. int
  400. default 0 if ESP32_BROWNOUT_DET_LVL_SEL_0
  401. default 1 if ESP32_BROWNOUT_DET_LVL_SEL_1
  402. default 2 if ESP32_BROWNOUT_DET_LVL_SEL_2
  403. default 3 if ESP32_BROWNOUT_DET_LVL_SEL_3
  404. default 4 if ESP32_BROWNOUT_DET_LVL_SEL_4
  405. default 5 if ESP32_BROWNOUT_DET_LVL_SEL_5
  406. default 6 if ESP32_BROWNOUT_DET_LVL_SEL_6
  407. default 7 if ESP32_BROWNOUT_DET_LVL_SEL_7
  408. #Reduce PHY TX power when brownout reset
  409. config ESP32_REDUCE_PHY_TX_POWER
  410. bool "Reduce PHY TX power when brownout reset"
  411. depends on ESP32_BROWNOUT_DET
  412. default y
  413. help
  414. When brownout reset occurs, reduce PHY TX power to keep the code running
  415. # Note about the use of "FRC1" name: currently FRC1 timer is not used for
  416. # high resolution timekeeping anymore. Instead the esp_timer API is used.
  417. # FRC1 name in the option name is kept for compatibility.
  418. choice ESP32_TIME_SYSCALL
  419. prompt "Timers used for gettimeofday function"
  420. default ESP32_TIME_SYSCALL_USE_RTC_FRC1
  421. help
  422. This setting defines which hardware timers are used to
  423. implement 'gettimeofday' and 'time' functions in C library.
  424. - If both high-resolution and RTC timers are used, timekeeping will
  425. continue in deep sleep. Time will be reported at 1 microsecond
  426. resolution. This is the default, and the recommended option.
  427. - If only high-resolution timer is used, gettimeofday will
  428. provide time at microsecond resolution.
  429. Time will not be preserved when going into deep sleep mode.
  430. - If only RTC timer is used, timekeeping will continue in
  431. deep sleep, but time will be measured at 6.(6) microsecond
  432. resolution. Also the gettimeofday function itself may take
  433. longer to run.
  434. - If no timers are used, gettimeofday and time functions
  435. return -1 and set errno to ENOSYS.
  436. - When RTC is used for timekeeping, two RTC_STORE registers are
  437. used to keep time in deep sleep mode.
  438. config ESP32_TIME_SYSCALL_USE_RTC_FRC1
  439. bool "RTC and high-resolution timer"
  440. config ESP32_TIME_SYSCALL_USE_RTC
  441. bool "RTC"
  442. config ESP32_TIME_SYSCALL_USE_FRC1
  443. bool "High-resolution timer"
  444. config ESP32_TIME_SYSCALL_USE_NONE
  445. bool "None"
  446. endchoice
  447. choice ESP32_RTC_CLK_SRC
  448. prompt "RTC clock source"
  449. default ESP32_RTC_CLK_SRC_INT_RC
  450. help
  451. Choose which clock is used as RTC clock source.
  452. - "Internal 150kHz oscillator" option provides lowest deep sleep current
  453. consumption, and does not require extra external components. However
  454. frequency stability with respect to temperature is poor, so time may
  455. drift in deep/light sleep modes.
  456. - "External 32kHz crystal" provides better frequency stability, at the
  457. expense of slightly higher (1uA) deep sleep current consumption.
  458. - "External 32kHz oscillator" allows using 32kHz clock generated by an
  459. external circuit. In this case, external clock signal must be connected
  460. to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal,
  461. and <1V in case of square wave signal. Common mode voltage should be
  462. 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude.
  463. Additionally, 1nF capacitor must be connected between 32K_XP pin and
  464. ground. 32K_XP pin can not be used as a GPIO in this case.
  465. - "Internal 8.5MHz oscillator divided by 256" option results in higher
  466. deep sleep current (by 5uA) but has better frequency stability than
  467. the internal 150kHz oscillator. It does not require external components.
  468. config ESP32_RTC_CLK_SRC_INT_RC
  469. bool "Internal 150kHz RC oscillator"
  470. config ESP32_RTC_CLK_SRC_EXT_CRYS
  471. bool "External 32kHz crystal"
  472. config ESP32_RTC_CLK_SRC_EXT_OSC
  473. bool "External 32kHz oscillator at 32K_XN pin"
  474. config ESP32_RTC_CLK_SRC_INT_8MD256
  475. bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)"
  476. endchoice
  477. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT
  478. bool "Additional current for external 32kHz crystal"
  479. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  480. default "n"
  481. help
  482. Choose which additional current is used for rtc external crystal.
  483. - With some 32kHz crystal configurations, the X32N and X32P pins may not
  484. have enough drive strength to keep the crystal oscillating during deep sleep.
  485. If this option is enabled, additional current from touchpad 9 is provided
  486. internally to drive the 32kHz crystal. If this option is enabled, deep sleep current
  487. is slightly higher (4-5uA) and the touchpad and ULP wakeup sources are not available.
  488. config ESP32_RTC_CLK_CAL_CYCLES
  489. int "Number of cycles for RTC_SLOW_CLK calibration"
  490. default 3000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256
  491. default 1024 if ESP32_RTC_CLK_SRC_INT_RC
  492. range 0 27000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256
  493. range 0 32766 if ESP32_RTC_CLK_SRC_INT_RC
  494. help
  495. When the startup code initializes RTC_SLOW_CLK, it can perform
  496. calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
  497. frequency. This option sets the number of RTC_SLOW_CLK cycles measured
  498. by the calibration routine. Higher numbers increase calibration
  499. precision, which may be important for applications which spend a lot of
  500. time in deep sleep. Lower numbers reduce startup time.
  501. When this option is set to 0, clock calibration will not be performed at
  502. startup, and approximate clock frequencies will be assumed:
  503. - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
  504. - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
  505. In case more value will help improve the definition of the launch of the crystal.
  506. If the crystal could not start, it will be switched to internal RC.
  507. config ESP32_RTC_XTAL_CAL_RETRY
  508. int "Number of attempts to repeat 32k XTAL calibration"
  509. default 1
  510. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  511. help
  512. Number of attempts to repeat 32k XTAL calibration
  513. before giving up and switching to the internal RC.
  514. Increase this option if the 32k crystal oscillator
  515. does not start and switches to internal RC.
  516. config ESP32_RTC_XTAL_BOOTSTRAP_CYCLES
  517. int "Bootstrap cycles for external 32kHz crystal"
  518. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  519. default 5
  520. range 0 32768
  521. help
  522. To reduce the startup time of an external RTC crystal,
  523. we bootstrap it with a 32kHz square wave for a fixed number of cycles.
  524. Setting 0 will disable bootstrapping (if disabled, the crystal may take
  525. longer to start up or fail to oscillate under some conditions).
  526. If this value is too high, a faulty crystal may initially start and then fail.
  527. If this value is too low, an otherwise good crystal may not start.
  528. To accurately determine if the crystal has started,
  529. set a larger "Number of cycles for RTC_SLOW_CLK calibration" (about 3000).
  530. config ESP32_DEEP_SLEEP_WAKEUP_DELAY
  531. int "Extra delay in deep sleep wake stub (in us)"
  532. default 2000
  533. range 0 5000
  534. help
  535. When ESP32 exits deep sleep, the CPU and the flash chip are powered on
  536. at the same time. CPU will run deep sleep stub first, and then
  537. proceed to load code from flash. Some flash chips need sufficient
  538. time to pass between power on and first read operation. By default,
  539. without any extra delay, this time is approximately 900us, although
  540. some flash chip types need more than that.
  541. By default extra delay is set to 2000us. When optimizing startup time
  542. for applications which require it, this value may be reduced.
  543. If you are seeing "flash read err, 1000" message printed to the
  544. console after deep sleep reset, try increasing this value.
  545. choice ESP32_XTAL_FREQ_SEL
  546. prompt "Main XTAL frequency"
  547. default ESP32_XTAL_FREQ_40
  548. help
  549. ESP32 currently supports the following XTAL frequencies:
  550. - 26 MHz
  551. - 40 MHz
  552. Startup code can automatically estimate XTAL frequency. This feature
  553. uses the internal 8MHz oscillator as a reference. Because the internal
  554. oscillator frequency is temperature dependent, it is not recommended
  555. to use automatic XTAL frequency detection in applications which need
  556. to work at high ambient temperatures and use high-temperature
  557. qualified chips and modules.
  558. config ESP32_XTAL_FREQ_40
  559. bool "40 MHz"
  560. config ESP32_XTAL_FREQ_26
  561. bool "26 MHz"
  562. config ESP32_XTAL_FREQ_AUTO
  563. bool "Autodetect"
  564. endchoice
  565. # Keep these values in sync with rtc_xtal_freq_t enum in soc/rtc.h
  566. config ESP32_XTAL_FREQ
  567. int
  568. default 0 if ESP32_XTAL_FREQ_AUTO
  569. default 40 if ESP32_XTAL_FREQ_40
  570. default 26 if ESP32_XTAL_FREQ_26
  571. config ESP32_DISABLE_BASIC_ROM_CONSOLE
  572. bool "Permanently disable BASIC ROM Console"
  573. default n
  574. help
  575. If set, the first time the app boots it will disable the BASIC ROM Console
  576. permanently (by burning an eFuse).
  577. Otherwise, the BASIC ROM Console starts on reset if no valid bootloader is
  578. read from the flash.
  579. (Enabling secure boot also disables the BASIC ROM Console by default.)
  580. config ESP32_NO_BLOBS
  581. bool "No Binary Blobs"
  582. depends on !BT_ENABLED
  583. default n
  584. help
  585. If enabled, this disables the linking of binary libraries in the application build. Note
  586. that after enabling this Wi-Fi/Bluetooth will not work.
  587. config ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS
  588. bool "App compatible with bootloaders before IDF v2.1"
  589. default n
  590. help
  591. Bootloaders before IDF v2.1 did less initialisation of the
  592. system clock. This setting needs to be enabled to build an app
  593. which can be booted by these older bootloaders.
  594. If this setting is enabled, the app can be booted by any bootloader
  595. from IDF v1.0 up to the current version.
  596. If this setting is disabled, the app can only be booted by bootloaders
  597. from IDF v2.1 or newer.
  598. Enabling this setting adds approximately 1KB to the app's IRAM usage.
  599. config ESP32_APP_INIT_CLK
  600. bool
  601. default y if ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS
  602. default y if APP_BUILD_TYPE_ELF_RAM
  603. config ESP32_RTCDATA_IN_FAST_MEM
  604. bool "Place RTC_DATA_ATTR and RTC_RODATA_ATTR variables into RTC fast memory segment"
  605. default n
  606. depends on FREERTOS_UNICORE
  607. help
  608. This option allows to place .rtc_data and .rtc_rodata sections into
  609. RTC fast memory segment to free the slow memory region for ULP programs.
  610. This option depends on the CONFIG_FREERTOS_UNICORE option because RTC fast memory
  611. can be accessed only by PRO_CPU core.
  612. config ESP32_USE_FIXED_STATIC_RAM_SIZE
  613. bool "Use fixed static RAM size"
  614. default n
  615. help
  616. If this option is disabled, the DRAM part of the heap starts right after the .bss section,
  617. within the dram0_0 region. As a result, adding or removing some static variables
  618. will change the available heap size.
  619. If this option is enabled, the DRAM part of the heap starts right after the dram0_0 region,
  620. where its length is set with ESP32_FIXED_STATIC_RAM_SIZE
  621. config ESP32_FIXED_STATIC_RAM_SIZE
  622. hex "Fixed Static RAM size"
  623. default 0x1E000
  624. range 0 0x2c200
  625. depends on ESP32_USE_FIXED_STATIC_RAM_SIZE
  626. help
  627. RAM size dedicated for static variables (.data & .bss sections).
  628. Please note that the actual length will be reduced by BT_RESERVE_DRAM if Bluetooth
  629. controller is enabled.
  630. config ESP32_DPORT_DIS_INTERRUPT_LVL
  631. int "Disable the interrupt level for the DPORT workarounds"
  632. default 5
  633. help
  634. To prevent interrupting DPORT workarounds,
  635. need to disable interrupt with a maximum used level in the system.
  636. config ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
  637. bool "Enable IRAM as 8 bit accessible memory"
  638. depends on FREERTOS_UNICORE
  639. help
  640. If enabled, application can use IRAM as byte accessible region for storing data
  641. (Note: IRAM region cannot be used as task stack)
  642. This is possible due to handling of exceptions `LoadStoreError (3)` and `LoadStoreAlignmentError (9)`
  643. Each unaligned read/write access will incur a penalty of maximum of 167 CPU cycles.
  644. config ESP32_ALLOW_RTC_FAST_MEM_AS_HEAP
  645. bool "Enable RTC fast memory for dynamic allocations"
  646. default y
  647. depends on FREERTOS_UNICORE
  648. help
  649. This config option allows to add RTC fast memory region to system heap with capability
  650. similar to that of DRAM region but without DMA. This memory will be consumed first per
  651. heap initialization order by early startup services and scheduler related code. Speed
  652. wise RTC fast memory operates on APB clock and hence does not have much performance impact.
  653. RTC fast memory is accessible to PRO cpu only and hence this is allowed for single core
  654. configuration only for ESP32.
  655. endmenu # ESP32-Specific
  656. menu "Power Management"
  657. # TODO: this component simply shouldn't be included
  658. # in the build at the CMake level, but this is currently
  659. # not working so we just hide all items here
  660. visible if IDF_TARGET_ESP32
  661. config PM_ENABLE
  662. bool "Support for power management"
  663. default n
  664. help
  665. If enabled, application is compiled with support for power management.
  666. This option has run-time overhead (increased interrupt latency,
  667. longer time to enter idle state), and it also reduces accuracy of
  668. RTOS ticks and timers used for timekeeping.
  669. Enable this option if application uses power management APIs.
  670. config PM_DFS_INIT_AUTO
  671. bool "Enable dynamic frequency scaling (DFS) at startup"
  672. depends on PM_ENABLE
  673. default n
  674. help
  675. If enabled, startup code configures dynamic frequency scaling.
  676. Max CPU frequency is set to CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ setting,
  677. min frequency is set to XTAL frequency.
  678. If disabled, DFS will not be active until the application
  679. configures it using esp_pm_configure function.
  680. config PM_USE_RTC_TIMER_REF
  681. bool "Use RTC timer to prevent time drift (EXPERIMENTAL)"
  682. depends on PM_ENABLE && ESP_TIMER_IMPL_FRC2 && (ESP32_TIME_SYSCALL_USE_RTC || ESP32_TIME_SYSCALL_USE_RTC_FRC1)
  683. default n
  684. help
  685. When APB clock frequency changes, high-resolution timer (esp_timer)
  686. scale and base value need to be adjusted. Each adjustment may cause
  687. small error, and over time such small errors may cause time drift.
  688. If this option is enabled, RTC timer will be used as a reference to
  689. compensate for the drift.
  690. It is recommended that this option is only used if 32k XTAL is selected
  691. as RTC clock source.
  692. config PM_PROFILING
  693. bool "Enable profiling counters for PM locks"
  694. depends on PM_ENABLE
  695. default n
  696. help
  697. If enabled, esp_pm_* functions will keep track of the amount of time
  698. each of the power management locks has been held, and esp_pm_dump_locks
  699. function will print this information.
  700. This feature can be used to analyze which locks are preventing the chip
  701. from going into a lower power state, and see what time the chip spends
  702. in each power saving mode. This feature does incur some run-time
  703. overhead, so should typically be disabled in production builds.
  704. config PM_TRACE
  705. bool "Enable debug tracing of PM using GPIOs"
  706. depends on PM_ENABLE
  707. default n
  708. help
  709. If enabled, some GPIOs will be used to signal events such as RTOS ticks,
  710. frequency switching, entry/exit from idle state. Refer to pm_trace.c
  711. file for the list of GPIOs.
  712. This feature is intended to be used when analyzing/debugging behavior
  713. of power management implementation, and should be kept disabled in
  714. applications.
  715. endmenu # "Power Management"