Conversation
DhruvaG2000
left a comment
There was a problem hiding this comment.
Thanks for contributing!
Few minor comments, since the PR is still marked as a draft.
| namespace arduino { | ||
|
|
||
| class ZephyrEEPROM { | ||
| public: |
There was a problem hiding this comment.
Is the indent correct? Doesn't public need some indentation?
There was a problem hiding this comment.
Both styles work the same in C++, but typically, access specifiers like public are aligned with the class definition. However, the content under access specifiers should have half-indentation for better consistency, I'll make changes. I also referred to the Wire library codebase.
samples/eeprom_operations/README.rst
Outdated
| Overview | ||
| ******** | ||
|
|
||
| A sample that reads data from flash memory, as well as writes data to flash memory. |
There was a problem hiding this comment.
Some sort of sample output will be good to show.
Also a build command to show how to build this sample can make things much easier for any new users
There was a problem hiding this comment.
Yes sure, I'll add a sample output and include a build command.
| int arduino::ZephyrEEPROM::read_data(uint16_t id, void *data, size_t max_len) | ||
| { | ||
| /* Correctly pass data and max_len */ | ||
| int rc = nvs_read(&fs, id, data, max_len); |
There was a problem hiding this comment.
Just helping debug the issues that you're facing, have you first tried pure zephyr samples?
https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/nvs
Do these work?
|
Ping... is there any further update on getting this to work? |
|
closing due to inactivity |

This PR resolves issue #88
Description:
Implement EEPROM library to ensure compatibility with standard AVR Arduino where actual EEPROM is not present, utilizing non-volatile storage (NVS) as a substitute.
Changes Made:
- Initialization Function: Sets up the NVS storage for data persistence.
- Write Function: Allows writing data into NVS memory.
- Read Function: Retrieves data from NVS memory.
Testing:
Used the beagleconnect_freedom board to test the implementation.
Followed the testing process as outlined here.
Output:

Encountered the following error during testing: unable to get page info.
Please review the code and suggest if any changes are required to improve the implementation or resolve the encountered issue.