joltwallet / esp_littlefs

LittleFS port for ESP-IDF
MIT License
254 stars 95 forks source link

LittleFS 1.10.1 Starving in place a FatFS wear leaveling #153

Closed filzek closed 6 months ago

filzek commented 10 months ago

Hi,

we are using the latest version of 1.10.1 with idf 4.4.6 and when we replace the FatFS with LittleFS the system dispare a lot of wdts everywhere, so, something is intense consuming cpu usage during flash operations, we have to add a lot of task wait to clear the wdts.

Is that normal or a buggy?

In the FatFS everything works perfectly without any wdt.

The LittleFS doesnt dispare any WDT reset only intense wdt usage.

BrianPugh commented 10 months ago

There are a few time/cpu expensive operations within littlefs. It seems like your current issue is that some littlefs operations take up too much time, and consequently trigger your watch dog timers?

If so, I suppose there are a few options:

  1. Lengthen your WDT period via CONFIG_ESP_TASK_WDT_TIMEOUT_S.
  2. Call taskYIELD() before filesystem operations.
  3. Upstream littlefs has a function lfs_fs_gc, that can front-load some of the expensive operations. I could add an interface to expose this, and the user could call this during times the CPU would otherwise be idling.
filzek commented 10 months ago

did not solve the problem, the system got corrupted everywhere in 1.10.1, we will try the 1.10.2 version

BrianPugh commented 10 months ago

Can you explain your usage context a bit more? Also have you tried debugging to see what is causing your system to hang?

BrianPugh commented 6 months ago

Closing due to lack of activity.