Kconfig 42 KB

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