Skip to content

Conversation

@AarC10
Copy link
Member

@AarC10 AarC10 commented Jun 13, 2025

Description

Write a summary of what you changed. It is helpful to have context on why you made this change!

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • New functionality is documented in the necessary spots (i.e new functions documented in the header)
  • Unit tests cover any new functionality or edge cases that the PR was meant to resolve (if applicable)
  • The CI checks are passing
  • I reviewed my own code in the GitHub diff and am sure that each change is intentional
  • I feel comfortable about this code flying in a rocket

@AarC10 AarC10 requested a review from Copilot June 25, 2025 03:55
Copy link

Copilot AI left a 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>
@AarC10 AarC10 requested a review from a team as a code owner August 25, 2025 21:13
Comment on lines +23 to +29
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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@cowsed cowsed left a 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);
Copy link
Contributor

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

Copy link
Contributor

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;
Copy link
Contributor

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();
Copy link
Contributor

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants