Kconfig 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  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_40 if IDF_ENV_FPGA
  38. default ESP32_DEFAULT_CPU_FREQ_160
  39. help
  40. CPU frequency to be set on application startup.
  41. config ESP32_DEFAULT_CPU_FREQ_40
  42. bool "40 MHz"
  43. depends on IDF_ENV_FPGA
  44. config ESP32_DEFAULT_CPU_FREQ_80
  45. bool "80 MHz"
  46. config ESP32_DEFAULT_CPU_FREQ_160
  47. bool "160 MHz"
  48. config ESP32_DEFAULT_CPU_FREQ_240
  49. bool "240 MHz"
  50. endchoice
  51. config ESP32_DEFAULT_CPU_FREQ_MHZ
  52. int
  53. default 40 if ESP32_DEFAULT_CPU_FREQ_40
  54. default 80 if ESP32_DEFAULT_CPU_FREQ_80
  55. default 160 if ESP32_DEFAULT_CPU_FREQ_160
  56. default 240 if ESP32_DEFAULT_CPU_FREQ_240
  57. # Note: to support SPIRAM across multiple chips, check CONFIG_SPIRAM
  58. # instead
  59. config ESP32_SPIRAM_SUPPORT
  60. bool "Support for external, SPI-connected RAM"
  61. default "n"
  62. select SPIRAM
  63. help
  64. This enables support for an external SPI RAM chip, connected in parallel with the
  65. main SPI flash chip.
  66. menu "SPI RAM config"
  67. depends on ESP32_SPIRAM_SUPPORT
  68. choice SPIRAM_TYPE
  69. prompt "Type of SPI RAM chip in use"
  70. default SPIRAM_TYPE_AUTO
  71. config SPIRAM_TYPE_AUTO
  72. bool "Auto-detect"
  73. config SPIRAM_TYPE_ESPPSRAM16
  74. bool "ESP-PSRAM16 or APS1604"
  75. config SPIRAM_TYPE_ESPPSRAM32
  76. bool "ESP-PSRAM32 or IS25WP032"
  77. config SPIRAM_TYPE_ESPPSRAM64
  78. bool "ESP-PSRAM64 or LY68L6400"
  79. endchoice
  80. config SPIRAM_SIZE
  81. int
  82. default -1 if SPIRAM_TYPE_AUTO
  83. default 2097152 if SPIRAM_TYPE_ESPPSRAM16
  84. default 4194304 if SPIRAM_TYPE_ESPPSRAM32
  85. default 8388608 if SPIRAM_TYPE_ESPPSRAM64
  86. default 0
  87. choice SPIRAM_SPEED
  88. prompt "Set RAM clock speed"
  89. default SPIRAM_SPEED_40M
  90. help
  91. Select the speed for the SPI RAM chip.
  92. If SPI RAM is enabled, we only support three combinations of SPI speed mode we supported now:
  93. 1. Flash SPI running at 40Mhz and RAM SPI running at 40Mhz
  94. 2. Flash SPI running at 80Mhz and RAM SPI running at 40Mhz
  95. 3. Flash SPI running at 80Mhz and RAM SPI running at 80Mhz
  96. Note: If the third mode(80Mhz+80Mhz) is enabled for SPI RAM of type 32MBit, one of the HSPI/VSPI host
  97. will be occupied by the system. Which SPI host to use can be selected by the config item
  98. SPIRAM_OCCUPY_SPI_HOST. Application code should never touch HSPI/VSPI hardware in this case. The
  99. option to select 80MHz will only be visible if the flash SPI speed is also 80MHz.
  100. (ESPTOOLPY_FLASHFREQ_80M is true)
  101. config SPIRAM_SPEED_40M
  102. bool "40MHz clock speed"
  103. config SPIRAM_SPEED_80M
  104. depends on ESPTOOLPY_FLASHFREQ_80M
  105. bool "80MHz clock speed"
  106. endchoice
  107. # insert non-chip-specific items here
  108. source "$IDF_PATH/components/esp_hw_support/Kconfig.spiram.common"
  109. config SPIRAM_CACHE_WORKAROUND
  110. bool "Enable workaround for bug in SPI RAM cache for Rev1 ESP32s"
  111. depends on (SPIRAM_USE_MEMMAP || SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC) && (ESP32_REV_MIN < 3)
  112. default "y"
  113. help
  114. Revision 1 of the ESP32 has a bug that can cause a write to PSRAM not to take place in some situations
  115. when the cache line needs to be fetched from external RAM and an interrupt occurs. This enables a
  116. fix in the compiler (-mfix-esp32-psram-cache-issue) that makes sure the specific code that is
  117. vulnerable to this will not be emitted.
  118. This will also not use any bits of newlib that are located in ROM, opting for a version that is
  119. compiled with the workaround and located in flash instead.
  120. The workaround is not required for ESP32 revision 3 and above.
  121. menu "SPIRAM cache workaround debugging"
  122. choice SPIRAM_CACHE_WORKAROUND_STRATEGY
  123. prompt "Workaround strategy"
  124. depends on SPIRAM_CACHE_WORKAROUND
  125. default SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW
  126. help
  127. Select the workaround strategy. Note that the strategy for precompiled
  128. libraries (libgcc, newlib, bt, wifi) is not affected by this selection.
  129. Unless you know you need a different strategy, it's suggested you stay
  130. with the default MEMW strategy. Note that DUPLDST can interfere with hardware
  131. encryption and this will be automatically disabled if this workaround is selected.
  132. 'Insert nops' is the workaround that was used in older esp-idf versions. This workaround
  133. still can cause faulty data transfers from/to SPI RAM in some situation.
  134. config SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW
  135. bool "Insert memw after vulnerable instructions (default)"
  136. config SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST
  137. bool "Duplicate LD/ST for 32-bit, memw for 8/16 bit"
  138. config SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS
  139. bool "Insert nops between vulnerable loads/stores (old strategy, obsolete)"
  140. endchoice
  141. #This needs to be Y only for the dupldst workaround
  142. config SPIRAM_WORKAROUND_NEED_VOLATILE_SPINLOCK
  143. bool
  144. default "y" if SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST
  145. endmenu
  146. menu "SPIRAM workaround libraries placement"
  147. visible if SPIRAM_CACHE_WORKAROUND
  148. config SPIRAM_CACHE_LIBJMP_IN_IRAM
  149. bool "Put libc's jump related functions in IRAM"
  150. depends on SPIRAM_CACHE_WORKAROUND
  151. default "y"
  152. help
  153. The functions affected by this option are: longjmp and setjmp.
  154. Putting these function in IRAM will allow them to be called when flash cache is disabled
  155. but it will also reduce the available size of free IRAM for the user application.
  156. config SPIRAM_CACHE_LIBMATH_IN_IRAM
  157. bool "Put libc's math related functions in IRAM"
  158. depends on SPIRAM_CACHE_WORKAROUND
  159. default "y"
  160. help
  161. The functions affected by this option are: abs, div, labs, ldiv, quorem, fpclassify,
  162. and nan.
  163. Putting these function in IRAM will allow them to be called when flash cache is disabled
  164. but it will also reduce the available size of free IRAM for the user application.
  165. config SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM
  166. bool "Put libc's number parsing related functions in IRAM"
  167. depends on SPIRAM_CACHE_WORKAROUND
  168. default "y"
  169. help
  170. The functions affected by this option are: utoa, itoa, atoi, atol, strtol, and strtoul.
  171. Putting these function in IRAM will allow them to be called when flash cache is disabled
  172. but it will also reduce the available size of free IRAM for the user application.
  173. config SPIRAM_CACHE_LIBIO_IN_IRAM
  174. bool "Put libc's I/O related functions in IRAM"
  175. depends on SPIRAM_CACHE_WORKAROUND
  176. default "y"
  177. help
  178. The functions affected by this option are: wcrtomb, fvwrite, wbuf, wsetup, fputwc, wctomb_r,
  179. ungetc, makebuf, fflush, refill, and sccl.
  180. Putting these function in IRAM will allow them to be called when flash cache is disabled
  181. but it will also reduce the available size of free IRAM for the user application.
  182. config SPIRAM_CACHE_LIBTIME_IN_IRAM
  183. bool "Put libc's time related functions in IRAM"
  184. depends on SPIRAM_CACHE_WORKAROUND
  185. default "y"
  186. help
  187. The functions affected by this option are: asctime, asctime_r, ctime, ctime_r, lcltime, lcltime_r,
  188. gmtime, gmtime_r, strftime, mktime, tzset_r, tzset, time, gettzinfo, systimes, month_lengths,
  189. timelocal, tzvars, tzlock, tzcalc_limits, and strptime.
  190. Putting these function in IRAM will allow them to be called when flash cache is disabled
  191. but it will also reduce the available size of free IRAM for the user application.
  192. config SPIRAM_CACHE_LIBCHAR_IN_IRAM
  193. bool "Put libc's characters related functions in IRAM"
  194. depends on SPIRAM_CACHE_WORKAROUND
  195. default "y"
  196. help
  197. The functions affected by this option are: ctype_, toupper, tolower, toascii, strupr, bzero,
  198. isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower, isprint, ispunct,
  199. isspace, and isupper.
  200. Putting these function in IRAM will allow them to be called when flash cache is disabled
  201. but it will also reduce the available size of free IRAM for the user application.
  202. config SPIRAM_CACHE_LIBMEM_IN_IRAM
  203. bool "Put libc's memory related functions in IRAM"
  204. depends on SPIRAM_CACHE_WORKAROUND
  205. default "y"
  206. help
  207. The functions affected by this option are: memccpy, memchr memmove, and memrchr.
  208. Putting these function in IRAM will allow them to be called when flash cache is disabled
  209. but it will also reduce the available size of free IRAM for the user application.
  210. config SPIRAM_CACHE_LIBSTR_IN_IRAM
  211. bool "Put libc's string related functions in IRAM"
  212. depends on SPIRAM_CACHE_WORKAROUND
  213. default "y"
  214. help
  215. The functions affected by this option are: strcasecmp, strcasestr, strchr, strcoll,
  216. strcpy, strcspn, strdup, strdup_r, strlcat, strlcpy, strlen, strlwr, strncasecmp,
  217. strncat, strncmp, strncpy, strndup, strndup_r, strrchr, strsep, strspn, strstr,
  218. strtok_r, and strupr.
  219. Putting these function in IRAM will allow them to be called when flash cache is disabled
  220. but it will also reduce the available size of free IRAM for the user application.
  221. config SPIRAM_CACHE_LIBRAND_IN_IRAM
  222. bool "Put libc's random related functions in IRAM"
  223. depends on SPIRAM_CACHE_WORKAROUND
  224. default "y"
  225. help
  226. The functions affected by this option are: srand, rand, and rand_r.
  227. Putting these function in IRAM will allow them to be called when flash cache is disabled
  228. but it will also reduce the available size of free IRAM for the user application.
  229. config SPIRAM_CACHE_LIBENV_IN_IRAM
  230. bool "Put libc's environment related functions in IRAM"
  231. depends on SPIRAM_CACHE_WORKAROUND
  232. default "y"
  233. help
  234. The functions affected by this option are: environ, envlock, and getenv_r.
  235. Putting these function in IRAM will allow them to be called when flash cache is disabled
  236. but it will also reduce the available size of free IRAM for the user application.
  237. config SPIRAM_CACHE_LIBFILE_IN_IRAM
  238. bool "Put libc's file related functions in IRAM"
  239. depends on SPIRAM_CACHE_WORKAROUND
  240. default "y"
  241. help
  242. The functions affected by this option are: lock, isatty, fclose, open, close, creat, read,
  243. rshift, sbrk, stdio, syssbrk, sysclose, sysopen, creat, sysread, syswrite, impure, fwalk,
  244. and findfp.
  245. Putting these function in IRAM will allow them to be called when flash cache is disabled
  246. but it will also reduce the available size of free IRAM for the user application.
  247. config SPIRAM_CACHE_LIBMISC_IN_IRAM
  248. bool "Put libc's miscellaneous functions in IRAM, see help"
  249. depends on SPIRAM_CACHE_WORKAROUND
  250. default "y"
  251. help
  252. The functions affected by this option are: raise and system
  253. Putting these function in IRAM will allow them to be called when flash cache is disabled
  254. but it will also reduce the available size of free IRAM for the user application.
  255. endmenu
  256. config SPIRAM_BANKSWITCH_ENABLE
  257. bool "Enable bank switching for >4MiB external RAM"
  258. default y
  259. depends on SPIRAM_USE_MEMMAP || SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
  260. help
  261. The ESP32 only supports 4MiB of external RAM in its address space. The hardware does support larger
  262. memories, but these have to be bank-switched in and out of this address space. Enabling this allows you
  263. to reserve some MMU pages for this, which allows the use of the esp_himem api to manage these banks.
  264. #Note that this is limited to 62 banks, as esp_spiram_writeback_cache needs some kind of mapping of
  265. #some banks below that mark to work. We cannot at this moment guarantee this to exist when himem is
  266. #enabled.
  267. If spiram 2T mode is enabled, the size of 64Mbit psram will be changed as 32Mbit, so himem will be
  268. unusable.
  269. config SPIRAM_BANKSWITCH_RESERVE
  270. int "Amount of 32K pages to reserve for bank switching"
  271. depends on SPIRAM_BANKSWITCH_ENABLE
  272. default 8
  273. range 1 62
  274. help
  275. Select the amount of banks reserved for bank switching. Note that the amount of RAM allocatable with
  276. malloc/esp_heap_alloc_caps will decrease by 32K for each page reserved here.
  277. Note that this reservation is only actually done if your program actually uses the himem API. Without
  278. any himem calls, the reservation is not done and the original amount of memory will be available
  279. to malloc/esp_heap_alloc_caps.
  280. config SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
  281. bool "Allow external memory as an argument to xTaskCreateStatic"
  282. default n
  283. depends on SPIRAM_USE_MALLOC
  284. help
  285. Because some bits of the ESP32 code environment cannot be recompiled with the cache workaround,
  286. normally tasks cannot be safely run with their stack residing in external memory; for this reason
  287. xTaskCreate (and related task creaton functions) always allocate stack in internal memory and
  288. xTaskCreateStatic will check if the memory passed to it is in internal memory. If you have a task that
  289. needs a large amount of stack and does not call on ROM code in any way (no direct calls, but also no
  290. Bluetooth/WiFi), you can try enable this to cause xTaskCreateStatic to allow tasks stack in external
  291. memory.
  292. choice SPIRAM_OCCUPY_SPI_HOST
  293. prompt "SPI host to use for 32MBit PSRAM"
  294. default SPIRAM_OCCUPY_VSPI_HOST
  295. depends on SPIRAM_SPEED_80M
  296. help
  297. When both flash and PSRAM is working under 80MHz, and the PSRAM is of type 32MBit, one of the HSPI/VSPI
  298. host will be used to output the clock. Select which one to use here.
  299. config SPIRAM_OCCUPY_HSPI_HOST
  300. bool "HSPI host (SPI2)"
  301. config SPIRAM_OCCUPY_VSPI_HOST
  302. bool "VSPI host (SPI3)"
  303. config SPIRAM_OCCUPY_NO_HOST
  304. bool "Will not try to use any host, will abort if not able to use the PSRAM"
  305. endchoice
  306. menu "PSRAM clock and cs IO for ESP32-DOWD"
  307. config D0WD_PSRAM_CLK_IO
  308. int "PSRAM CLK IO number"
  309. depends on ESP32_SPIRAM_SUPPORT
  310. range 0 33
  311. default 17
  312. help
  313. The PSRAM CLOCK IO can be any unused GPIO, user can config it based on hardware design. If user use
  314. 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  315. config D0WD_PSRAM_CS_IO
  316. int "PSRAM CS IO number"
  317. depends on ESP32_SPIRAM_SUPPORT
  318. range 0 33
  319. default 16
  320. help
  321. The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design. If user use
  322. 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  323. endmenu
  324. menu "PSRAM clock and cs IO for ESP32-D2WD"
  325. config D2WD_PSRAM_CLK_IO
  326. int "PSRAM CLK IO number"
  327. depends on ESP32_SPIRAM_SUPPORT
  328. range 0 33
  329. default 9
  330. help
  331. User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram,
  332. so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  333. config D2WD_PSRAM_CS_IO
  334. int "PSRAM CS IO number"
  335. depends on ESP32_SPIRAM_SUPPORT
  336. range 0 33
  337. default 10
  338. help
  339. User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram,
  340. so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17.
  341. endmenu
  342. menu "PSRAM clock and cs IO for ESP32-PICO"
  343. config PICO_PSRAM_CS_IO
  344. int "PSRAM CS IO number"
  345. depends on ESP32_SPIRAM_SUPPORT
  346. range 0 33
  347. default 10
  348. help
  349. The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design.
  350. For ESP32-PICO chip, the psram share clock with flash, so user do not need to configure the clock
  351. IO.
  352. For the reference hardware design, please refer to
  353. https://www.espressif.com/sites/default/files/documentation/esp32-pico-d4_datasheet_en.pdf
  354. endmenu
  355. config SPIRAM_CUSTOM_SPIWP_SD3_PIN
  356. bool "Use custom SPI PSRAM WP(SD3) Pin when flash pins set in eFuse (read help)"
  357. depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_DIO || ESPTOOLPY_FLASHMODE_DOUT)
  358. default y if SPIRAM_SPIWP_SD3_PIN != 7 # backwards compatibility, can remove in IDF 5
  359. default n
  360. help
  361. This setting is only used if the SPI flash pins have been overridden by setting the eFuses
  362. SPI_PAD_CONFIG_xxx, and the SPI flash mode is DIO or DOUT.
  363. When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka
  364. ESP32 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. The psram only has QPI
  365. mode, so a WP pin setting is necessary.
  366. If this config item is set to N (default), the correct WP pin will be automatically used for any
  367. Espressif chip or module with integrated flash. If a custom setting is needed, set this config item
  368. to Y and specify the GPIO number connected to the WP pin.
  369. When flash mode is set to QIO or QOUT, the PSRAM WP pin will be set the same as the SPI Flash WP pin
  370. configured in the bootloader.
  371. config SPIRAM_SPIWP_SD3_PIN
  372. int "Custom SPI PSRAM WP(SD3) Pin"
  373. depends on IDF_TARGET_ESP32 && (ESPTOOLPY_FLASHMODE_DIO || ESPTOOLPY_FLASHMODE_DOUT)
  374. #depends on SPIRAM_CUSTOM_SPIWP_SD3_PIN # backwards compatibility, can uncomment in IDF 5
  375. range 0 33
  376. default 7
  377. help
  378. The option "Use custom SPI PSRAM WP(SD3) pin" must be set or this value is ignored
  379. If burning a customized set of SPI flash pins in eFuse and using DIO or DOUT mode for flash, set this
  380. value to the GPIO number of the SPIRAM WP pin.
  381. config SPIRAM_2T_MODE
  382. bool "Enable SPI PSRAM 2T mode"
  383. depends on ESP32_SPIRAM_SUPPORT
  384. default "n"
  385. help
  386. Enable this option to fix single bit errors inside 64Mbit PSRAM.
  387. Some 64Mbit PSRAM chips have a hardware issue in the RAM which causes bit errors at multiple
  388. fixed bit positions.
  389. Note: If this option is enabled, the 64Mbit PSRAM chip will appear to be 32Mbit in size.
  390. Applications will not be affected unless the use the esp_himem APIs, which are not supported
  391. in 2T mode.
  392. endmenu # "SPI RAM config"
  393. config ESP32_MEMMAP_TRACEMEM
  394. bool
  395. default "n"
  396. config ESP32_MEMMAP_TRACEMEM_TWOBANKS
  397. bool
  398. default "n"
  399. config ESP32_TRAX
  400. bool "Use TRAX tracing feature"
  401. default "n"
  402. select ESP32_MEMMAP_TRACEMEM
  403. help
  404. The ESP32 contains a feature which allows you to trace the execution path the processor
  405. has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
  406. of memory that can't be used for general purposes anymore. Disable this if you do not know
  407. what this is.
  408. config ESP32_TRAX_TWOBANKS
  409. bool "Reserve memory for tracing both pro as well as app cpu execution"
  410. default "n"
  411. depends on ESP32_TRAX && !FREERTOS_UNICORE
  412. select ESP32_MEMMAP_TRACEMEM_TWOBANKS
  413. help
  414. The ESP32 contains a feature which allows you to trace the execution path the processor
  415. has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
  416. of memory that can't be used for general purposes anymore. Disable this if you do not know
  417. what this is.
  418. # Memory to reverse for trace, used in linker script
  419. config ESP32_TRACEMEM_RESERVE_DRAM
  420. hex
  421. default 0x8000 if ESP32_MEMMAP_TRACEMEM && ESP32_MEMMAP_TRACEMEM_TWOBANKS
  422. default 0x4000 if ESP32_MEMMAP_TRACEMEM && !ESP32_MEMMAP_TRACEMEM_TWOBANKS
  423. default 0x0
  424. config ESP32_ULP_COPROC_ENABLED
  425. bool "Enable Ultra Low Power (ULP) Coprocessor"
  426. default "n"
  427. help
  428. Set to 'y' if you plan to load a firmware for the coprocessor.
  429. If this option is enabled, further coprocessor configuration will appear in the Components menu.
  430. config ESP32_ULP_COPROC_RESERVE_MEM
  431. int
  432. prompt "RTC slow memory reserved for coprocessor" if ESP32_ULP_COPROC_ENABLED
  433. default 512 if ESP32_ULP_COPROC_ENABLED
  434. range 32 8176 if ESP32_ULP_COPROC_ENABLED
  435. default 0 if !ESP32_ULP_COPROC_ENABLED
  436. range 0 0 if !ESP32_ULP_COPROC_ENABLED
  437. help
  438. Bytes of memory to reserve for ULP coprocessor firmware & data.
  439. Data is reserved at the beginning of RTC slow memory.
  440. config ESP32_DEBUG_OCDAWARE
  441. bool "Make exception and panic handlers JTAG/OCD aware"
  442. default y
  443. select FREERTOS_DEBUG_OCDAWARE
  444. help
  445. The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and
  446. instead of panicking, have the debugger stop on the offending instruction.
  447. config ESP32_BROWNOUT_DET
  448. bool "Hardware brownout detect & reset"
  449. depends on !IDF_ENV_FPGA
  450. default y
  451. help
  452. The ESP32 has a built-in brownout detector which can detect if the voltage is lower than
  453. a specific value. If this happens, it will reset the chip in order to prevent unintended
  454. behaviour.
  455. choice ESP32_BROWNOUT_DET_LVL_SEL
  456. prompt "Brownout voltage level"
  457. depends on ESP32_BROWNOUT_DET
  458. default ESP32_BROWNOUT_DET_LVL_SEL_0
  459. help
  460. The brownout detector will reset the chip when the supply voltage is approximately
  461. below this level. Note that there may be some variation of brownout voltage level
  462. between each ESP32 chip.
  463. #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages
  464. #of the brownout threshold levels.
  465. config ESP32_BROWNOUT_DET_LVL_SEL_0
  466. bool "2.43V +/- 0.05"
  467. config ESP32_BROWNOUT_DET_LVL_SEL_1
  468. bool "2.48V +/- 0.05"
  469. config ESP32_BROWNOUT_DET_LVL_SEL_2
  470. bool "2.58V +/- 0.05"
  471. config ESP32_BROWNOUT_DET_LVL_SEL_3
  472. bool "2.62V +/- 0.05"
  473. config ESP32_BROWNOUT_DET_LVL_SEL_4
  474. bool "2.67V +/- 0.05"
  475. config ESP32_BROWNOUT_DET_LVL_SEL_5
  476. bool "2.70V +/- 0.05"
  477. config ESP32_BROWNOUT_DET_LVL_SEL_6
  478. bool "2.77V +/- 0.05"
  479. config ESP32_BROWNOUT_DET_LVL_SEL_7
  480. bool "2.80V +/- 0.05"
  481. endchoice
  482. config ESP32_BROWNOUT_DET_LVL
  483. int
  484. default 0 if ESP32_BROWNOUT_DET_LVL_SEL_0
  485. default 1 if ESP32_BROWNOUT_DET_LVL_SEL_1
  486. default 2 if ESP32_BROWNOUT_DET_LVL_SEL_2
  487. default 3 if ESP32_BROWNOUT_DET_LVL_SEL_3
  488. default 4 if ESP32_BROWNOUT_DET_LVL_SEL_4
  489. default 5 if ESP32_BROWNOUT_DET_LVL_SEL_5
  490. default 6 if ESP32_BROWNOUT_DET_LVL_SEL_6
  491. default 7 if ESP32_BROWNOUT_DET_LVL_SEL_7
  492. choice ESP32_TIME_SYSCALL
  493. prompt "Timers used for gettimeofday function"
  494. default ESP32_TIME_SYSCALL_USE_RTC_FRC1
  495. help
  496. This setting defines which hardware timers are used to
  497. implement 'gettimeofday' and 'time' functions in C library.
  498. - If both high-resolution and RTC timers are used, timekeeping will
  499. continue in deep sleep. Time will be reported at 1 microsecond
  500. resolution. This is the default, and the recommended option.
  501. - If only high-resolution timer is used, gettimeofday will
  502. provide time at microsecond resolution.
  503. Time will not be preserved when going into deep sleep mode.
  504. - If only RTC timer is used, timekeeping will continue in
  505. deep sleep, but time will be measured at 6.(6) microsecond
  506. resolution. Also the gettimeofday function itself may take
  507. longer to run.
  508. - If no timers are used, gettimeofday and time functions
  509. return -1 and set errno to ENOSYS.
  510. - When RTC is used for timekeeping, two RTC_STORE registers are
  511. used to keep time in deep sleep mode.
  512. config ESP32_TIME_SYSCALL_USE_RTC_FRC1
  513. bool "RTC and high-resolution timer"
  514. select ESP_TIME_FUNCS_USE_RTC_TIMER
  515. select ESP_TIME_FUNCS_USE_ESP_TIMER
  516. config ESP32_TIME_SYSCALL_USE_RTC
  517. bool "RTC"
  518. select ESP_TIME_FUNCS_USE_RTC_TIMER
  519. config ESP32_TIME_SYSCALL_USE_FRC1
  520. bool "High-resolution timer"
  521. select ESP_TIME_FUNCS_USE_ESP_TIMER
  522. config ESP32_TIME_SYSCALL_USE_NONE
  523. bool "None"
  524. select ESP_TIME_FUNCS_USE_NONE
  525. endchoice
  526. choice ESP32_RTC_CLK_SRC
  527. prompt "RTC clock source"
  528. default ESP32_RTC_CLK_SRC_INT_RC
  529. help
  530. Choose which clock is used as RTC clock source.
  531. - "Internal 150kHz oscillator" option provides lowest deep sleep current
  532. consumption, and does not require extra external components. However
  533. frequency stability with respect to temperature is poor, so time may
  534. drift in deep/light sleep modes.
  535. - "External 32kHz crystal" provides better frequency stability, at the
  536. expense of slightly higher (1uA) deep sleep current consumption.
  537. - "External 32kHz oscillator" allows using 32kHz clock generated by an
  538. external circuit. In this case, external clock signal must be connected
  539. to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal,
  540. and <1V in case of square wave signal. Common mode voltage should be
  541. 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude.
  542. Additionally, 1nF capacitor must be connected between 32K_XP pin and
  543. ground. 32K_XP pin can not be used as a GPIO in this case.
  544. - "Internal 8.5MHz oscillator divided by 256" option results in higher
  545. deep sleep current (by 5uA) but has better frequency stability than
  546. the internal 150kHz oscillator. It does not require external components.
  547. config ESP32_RTC_CLK_SRC_INT_RC
  548. bool "Internal 150kHz RC oscillator"
  549. config ESP32_RTC_CLK_SRC_EXT_CRYS
  550. bool "External 32kHz crystal"
  551. select ESP_SYSTEM_RTC_EXT_XTAL
  552. config ESP32_RTC_CLK_SRC_EXT_OSC
  553. bool "External 32kHz oscillator at 32K_XN pin"
  554. select ESP_SYSTEM_RTC_EXT_OSC
  555. config ESP32_RTC_CLK_SRC_INT_8MD256
  556. bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)"
  557. endchoice
  558. choice ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_METHOD
  559. prompt "Additional current for external 32kHz crystal"
  560. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  561. depends on ESP32_REV_MIN <= 1
  562. default ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_NONE
  563. help
  564. With some 32kHz crystal configurations, the X32N and X32P pins may not have enough
  565. drive strength to keep the crystal oscillating. Choose the method to provide
  566. additional current from touchpad 9 to the external 32kHz crystal. Note that
  567. the deep sleep current is slightly high (4-5uA) and the touchpad and the
  568. wakeup sources of both touchpad and ULP are not available in method 1 and method 2.
  569. This problem is fixed in ESP32 ECO 3, so this workaround is not needed. Setting the
  570. project configuration to minimum revision ECO3 will disable this option, , allow
  571. all wakeup sources, and save some code size.
  572. - "None" option will not provide additional current to external crystal
  573. - "Method 1" option can't ensure 100% to solve the external 32k crystal start failed
  574. issue, but the touchpad can work in this method.
  575. - "Method 2" option can solve the external 32k issue, but the touchpad can't work
  576. in this method.
  577. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_NONE
  578. bool "None"
  579. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT
  580. bool "Method 1"
  581. config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT_V2
  582. bool "Method 2"
  583. endchoice
  584. config ESP32_RTC_CLK_CAL_CYCLES
  585. int "Number of cycles for RTC_SLOW_CLK calibration"
  586. default 3000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256
  587. default 1024 if ESP32_RTC_CLK_SRC_INT_RC
  588. range 0 27000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256
  589. range 0 32766 if ESP32_RTC_CLK_SRC_INT_RC
  590. help
  591. When the startup code initializes RTC_SLOW_CLK, it can perform
  592. calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
  593. frequency. This option sets the number of RTC_SLOW_CLK cycles measured
  594. by the calibration routine. Higher numbers increase calibration
  595. precision, which may be important for applications which spend a lot of
  596. time in deep sleep. Lower numbers reduce startup time.
  597. When this option is set to 0, clock calibration will not be performed at
  598. startup, and approximate clock frequencies will be assumed:
  599. - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
  600. - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
  601. In case more value will help improve the definition of the launch of the crystal.
  602. If the crystal could not start, it will be switched to internal RC.
  603. config ESP32_RTC_XTAL_CAL_RETRY
  604. int "Number of attempts to repeat 32k XTAL calibration"
  605. default 1
  606. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  607. help
  608. Number of attempts to repeat 32k XTAL calibration
  609. before giving up and switching to the internal RC.
  610. Increase this option if the 32k crystal oscillator
  611. does not start and switches to internal RC.
  612. config ESP32_DEEP_SLEEP_WAKEUP_DELAY
  613. int "Extra delay in deep sleep wake stub (in us)"
  614. default 2000
  615. range 0 5000
  616. help
  617. When ESP32 exits deep sleep, the CPU and the flash chip are powered on
  618. at the same time. CPU will run deep sleep stub first, and then
  619. proceed to load code from flash. Some flash chips need sufficient
  620. time to pass between power on and first read operation. By default,
  621. without any extra delay, this time is approximately 900us, although
  622. some flash chip types need more than that.
  623. By default extra delay is set to 2000us. When optimizing startup time
  624. for applications which require it, this value may be reduced.
  625. If you are seeing "flash read err, 1000" message printed to the
  626. console after deep sleep reset, try increasing this value.
  627. choice ESP32_XTAL_FREQ_SEL
  628. prompt "Main XTAL frequency"
  629. default ESP32_XTAL_FREQ_40
  630. help
  631. ESP32 currently supports the following XTAL frequencies:
  632. - 26 MHz
  633. - 40 MHz
  634. Startup code can automatically estimate XTAL frequency. This feature
  635. uses the internal 8MHz oscillator as a reference. Because the internal
  636. oscillator frequency is temperature dependent, it is not recommended
  637. to use automatic XTAL frequency detection in applications which need
  638. to work at high ambient temperatures and use high-temperature
  639. qualified chips and modules.
  640. config ESP32_XTAL_FREQ_40
  641. bool "40 MHz"
  642. config ESP32_XTAL_FREQ_26
  643. bool "26 MHz"
  644. config ESP32_XTAL_FREQ_AUTO
  645. bool "Autodetect"
  646. endchoice
  647. # Keep these values in sync with rtc_xtal_freq_t enum in soc/rtc.h
  648. config ESP32_XTAL_FREQ
  649. int
  650. default 0 if ESP32_XTAL_FREQ_AUTO
  651. default 40 if ESP32_XTAL_FREQ_40
  652. default 26 if ESP32_XTAL_FREQ_26
  653. config ESP32_DISABLE_BASIC_ROM_CONSOLE
  654. bool "Permanently disable BASIC ROM Console"
  655. default n
  656. help
  657. If set, the first time the app boots it will disable the BASIC ROM Console
  658. permanently (by burning an eFuse).
  659. Otherwise, the BASIC ROM Console starts on reset if no valid bootloader is
  660. read from the flash.
  661. (Enabling secure boot also disables the BASIC ROM Console by default.)
  662. config ESP32_NO_BLOBS
  663. bool "No Binary Blobs"
  664. depends on !BT_ENABLED
  665. default n
  666. help
  667. If enabled, this disables the linking of binary libraries in the application build. Note
  668. that after enabling this Wi-Fi/Bluetooth will not work.
  669. config ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS
  670. bool "App compatible with bootloaders before ESP-IDF v2.1"
  671. select ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS
  672. default n
  673. help
  674. Bootloaders before ESP-IDF v2.1 did less initialisation of the
  675. system clock. This setting needs to be enabled to build an app
  676. which can be booted by these older bootloaders.
  677. If this setting is enabled, the app can be booted by any bootloader
  678. from IDF v1.0 up to the current version.
  679. If this setting is disabled, the app can only be booted by bootloaders
  680. from IDF v2.1 or newer.
  681. Enabling this setting adds approximately 1KB to the app's IRAM usage.
  682. config ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS
  683. bool "App compatible with bootloader and partition table before ESP-IDF v3.1"
  684. default n
  685. help
  686. Partition tables before ESP-IDF V3.1 do not contain an MD5 checksum
  687. field, and the bootloader before ESP-IDF v3.1 cannot read a partition
  688. table that contains an MD5 checksum field.
  689. Enable this option only if your app needs to boot on a bootloader and/or
  690. partition table that was generated from a version *before* ESP-IDF v3.1.
  691. If this option and Flash Encryption are enabled at the same time, and any
  692. data partitions in the partition table are marked Encrypted, then the
  693. partition encrypted flag should be manually verified in the app before accessing
  694. the partition (see CVE-2021-27926).
  695. config ESP32_APP_INIT_CLK
  696. bool
  697. default y if ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS
  698. default y if APP_BUILD_TYPE_ELF_RAM
  699. config ESP32_RTCDATA_IN_FAST_MEM
  700. bool "Place RTC_DATA_ATTR and RTC_RODATA_ATTR variables into RTC fast memory segment"
  701. default n
  702. depends on FREERTOS_UNICORE
  703. help
  704. This option allows to place .rtc_data and .rtc_rodata sections into
  705. RTC fast memory segment to free the slow memory region for ULP programs.
  706. This option depends on the CONFIG_FREERTOS_UNICORE option because RTC fast memory
  707. can be accessed only by PRO_CPU core.
  708. config ESP32_USE_FIXED_STATIC_RAM_SIZE
  709. bool "Use fixed static RAM size"
  710. default n
  711. help
  712. If this option is disabled, the DRAM part of the heap starts right after the .bss section,
  713. within the dram0_0 region. As a result, adding or removing some static variables
  714. will change the available heap size.
  715. If this option is enabled, the DRAM part of the heap starts right after the dram0_0 region,
  716. where its length is set with ESP32_FIXED_STATIC_RAM_SIZE
  717. config ESP32_FIXED_STATIC_RAM_SIZE
  718. hex "Fixed Static RAM size"
  719. default 0x1E000
  720. range 0 0x2c200
  721. depends on ESP32_USE_FIXED_STATIC_RAM_SIZE
  722. help
  723. RAM size dedicated for static variables (.data & .bss sections).
  724. Please note that the actual length will be reduced by BTDM_RESERVE_DRAM if Bluetooth
  725. controller is enabled.
  726. config ESP32_DPORT_DIS_INTERRUPT_LVL
  727. int "Disable the interrupt level for the DPORT workarounds"
  728. default 5
  729. help
  730. To prevent interrupting DPORT workarounds,
  731. need to disable interrupt with a maximum used level in the system.
  732. config ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
  733. bool "Enable IRAM as 8 bit accessible memory"
  734. depends on FREERTOS_UNICORE
  735. help
  736. If enabled, application can use IRAM as byte accessible region for storing data
  737. (Note: IRAM region cannot be used as task stack)
  738. This is possible due to handling of exceptions `LoadStoreError (3)` and `LoadStoreAlignmentError (9)`
  739. Each unaligned read/write access will incur a penalty of maximum of 167 CPU cycles.
  740. endmenu # ESP32-Specific