fix(esp_system): update cache livelock workaround bind to interrupt WDT configuration

This commit is contained in:
wuzhenghui
2026-06-02 17:31:11 +08:00
parent 9cede1d920
commit f34f07ba07
6 changed files with 16 additions and 13 deletions
@@ -36,7 +36,7 @@ void esp_int_wdt_init(void);
*/
void esp_int_wdt_cpu_init(void);
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#if CONFIG_ESP_INT_WDT && CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
/**
* @brief Reconfigure WDT stage timeouts (ticks).
*
+4 -4
View File
@@ -29,7 +29,7 @@
#include "esp_private/sleep_retention.h"
#endif
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#if CONFIG_ESP_INT_WDT && CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#include "esp_private/eco3_livelock_workaround.h"
#endif
@@ -102,7 +102,7 @@ static void ESP_SYSTEM_IRAM_ATTR reconfigure_ticks(uint32_t stage0_ticks, uint32
wdt_hal_write_protect_enable(&iwdt_context);
}
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#if CONFIG_ESP_INT_WDT && CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
static portMUX_TYPE s_iwdt_configure_lock = portMUX_INITIALIZER_UNLOCKED;
void ESP_SYSTEM_IRAM_ATTR esp_int_wdt_reconfigure_ticks(uint32_t stage0_ticks, uint32_t stage1_ticks)
{
@@ -131,7 +131,7 @@ static void ESP_SYSTEM_IRAM_ATTR tick_hook(void)
return;
}
#endif
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#if CONFIG_ESP_INT_WDT && CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
esp_int_wdt_set_livelock_params(CONFIG_ESP_INT_WDT_TIMEOUT_MS);
esp_int_wdt_reconfigure_ticks(esp_int_wdt_livelock_get_feed_stage0_ticks(), IWDT_STAGE1_TIMEOUT_US);
#else
@@ -163,7 +163,7 @@ void esp_int_wdt_init(void)
esp_int_wdt_retention_enable(IWDT_TIMER_GROUP);
#endif
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#if CONFIG_ESP_INT_WDT && CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
/*
* This is a workaround for issue WDT-3.15 in "ESP32 ECO and workarounds for
* Bugs" document.
@@ -14,7 +14,7 @@
extern "C" {
#endif
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#if CONFIG_ESP_INT_WDT && CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
/**
* @brief Enable or disable the livelock workaround and reconfigure the interrupt WDT.
@@ -49,7 +49,7 @@ void esp_int_wdt_set_livelock_params(uint32_t timeout_ms);
*/
void esp_int_wdt_reset_livelock_params(void);
#endif // CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
#endif // (CONFIG_ESP_INT_WDT && CONFIG_ESP32_ECO3_CACHE_LOCK_FIX)
#ifdef __cplusplus
}
@@ -45,6 +45,9 @@ uint32_t ESP_SYSTEM_IRAM_ATTR esp_int_wdt_livelock_get_feed_stage0_ticks(void)
void ESP_SYSTEM_IRAM_ATTR esp_int_wdt_livelock_workaround(bool enable)
{
if (!soc_has_cache_lock_bug()) {
return;
}
uint32_t stage0_ticks = IWDT_STAGE0_TIMEOUT_US;
if (enable) {
esp_int_wdt_set_livelock_params(CONFIG_ESP_INT_WDT_TIMEOUT_MS);