s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266

Home Page:https://valencia.lbsfilm.at/midterm-presentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Boot loop when preparing file system

tolletrolden opened this issue · comments

When i run the prepare filesystem sketch, it always ends in a boot loop.

Tested different esp32 modules - all the same.

Using arduino ide 2.0.0-rc7

Try not preparing the filesystem first, just start the UI with ESPUI.begin() to serve from PROGMEM.

That's easier, and then if that is OK it will help you to debug what is going on.

I have replicated this issue across ESP32 and ESP32-S2 as well with "prepareFilesystem.ino". The exception decoder points at fs::LittleFSFS::format().

Even a minimal sketch without ESPUI that does little else but "LittleFS.format();" on ESP32 crashes repeatedly. This is also with an 'out of the bag' ESP32 never used before so it's not about whether it's already been formatted or not. It seems LittleFS.format() must be done after LittleFS.begin() but in this case you may end up formatting LittleFS twice.

I've come up with a fix, that uses LittleFS.begin(false) to see if LittleFS is already formatted, then only format it (to clear existing files) if it is already formatted and mounts. I will submit a PR for this shortly, along with some other LittleFS fixes.