Skip to content

Information about the WatchDog Timers. #2942

@tttapa

Description

@tttapa

Could someone please give some more information about the WDT reset, or at least point me to a link?
From my experiments, it seems that some functions, like Serial.flush() automatically leave some time for the WiFi code, and reset the WDT.
If you don't use yield() or delay(0), the soft WDT seems to reset after exactly 3 seconds, and when disabled, the hardware WDT resets after ~8375933µs (>8 seconds). This seems to be independent of the clock speed (80/160MHz).

This is the code I used:

void setup() {
  Serial.begin(115200);
  // ESP.wdtDisable();
}

void loop() {
  unsigned long startMicros = micros();
  while(1) {
    Serial.print(ESP.getCycleCount());
    Serial.print('\t');
    Serial.println(micros() - startMicros);
  }
}

What are the safe limits? What is the absolute maximum time without yield()'ing? Will the WiFi crash if I wait too long, or will it just be paused?
What is the advantage of having a software WDT as well as a hardware WDT?

Thanks!
Pieter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions