ekv-fs
A chunked, #![no_std], fully asynchronous virtual file system on top of Embassy ekv for embedded Rust.
Why
Flash on microcontrollers needs wear leveling. ekv provides a safe KV store, but not paths, large blobs, or streaming reads. ekv-fs maps path strings to chunked keys so you can store and read files with bounded RAM—pure Rust, no C FFI.
Features
- no_std with
heaplesspaths and const-genericMAX_PATH_LEN/CHUNK_SIZE - Async API aligned with Embassy
- Streaming reads via
EkvFile - Replace-safe writes — overwriting a file removes old chunks in one transaction
Quick start
[]
= "0.2"
= { = "1", = false }
= { = "0.6", = false }
use ;
use EkvFs;
// After you have a formatted `Database` on your flash driver:
let fs = new;
fs.write_file.await?;
let meta = fs.stat.await?;
let mut file = fs.open.await?;
let mut buf = ;
let n = file.read.await?;
fs.delete_file.await?;
Pick MAX_PATH_LEN and CHUNK_SIZE to match your MCU RAM budget. MAX_PATH_LEN must be at most KEY_BUF_CAP - KEY_SUFFIX_OVERHEAD (104 bytes with the default KEY_BUF_CAP of 128).
API scope (v0.2)
| Supported | Not yet |
|---|---|
| Whole-file write / replace | Append, partial write |
| Stat, open, sequential read | Seek |
| Delete | Directory listing, rename |
Paths are opaque strings (e.g. /photos/cat.jpg); there is no directory tree.
Errors
Operations return ekv_fs::Error: NotFound, PathTooLong, KeyTooLong, Database, Serialize.
MSRV
Rust 1.87 or newer (edition 2024; required by heapless 0.9; see rust-version in Cargo.toml).
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.