Kconfig 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  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. select ESP_TIME_FUNCS_USE_RTC_TIMER
  441. select ESP_TIME_FUNCS_USE_ESP_TIMER
  442. config ESP32_TIME_SYSCALL_USE_RTC
  443. bool "RTC"
  444. select ESP_TIME_FUNCS_USE_RTC_TIMER
  445. config ESP32_TIME_SYSCALL_USE_FRC1
  446. bool "High-resolution timer"
  447. select ESP_TIME_FUNCS_USE_ESP_TIMER
  448. config ESP32_TIME_SYSCALL_USE_NONE
  449. bool "None"
  450. select ESP_TIME_FUNCS_USE_NONE
  451. endchoice
  452. choice ESP32_RTC_CLK_SRC
  453. prompt "RTC clock source"
  454. default ESP32_RTC_CLK_SRC_INT_RC
  455. help
  456. Choose which clock is used as RTC clock source.
  457. - "Internal 150kHz oscillator" option provides lowest deep sleep current
  458. consumption, and does not require extra external components. However
  459. frequency stability with respect to temperature is poor, so time may
  460. drift in deep/light sleep modes.
  461. - "External 32kHz crystal" provides better frequency stability, at the
  462. expense of slightly higher (1uA) deep sleep current consumption.
  463. - "External 32kHz oscillator" allows using 32kHz clock generated by an
  464. external circuit. In this case, external clock signal must be connected
  465. to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal,
  466. and <1V in case of square wave signal. Common mode voltage should be
  467. 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude.
  468. Additionally, 1nF capacitor must be connected between 32K_XP pin and
  469. ground. 32K_XP pin can not be used as a GPIO in this case.
  470. - "Internal 8.5MHz oscillator divided by 256" option results in higher
  471. deep sleep current (by 5uA) but has better frequency stability than
  472. the internal 150kHz oscillator. It does not require external components.
  473. config ESP32_RTC_CLK_SRC_INT_RC
  474. bool "Internal 150kHz RC oscillator"
  475. config ESP32_RTC_CLK_SRC_EXT_CRYS
  476. bool "External 32kHz crystal"
  477. select ESP_SYSTEM_RTC_EXT_XTAL
  478. config ESP32_RTC_CLK_SRC_EXT_OSC
  479. bool "External 32kHz oscillator at 32K_XN pin"
  480. config ESP32_RTC_CLK_SRC_INT_8MD256
  481. bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)"
  482. endchoice
  483. choice ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_METHOD
  484. prompt "Additional current for external 32kHz crystal"
  485. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  486. depends on ESP32_REV_MIN <= 1
  487. default ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_NONE
  488. help
  489. With some 32kHz crystal configurations, the X32N and X32P pins may not have enough
  490. drive strength to keep the crystal oscillating. Choose the method to provide
  491. additional current from touchpad 9 to the external 32kHz crystal. Note that
  492. the deep sleep current is slightly high (4-5uA) and the touchpad and the
  493. wakeup sources of both touchpad and ULP are not available in method 1 and method 2.
  494. This problem is fixed in ESP32 ECO 3, so this workaround is not needed. Setting the
  495. project configuration to minimum revision ECO3 will disable this option, , allow
  496. all wakeup sources, and save some code size.
  497. - "None" option will not provide additional current to external crystal
  498. - "Method 1" option can't ensure 100% to solve the external 32k crystal start failed
  499. issue, but the touchpad can work in this method.
  500. - "Method 2" option can solve the external 32k issue, but the touchpad can't work
  501. in this method.
  502. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_NONE
  503. bool "None"
  504. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT
  505. bool "Method 1"
  506. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_V2
  507. bool "Method 2"
  508. endchoice
  509. config ESP32_RTC_CLK_CAL_CYCLES
  510. int "Number of cycles for RTC_SLOW_CLK calibration"
  511. default 3000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256
  512. default 1024 if ESP32_RTC_CLK_SRC_INT_RC
  513. range 0 27000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256
  514. range 0 32766 if ESP32_RTC_CLK_SRC_INT_RC
  515. help
  516. When the startup code initializes RTC_SLOW_CLK, it can perform
  517. calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
  518. frequency. This option sets the number of RTC_SLOW_CLK cycles measured
  519. by the calibration routine. Higher numbers increase calibration
  520. precision, which may be important for applications which spend a lot of
  521. time in deep sleep. Lower numbers reduce startup time.
  522. When this option is set to 0, clock calibration will not be performed at
  523. startup, and approximate clock frequencies will be assumed:
  524. - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
  525. - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
  526. In case more value will help improve the definition of the launch of the crystal.
  527. If the crystal could not start, it will be switched to internal RC.
  528. config ESP32_RTC_XTAL_CAL_RETRY
  529. int "Number of attempts to repeat 32k XTAL calibration"
  530. default 1
  531. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  532. help
  533. Number of attempts to repeat 32k XTAL calibration
  534. before giving up and switching to the internal RC.
  535. Increase this option if the 32k crystal oscillator
  536. does not start and switches to internal RC.
  537. config ESP32_DEEP_SLEEP_WAKEUP_DELAY
  538. int "Extra delay in deep sleep wake stub (in us)"
  539. default 2000
  540. range 0 5000
  541. help
  542. When ESP32 exits deep sleep, the CPU and the flash chip are powered on
  543. at the same time. CPU will run deep sleep stub first, and then
  544. proceed to load code from flash. Some flash chips need sufficient
  545. time to pass between power on and first read operation. By default,
  546. without any extra delay, this time is approximately 900us, although
  547. some flash chip types need more than that.
  548. By default extra delay is set to 2000us. When optimizing startup time
  549. for applications which require it, this value may be reduced.
  550. If you are seeing "flash read err, 1000" message printed to the
  551. console after deep sleep reset, try increasing this value.
  552. choice ESP32_XTAL_FREQ_SEL
  553. prompt "Main XTAL frequency"
  554. default ESP32_XTAL_FREQ_40
  555. help
  556. ESP32 currently supports the following XTAL frequencies:
  557. - 26 MHz
  558. - 40 MHz
  559. Startup code can automatically estimate XTAL frequency. This feature
  560. uses the internal 8MHz oscillator as a reference. Because the internal
  561. oscillator frequency is temperature dependent, it is not recommended
  562. to use automatic XTAL frequency detection in applications which need
  563. to work at high ambient temperatures and use high-temperature
  564. qualified chips and modules.
  565. config ESP32_XTAL_FREQ_40
  566. bool "40 MHz"
  567. config ESP32_XTAL_FREQ_26
  568. bool "26 MHz"
  569. config ESP32_XTAL_FREQ_AUTO
  570. bool "Autodetect"
  571. endchoice
  572. # Keep these values in sync with rtc_xtal_freq_t enum in soc/rtc.h
  573. config ESP32_XTAL_FREQ
  574. int
  575. default 0 if ESP32_XTAL_FREQ_AUTO
  576. default 40 if ESP32_XTAL_FREQ_40
  577. default 26 if ESP32_XTAL_FREQ_26
  578. config ESP32_DISABLE_BASIC_ROM_CONSOLE
  579. bool "Permanently disable BASIC ROM Console"
  580. default n
  581. help
  582. If set, the first time the app boots it will disable the BASIC ROM Console
  583. permanently (by burning an eFuse).
  584. Otherwise, the BASIC ROM Console starts on reset if no valid bootloader is
  585. read from the flash.
  586. (Enabling secure boot also disables the BASIC ROM Console by default.)
  587. config ESP32_NO_BLOBS
  588. bool "No Binary Blobs"
  589. depends on !BT_ENABLED
  590. default n
  591. help
  592. If enabled, this disables the linking of binary libraries in the application build. Note
  593. that after enabling this Wi-Fi/Bluetooth will not work.
  594. config ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS
  595. bool "App compatible with bootloaders before IDF v2.1"
  596. default n
  597. help
  598. Bootloaders before IDF v2.1 did less initialisation of the
  599. system clock. This setting needs to be enabled to build an app
  600. which can be booted by these older bootloaders.
  601. If this setting is enabled, the app can be booted by any bootloader
  602. from IDF v1.0 up to the current version.
  603. If this setting is disabled, the app can only be booted by bootloaders
  604. from IDF v2.1 or newer.
  605. Enabling this setting adds approximately 1KB to the app's IRAM usage.
  606. config ESP32_APP_INIT_CLK
  607. bool
  608. default y if ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS
  609. default y if APP_BUILD_TYPE_ELF_RAM
  610. config ESP32_RTCDATA_IN_FAST_MEM
  611. bool "Place RTC_DATA_ATTR and RTC_RODATA_ATTR variables into RTC fast memory segment"
  612. default n
  613. depends on FREERTOS_UNICORE
  614. help
  615. This option allows to place .rtc_data and .rtc_rodata sections into
  616. RTC fast memory segment to free the slow memory region for ULP programs.
  617. This option depends on the CONFIG_FREERTOS_UNICORE option because RTC fast memory
  618. can be accessed only by PRO_CPU core.
  619. config ESP32_USE_FIXED_STATIC_RAM_SIZE
  620. bool "Use fixed static RAM size"
  621. default n
  622. help
  623. If this option is disabled, the DRAM part of the heap starts right after the .bss section,
  624. within the dram0_0 region. As a result, adding or removing some static variables
  625. will change the available heap size.
  626. If this option is enabled, the DRAM part of the heap starts right after the dram0_0 region,
  627. where its length is set with ESP32_FIXED_STATIC_RAM_SIZE
  628. config ESP32_FIXED_STATIC_RAM_SIZE
  629. hex "Fixed Static RAM size"
  630. default 0x1E000
  631. range 0 0x2c200
  632. depends on ESP32_USE_FIXED_STATIC_RAM_SIZE
  633. help
  634. RAM size dedicated for static variables (.data & .bss sections).
  635. Please note that the actual length will be reduced by BT_RESERVE_DRAM if Bluetooth
  636. controller is enabled.
  637. config ESP32_DPORT_DIS_INTERRUPT_LVL
  638. int "Disable the interrupt level for the DPORT workarounds"
  639. default 5
  640. help
  641. To prevent interrupting DPORT workarounds,
  642. need to disable interrupt with a maximum used level in the system.
  643. config ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
  644. bool "Enable IRAM as 8 bit accessible memory"
  645. depends on FREERTOS_UNICORE
  646. help
  647. If enabled, application can use IRAM as byte accessible region for storing data
  648. (Note: IRAM region cannot be used as task stack)
  649. This is possible due to handling of exceptions `LoadStoreError (3)` and `LoadStoreAlignmentError (9)`
  650. Each unaligned read/write access will incur a penalty of maximum of 167 CPU cycles.
  651. config ESP32_ALLOW_RTC_FAST_MEM_AS_HEAP
  652. bool "Enable RTC fast memory for dynamic allocations"
  653. default y
  654. depends on FREERTOS_UNICORE
  655. help
  656. This config option allows to add RTC fast memory region to system heap with capability
  657. similar to that of DRAM region but without DMA. This memory will be consumed first per
  658. heap initialization order by early startup services and scheduler related code. Speed
  659. wise RTC fast memory operates on APB clock and hence does not have much performance impact.
  660. RTC fast memory is accessible to PRO cpu only and hence this is allowed for single core
  661. configuration only for ESP32.
  662. endmenu # ESP32-Specific