Skip to content

testing/drivers/taskwdt: test the watchdog task monitor. - #3908

Merged
acassis merged 1 commit into
apache:masterfrom
daniel-p-carvalho:feat/taskwdt-test-taskmonitor
Oct 24, 2026
Merged

acassis merged 1 commit into
apache:masterfrom
daniel-p-carvalho:feat/taskwdt-test-taskmonitor

Conversation

@daniel-p-carvalho

Copy link
Copy Markdown
Contributor

Summary

taskwdt_test (CONFIG_TESTING_TASKWDT, added in #3874) tests the task
watchdog supervisor. In apache/nuttx#20782 the supervisor is no longer a
separate driver: it became the task monitor of the watchdog upper half
(CONFIG_WATCHDOG_TASKMONITOR), and its channels are opened on
CONFIG_WATCHDOG_DEVPATH instead of /dev/taskwdt.

This change follows that:

  • the option depends on WATCHDOG_TASKMONITOR instead of TASKWDT, and the
    program includes nuttx/timers/watchdog.h and opens
    CONFIG_WATCHDOG_DEVPATH;
  • the "unknown ioctl" check of the errors case uses an unused request
    (_WDIOC(0x7f)), because WDIOC_CAPTURE is now also rejected, with
    ENOSYS, and no longer tests the ENOTTY path;
  • new case handoff: one thread opens a channel and another one feeds it,
    which a channel per open file description must allow.

WATCHDOG_TASKMONITOR only exists with the nuttx PR, so this change builds
nothing until then and can be merged first. It must be merged before
apache/nuttx#20782, whose sim:taskmonitor configuration enables this test.

Impact

Test application only, off by default; no effect on existing configurations.
CONFIG_TASKWDT no longer exists with the nuttx PR, so the option cannot be
selected for the old supervisor any more.

Testing

Build host: Linux x86_64 (Ubuntu), gcc for the sim, arm-none-eabi-gcc and
Microchip XC32 v6.00 for the boards. Run with the nuttx PR on sim:taskmonitor,
NUCLEO-L432KC and EV49N51A (PIC32MZ-W1): the cases that must not reset print
PASS (including handoff) and the others reset the system as expected. The
results and logs are in apache/nuttx#20782.

tools/checkpatch.sh -m -g is clean for the commit and -f for the two files
(spelling and encoding checks were not run).

The task watchdog supervisor is now the task monitor of the watchdog upper
half, CONFIG_WATCHDOG_TASKMONITOR, and its channels are opened on
CONFIG_WATCHDOG_DEVPATH instead of CONFIG_TASKWDT_DEVPATH.

Depend on the new option and include nuttx/timers/watchdog.h. The ioctl that
must fail with ENOTTY is an unused request, as the task monitor does not
forward the other commands to the lower half. Add the handoff case: a thread
opens a channel and another one feeds it, which a channel per open file
description must allow.

Assisted-by: Claude Code:claude-sonnet-5-5
Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>

@cederom cederom left a comment

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.

Thank you @daniel-p-carvalho :-)

@acassis
acassis merged commit b89cb41 into apache:master Oct 24, 2026
23 of 40 checks passed
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