mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 21:54:33 +02:00
Merge branch 'bugfix/esp32h2_print_wrong_cpu_rate' into 'master'
clk: fix esp32h2 print wrong CPU frequency See merge request espressif/esp-idf!15942
This commit is contained in:
@@ -71,7 +71,7 @@ int IRAM_ATTR esp_clk_cpu_freq(void)
|
|||||||
|
|
||||||
int IRAM_ATTR esp_clk_apb_freq(void)
|
int IRAM_ATTR esp_clk_apb_freq(void)
|
||||||
{
|
{
|
||||||
return MIN(s_get_cpu_freq_mhz(), 80) * MHZ;
|
return MIN(s_get_cpu_freq_mhz() * MHZ, APB_CLK_FREQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
int IRAM_ATTR esp_clk_xtal_freq(void)
|
int IRAM_ATTR esp_clk_xtal_freq(void)
|
||||||
|
@@ -232,6 +232,7 @@ void rtc_clk_cpu_freq_set_config(const rtc_cpu_freq_config_t *config)
|
|||||||
uint32_t src_freq_mhz = root_clk_slt(config->source);
|
uint32_t src_freq_mhz = root_clk_slt(config->source);
|
||||||
uint32_t div = src_freq_mhz / (config->freq_mhz);
|
uint32_t div = src_freq_mhz / (config->freq_mhz);
|
||||||
rtc_clk_cpu_freq_set(config->source, div);
|
rtc_clk_cpu_freq_set(config->source, div);
|
||||||
|
ets_update_cpu_frequency(config->freq_mhz);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtc_clk_cpu_freq_get_config(rtc_cpu_freq_config_t *out_config)
|
void rtc_clk_cpu_freq_get_config(rtc_cpu_freq_config_t *out_config)
|
||||||
|
@@ -374,7 +374,7 @@ static void start_cpu0_default(void)
|
|||||||
|
|
||||||
ESP_EARLY_LOGI(TAG, "Pro cpu start user code");
|
ESP_EARLY_LOGI(TAG, "Pro cpu start user code");
|
||||||
int cpu_freq = esp_clk_cpu_freq();
|
int cpu_freq = esp_clk_cpu_freq();
|
||||||
ESP_EARLY_LOGI(TAG, "cpu freq: %d", cpu_freq);
|
ESP_EARLY_LOGI(TAG, "cpu freq: %d Hz", cpu_freq);
|
||||||
|
|
||||||
// Display information about the current running image.
|
// Display information about the current running image.
|
||||||
if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) {
|
if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) {
|
||||||
|
Reference in New Issue
Block a user