mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 21:24:32 +02:00
esp32s2: Add a Kconfig option- Number of attempts to repeat 32k XTAL calibration
This commit is contained in:
committed by
bot
parent
a259746016
commit
df2ea2527f
@@ -457,6 +457,16 @@ menu "ESP32S2-specific"
|
|||||||
In case more value will help improve the definition of the launch of the crystal.
|
In case more value will help improve the definition of the launch of the crystal.
|
||||||
If the crystal could not start, it will be switched to internal RC.
|
If the crystal could not start, it will be switched to internal RC.
|
||||||
|
|
||||||
|
config ESP32S2_RTC_XTAL_CAL_RETRY
|
||||||
|
int "Number of attempts to repeat 32k XTAL calibration"
|
||||||
|
default 3
|
||||||
|
depends on ESP32S2_RTC_CLK_SRC_EXT_CRYS
|
||||||
|
help
|
||||||
|
Number of attempts to repeat 32k XTAL calibration
|
||||||
|
before giving up and switching to the internal RC.
|
||||||
|
Increase this option if the 32k crystal oscillator
|
||||||
|
does not start and switches to internal RC.
|
||||||
|
|
||||||
config ESP32S2_DISABLE_BASIC_ROM_CONSOLE
|
config ESP32S2_DISABLE_BASIC_ROM_CONSOLE
|
||||||
bool "Permanently disable BASIC ROM Console"
|
bool "Permanently disable BASIC ROM Console"
|
||||||
default n
|
default n
|
||||||
|
@@ -42,6 +42,12 @@
|
|||||||
*/
|
*/
|
||||||
#define SLOW_CLK_CAL_CYCLES CONFIG_ESP32S2_RTC_CLK_CAL_CYCLES
|
#define SLOW_CLK_CAL_CYCLES CONFIG_ESP32S2_RTC_CLK_CAL_CYCLES
|
||||||
|
|
||||||
|
#ifdef CONFIG_ESP32S2_RTC_XTAL_CAL_RETRY
|
||||||
|
#define RTC_XTAL_CAL_RETRY CONFIG_ESP32S2_RTC_XTAL_CAL_RETRY
|
||||||
|
#else
|
||||||
|
#define RTC_XTAL_CAL_RETRY 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MHZ (1000000)
|
#define MHZ (1000000)
|
||||||
|
|
||||||
/* Lower threshold for a reasonably-looking calibration value for a 32k XTAL.
|
/* Lower threshold for a reasonably-looking calibration value for a 32k XTAL.
|
||||||
@@ -148,11 +154,7 @@ static void select_rtc_slow_clk(slow_clk_sel_t slow_clk)
|
|||||||
/* number of times to repeat 32k XTAL calibration
|
/* number of times to repeat 32k XTAL calibration
|
||||||
* before giving up and switching to the internal RC
|
* before giving up and switching to the internal RC
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
int retry_32k_xtal = RTC_XTAL_CAL_RETRY;
|
||||||
int retry_32k_xtal = 1; /* don't change the behavior for the ESP32 */
|
|
||||||
#else
|
|
||||||
int retry_32k_xtal = 3;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (rtc_slow_freq == RTC_SLOW_FREQ_32K_XTAL) {
|
if (rtc_slow_freq == RTC_SLOW_FREQ_32K_XTAL) {
|
||||||
|
Reference in New Issue
Block a user