mEEM: automatic EEPROM manager for resource-constrained embedded systems.
- Unlike most of the freely available EEPROM libraries, the mEEM provides your application with a non-blocking, immediate-like access to non-volatile data.
- Guarantees data integrity through checksum verification and provision of default values, so your application would never operate with invalid/undefined data.
- Configurable via GUI tool and JSON files, so you don't have to deal with EEPROM addresses at all.
- Platform-independent: can be used on bare metal, with Arduinos or RTOSes. It follows an asynchronous, non-blocking programming model, that fits everywhere. Thread-safe with caution.
- Hardware-independent: uses unified interface to MCUs' on-chip EEPROMs, external serial EEPROMs/FLASHes, on-chip data FLASHes.
- Highly scalable, with minimalalistic memory footprint
- Manages up to 64KiB EEPROM address space
- Written in C99
Principle of operation (TL;DR)
At startup, the mEEM loads all EEPROM data into RAM (the "cache") and validates it; if data is invalid, default values are loaded; your application uses only the cache, and occasionnaly requests specific caches to be written back to the EEPROM.
For more, see a detailed description.
$ git clone https://github.com/kaladim/microeeprommanager.git
$ cd microeeprommanager
$ git submodule update --initPython 3.10 (or newer) + an active virtual environment:
Linux/macOS:
$ source ./setup_venv.shWindows:
> .\setup_venv.ps1- The process is covered in details here.
- Function bodies of the EEPROM access interface
- Function body of the checksum routine
- Function bodies of user callbacks
A well-written EEPROM access driver and properly chosen checksum algorithm have crucial role in the proper operation of the mEEM!
3. Include the MEEM.h in your application code.
The provided API consists of two parts:
- Core: interface to the mEEM's core logic, provided by the MEEM.h header
- Generated: project-specific interface, provided by the MEEM_GenInterface.h header.
Since the mEEM is useless without the generated interface, MEEM.h includes also MEEM_GenInterface.h. - Although block caches have public visibility, avoid their direct usage. Prefer the generated getters and setters.
- Add core mEEM files and include paths
- Add generated mEEM files and include paths
- Add implemented required interface and include paths
See the provided complete example for reference.
This project is licensed under the MIT License - see the LICENSE file for details.