Repository navigation
UtilifyEEPROM 1.0.10
UtilifyEEPROM 1.0.10 significantly improves storage integrity, EEPROM bounds checking, ESP32 persistence, tests, and documentation while preserving the existing public API.
Highlights
- Added strict validation of EEPROM addresses, metadata, counters, and CRC values.
- Added read-back verification after saving.
- Fixed persistence on ESP32 by committing writes internally.
- Improved sequential block rotation reliability.
- Added compile-time validation of stored data types.
- Added comprehensive unit tests.
- Added complete English and French documentation.
- Added GitHub Actions continuous integration.
- Added build validation for Uno R3, Uno R4, and ESP32.
Storage integrity improvements
load()validates the current block address before accessing it.- Invalid or empty write counters are rejected.
- CRC16 is verified before data is exposed to the application.
- Failed loads leave the current RAM value unchanged.
save()reads the record back and verifies its counter, CRC, and payload.- Invalid metadata and out-of-bounds addresses no longer lead to unsafe EEPROM access.
- RAM storage is now value-initialized.
Write and rotation improvements
- Each block accepts 20,000 successful saves by default.
- The next save moves to the following block.
- A new block is verified before the header points to it.
save()returnsfalsewhen no valid block remains.- Invalid or corrupted write counters are rejected.
- AVR uses
EEPROM.update()while erasing to avoid unnecessary physical writes. - ESP32 writes are committed before an operation reports success.
The block limit can still be overridden for testing:
build_flags =
-D OVERRIDE_EEPROM_MAX_WRITES_PER_BLOCK=3Stored type requirements
EEPROMDataStorage<T> now checks at compile time that T is trivially copyable.
Suitable types include structures containing:
- fixed-width integers;
- floating-point values;
- fixed-size arrays;
- other trivially copyable structures.
Do not store:
String;- pointers;
- virtual objects;
- dynamically owning containers;
- objects whose representation differs between target platforms.
Use fixed-width types such as uint16_t when data must remain portable between boards.
Tests
The test suite covers:
DataStorage<T>;- value initialization;
- RAM data replacement;
- successful saves and loads;
- invalid application signatures;
- CRC corruption;
- invalid block addresses;
- invalid write counters;
- EEPROM areas that are too small;
- sequential block rotation;
- full EEPROM handling;
- ESP32 commit failures;
- read-back verification;
- EEPROM initialization and erasure.
The test firmware can be compiled for Uno R3, Uno R4 Minima, Uno R4 WiFi, and ESP32.
Documentation
The new bilingual documentation covers:
- typed storage;
- EEPROM layout;
- application signatures;
- CRC validation;
- sequential block rotation;
- ESP32 initialization and commits;
- stored type restrictions;
- power-loss limitations;
- EEPROM ownership;
- PlatformIO and Arduino IDE installation;
- running tests from PlatformIO and Visual Studio Code.
Documentation:
Supported platforms
- Arduino Uno R3
- Arduino Uno R4 Minima
- Arduino Uno R4 WiFi
- ESP32 using the Arduino framework
Installation
Available from the PlatformIO Registry:
lib_deps =
sirdrako/UtilifyEEPROM@^1.0.10Utilify and the CRC library by Rob Tillaart are installed automatically.
Important storage warning
UtilifyEEPROM owns the complete EEPROM area exposed by EEPROM.length().
A different application signature or an invalid current-block address causes the library to erase that entire area and initialize a new header. Do not share the configured EEPROM area with unrelated application data.
CRC16 detects accidental corruption but does not provide encryption or authentication.
Repeated writes to the same block are not fully transactional. A power loss during an in-place write may invalidate the latest record.
Compatibility
No existing public method or constructor has been removed or renamed.
EEPROMDataStorage<T> now intentionally rejects non-trivially-copyable data types at compile time.
Thank you for using UtilifyEEPROM!