Repository navigation
Description
Context
embedded_fs_esp.hpp selects Arduino LittleFS when FS.h/LittleFS.h exist, directly stores Arduino File, and calls the global LittleFS object. Verified Arduino 2.0.17 FS.h includes Arduino.h and File inherits Stream. Header availability is currently deciding implementation/dependency acquisition.
The existing embedded storage entry point is deliberately isolated in fl.fs.embedded+.cpp.o. Unused storage should already drop; this is not evidence of additional bloat in the current non-storage D32 benchmark.
Proposal
Use an optional weak provider factory expressed in existing FastLED filesystem types. An explicitly linked Arduino adapter may supply LittleFS behavior without exposing Arduino File/Stream types to native ESP code. Supply a native supported fallback so existing working embedded-storage sketches retain functionality; use the existing null contract only where storage is genuinely unavailable. Resolve provider selection before mounting or taking ownership.
Acceptance criteria
- RED -> GREEN: reproduce the current Arduino header/link dependency in a real storage-enabled build, then demonstrate its removal from the native path.
- Test provider present, absent, failed mount, and failed open; verify archive-only providers are not implicitly extracted and document explicit linkage.
- Preserve getEmbeddedFs(bool), default no-format behavior, valid reads/seeks/EOF/close, and already mounted filesystem ownership; never format or unmount another owner's storage unexpectedly.
- Run real flash-backed read/seek/reopen tests with provider and native fallback; preserve ESP8266 opt-in/toolchain limitations.
- Measure matched no-storage, native-storage, and Arduino-provider builds (flash/static RAM/runtime heap, live symbol/map roots). No-storage must retain its separate-object elision.
- Keep normal lint/tests green and document migration/activation without adding GHA.
Decisions
- ESP32 first, retaining the technology-neutral API and design: expose on-chip flash storage generically, not as make_littlefs_filesystem #4007's translation-unit boundary.
- Use a small provider factory, not weak calls to guessed Arduino C++ methods or a weak global object followed by strong method references.
- Do not silently turn working storage into null merely to meet a size target.
Open questions
- Confirm native LittleFS component availability and lifecycle across supported SDK packages; record unsupported configurations explicitly.
Related issues
Tracked under #4888.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 22, 2026
Implemented and published in #4894 (stacked on #4887's branch; full master CI remains required before integration).
Matched Lolin D32 fbuild + bloat: default embedded storage 293,858 -> 284,070 bytes flash (-9,788); physical static RAM 21,420 -> 21,412 (-8). No-storage remains exactly 231,094 / 21,000. Explicit app-mounted Arduino provider is 293,894 -> 293,998 flash (+104) with unchanged static RAM; native backend symbols are fully discarded in that mode.
Actual production-entry linker tests cover absent/archive/direct providers. Selectively reverting the entry makes the direct-provider test fail; fixed source restored and passing. Physical AutoResearch passes native 105 and provider 82 checks per call, both cold and warm, including an unmounted-provider failure without fallback mounting, mount ownership, reads/seeks/EOF and file lifetime. Warm retained heap is zero in both modes. First measured cycles retain native96/provider440 bytes for lazy allocations. Canonical AutoResearch restored, final legacy RMT 3/3 passes.
Full debug suite 326 units / 95 examples passes. Full Python run revealed five failures (four stale assertions plus new header-local registry state); all fixed, final selected rerun 18/18 passes. Normal lint and independent production review pass. SDK4.4 / SDK5.5 compile evidence and the ownership/activation limitations are documented in
docs/ESP32_EMBEDDED_FS.md.This does not claim physical USB acceptance for #4893. Proceeding next to #4890, as the next sequential implementation.
zackees commentedon Oct 22, 2026
Resolved by #4894 (merged to master 2026-10-22, 2d83b42 ancestry).
docs(todo): update #4889/#4890/#4891 narrative lines to match merged …