Skip to content
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 component tries to retrieve data from the APP (should be in NVS data) partition with guids to invalit argument in esp_partition_read() (IDFGH-11823) #12916

Closed
3 tasks done
ralphde opened this issue Jan 2, 2024 · 8 comments
Assignees
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@ralphde
Copy link

ralphde commented Jan 2, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

5.x

Espressif SoC revision.

ESP32-S2

Operating System used.

Windows

How did you build your project?

Eclipse IDE

If you are using Windows, please specify command line type.

None

Development Kit.

custom

Power Supply used.

External 5V

What is the expected behavior?

that values stored in NVS can be retrieved from any task at any time.

What is the actual behavior?

The purpose is to store and read a simple unsigned log variable stored in NVS. While the Wifi component are able to read and write is it impossible for my application to read the variable from the HTTP server component task.
Screenshot 2024-01-01 112210
Screenshot 2024-01-01 112455

And this is how a call should look
Screenshot 2024-01-01 131452

Steps to reproduce.

create a NVS variable in the main task and read it from anywhere

Debug Logs.

see screen shots

More Information.

I have sacrificed my Christmas and new years eve to find a solution, no chance. The whole problem started when I set up a new computer for developing with no ties to former installed IDF versions. On my old computer, where the .espressife folder contained other IDF tools it worked miraculously using IDF 5.0.2 until I started to use a clean new computer. And now I introduced the habit to delete the .espressife folder when I change the IDF version and this issue is persistent now

This behavior is so bad, that I thing any IDF 5.x is not usable at all because I have also the problem that simple global variables are not accessible from other tasks scopes. I had to store all those in the heap.

@ralphde ralphde added the Type: Bug bugs in IDF label Jan 2, 2024
@github-actions github-actions bot changed the title NVS component tries to retrieve data from the APP (should be in NVS data) partition with guids to invalit argument in esp_partition_read() NVS component tries to retrieve data from the APP (should be in NVS data) partition with guids to invalit argument in esp_partition_read() (IDFGH-11823) Jan 2, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 2, 2024
@pacucha42
Copy link
Collaborator

Hi @ralphde, thank you for the report.
Could you share code, please? The troublesome parts would be sufficient. NVS component uses its own partition type and should be accessed purely by the NVS interface (no esp_partition_read()). Generally, the access should be independent on OS task type.

@ralphde
Copy link
Author

ralphde commented Jan 8, 2024 via email

@pacucha42
Copy link
Collaborator

Ok, will take a look. Thanks!

@ralphde
Copy link
Author

ralphde commented Jan 8, 2024 via email

@pacucha42
Copy link
Collaborator

Source code attachment found, I'll update you asap. Thank you

@AxelLin
Copy link
Contributor

AxelLin commented May 20, 2024

Source code attachment found, I'll update you asap. Thank you

@pacucha42 Any update?

@espressif-bot espressif-bot assigned rrtandler and unassigned pacucha42 May 25, 2024
@rrtandler
Copy link
Collaborator

Hi @AxelLin and @ralphde,

Please try to avoid second call to nvs_flash_init. The current source code does the sequence:
main.c -> maxill_name.c:fileNameInit() -> nvs_flash_init();
main.c -> maxill_name.c:fileNameInit() -> nvs_open(... &maxill_nvs_handle);
main.c:ESP_ERROR_CHECK(nvs_flash_init());

Second call to nvs_flash_init in main.c likely invalidates the maxill_nvs_handle obtained in the fileNameInit()

You can try to comment the "main.c:ESP_ERROR_CHECK(nvs_flash_init());" line as the nvs_flash is already initialized by the fileNameInit().

@rrtandler
Copy link
Collaborator

I am closing the issue as there is no update for a long period of the time. Please free to reopen if you feel the problem persists.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Won't Do This will not be worked on and removed Status: Opened Issue is new labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

5 participants