RTEMS | Draft: bsps/riscv/esp32: Disable the watchdogs bsp_start() means to disable (!1555)

Sam Price (@TheSamPrice) gitlab at rtems.org
Tue Nov 3 04:19:26 UTC 2026



Sam Price created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1555

Project:Branches: TheSamPrice/rtems:esp32c3-watchdog-disable to rtems/rtos/rtems:main
Author: Sam Price

`bsp_start()` is meant to turn off the RTC and timer group 0 watchdogs. It turns off neither, for two reasons:

1. **The TIMG0 write-protect key is never written.** The RTC watchdog gets its key, but timer group 0 has its own write protection (same key value), so every write to `TIMG_WDTCONFIG0` is silently thrown away.
2. **Flash-boot mode keeps the watchdog running.** `TIMG_WDT_FLASHBOOT_MOD_EN` and `RTC_CNTL_WDT_FLASHBOOT_MOD_EN` reset to 1 and keep the watchdog armed even with its enable bit clear. ESP-IDF's second-stage bootloader clears them, so ESP-IDF applications never hit this. A direct-boot image like this BSP always does. Read back on hardware: `TIMG_WDTCONFIG0 = 0x0004c000`, enable clear and flash-boot mode set.

The timeout is about 1.5 s. Anything that finishes sooner looks healthy, which is why it went unnoticed until a WiFi application idled in a 2 s `rtems_task_wake_after()` and the chip reset with `rst:0x7 (TG0WDT_SYS_RST)`.

**Testing:** `riscv/esp32c3db` and its samples build with no warnings. On ESP32-C3 hardware, a WiFi application that runs for well over 1.5 s now finishes and associates with a WPA2 access point. QEMU models neither watchdog, so the testsuite can't catch this.

Assisted-by: Claude Opus 5 (1M context) <noreply at anthropic.com>

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1555
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/6-92ojaxsm35ig5m8726f3sulp6-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20261103/e8a2b419/attachment.htm>


More information about the bugs mailing list