Kconfig 37 KB

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