mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
c7fdd534bcdee71a448276088a5099d9d2abfcca
BK72xx silicon requires a ~200us busy-wait (sctrl_dpll_delay200us) between two watchdog register key writes on every reload, making each arch_feed_wdt() call ~300us on BK7231T/N/BK7238. This is hardware errata in the BDK's wdt_ctrl (beken378/driver/wdt/wdt.c:WCMD_RELOAD_PERIOD) and cannot be worked around at the SDK level. LibreTiny initialises the BK72xx HW watchdog at 10000ms, but ESPHome's generic WDT_FEED_INTERVAL_MS of 300ms was sized for ESP8266's 1.6s soft watchdog. That left BK72xx over-servicing the watchdog ~33x per timeout window, paying ~60ms/min of main-loop overhead to no benefit. Raise the interval to 2000ms on BK72xx only, which keeps a 5x safety margin on the 10s HW WDT — matching the ESP8266 ratio that originally motivated the 300ms value — while cutting feed frequency ~6x. Measured on a NiceMCU XH-WB3S (BK7238) while testing libretiny-eu/libretiny#360: Before (300ms interval): wdt_slow_path: hits=195 (5.9% of iters, avg=315.97us/hit) main_loop_before_breakdown: sched=73.2ms, wdt=61.6ms, residual=0.0ms Other platforms retain the existing 300ms value.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
545 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
