-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvs_write: Bad documented return value. #34204
Comments
@Vladimirek, thanks for reporting this. I am unsure what the error is, when a rewrite of the same data is done, nothing is written to flash, so nvs reports 0 (as documented). Wether this operation is succesful or not, this can be discussed. |
|
I think from user perspective API should return the number of bytes requested to be written for this case as well. |
Will response to this in a patch. |
@nvlsianpu, I don't think a patch is needed. It should be possible for a user to distinguish between a real write to flash and a trial to rewrite. If a documentation update is required i leave up to you. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
Decisions like this are why zephyr isn't as successful as it could be. The user doesn't care how the data was written, only that it was written. This just makes the API needlessly confusing. |
Docs say:
zephyr/include/fs/nvs.h
Lines 105 to 106 in 1342d12
But when the key is already in flash with the same value zero is returned:
zephyr/subsys/fs/nvs/nvs.c
Lines 842 to 846 in 6acc4a2
Need update code or doc header.
The text was updated successfully, but these errors were encountered: