fix(bootloader): enable super WDT auto-feed on ESP32-S31

The super WDT was firing during bootloader init because auto-feed was
not enabled, causing continuous resets with rst:0x12 (SUPER_WDT_RESET).

Made-with: Cursor
This commit is contained in:
Marius Vikhammer
2026-03-17 12:00:13 +08:00
parent 22c384ca9f
commit e8ba294bd2
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -18,15 +18,24 @@
#include "bootloader_flash_priv.h"
#include "bootloader_soc.h"
#include "esp_private/bootloader_flash_internal.h"
#include "soc/rtc_wdt_reg.h"
#include "hal/rwdt_ll.h"
ESP_LOG_ATTR_TAG(TAG, "boot.esp32s31");
static void bootloader_super_wdt_auto_feed(void)
{
REG_WRITE(RTC_WDT_SWD_WPROTECT_REG, RTC_WDT_SWD_WKEY_VALUE);
REG_SET_BIT(RTC_WDT_SWD_CONFIG_REG, RTC_WDT_SWD_AUTO_FEED_EN);
REG_WRITE(RTC_WDT_SWD_WPROTECT_REG, 0);
}
esp_err_t bootloader_init(void)
{
esp_err_t ret = ESP_OK;
// bootloader_hardware_init(); // TODO: IDF-14696
// bootloader_super_wdt_auto_feed(); // TODO: IDF-14678
bootloader_super_wdt_auto_feed();
// In RAM_APP, memory will be initialized in `call_start_cpu0`
#if !CONFIG_APP_BUILD_TYPE_RAM