Uh oh!
There was an error while loading. Please reload this page.
Fresh 0.2.0 pluggable storage and formatting - #18
Merged
Conversation
Fix pluggable storage failure guarantees
zekageri
marked this pull request as draft
August 4, 2026 07:42
…shSDMMCPowerMode::OnChipLDO, including cleanup after mount failure and unmount
zekageri
marked this pull request as ready for review
August 4, 2026 13:36
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Redesigns Fresh 0.2.0 around owned storage backends and a direct application-file facade, and adds a destructive whole-volume formatting lifecycle.
Public API
FreshConfigcontains database behavior onlydb.init(path, config, storage)and become Fresh-owneddb.init(path, config)remains as a convenient default-LittleFS overloaddb.storage()directlyFreshInitResultas the initialization result typeFresh::format()for explicitly destructive whole-volume formattingDestructive formatting
format()deletes the Fresh database, application files accessed throughdb.storage(), and unrelated files on the same configured filesystem. It is intentionally different fromdropAllModels().The operation:
FreshFilehandlesFreshModelhandlesLittleFS, SDSPI, SDMMC, and eMMC use their ESP-IDF native format paths. Custom backends remain unsupported by default and can opt in with
supportsFormat()andformatBackend().Built-in storage
FreshLittleFSStoragethrough ESP-IDF LittleFS VFSFreshSDStoragethrough ESP-IDF SDSPI or SDMMCFreshEMMCStoragewith 1-, 4-, and 8-bit SDMMC configurationFreshStorageandFreshFileBackendimplementationsFresh does not include or synchronize Arduino's global
LittleFS,SD, orSD_MMCobjects.Application files and lifecycle
db.storage()exposes open/read/write, complete-file helpers, existence and size queries, recursive directory creation, listing, removal, rename, and capacity diagnosticsFreshFilehandles retain explicitsync(),close(), andsyncAndClose()durability boundariesdeinit()to returnFreshStatus::BusyRegression coverage
Adds
StorageFormatRegressionTestwith a custom in-memory backend covering:Validation
The implementation passed structural source checks for balanced delimiters and the production-source audit patterns. The repository CI build matrix is the authoritative compilation validation for ESP32, ESP32-C3, ESP32-S3, and ESP32-P4 and will run on this PR update.
Hardware qualification
Physical validation remains required for whole-volume formatting and remounting on representative LittleFS, SDSPI, SDMMC, and eMMC hardware, including absent/full media, card removal, power loss, and board-specific power/reset sequencing.