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

Unexpected Watchdog Reset on NXP RT1060-EVKB with Sleep Mode Enabled #86437

Open
ofirshe opened this issue Feb 27, 2025 · 0 comments
Open

Unexpected Watchdog Reset on NXP RT1060-EVKB with Sleep Mode Enabled #86437

ofirshe opened this issue Feb 27, 2025 · 0 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP

Comments

@ofirshe
Copy link
Contributor

ofirshe commented Feb 27, 2025

Describe the bug

Hey, I tested the watchdog on the RT1060-EVKB with a timeout of 1000ms and enabled both flags: WDT_OPT_PAUSE_HALTED_BY_DBG and WDT_OPT_PAUSE_IN_SLEEP.

As shown in the code, immediately after calling wdt_setup, the CPU enters sleep mode for 2000ms. However, I noticed that the SoC unexpectedly resets, even though it shouldn't.

code snippet:

void main(void) {
    int err;
    int wdt_channel_id;
    const struct device *const wdt = DEVICE_DT_GET(DT_ALIAS(watchdog0));

    printk("Watchdog sample application\n");

    if (!device_is_ready(wdt)) {
        printk("%s: device not ready.\n", wdt->name);
        return;
    }

    struct wdt_timeout_cfg wdt_config = {
        /* Reset SoC when watchdog timer expires. */
        .flags = WDT_FLAG_RESET_SOC,

        /* Expire watchdog after max window */
        .window.min = 0U,
        .window.max = 1000U,
    };

    wdt_channel_id = wdt_install_timeout(wdt, &wdt_config);
    if (wdt_channel_id < 0) {
        printk("Watchdog install error\n");
        return;
    }

    err = wdt_setup(wdt, (WDT_OPT_PAUSE_HALTED_BY_DBG | WDT_OPT_PAUSE_IN_SLEEP));
    if (err < 0) {
        printk("Watchdog setup error\n");
        return;
    }

    for (int i = 0; i < 100; ++i) {
        printk("Feeding watchdog... %d \n", i);
        wdt_feed(wdt, 0);
        k_sleep(K_MSEC(2000));
    }

    return 0;
}

To Reproduce
Simply build and run the code for mimxrt1060_evkb.

Expected behavior
SoC shouldn't reset.

Environment (please complete the following information):

  • OS: Windows
  • Toolchain: Zephyr SDK
  • SHA: 30b9463
@ofirshe ofirshe added the bug The issue is a bug, or the PR is fixing a bug label Feb 27, 2025
@ofirshe ofirshe changed the title Unexpected Watchdog Reset on RT1060-EVKB with Sleep Mode Enabled Unexpected Watchdog Reset on NXP RT1060-EVKB with Sleep Mode Enabled Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP
Projects
None yet
Development

No branches or pull requests

6 participants