Kconfig 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. menu "Hardware Settings"
  2. orsource "./port/$IDF_TARGET/Kconfig.spiram"
  3. menu "MAC Config"
  4. config ESP_MAC_ADDR_UNIVERSE_WIFI_STA
  5. bool
  6. config ESP_MAC_ADDR_UNIVERSE_WIFI_AP
  7. bool
  8. config ESP_MAC_ADDR_UNIVERSE_BT
  9. bool
  10. config ESP_MAC_ADDR_UNIVERSE_ETH
  11. bool
  12. # Insert chip-specific MAC config
  13. rsource "./port/$IDF_TARGET/Kconfig.mac"
  14. endmenu
  15. menu "Sleep Config"
  16. # This is here since this option affect behavior of esp_light_sleep_start
  17. # regardless of power management configuration.
  18. config ESP_SLEEP_POWER_DOWN_FLASH
  19. bool "Power down flash in light sleep when there is no SPIRAM"
  20. depends on !SPIRAM
  21. default n
  22. help
  23. If enabled, chip will try to power down flash as part of esp_light_sleep_start(), which costs
  24. more time when chip wakes up. Can only be enabled if there is no SPIRAM configured.
  25. This option will power down flash under a strict but relatively safe condition. Also, it is possible to
  26. power down flash under a relaxed condition by using esp_sleep_pd_config() to set ESP_PD_DOMAIN_VDDSDIO
  27. to ESP_PD_OPTION_OFF. It should be noted that there is a risk in powering down flash, you can refer
  28. `ESP-IDF Programming Guide/API Reference/System API/Sleep Modes/Power-down of Flash` for more details.
  29. config ESP_SLEEP_RTC_BUS_ISO_WORKAROUND
  30. bool
  31. default y if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
  32. config ESP_SLEEP_GPIO_RESET_WORKAROUND
  33. bool "light sleep GPIO reset workaround"
  34. default y if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
  35. select PM_SLP_DISABLE_GPIO if FREERTOS_USE_TICKLESS_IDLE
  36. help
  37. esp32c2, esp32c3 and esp32s3 will reset at wake-up if GPIO is received a small electrostatic
  38. pulse during light sleep, with specific condition
  39. - GPIO needs to be configured as input-mode only
  40. - The pin receives a small electrostatic pulse, and reset occurs when the pulse
  41. voltage is higher than 6 V
  42. For GPIO set to input mode only, it is not a good practice to leave it open/floating,
  43. The hardware design needs to controlled it with determined supply or ground voltage
  44. is necessary.
  45. This option provides a software workaround for this issue. Configure to isolate all
  46. GPIO pins in sleep state.
  47. config ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND
  48. bool "PSRAM leakage current workaround in light sleep"
  49. depends on SPIRAM
  50. default y
  51. help
  52. When the CS pin of SPIRAM is not pulled up, the sleep current will
  53. increase during light sleep. If the CS pin of SPIRAM has an external
  54. pull-up, you do not need to select this option, otherwise, you
  55. should enable this option.
  56. config ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
  57. bool "Flash leakage current workaround in light sleep"
  58. default y
  59. help
  60. When the CS pin of Flash is not pulled up, the sleep current will
  61. increase during light sleep. If the CS pin of Flash has an external
  62. pull-up, you do not need to select this option, otherwise, you
  63. should enable this option.
  64. config ESP_SLEEP_MSPI_NEED_ALL_IO_PU
  65. bool "All pins of mspi need pull up"
  66. depends on ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND || ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND
  67. default y if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32S3
  68. help
  69. To reduce leakage current, some types of SPI Flash/RAM only need to pull up the CS pin
  70. during light sleep. But there are also some kinds of SPI Flash/RAM that need to pull up
  71. all pins. It depends on the SPI Flash/RAM chip used.
  72. config ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY
  73. int "Extra delay in deep sleep wake stub (in us)"
  74. depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3
  75. default 2000
  76. range 0 5000
  77. help
  78. When the chip exits deep sleep, the CPU and the flash chip are powered on
  79. at the same time. CPU will run deep sleep stub first, and then
  80. proceed to load code from flash. Some flash chips need sufficient
  81. time to pass between power on and first read operation. By default,
  82. without any extra delay, this time is approximately 900us, although
  83. some flash chip types need more than that.
  84. By default extra delay is set to 2000us. When optimizing startup time
  85. for applications which require it, this value may be reduced.
  86. If you are seeing "flash read err, 1000" message printed to the
  87. console after deep sleep reset, try increasing this value.
  88. endmenu
  89. menu "RTC Clock Config"
  90. orsource "./port/$IDF_TARGET/Kconfig.rtc"
  91. config RTC_CLOCK_BBPLL_POWER_ON_WITH_USB
  92. # This is used for configure the RTC clock.
  93. bool "Keep BBPLL clock always work"
  94. depends on ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
  95. default y
  96. help
  97. When the chip goes sleep or software reset, the clock source would change to XTAL
  98. and switch off the BBPLL clock for saving power. However, this might make the
  99. USB_SERIAL_JTAG down which depends on BBPLL as its unique clock source.
  100. Therefore, this is used for keeping bbpll clock always on when USB_SERIAL_JTAG PORT is using.
  101. If you want to use USB_SERIAL_JTAG under sw_reset case or sleep-wakeup case, you shoule select
  102. this option. But be aware that this might increase the power consumption.
  103. endmenu
  104. menu "Peripheral Control"
  105. config PERIPH_CTRL_FUNC_IN_IRAM
  106. bool "Place peripheral control functions into IRAM"
  107. default n
  108. help
  109. Place peripheral control functions (e.g. periph_module_reset) into IRAM,
  110. so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context.
  111. endmenu
  112. menu "MMU Config"
  113. # This Config is used for configure the MMU.
  114. # Be configured based on flash size selection.
  115. # Invisible to users.
  116. config MMU_PAGE_SIZE_16KB
  117. bool
  118. default y if IDF_TARGET_ESP32C2 && ESPTOOLPY_FLASHSIZE_1MB
  119. default n
  120. config MMU_PAGE_SIZE_32KB
  121. bool
  122. default y if IDF_TARGET_ESP32C2 && ESPTOOLPY_FLASHSIZE_2MB
  123. default n
  124. config MMU_PAGE_SIZE_64KB
  125. bool
  126. default y if !MMU_PAGE_SIZE_32KB && !MMU_PAGE_SIZE_16KB
  127. default n
  128. config MMU_PAGE_MODE
  129. string
  130. default "16KB" if MMU_PAGE_SIZE_16KB
  131. default "32KB" if MMU_PAGE_SIZE_32KB
  132. default "64KB" if MMU_PAGE_SIZE_64KB
  133. config MMU_PAGE_SIZE
  134. # Some chips support different flash MMU page sizes: 64k, 32k, 16k.
  135. # Since the number of MMU pages is limited, the maximum flash size supported
  136. # for each page size is reduced proportionally: 4 MB, 2MB, 1MB. To make best
  137. # use of small flash sizes (reducing the wasted space due to alignment), we
  138. # need to use the smallest possible MMU page size for the given flash size.
  139. hex
  140. default 0x4000 if MMU_PAGE_SIZE_16KB
  141. default 0x8000 if MMU_PAGE_SIZE_32KB
  142. default 0x10000 if MMU_PAGE_SIZE_64KB
  143. endmenu
  144. # Insert chip-specific HW config
  145. orsource "./port/$IDF_TARGET/Kconfig.hw_support"
  146. menu "GDMA Configuration"
  147. depends on SOC_GDMA_SUPPORTED
  148. config GDMA_CTRL_FUNC_IN_IRAM
  149. bool "Place GDMA control functions into IRAM"
  150. default n
  151. help
  152. Place GDMA control functions (like start/stop/append/reset) into IRAM,
  153. so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context.
  154. Enabling this option can improve driver performance as well.
  155. config GDMA_ISR_IRAM_SAFE
  156. bool "GDMA ISR IRAM-Safe"
  157. default n
  158. help
  159. This will ensure the GDMA interrupt handler is IRAM-Safe, allow to avoid flash
  160. cache misses, and also be able to run whilst the cache is disabled.
  161. (e.g. SPI Flash write).
  162. endmenu # GDMA Configuration
  163. menu "Main XTAL Config"
  164. choice XTAL_FREQ_SEL
  165. prompt "Main XTAL frequency"
  166. default XTAL_FREQ_40 if SOC_XTAL_SUPPORT_40M
  167. help
  168. This option selects the operating frequency of the XTAL (crystal) clock used to drive the ESP target.
  169. The selected value MUST reflect the frequency of the given hardware.
  170. Note: The XTAL_FREQ_AUTO option allows the ESP target to automatically estimating XTAL clock's
  171. operating frequency. However, this feature is only supported on the ESP32. The ESP32 uses the
  172. internal 8MHZ as a reference when estimating. Due to the internal oscillator's frequency being
  173. temperature dependent, usage of the XTAL_FREQ_AUTO is not recommended in applications that operate
  174. in high ambient temperatures or use high-temperature qualified chips and modules.
  175. config XTAL_FREQ_24
  176. depends on SOC_XTAL_SUPPORT_24M
  177. bool "24 MHz"
  178. config XTAL_FREQ_26
  179. depends on SOC_XTAL_SUPPORT_26M
  180. bool "26 MHz"
  181. config XTAL_FREQ_32
  182. depends on SOC_XTAL_SUPPORT_32M
  183. bool "32 MHz"
  184. config XTAL_FREQ_40
  185. depends on SOC_XTAL_SUPPORT_40M
  186. bool "40 MHz"
  187. config XTAL_FREQ_AUTO
  188. depends on SOC_XTAL_SUPPORT_AUTO_DETECT
  189. bool "Autodetect"
  190. endchoice
  191. # rtc_xtal_freq_t enum in soc/rtc.h lists the XTAL frequencies can be supported
  192. # SOC_XTAL_SUPPORT_XXX in soc_caps.h lists the XTAL frequencies already supported
  193. config XTAL_FREQ
  194. int
  195. default 24 if XTAL_FREQ_24
  196. default 26 if XTAL_FREQ_26
  197. default 32 if XTAL_FREQ_32
  198. default 40 if XTAL_FREQ_40
  199. default 0 if XTAL_FREQ_AUTO
  200. endmenu
  201. endmenu