I want to put a task WD in my project that as a last ditch effort will reboot the device if the supervising task is hung. But the Task WD API doesn't seem to support any functionality by the application other than a print out which is nice for newbie level debug, but not very useful. There is one short reference to a handler, but the API doesn't support installing a handler. Yes, I can look through the source, but I'm curious why the task WD seems like a half implemented feature.
John A
Task WD seems useless
Re: Task WD seems useless
I looked through the source and it appears that the "esp_task_wdt_isr_user_handler" feature is not supported at all. It appears that there is little more that can be done except disabling the idle task WD, setting the panic flag, and just enabling the WD for the task in question.
John A
John A
Re: Task WD seems useless
https://github.com/espressif/arduino-es ... gTimer.ino
can you do that?
Depending upon the requirements a more or less hw/sw independent timer is needed; how independent do you need? hw:555? timer in c; processor #2 or #3? all 3 are easy.
Tom Meyers
can you do that?
Depending upon the requirements a more or less hw/sw independent timer is needed; how independent do you need? hw:555? timer in c; processor #2 or #3? all 3 are easy.
Tom Meyers
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Task WD seems useless
I'm not using Arduino, but I could use the IDF timer routines to accomplish the same thing. Thanks for the suggestion.tommeyers wrote:can you do that?
John A
Re: Task WD seems useless
Just to let you know I used the timer technique. That allowed me to implement a long period WD and I can still keep the idle task WD just to detect any weirdness that might pop up. Erasing memory for an OTA triggers the idle WD.tommeyers wrote:can you do that?
John A
Re: Task WD seems useless
If you call esp_task_wdt_init() with the panic argument set to true, the task WDT will trip the IDF "panic handler" if it is triggered.fly135 wrote:I want to put a task WD in my project that as a last ditch effort will reboot the device if the supervising task is hung.
The default configuration for the panic handler is to dump a backtrace and then reset the system.
Does that achieve your goal?
This feature was added recently, so if you're reading the "latest" documentation then it may refer to things which aren't in older ESP-IDF versions.fly135 wrote:I looked through the source and it appears that the "esp_task_wdt_isr_user_handler" feature is not supported at all.
The "weak linked" implementation is here:
https://github.com/espressif/esp-idf/bl ... wdt.c#L121
If you implement a function with this name (without the "__attribute__((weak))") in a source file of your project, it will become the handler. The only requirement is that this source file must get linked into the project - this means that the function has to be in a source file which also has some other thing (function, variable) which is used by the project (ie the app_main() routine, or a function which is called from somewhere, etc). Otherwise the linker may never look in the object file at all, and doesn't see the replacement handler to link it.
Re: Task WD seems useless
It could be useful to move if the whole logging part part ("Task watchdog got triggered. ...") in the task_wdt_isr to the default esp_task_wdt_isr_user_handler.ESP_Angus wrote:fly135 wrote:If you implement a function with this name (without the "__attribute__((weak))") in a source file of your project, it will become the handler. The only requirement is that this source file must get linked into the project - this means that the function has to be in a source file which also has some other thing (function, variable) which is used by the project (ie the app_main() routine, or a function which is called from somewhere, etc). Otherwise the linker may never look in the object file at all, and doesn't see the replacement handler to link it.
That way the user could chose not to print the log messages, but only to take some other acction.
Re: Task WD seems useless
I had my mind wrapped around using the callback, so saying the WD seems useless was a bit knee jerk. The panic option does achieve the goal.ESP_Angus wrote:Does that achieve your goal?
OK, that explains it. I'm working with v3.1 release.ESP_Angus wrote:This feature was added recently, so if you're reading the "latest" documentation then it may refer to things which aren't in older ESP-IDF versions.
John A
Who is online
Users browsing this forum: No registered users and 112 guests