Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By brutzler
#22628 I want the ESP to reboot, if the code stucks, or similiar. Like you described.
I made a little testprogramm, but there was no reboot until 90 seconds of delay in the loop. Looks like there is no watchdog working.
Code: Select allint deltime = 1000;
void setup() {
  Serial.begin(115200);
  Serial.println("Programmstart ");
}
void loop() {
  Serial.print("DelTime = ");
  Serial.println(deltime);
  delay(deltime);
  deltime=deltime+1000;
}


If application code takes too long to return control to the OS

What is ment by this? Is this, if it lasts too long to start a new loop?
User avatar
By martinayotte
#22629 The loop() is not a good example, because probably the watchdog is been resetted on every loop and also by the delay() function. You can test it by doing a "for (int i = 0; i < 1000000; i++) { __asm__ volatile ("nop"); } " instead.

EDIT : I've just give this a try, but oooups ! 1 million wasn't enough, 100 million is better. ;)
But beware : I've saw sometimes the watchdog doing reset, but the reset was also hanging sometime.
So, it is probably not a good way to force reset, the ESP.reset() function is much better.
User avatar
By brutzler
#22673
martinayotte wrote:So, it is probably not a good way to force reset, the ESP.reset() function is much better.


But to use the ESP.reset() you need "control "about the software. And then, there is no need for a watchdog.
User avatar
By kolban
#22686 This might be a useless post ... but I note that the SDK documents a hardware timer function. See hw_timer_init(). It may be that this causes an interrupt in software where you can perform your reset.