Skip to content

issues on ESP32 under heavy load (watchdog + endless loop) #67

@Jeronimo59

Description

@Jeronimo59

Hello,

Thank you for this useful library.

When using it on a "heavy loaded" ESP32-S3, I experienced watchdog timer (WDT) issues, suggesting a loop task was running for too long.

After some investigation, I found that delay(0) was not yielding, so I solved the issue by replacing

      delay(0);

by

      vTaskDelay(1);

in the following functions:

DFRobotDFPlayerMini::sendStack()
DFRobotDFPlayerMini::waitAvailable(unsigned long duration)
DFRobotDFPlayerMini::available()

I also came across situation where DFRobotDFPlayerMini::sendStack() whould be stuck in endless loop, so I replaced in

      while (_isSending)

by

      long timeout = millis() + 1000; // wait no more than 1000 ms
      while (_isSending && millis() < timeout)

I found those changes to make the library more robust in my context.

HTH

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions