Skip to content

drivertest/watchdog: tighten reset cause and timing validation - #3983

Open
bigcat-2026 wants to merge 1 commit into
apache:masterfrom
bigcat-2026:port/watchdog-test-validation
Open

bigcat-2026 wants to merge 1 commit into
apache:masterfrom
bigcat-2026:port/watchdog-test-validation

Conversation

@bigcat-2026

Copy link
Copy Markdown
Contributor

Summary

Tighten the watchdog driver test validation, ported from
open-vela/nuttx-apps#142.

  • Use a chip-specific expected reset cause: the ESP32-S3 reports a
    BOARDIOC_RESETCAUSE_CORE_MWDT reset, while other platforms report
    BOARDIOC_RESETCAUSE_SYS_RWDT.
  • Validate that the reported timeleft is not greater than the configured
    timeout.
  • Compare the remaining-time delta against the measured ping delay instead
    of the configured ping delay.

Change

  • testing/drivers/drivertest/drivertest_watchdog.c

Use a chip-specific expected reset cause (ESP32-S3 reports a core MWDT
reset instead of the system RWDT reset), and validate the reported
timeleft against the measured ping delay.

Ported from open-vela/nuttx-apps#142.

Signed-off-by: bigcat2026 <bigcat_2026@163.com>
@bigcat-2026
bigcat-2026 force-pushed the port/watchdog-test-validation branch from 1067622 to be39731 Compare November 6, 2026 01:42
#define WDG_DEFAULT_TIMEOUT 2000
#define WDG_DEFAULT_TESTCASE 0
#define WDG_DEFAULT_DEVIATION 20
#ifdef CONFIG_ARCH_CHIP_ESP32S3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why check the special chip in the common code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is for the ESP32-S3

#define WDG_DEFAULT_TIMEOUT 2000
#define WDG_DEFAULT_TESTCASE 0
#define WDG_DEFAULT_DEVIATION 20
#ifdef CONFIG_ARCH_CHIP_ESP32S3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On upstream the ESP32-S3 branch is never built: only boards/arm/n32h7 and boards/arm/samv7 provide board_reset_cause(), so CONFIG_BOARDCTL_RESET_CAUSE does not link on ESP32-S3.
Fix: drop the chip check and let the caller give the expected reset cause, for example with a new command-line option next to -a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants