Skip to content

Commit d83e4bc

Browse files
committed
Merge branch 'fix/trigger_system_reset_in_brownout_isr_v5.3' into 'release/v5.3'
change(esp_system): trigger digital system reset in brownout isr (v5.3) See merge request espressif/esp-idf!31683
2 parents 92c239d + 04429c9 commit d83e4bc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

components/esp_hw_support/port/esp32c6/rtc_clk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ soc_xtal_freq_t rtc_clk_xtal_freq_get(void)
362362
uint32_t xtal_freq_mhz = clk_ll_xtal_load_freq_mhz();
363363
if (xtal_freq_mhz == 0) {
364364
ESP_HW_LOGW(TAG, "invalid RTC_XTAL_FREQ_REG value, assume 40MHz");
365+
clk_ll_xtal_store_freq_mhz(SOC_XTAL_FREQ_40M);
365366
return SOC_XTAL_FREQ_40M;
366367
}
367368
return (soc_xtal_freq_t)xtal_freq_mhz;

components/esp_system/port/brownout.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -16,6 +16,7 @@
1616
#include "soc/soc.h"
1717
#include "soc/rtc_periph.h"
1818
#include "esp_attr.h"
19+
#include "esp_rom_sys.h"
1920
#include "bootloader_flash.h"
2021
#include "esp_intr_alloc.h"
2122
#include "hal/brownout_hal.h"
@@ -56,7 +57,10 @@ IRAM_ATTR static void rtc_brownout_isr_handler(void *arg)
5657
ESP_DRAM_LOGI(TAG, "Brownout detector was triggered\r\n\r\n");
5758
}
5859

59-
esp_restart_noos();
60+
esp_rom_software_reset_system();
61+
while (true) {
62+
;
63+
}
6064
}
6165
#endif // CONFIG_ESP_SYSTEM_BROWNOUT_INTR
6266

0 commit comments

Comments
 (0)