diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index b72ee7a7c4..0c68d09134 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -146,6 +146,11 @@ if(NOT non_os_build) if(CONFIG_SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX OR CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX) list(APPEND srcs "esp_clock_output.c") endif() + + if(CONFIG_SOC_BOD_SUPPORTED) + list(APPEND srcs "power_supply/brownout.c") + endif() + else() if(ESP_TEE_BUILD) list(APPEND srcs "esp_clk.c" "hw_random.c") @@ -156,7 +161,7 @@ endif() set(public_include_dirs "include" "include/soc" "include/soc/${target}" "dma/include" "ldo/include" "debug_probe/include" - "mspi_timing_tuning/include") + "mspi_timing_tuning/include" "power_supply/include") if(CONFIG_IDF_TARGET_ESP32H21) list(REMOVE_ITEM srcs diff --git a/components/esp_hw_support/Kconfig b/components/esp_hw_support/Kconfig index ef9d4f9c51..2fbfad0b40 100644 --- a/components/esp_hw_support/Kconfig +++ b/components/esp_hw_support/Kconfig @@ -247,6 +247,8 @@ menu "Hardware Settings" orsource "./port/$IDF_TARGET/Kconfig.ldo" + orsource "./power_supply/port/$IDF_TARGET/Kconfig.bod" + # Invisible bringup bypass options for esp_hw_support component config ESP_BRINGUP_BYPASS_CPU_CLK_SETTING bool diff --git a/components/esp_hw_support/port/esp32/Kconfig.hw_support b/components/esp_hw_support/port/esp32/Kconfig.hw_support index 732dc6cd49..d2fc9ef88a 100644 --- a/components/esp_hw_support/port/esp32/Kconfig.hw_support +++ b/components/esp_hw_support/port/esp32/Kconfig.hw_support @@ -12,7 +12,7 @@ choice ESP32_REV_MIN config ESP32_REV_MIN_0 bool "Rev v0.0 (ECO0)" # Brownout on Rev 0 is bugged, must use interrupt - select ESP_SYSTEM_BROWNOUT_INTR + select ESP_BROWNOUT_USE_INTR config ESP32_REV_MIN_1 bool "Rev v1.0 (ECO1)" config ESP32_REV_MIN_1_1 diff --git a/components/esp_system/port/brownout.c b/components/esp_hw_support/power_supply/brownout.c similarity index 76% rename from components/esp_system/port/brownout.c rename to components/esp_hw_support/power_supply/brownout.c index ffb59e12f5..aa20d8c46c 100644 --- a/components/esp_system/port/brownout.c +++ b/components/esp_hw_support/power_supply/brownout.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -25,6 +25,7 @@ #include "sdkconfig.h" #include "esp_rom_uart.h" #include "hal/uart_ll.h" +#include "soc/power_supply_periph.h" #if defined(CONFIG_ESP_BROWNOUT_DET_LVL) #define BROWNOUT_DET_LVL CONFIG_ESP_BROWNOUT_DET_LVL @@ -34,7 +35,7 @@ static __attribute__((unused)) DRAM_ATTR const char TAG[] = "BOD"; -#if CONFIG_ESP_SYSTEM_BROWNOUT_INTR +#if CONFIG_ESP_BROWNOUT_USE_INTR IRAM_ATTR static void rtc_brownout_isr_handler(void *arg) { /* Normally RTC ISR clears the interrupt flag after the application-supplied @@ -71,11 +72,11 @@ IRAM_ATTR static void rtc_brownout_isr_handler(void *arg) ESP_INFINITE_LOOP(); } -#endif // CONFIG_ESP_SYSTEM_BROWNOUT_INTR +#endif // CONFIG_ESP_BROWNOUT_USE_INTR void esp_brownout_init(void) { -#if CONFIG_ESP_SYSTEM_BROWNOUT_INTR +#if CONFIG_ESP_BROWNOUT_USE_INTR brownout_hal_config_t cfg = { .threshold = BROWNOUT_DET_LVL, .enabled = true, @@ -87,15 +88,12 @@ void esp_brownout_init(void) brownout_hal_config(&cfg); brownout_ll_intr_clear(); -#if SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE - // TODO IDF-6606: LP_RTC_TIMER interrupt source is shared by lp_timer and brownout detector, but lp_timer interrupt - // is not used now. An interrupt allocator is needed when lp_timer intr gets supported. - esp_intr_alloc_intrstatus(ETS_LP_RTC_TIMER_INTR_SOURCE, ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_SHARED, (uint32_t)brownout_ll_intr_get_status_reg(), BROWNOUT_DETECTOR_LL_INTERRUPT_MASK, &rtc_brownout_isr_handler, NULL, NULL); -#elif CONFIG_IDF_TARGET_ESP32P4 - esp_intr_alloc(ETS_LP_ANAPERI_INTR_SOURCE, ESP_INTR_FLAG_IRAM, &rtc_brownout_isr_handler, NULL, NULL); -#else +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 rtc_isr_register(rtc_brownout_isr_handler, NULL, RTC_CNTL_BROWN_OUT_INT_ENA_M, RTC_INTR_FLAG_IRAM); +#else + esp_intr_alloc_intrstatus(power_supply_periph_signal.irq, ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_SHARED, (uint32_t)brownout_ll_intr_get_status_reg(), BROWNOUT_DETECTOR_LL_INTERRUPT_MASK, &rtc_brownout_isr_handler, NULL, NULL); #endif + brownout_ll_intr_enable(true); #else // brownout without interrupt @@ -119,8 +117,8 @@ void esp_brownout_disable(void) }; brownout_hal_config(&cfg); -#if CONFIG_ESP_SYSTEM_BROWNOUT_INTR +#if CONFIG_ESP_BROWNOUT_USE_INTR brownout_ll_intr_enable(false); rtc_isr_deregister(rtc_brownout_isr_handler, NULL); -#endif // CONFIG_ESP_SYSTEM_BROWNOUT_INTR +#endif // CONFIG_ESP_BROWNOUT_USE_INTR } diff --git a/components/esp_hw_support/power_supply/include/esp_private/brownout.h b/components/esp_hw_support/power_supply/include/esp_private/brownout.h new file mode 100644 index 0000000000..eb9028ec50 --- /dev/null +++ b/components/esp_hw_support/power_supply/include/esp_private/brownout.h @@ -0,0 +1,35 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize the brownout detection system + * + * This function configures and enables the brownout detection hardware, which monitors + * the power supply voltage and triggers appropriate system actions if the voltage + * drops below a predefined threshold. Brownout detection helps ensure the stability + * and reliability of the system under low-voltage conditions. + */ +void esp_brownout_init(void); + +/** + * @brief Disable the brownout detection system + * + * This function disables the brownout detection hardware, stopping voltage monitoring + * and associated system actions. Use this function with caution, as disabling brownout + * detection may increase the risk of system instability or malfunction under low-voltage + * conditions. + */ +void esp_brownout_disable(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_hw_support/power_supply/port/esp32/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32/Kconfig.bod new file mode 100644 index 0000000000..b79c97eb6b --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32/Kconfig.bod @@ -0,0 +1,64 @@ +menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_0 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each ESP chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_0 + bool "2.43V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "2.48V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "2.58V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.62V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.67V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.70V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.77V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.80V +/- 0.05" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + Two occasions need to restart the chip with interrupt so far. + (1). For ESP32 version 1, brown-out reset function doesn't work (see ESP32 errata 3.4). + So that we must restart from interrupt. + (2). For special workflow, the chip needs do more things instead of restarting directly. This part + needs to be done in callback function of interrupt. + +endmenu diff --git a/components/esp_system/port/soc/esp32c2/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.bod similarity index 78% rename from components/esp_system/port/soc/esp32c2/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32c2/Kconfig.bod index 26c0ee743e..0d0fb822e7 100644 --- a/components/esp_system/port/soc/esp32c2/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32c2/Kconfig.bod @@ -42,4 +42,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_system/port/soc/esp32c3/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.bod similarity index 78% rename from components/esp_system/port/soc/esp32c3/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32c3/Kconfig.bod index c0944b84ee..19eb8e94d9 100644 --- a/components/esp_system/port/soc/esp32c3/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32c3/Kconfig.bod @@ -42,4 +42,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_system/port/soc/esp32c5/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.bod similarity index 78% rename from components/esp_system/port/soc/esp32c5/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32c5/Kconfig.bod index 50a039717d..4583c6bee3 100644 --- a/components/esp_system/port/soc/esp32c5/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32c5/Kconfig.bod @@ -42,4 +42,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_system/port/soc/esp32c6/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.bod similarity index 78% rename from components/esp_system/port/soc/esp32c6/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32c6/Kconfig.bod index 1427bb2521..5c3d440e83 100644 --- a/components/esp_system/port/soc/esp32c6/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32c6/Kconfig.bod @@ -42,4 +42,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_system/port/soc/esp32c61/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.bod similarity index 78% rename from components/esp_system/port/soc/esp32c61/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32c61/Kconfig.bod index cc01c03f10..f1b083e18a 100644 --- a/components/esp_system/port/soc/esp32c61/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32c61/Kconfig.bod @@ -42,4 +42,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_system/port/soc/esp32h2/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.bod similarity index 80% rename from components/esp_system/port/soc/esp32h2/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32h2/Kconfig.bod index c76dcd88b4..d0a38ee74f 100644 --- a/components/esp_system/port/soc/esp32h2/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32h2/Kconfig.bod @@ -48,4 +48,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_system/port/soc/esp32h21/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.bod similarity index 80% rename from components/esp_system/port/soc/esp32h21/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32h21/Kconfig.bod index eacf17eca6..61eca9bba6 100644 --- a/components/esp_system/port/soc/esp32h21/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32h21/Kconfig.bod @@ -48,4 +48,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_system/port/soc/esp32p4/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.bod similarity index 76% rename from components/esp_system/port/soc/esp32p4/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32p4/Kconfig.bod index 02a1c4acd1..14a7a2dc23 100644 --- a/components/esp_system/port/soc/esp32p4/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32p4/Kconfig.bod @@ -36,4 +36,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.bod b/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.bod new file mode 100644 index 0000000000..d7103f235c --- /dev/null +++ b/components/esp_hw_support/power_supply/port/esp32s2/Kconfig.bod @@ -0,0 +1,59 @@ +menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-S2 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_7 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each ESP3-S2 chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.44V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.56V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.67V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.84V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.98V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.19V" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "3.30V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + +endmenu diff --git a/components/esp_system/port/soc/esp32s3/Kconfig.system b/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.bod similarity index 79% rename from components/esp_system/port/soc/esp32s3/Kconfig.system rename to components/esp_hw_support/power_supply/port/esp32s3/Kconfig.bod index 9d54d3a40d..6db64c1147 100644 --- a/components/esp_system/port/soc/esp32s3/Kconfig.system +++ b/components/esp_hw_support/power_supply/port/esp32s3/Kconfig.bod @@ -46,4 +46,14 @@ menu "Brownout Detector" default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + config ESP_BROWNOUT_USE_INTR + bool + default n + help + This config allows to trigger an interrupt when brownout detected. Software restart will be done + at the end of the default callback. + This is because for some special workflow, the chip needs do more things when brownout happens + before restart instead of restarting directly. This part needs to be done in callback function + of interrupt. + endmenu diff --git a/components/esp_hw_support/sdkconfig.rename b/components/esp_hw_support/sdkconfig.rename index efc2e1f820..7addeba065 100644 --- a/components/esp_hw_support/sdkconfig.rename +++ b/components/esp_hw_support/sdkconfig.rename @@ -6,3 +6,4 @@ CONFIG_TWO_UNIVERSAL_MAC_ADDRESS CONFIG_ESP32_UNIVERSAL_M CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR CONFIG_ESP_SYSTEM_PD_FLASH CONFIG_ESP_SLEEP_POWER_DOWN_FLASH +CONFIG_ESP_SYSTEM_BROWNOUT_INTR CONFIG_ESP_BROWNOUT_USE_INTR diff --git a/components/esp_system/Kconfig b/components/esp_system/Kconfig index 136d4616fc..282eade65f 100644 --- a/components/esp_system/Kconfig +++ b/components/esp_system/Kconfig @@ -583,19 +583,7 @@ menu "ESP System Settings" endchoice # Insert chip-specific system config - rsource "./port/soc/$IDF_TARGET/Kconfig.system" - - config ESP_SYSTEM_BROWNOUT_INTR - bool - default n - help - This config allows to trigger an interrupt when brownout detected. Software restart will be done - at the end of the default callback. - Two occasions need to restart the chip with interrupt so far. - (1). For ESP32 version 1, brown-out reset function doesn't work (see ESP32 errata 3.4). - So that we must restart from interrupt. - (2). For special workflow, the chip needs do more things instead of restarting directly. This part - needs to be done in callback function of interrupt. + orsource "./port/soc/$IDF_TARGET/Kconfig.system" config ESP_SYSTEM_HW_STACK_GUARD bool "Hardware stack guard" diff --git a/components/esp_system/port/CMakeLists.txt b/components/esp_system/port/CMakeLists.txt index 05a476f8cf..8ba4c6fce8 100644 --- a/components/esp_system/port/CMakeLists.txt +++ b/components/esp_system/port/CMakeLists.txt @@ -12,10 +12,6 @@ if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP) list(APPEND srcs "image_process.c") endif() -if(CONFIG_SOC_BOD_SUPPORTED) - list(APPEND srcs "brownout.c") -endif() - if(CONFIG_ESP_CONSOLE_USB_CDC) list(APPEND srcs "usb_console.c") endif() diff --git a/components/esp_system/port/include/private/esp_private/brownout.h b/components/esp_system/port/include/private/esp_private/brownout.h deleted file mode 100644 index 23eb46f3f6..0000000000 --- a/components/esp_system/port/include/private/esp_private/brownout.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef __ESP_BROWNOUT_H -#define __ESP_BROWNOUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -void esp_brownout_init(void); - -void esp_brownout_disable(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/components/esp_system/port/soc/esp32/Kconfig.system b/components/esp_system/port/soc/esp32/Kconfig.system index 26cbcddfd7..3dc704fe5e 100644 --- a/components/esp_system/port/soc/esp32/Kconfig.system +++ b/components/esp_system/port/soc/esp32/Kconfig.system @@ -1,56 +1,3 @@ -menu "Brownout Detector" - - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - default ESP_BROWNOUT_DET_LVL_SEL_0 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each ESP chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP_BROWNOUT_DET_LVL_SEL_0 - bool "2.43V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_1 - bool "2.48V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "2.58V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.62V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.67V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.70V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.77V +/- 0.05" - config ESP_BROWNOUT_DET_LVL_SEL_7 - bool "2.80V +/- 0.05" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 - default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 - default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 - -endmenu - config ESP32_DISABLE_BASIC_ROM_CONSOLE bool "Permanently disable BASIC ROM Console" default n diff --git a/components/esp_system/port/soc/esp32s2/Kconfig.system b/components/esp_system/port/soc/esp32s2/Kconfig.system index d31ee4eff3..229ff1cbf7 100644 --- a/components/esp_system/port/soc/esp32s2/Kconfig.system +++ b/components/esp_system/port/soc/esp32s2/Kconfig.system @@ -1,53 +1,3 @@ -menu "Brownout Detector" - - config ESP_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-S2 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP_BROWNOUT_DET - default ESP_BROWNOUT_DET_LVL_SEL_7 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each ESP3-S2 chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP_BROWNOUT_DET_LVL_SEL_7 - bool "2.44V" - config ESP_BROWNOUT_DET_LVL_SEL_6 - bool "2.56V" - config ESP_BROWNOUT_DET_LVL_SEL_5 - bool "2.67V" - config ESP_BROWNOUT_DET_LVL_SEL_4 - bool "2.84V" - config ESP_BROWNOUT_DET_LVL_SEL_3 - bool "2.98V" - config ESP_BROWNOUT_DET_LVL_SEL_2 - bool "3.19V" - config ESP_BROWNOUT_DET_LVL_SEL_1 - bool "3.30V" - endchoice - - config ESP_BROWNOUT_DET_LVL - int - default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 - default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 - -endmenu - config ESP32S2_KEEP_USB_ALIVE bool "Keep USB peripheral enabled at start up" if !ESP_CONSOLE_USB_CDC default y if ESP_CONSOLE_USB_CDC diff --git a/components/hal/esp32p4/include/hal/brownout_ll.h b/components/hal/esp32p4/include/hal/brownout_ll.h index 96224c63ad..9f13dde6af 100644 --- a/components/hal/esp32p4/include/hal/brownout_ll.h +++ b/components/hal/esp32p4/include/hal/brownout_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -20,6 +20,7 @@ #include "hal/efuse_hal.h" #include "soc/chip_revision.h" +#define BROWNOUT_DETECTOR_LL_INTERRUPT_MASK (BIT(31)) #define BROWNOUT_DETECTOR_LL_FIB_ENABLE (BIT(1)) #ifdef __cplusplus @@ -138,6 +139,16 @@ static inline void brownout_ll_clear_count(void) LP_ANA_PERI.bod_mode0_cntl.bod_mode0_cnt_clr = 0; } +/** + * @brief Get interrupt status register address + * + * @return Register address + */ +static inline volatile void *brownout_ll_intr_get_status_reg(void) +{ + return &LP_ANA_PERI.int_st; +} + #ifdef __cplusplus } #endif diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index 032467798f..01ec2bf601 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -169,6 +169,10 @@ if(CONFIG_SOC_LCDCAM_CAM_SUPPORTED) list(APPEND srcs "${target_folder}/cam_periph.c") endif() +if(CONFIG_SOC_BOD_SUPPORTED) + list(APPEND srcs "${target_folder}/power_supply_periph.c") +endif() + idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${includes} LDFRAGMENTS "linker.lf") diff --git a/components/soc/esp32/power_supply_periph.c b/components/soc/esp32/power_supply_periph.c new file mode 100644 index 0000000000..95498a03d5 --- /dev/null +++ b/components/soc/esp32/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_RTC_CORE_INTR_SOURCE, +}; diff --git a/components/soc/esp32c2/power_supply_periph.c b/components/soc/esp32c2/power_supply_periph.c new file mode 100644 index 0000000000..95498a03d5 --- /dev/null +++ b/components/soc/esp32c2/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_RTC_CORE_INTR_SOURCE, +}; diff --git a/components/soc/esp32c3/power_supply_periph.c b/components/soc/esp32c3/power_supply_periph.c new file mode 100644 index 0000000000..95498a03d5 --- /dev/null +++ b/components/soc/esp32c3/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_RTC_CORE_INTR_SOURCE, +}; diff --git a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in index ab8f9af03c..4d7cfaf710 100644 --- a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in @@ -1215,10 +1215,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI int default 16 -config SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE - bool - default y - config SOC_TIMER_GROUPS int default 2 diff --git a/components/soc/esp32c5/include/soc/soc_caps.h b/components/soc/esp32c5/include/soc/soc_caps.h index 6be9296b1a..911977a2ed 100644 --- a/components/soc/esp32c5/include/soc/soc_caps.h +++ b/components/soc/esp32c5/include/soc/soc_caps.h @@ -485,7 +485,6 @@ /*-------------------------- LP_TIMER CAPS ----------------------------------*/ #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part -#define SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE 1 //LP timer and brownout detector share the interrupt source /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ #define SOC_TIMER_GROUPS (2) diff --git a/components/soc/esp32c5/power_supply_periph.c b/components/soc/esp32c5/power_supply_periph.c new file mode 100644 index 0000000000..d9b2bac962 --- /dev/null +++ b/components/soc/esp32c5/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, +}; diff --git a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in index 3bf5bc0a9b..d74c870750 100644 --- a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in @@ -1155,10 +1155,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI int default 16 -config SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE - bool - default y - config SOC_TIMER_GROUPS int default 2 diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index 3ee6497421..0fca54482c 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -450,7 +450,6 @@ /*-------------------------- LP_TIMER CAPS ----------------------------------*/ #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part -#define SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE 1 //LP timer and brownout detector share the interrupt source /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ #define SOC_TIMER_GROUPS (2) diff --git a/components/soc/esp32c6/power_supply_periph.c b/components/soc/esp32c6/power_supply_periph.c new file mode 100644 index 0000000000..d9b2bac962 --- /dev/null +++ b/components/soc/esp32c6/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, +}; diff --git a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in index 16ba6a9807..d5a23d2cce 100644 --- a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in @@ -875,10 +875,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI int default 16 -config SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE - bool - default y - config SOC_TIMER_GROUPS int default 2 diff --git a/components/soc/esp32c61/include/soc/soc_caps.h b/components/soc/esp32c61/include/soc/soc_caps.h index 1613cd91f7..e9c42dafa7 100644 --- a/components/soc/esp32c61/include/soc/soc_caps.h +++ b/components/soc/esp32c61/include/soc/soc_caps.h @@ -363,7 +363,6 @@ /*-------------------------- LP_TIMER CAPS ----------------------------------*/ #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part -#define SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE 1 //LP timer and brownout detector share the interrupt source /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ #define SOC_TIMER_GROUPS (2) diff --git a/components/soc/esp32c61/power_supply_periph.c b/components/soc/esp32c61/power_supply_periph.c new file mode 100644 index 0000000000..d9b2bac962 --- /dev/null +++ b/components/soc/esp32c61/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, +}; diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index 3336ff98a2..502bd5da43 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -1155,10 +1155,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI int default 16 -config SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE - bool - default y - config SOC_TIMER_GROUPS int default 2 diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index 249e937ef0..5f98f6542b 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -447,7 +447,6 @@ /*-------------------------- LP_TIMER CAPS ----------------------------------*/ #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part -#define SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE 1 //LP timer and brownout detector share the interrupt source /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ #define SOC_TIMER_GROUPS (2) diff --git a/components/soc/esp32h2/power_supply_periph.c b/components/soc/esp32h2/power_supply_periph.c new file mode 100644 index 0000000000..d9b2bac962 --- /dev/null +++ b/components/soc/esp32h2/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, +}; diff --git a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in index ffe58f6947..38497a77e4 100644 --- a/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h21/include/soc/Kconfig.soc_caps.in @@ -447,10 +447,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI int default 16 -config SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE - bool - default y - config SOC_TIMER_GROUPS int default 2 diff --git a/components/soc/esp32h21/include/soc/soc_caps.h b/components/soc/esp32h21/include/soc/soc_caps.h index 2f5f4bbe30..ab40d193d2 100644 --- a/components/soc/esp32h21/include/soc/soc_caps.h +++ b/components/soc/esp32h21/include/soc/soc_caps.h @@ -429,7 +429,6 @@ /*-------------------------- LP_TIMER CAPS ----------------------------------*/ #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part -#define SOC_LP_TIMER_BOD_SHARE_INTR_SOURCE 1 //LP timer and brownout detector share the interrupt source /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ #define SOC_TIMER_GROUPS (2) diff --git a/components/soc/esp32h21/power_supply_periph.c b/components/soc/esp32h21/power_supply_periph.c new file mode 100644 index 0000000000..d9b2bac962 --- /dev/null +++ b/components/soc/esp32h21/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_LP_RTC_TIMER_INTR_SOURCE, +}; diff --git a/components/soc/esp32p4/power_supply_periph.c b/components/soc/esp32p4/power_supply_periph.c new file mode 100644 index 0000000000..172b4f6589 --- /dev/null +++ b/components/soc/esp32p4/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_LP_ANAPERI_INTR_SOURCE, +}; diff --git a/components/soc/esp32s2/power_supply_periph.c b/components/soc/esp32s2/power_supply_periph.c new file mode 100644 index 0000000000..95498a03d5 --- /dev/null +++ b/components/soc/esp32s2/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_RTC_CORE_INTR_SOURCE, +}; diff --git a/components/soc/esp32s3/power_supply_periph.c b/components/soc/esp32s3/power_supply_periph.c new file mode 100644 index 0000000000..95498a03d5 --- /dev/null +++ b/components/soc/esp32s3/power_supply_periph.c @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/power_supply_periph.h" + +const power_supply_signal_conn_t power_supply_periph_signal = { + .irq = ETS_RTC_CORE_INTR_SOURCE, +}; diff --git a/components/soc/include/soc/power_supply_periph.h b/components/soc/include/soc/power_supply_periph.h new file mode 100644 index 0000000000..d87985639f --- /dev/null +++ b/components/soc/include/soc/power_supply_periph.h @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "soc/interrupts.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + const uint8_t irq; +} power_supply_signal_conn_t; + +extern const power_supply_signal_conn_t power_supply_periph_signal; + +#ifdef __cplusplus +} +#endif diff --git a/components/spi_flash/Kconfig b/components/spi_flash/Kconfig index 9fd4dc21f8..d1ea63f049 100644 --- a/components/spi_flash/Kconfig +++ b/components/spi_flash/Kconfig @@ -16,7 +16,7 @@ menu "Main Flash configuration" config SPI_FLASH_BROWNOUT_RESET bool default y - select ESP_SYSTEM_BROWNOUT_INTR + select ESP_BROWNOUT_USE_INTR help When brownout happens during flash erase/write operations, send reset command to stop the flash operations to improve stability. diff --git a/tools/test_apps/system/esp_intr_dump/expected_output/esp32p4.txt b/tools/test_apps/system/esp_intr_dump/expected_output/esp32p4.txt index 653010b71e..297f58ab9a 100644 --- a/tools/test_apps/system/esp_intr_dump/expected_output/esp32p4.txt +++ b/tools/test_apps/system/esp_intr_dump/expected_output/esp32p4.txt @@ -1,6 +1,6 @@ CPU 0 interrupt status: Int Level Type Status - 0 1 Level Used: LP_ANAPERI + 0 1 Level Shared: LP_ANAPERI 1 1 Level Used: CPU_INT_FROM_CPU_0 2 1 Level Used: SYSTIMER_TARGET0 3 1 Level Used: TG0_WDT_LEVEL @@ -67,3 +67,4 @@ CPU 1 interrupt status: 30 * * Free 31 * * Free Interrupts available for general use: 47 +Shared interrupts: 1