From 83d88e73a49e0903d206e0b047478293e9b8a7f8 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Fri, 27 Mar 2026 19:58:56 +0800 Subject: [PATCH] change(esp_rom): wdt_hal_config_stage fixed in rom_version: esp32p4-eco7-20260109 --- components/esp_hal_wdt/rom_patch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/esp_hal_wdt/rom_patch.c b/components/esp_hal_wdt/rom_patch.c index 659ffa9796..63c4b14533 100644 --- a/components/esp_hal_wdt/rom_patch.c +++ b/components/esp_hal_wdt/rom_patch.c @@ -5,8 +5,11 @@ */ #include +#include "hal/config.h" #include "soc/soc_caps.h" +#include "soc/chip_revision.h" #include "esp_rom_caps.h" +#include "hal/efuse_hal.h" #include "hal/mwdt_periph.h" #include "hal/wdt_hal.h" @@ -114,13 +117,13 @@ void wdt_hal_deinit(wdt_hal_context_t *hal) hal->mwdt_dev = NULL; } -#if SOC_IS(ESP32P4) +#if SOC_IS(ESP32P4) && (HAL_CONFIG(CHIP_SUPPORT_MIN_REV) <= 301) extern void rom_wdt_hal_config_stage(wdt_hal_context_t *hal, wdt_stage_t stage, uint32_t timeout, wdt_stage_action_t behavior); /* rwdt_ll_config_stage is implemented erroneously in ESP32P4 rom code, TODO: PM-654*/ void wdt_hal_config_stage(wdt_hal_context_t *hal, wdt_stage_t stage, uint32_t timeout_ticks, wdt_stage_action_t behavior) { - if (hal->inst == WDT_RWDT && stage == WDT_STAGE0) { + if ((hal->inst == WDT_RWDT && stage == WDT_STAGE0) && !ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 302)) { timeout_ticks = timeout_ticks >> (1 + REG_GET_FIELD(EFUSE_RD_REPEAT_DATA1_REG, EFUSE_WDT_DELAY_SEL)); } rom_wdt_hal_config_stage(hal, stage, timeout_ticks, behavior);