Interrupt watchdog triggers immediately

User avatar
dg9ngf
Posts: 65
Joined: Mon Sep 16, 2019 6:49 pm
Location: Germany
Contact:

Interrupt watchdog triggers immediately

Postby dg9ngf » Wed Mar 19, 2025 8:05 pm

Hello,

I'm having big trouble creating anything useful now. I'm working on updating and extending old code that used to work. The new parts are around UART communications. I cannot get it to start because the code immediately triggers an interrupt watchdog. I have no idea why and where. It happens silently and I only know by asking after the next reboot. There is nothing in the serial console, it simply starts over with the "ets" line.

How can I find out what the problem is? I think I checked all my tasks and timers. I'm not dealing with interrupts directly. All loops have a long delay in them (100 ms) but it needs to go away eventually.

I can locate the bug to starting a task. If I'm not starting it, the app stays there sitting and doing nothing. But also not rebooting all the time. If I start that task, it reboots after a fraction of a second. The task does nothing but write a log message anymore, everything else is commented out.

Maybe this part of the code helps:

Code: Select all

void main()
{
	int helloDelay = 1000;
	ESP_LOGI(TAG, "Sending Hello in %d ms", helloDelay);
	timerHandle = xTimerCreate("hello", pdMS_TO_TICKS(helloDelay), pdFALSE, NULL, sendHello);
	configASSERT(xTimerStart(timerHandle, 0));

	while (true)
	{
		vTaskDelay(pdMS_TO_TICKS(100));
	}
}

void sendHello(const TimerHandle_t unusedParameters)
{
	ESP_LOGI(TAG, "sendHello");
	vTaskDelay(pdMS_TO_TICKS(100));
}
Any suggestions? It's really annoying that the thing just reboots without telling me any reason.

I'm using VSCode with PlatformIO and its integrated serial monitor.

MicroController
Posts: 2705
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Interrupt watchdog triggers immediately

Postby MicroController » Thu Mar 20, 2025 7:45 am

You shouldn't vTaskDelay() or block in a (timer) callback, and you cannot block when the callback happens in an ISR.

User avatar
dg9ngf
Posts: 65
Joined: Mon Sep 16, 2019 6:49 pm
Location: Germany
Contact:

Re: Interrupt watchdog triggers immediately

Postby dg9ngf » Thu Mar 20, 2025 9:38 pm

Right, I must have confused timers and tasks yesterday. Removing all delays from timers has helped. I also noticed that I don't need any delays in tasks that already have waiting function calls, like waiting for UART events or items in a queue. I had added those because I remember that a task with a loop that doesn't delay (or apparently otherwise wait) at some point will be stopped after a few seconds or so. Now these parts work fine!

Who is online

Users browsing this forum: ChatGPT-User and 2 guests