-
Notifications
You must be signed in to change notification settings - Fork 1
Task Watchdog #315
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
base: main
Are you sure you want to change the base?
Task Watchdog #315
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds watchdog support to the RTOS by integrating Zephyr’s watchdog APIs into the core OS and task modules, and updates board configurations to enable watchdog functionality.
- Updated NRtos::StartRtos() to set up the watchdog.
- Modified CTask class within c_task.cpp and c_task.h to install and feed the watchdog timer, as well as included proper watchdog header files.
- Updated defconfig and DTS files for multiple boards to enable and configure the watchdog device.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/f_core/os/n_rtos.cpp | Added watchdog initialization logic in StartRtos. |
| lib/f_core/os/c_task.cpp | Updated CTask constructor and Initialize/Run methods for watchdog integration. |
| include/f_core/os/c_task.h | Modified API and documentation to include watchdog configuration. |
| boards/arm/*/{sensor_module, radio_module, power_module, deployment_module} | Updated board configurations and device trees to enable watchdog support. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| const device* watchdogDev = nullptr; | ||
| #if DT_NODE_EXISTS(DT_ALIAS(watchdog)) | ||
| watchdogDev = DEVICE_DT_GET(DT_ALIAS(watchdog)); | ||
| #endif | ||
|
|
||
| // ReSharper disable once CppDFAConstantConditions | ||
| if (watchdogDev != nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix for resharper disable and #if s
rip 2 birds
cowsed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
| LOG_ERR("Watchdog already setup"); | ||
| k_oops(); | ||
| } else if (ret < 0) { | ||
| LOG_ERR("Failed to setup watchdog: %d", ret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this one be a WRN bc you continue despite it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or should you k oops here as well
|
|
||
| std::vector<CRunnableTenant*> tenants; | ||
| wdt_timeout_cfg *wdtConfig = nullptr; | ||
| const device *watchdogDev = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does a task need to hold onto the watchdog dev, shouldnt it be done using it after Initialize ends
| LOG_INF("RTOS Started!"); | ||
| for (CTask* task : tasks) { | ||
| LOG_INF("Starting task %s", task->GetName()); | ||
| task->Initialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so like, if wdg dev isnt passed in here, nothing actually happens. that seems important
Description
Write a summary of what you changed. It is helpful to have context on why you made this change!
Type of change
Checklist: