-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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 iterator does not seem to return all matching entries (IDFGH-2910) #4954
Comments
Hi @alyf80, thanks for posting this issue! Yes, a partition image of the |
btw, the blob |
Missed that... Here is the partition image: In case it matters, I am using this partition map:
|
Hi @alyf80. Seems like the problem is an incorrect handling of blobs here: https://github.com/espressif/esp-idf/blob/master/components/nvs_flash/src/nvs_storage.cpp#L766. I created a patch which fixes that behavior and shows the formerly missing items on your partition (thanks again for uploading!). Our unit tests all pass on this change, so it shouldn't have any side effects. Please let us know if it works. We'll feed the change into our internal CI system but until it's deployed and back ported to version 4.0, it may take a few weeks. |
Thanks @0xjakob, I can confirm that the patch solves the problem. I'll leave this open as the change isn't merged yet. |
@alyf80 Great to hear. It should be closed automatically once the change got merged. |
@alyf80 The fix has just been merged to master, backports for the other versions including v4.0 will be available soon. |
Module or chip used: ESP32-WROOM-32
IDF version: v4.0-223-gfdbdf9a0e
Build System: CMake
Compiler version: xtensa-esp32-elf-gcc (crosstool-NG esp-2019r2) 8.2.0
Operating System: Linux
Hello,
I am trying to iterate over all entries in an NVS partition using
nvs_entry_find()
as per the documentation; however it seems that some entries are being skipped.The missing entries can be read normally with open/get/close.
Dumping the partition (with
nvs_dump()
fromnvs_test_api.h
) shows that the entries being missed are the last two.The problem seems to be related to the partition's contents or layout: it is fully reproducible on this partition, and erasing the partition and recreating its contents does not fix it. However, I have another NVS partition with different contents whose entries I can iterate on successfully.
Test code:
Output:
mesh_core::mesh/sig
andmesh_core:.mesh/role
are missing from the second iteration.Am I doing something wrong?
I can provide an image of the two partitions if needed.
Thanks,
andrea
The text was updated successfully, but these errors were encountered: