Kconfig 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. menu "ESP32C2-Specific"
  2. visible if IDF_TARGET_ESP32C2
  3. choice ESP32C2_DEFAULT_CPU_FREQ_MHZ
  4. prompt "CPU frequency"
  5. default ESP32C2_DEFAULT_CPU_FREQ_40 if IDF_ENV_FPGA
  6. default ESP32C2_DEFAULT_CPU_FREQ_120 if !IDF_ENV_FPGA
  7. help
  8. CPU frequency to be set on application startup.
  9. config ESP32C2_DEFAULT_CPU_FREQ_40
  10. bool "40 MHz"
  11. depends on IDF_ENV_FPGA
  12. config ESP32C2_DEFAULT_CPU_FREQ_80
  13. bool "80 MHz"
  14. config ESP32C2_DEFAULT_CPU_FREQ_120
  15. bool "120 MHz"
  16. endchoice
  17. config ESP32C2_DEFAULT_CPU_FREQ_MHZ
  18. int
  19. default 40 if ESP32C2_DEFAULT_CPU_FREQ_40
  20. default 80 if ESP32C2_DEFAULT_CPU_FREQ_80
  21. default 120 if ESP32C2_DEFAULT_CPU_FREQ_120
  22. menu "Cache config"
  23. choice ESP32C2_MMU_PAGE_SIZE
  24. # TODO: IDF-3821
  25. prompt "Cache page size"
  26. default ESP32C2_MMU_PAGE_SIZE_64KB
  27. help
  28. Cache page size to be set on application startup
  29. config ESP32C2_MMU_PAGE_SIZE_16KB
  30. bool "16KB"
  31. config ESP32C2_MMU_PAGE_SIZE_32KB
  32. bool "32KB"
  33. config ESP32C2_MMU_PAGE_SIZE_64KB
  34. bool "64KB"
  35. endchoice
  36. config ESP32C2_INSTRUCTION_CACHE_WRAP
  37. bool
  38. prompt "Instruction cache wrap"
  39. help
  40. If enabled, instruction cache will use wrap mode to read spi flash.
  41. The wrap length is fixed to 32B
  42. config ESP32C2_MMU_PAGE_MODE
  43. int
  44. default 0 if ESP32C2_MMU_PAGE_SIZE_16KB
  45. default 1 if ESP32C2_MMU_PAGE_SIZE_32KB
  46. default 2 if ESP32C2_MMU_PAGE_SIZE_64KB
  47. endmenu
  48. config ESP32C2_DEBUG_STUBS_ENABLE
  49. bool "OpenOCD debug stubs"
  50. default COMPILER_OPTIMIZATION_LEVEL_DEBUG
  51. depends on !ESP32C2_TRAX
  52. help
  53. Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging,
  54. e.g. GCOV data dump.
  55. choice ESP32C2_TIME_SYSCALL
  56. prompt "Timers used for gettimeofday function"
  57. default ESP32C2_TIME_SYSCALL_USE_RTC_SYSTIMER
  58. help
  59. This setting defines which hardware timers are used to
  60. implement 'gettimeofday' and 'time' functions in C library.
  61. - If both high-resolution (systimer) and RTC timers are used, timekeeping will
  62. continue in deep sleep. Time will be reported at 1 microsecond
  63. resolution. This is the default, and the recommended option.
  64. - If only high-resolution timer (systimer) is used, gettimeofday will
  65. provide time at microsecond resolution.
  66. Time will not be preserved when going into deep sleep mode.
  67. - If only RTC timer is used, timekeeping will continue in
  68. deep sleep, but time will be measured at 6.(6) microsecond
  69. resolution. Also the gettimeofday function itself may take
  70. longer to run.
  71. - If no timers are used, gettimeofday and time functions
  72. return -1 and set errno to ENOSYS.
  73. - When RTC is used for timekeeping, two RTC_STORE registers are
  74. used to keep time in deep sleep mode.
  75. config ESP32C2_TIME_SYSCALL_USE_RTC_SYSTIMER
  76. bool "RTC and high-resolution timer"
  77. select ESP_TIME_FUNCS_USE_RTC_TIMER
  78. select ESP_TIME_FUNCS_USE_ESP_TIMER
  79. config ESP32C2_TIME_SYSCALL_USE_RTC
  80. bool "RTC"
  81. select ESP_TIME_FUNCS_USE_RTC_TIMER
  82. config ESP32C2_TIME_SYSCALL_USE_SYSTIMER
  83. bool "High-resolution timer"
  84. select ESP_TIME_FUNCS_USE_ESP_TIMER
  85. config ESP32C2_TIME_SYSCALL_USE_NONE
  86. bool "None"
  87. select ESP_TIME_FUNCS_USE_NONE
  88. endchoice
  89. choice ESP32C2_RTC_CLK_SRC
  90. prompt "RTC clock source"
  91. default ESP32C2_RTC_CLK_SRC_INT_RC
  92. help
  93. Choose which clock is used as RTC clock source.
  94. config ESP32C2_RTC_CLK_SRC_INT_RC
  95. bool "Internal 150kHz RC oscillator"
  96. config ESP32C2_RTC_CLK_SRC_EXT_OSC
  97. bool "External 32kHz oscillator at 32K_XP pin"
  98. config ESP32C2_RTC_CLK_SRC_INT_8MD256
  99. bool "Internal 8MHz oscillator, divided by 256 (~32kHz)"
  100. endchoice
  101. config ESP32C2_RTC_CLK_CAL_CYCLES
  102. int "Number of cycles for RTC_SLOW_CLK calibration"
  103. default 3000 if ESP32C2_RTC_CLK_SRC_EXT_OSC || ESP32C2_RTC_CLK_SRC_INT_8MD256
  104. default 1024 if ESP32C2_RTC_CLK_SRC_INT_RC
  105. range 0 27000 if ESP32C2_RTC_CLK_SRC_EXT_OSC || ESP32C2_RTC_CLK_SRC_INT_8MD256
  106. range 0 32766 if ESP32C2_RTC_CLK_SRC_INT_RC
  107. help
  108. When the startup code initializes RTC_SLOW_CLK, it can perform
  109. calibration by comparing the RTC_SLOW_CLK frequency with main XTAL
  110. frequency. This option sets the number of RTC_SLOW_CLK cycles measured
  111. by the calibration routine. Higher numbers increase calibration
  112. precision, which may be important for applications which spend a lot of
  113. time in deep sleep. Lower numbers reduce startup time.
  114. When this option is set to 0, clock calibration will not be performed at
  115. startup, and approximate clock frequencies will be assumed:
  116. - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024.
  117. - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more.
  118. In case more value will help improve the definition of the launch of the crystal.
  119. If the crystal could not start, it will be switched to internal RC.
  120. config ESP32C2_LIGHTSLEEP_GPIO_RESET_WORKAROUND # IDF-3904
  121. bool "light sleep GPIO reset workaround"
  122. default y
  123. select PM_SLP_DISABLE_GPIO if FREERTOS_USE_TICKLESS_IDLE
  124. help
  125. ESP32C2 will reset at wake-up if GPIO is received a small electrostatic pulse during
  126. light sleep, with specific condition
  127. - GPIO needs to be configured as input-mode only
  128. - The pin receives a small electrostatic pulse, and reset occurs when the pulse
  129. voltage is higher than 6 V
  130. For GPIO set to input mode only, it is not a good practice to leave it open/floating,
  131. The hardware design needs to controlled it with determined supply or ground voltage
  132. is necessary.
  133. This option provides a software workaround for this issue. Configure to isolate all
  134. GPIO pins in sleep state.
  135. endmenu # ESP32C2-Specific