Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion examples/simple_repeater/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,18 @@ void setup() {
fs = &InternalFS;
IdentityStore store(InternalFS, "");
#elif defined(ESP32)
SPIFFS.begin(true);
if (!SPIFFS.begin(true)) {
// format-on-mount-fail can itself fail on some boards/first-boots (blank flash).
// Retry with an explicit format before giving up, otherwise callers below will
// read/write against a non-mounted filesystem and get garbage back instead of
// clean failures (observed as SPIFFS mount errors followed by a boot crash-loop).
MESH_DEBUG_PRINTLN("SPIFFS mount failed, retrying with explicit format");
SPIFFS.format();
if (!SPIFFS.begin(true)) {
MESH_DEBUG_PRINTLN("SPIFFS mount failed after format, halting");
halt();
}
}
fs = &SPIFFS;
IdentityStore store(SPIFFS, "/identity");
#elif defined(RP2040_PLATFORM)
Expand Down