Skip to content

Conversation

@medamawa
Copy link

@medamawa medamawa commented Jan 3, 2026

Changes

Completely refactored the EEPROM directory architecture from a partition-based system to a key-value storage system with dynamic block allocation. The new implementation provides a more flexible and efficient way to store and retrieve data in EEPROM.

Notes

  • Public API: The public API is only in middleware/inc/eeprom_directory.h. All other header files (eeprom_alloc.h, eeprom_storage.h, eeprom_directory_struct.h) are internal implementation details and should not be used directly by application code.
  • The old partition-based API is completely replaced. Old code using eeprom_get_base_address() etc. will need to be migrated.
  • Maximum value size is 16 bytes (4 blocks × 4 bytes per block)
  • Keys are fixed 4-byte arrays, not null-terminated strings
  • The allocation table and key map are persisted in EEPROM
  • Memory layout: Allocation table (64 bytes) → Key map (1536 bytes) → Data space (2048 bytes)

Test Cases

  • Single byte value storage and retrieval
  • Multi-block value storage (up to 16 bytes)
  • Key overwrite behavior
  • Value deletion and block reuse
  • Error handling (null pointers, not found, allocation failures)
  • Allocation table state verification

To Do

  • Optimize memory allocation
  • Add unit tests
  • ...

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please reach out to your Project Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • No merge conflicts
  • All checks passing
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes # (issue #)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants