Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(task): Add support for enabling task watchdog on an espp::Task #322

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Aug 30, 2024

Description

  • Add static bool Task::configure_task_watchdog(timeout_ms, panic_on_timeout) to initialize / reconfigure the watchdog timer subsystem.
  • Add bool Task::start_watchdog() and bool Task::stop_watchdog() to (de-)register the task with the watchdog timer and inform the task to start resetting the watchdog timer.
  • Add static std::string Task::get_watchdog_info(error_code), which can be used (with some caveats mentioned in the docstrings) to get info about tasks which triggered the watchdog.
  • Add examples for configuring the watchdog to the task example
  • Update task example to use logger for easier to read / clearer delineation between the tests.

Motivation and Context

During debugging, it can be very useful to track execution of various tasks and ensure they do not deadlock or block for too long. This involves using the task watchdog - for which this PR adds convenience functions to configure the watchdog timer system and start/stop the watchdog for a given espp::Task.

How has this been tested?

Building and running task/example on a QtPy ESP32s3.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

CleanShot 2024-08-30 at 09 31 38

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

@finger563 finger563 self-assigned this Aug 30, 2024
@finger563 finger563 added enhancement New feature or request tasks labels Aug 30, 2024
Copy link

✅Static analysis result - no issues found! ✅

@finger563 finger563 changed the title feat(task): Add support for enabling task watchdog on an espp::Task feat(task): Add support for enabling task watchdog on an espp::Task Aug 30, 2024
@finger563 finger563 merged commit 5213b02 into main Aug 30, 2024
69 checks passed
@finger563 finger563 deleted the feature/task-watchdog branch August 30, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant