diff --git a/components/ulp/lp_core/shared/include/ulp_lp_core_cpu_freq_shared.h b/components/ulp/lp_core/shared/include/ulp_lp_core_cpu_freq_shared.h index 3c0970a6a77..b690a9186a1 100644 --- a/components/ulp/lp_core/shared/include/ulp_lp_core_cpu_freq_shared.h +++ b/components/ulp/lp_core/shared/include/ulp_lp_core_cpu_freq_shared.h @@ -6,13 +6,14 @@ #pragma once #include "sdkconfig.h" +#include "soc/clk_tree_defs.h" #include "soc/soc_caps.h" /* LP_FAST_CLK is not very accurate, for now use a rough estimate */ #if CONFIG_RTC_FAST_CLK_SRC_RC_FAST -#define LP_CORE_CPU_FREQUENCY_HZ 16000000U /* For P4 TRM says 20 MHz by default, but we tune it closer to 16 MHz */ -#define LP_CORE_CYCLES_PER_US_NUM 16U -#define LP_CORE_CYCLES_PER_US_DENOM 1U +#define LP_CORE_CPU_FREQUENCY_HZ SOC_CLK_RC_FAST_FREQ_APPROX +#define LP_CORE_CYCLES_PER_US_NUM (SOC_CLK_RC_FAST_FREQ_APPROX / 500000U) +#define LP_CORE_CYCLES_PER_US_DENOM 2U #elif CONFIG_RTC_FAST_CLK_SRC_XTAL #if SOC_XTAL_SUPPORT_48M #define LP_CORE_CPU_FREQUENCY_HZ 48000000U