• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Error – Task watchdog got triggered

Q&A Forum › Category: ESP32 › Error – Task watchdog got triggered
0 Vote Up Vote Down
lubond asked 6 years ago

I am trying my own sketch based on your sketch from
https://rntlab.com/module-12/esp32-dual-core-create-tasks/

Your code is OK, no watchdog event occurs. But in my code task watchdog got triggered about 5 seconds after tasks was created.

Shortly:
My Task1code() in core 0 resends inputString to USB serial port.
My Task2code() in core 1 is listerning on 2nd serial port and it fills string variable inputString until ‘\n’ char reseived..

Here’s a cut from my serial monitor:
17:28:03.698 -> My tasks are going to create now …
17:28:03.698 -> … task1 was created just now!
17:28:04.168 -> … task2 was created just now!
17:28:08.726 -> E (11178) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
17:28:08.726 -> E (11178) task_wdt: – IDLE0 (CPU 0)
17:28:08.726 -> E (11178) task_wdt: Tasks currently running:
17:28:08.726 -> E (11178) task_wdt: CPU 0: Task1
17:28:08.726 -> E (11178) task_wdt: CPU 1: loopTask
17:28:08.726 -> E (11178) task_wdt: Aborting.
17:28:08.726 -> abort() was called at PC 0x400d5e07 on core 0
17:28:08.726 ->
17:28:08.726 -> Backtrace: 0x400853ec:0x3ffbe250 0x40085619:0x3ffbe270 0x400d5e07:0x3ffbe290 0x400814b5:0x3ffbe2b0 0x400d0b44:0x00000000
17:28:08.726 -> Rebooting…

Note please, that there is no delay() calling in my Task1code(), because I dont want any delay there.
But if I place any delay() calling there ( e.g. delay(1); ), then no task watchdog event occurs.
I found this:
1/ It seems that delay() function clears the task watchdog hiddenly (in the background).
2/ Task2code() asigned to core 1 does not need any delay() call. Because core 1 probably does not need to handle watchdog explicitly.
3/ It seems that any Task assigned to core 0 requires to clear the watchdog explicitly.

Here is my question:  Is there another way (other than delay() calling) how to handle the task watchdog?

There is no word about watchdog in yout eBooks. I know what watchdog is and for what does it serve. But please can you help me to orientate myself faster in ESP32 watchdog timer clearing in Arduino ?
Thanks.

1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

Hi.
Unfortunately I’m not very familiar with this subject.
I think you really need to add that delay on core 0, otherwise the watchdog will be triggered. Here is a discussion about this subject that may help you: https://github.com/espressif/arduino-esp32/issues/595
Additionally, here is some information about watchdogs in ESP32 that may be useful: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/wdts.html
I’m sorry that I can’t help much. Meanwhile, if you find a solution let us know. It may be useful for other readers.
Regards,
Sara
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.