Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling Core0WDT in SPIFFS.format() might be the wrong WDT #11033

Open
1 task done
Bascy opened this issue Mar 3, 2025 · 5 comments
Open
1 task done

Disabling Core0WDT in SPIFFS.format() might be the wrong WDT #11033

Bascy opened this issue Mar 3, 2025 · 5 comments
Labels
Status: Needs investigation We need to do some research before taking next steps on this issue

Comments

@Bascy
Copy link
Contributor

Bascy commented Mar 3, 2025

Board

ESP32 Dev Module

Device Description

Propriety board, based on ESP32 chip

Hardware Configuration

not relevant

Version

latest master (checkout manually)

IDE Name

VSCode with PlatformIO and pioArduino platform

Operating System

Windows 11

Flash frequency

40 Mhz

PSRAM enabled

no

Upload speed

460800

Description

In our factory-firmware version of the firware we call SPIFFS.format() in a pretty early stage of the setup(). This causes a very large number of E (28769) task_wdt: esp_task_wdt_reset(705): task not found errors to occur, before the setup continues as normal.

This is caused by the disableCore0WDT() call in SPIFFS.format().

Question 1: Why is this error occuring?
Question 2: Why is it necessary to disable the watchdog of the other cores idle task, as setup() is always running on core1?
Question 3: What if I have a task running on Core 0 that calls SPIFFS.format(), shouldnt that task disable the core1 Idle watchdog then?

Sketch

void setup() {
  Serial.begin(576000);
  Serial.println("Starting...");
  SPIFFS.begin(true);

  #ifdef COMPILE_FACTORY_FIRMWARE
  SPIFFS.format();
  #endif
...

Debug Message

E (28766) task_wdt: esp_task_wdt_reset(705): task not found
E (28767) task_wdt: esp_task_wdt_reset(705): task not found
E (28768) task_wdt: esp_task_wdt_reset(705): task not found
E (28769) task_wdt: esp_task_wdt_reset(705): task not found
E (28770) task_wdt: esp_task_wdt_reset(705): task not found
E (28771) task_wdt: esp_task_wdt_reset(705): task not found
E (28772) task_wdt: esp_task_wdt_reset(705): task not found
E (28773) task_wdt: esp_task_wdt_reset(705): task not found
E (28774) task_wdt: esp_task_wdt_reset(705): task not found
E (28775) task_wdt: esp_task_wdt_reset(705): task not found

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@Bascy Bascy added the Status: Awaiting triage Issue is waiting for triage label Mar 3, 2025
@lbernstone
Copy link
Contributor

It is disabling the idle timer. While core1 is busy, it isn't feeding the idle timer on core 0, which causes the watchdog to fire.
The error is there because older versions of the IDF did not have any method to check the wdt status. That should be fixed with the latest PR.

@Bascy
Copy link
Contributor Author

Bascy commented Mar 4, 2025

I am using the latest version of disableCore0WDT() with the boolean return value, and it is still giving me the error.
pioarduino 53.03.13, using Arduino 3.1.3

Image

Also I still do not understand how this can be correct if you are calling SPIFFS.format() from core 0.

In the meantime I have learned why core0 idle warchdog might get triggered when formatting SPIFFS on core1, its because SPIFFS is a shared resource between the cores and prolonged acces could thus prevent core0 from firing idle task every now. (This is just to remind myself of this)

@me-no-dev
Copy link
Member

The logic is: Core 1 WDT is OFF in Arduino, Core 0 WDT is ON. Disable Core 0 WDT while formatting to prevent WDT restarts. On single-core chips, WDT is disabled in Arduino, so the code should not do anything. We will look into the task not found error and try to fix it.

@Bascy
Copy link
Contributor Author

Bascy commented Mar 5, 2025

@me-no-dev Thanks for the explanation. I didn't know that Core 1 WDT was switched off in Arduino.
Hope you will find the cause of the error

@lbernstone
Copy link
Contributor

@me-no-dev I think it is the loopWDT that generates these errors, but I can't really see how to disable it during the format.

@Jason2866 Jason2866 added Status: Needs investigation We need to do some research before taking next steps on this issue and removed Status: Awaiting triage Issue is waiting for triage labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs investigation We need to do some research before taking next steps on this issue
Projects
None yet
Development

No branches or pull requests

4 participants