Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By dayzman
#18767 I have this simple piece of code that somehow triggers the watchdog to reset continuously:

Code: Select allstatic ETSTimer testTimer1;

void user_init(void)
{
   // Configure the UART
   uart_init(BIT_RATE_115200, BIT_RATE_115200);

   os_timer_disarm(&testTimer1);
   os_timer_arm(&testTimer1, 1000, 1);
}


The timer shouldn't freeze up the device, so why does the watchdog keep resetting it continuously?

Thanks
User avatar
By BarryP
#18774 I reported the timer bug a while ago .
the latest SDK v1.1.0 has made the bug worse .

Edit: missed the main reason your problem ....
gotta set a callback .
Code: Select all 
 static ETSTimer testTimer1;
void testTimer1_cb(void *arg){
// do something
}
 void user_init(void)
 {
    // Configure the UART
    uart_init(BIT_RATE_115200, BIT_RATE_115200);

    os_timer_disarm(&testTimer1);
    os_timer_setfn(&testTimer1, (os_timer_func_t *)testTimer1_cb, NULL);
    os_timer_arm(&testTimer1, 1000, 1);
 }