You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use a readonly NVS partition to provide factory data. The NVS generation tool insists on having at least 3 pages of 4096 bytes (0x3000). IMHO the extra pages are only necessary for writing data to the NVS.
I cut down the generated NVS image to 4096 bytes and flashed it to the partition (type data, subtype nvs), nvs_tool.py can read this cut-down version, but nvs_open_from_partition() fails with error ESP_ERR_NVS_NO_FREE_PAGES.
A readonly NVS partition could ignore the missing empty pages from my point of view.
Describe the solution you'd like.
The runtime code in nvs_flash should ignore missing empty pages for read-only partitions.
Describe alternatives you've considered.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Allow a cut down NVS partition table if it is readonly
Allow a cut down NVS partition table if it is readonly (IDFGH-14558)
Feb 2, 2025
taliesin
changed the title
Allow a cut down NVS partition table if it is readonly (IDFGH-14558)
Allow a cut down NVS partition if it is readonly (IDFGH-14558)
Feb 2, 2025
The fix is a one-liner, I usually do pull requests, but in this case the documentation effort is probably more work
than the actual fix. Not sure if you want to go down that road ...
diff --git a/components/nvs_flash/src/nvs_pagemanager.cpp b/components/nvs_flash/src/nvs_pagemanager.cpp
index 9bbe32c98a..10a5786cba 100644
--- a/components/nvs_flash/src/nvs_pagemanager.cpp
+++ b/components/nvs_flash/src/nvs_pagemanager.cpp
@@ -125,7 +125,7 @@ esp_err_t PageManager::load(Partition *partition, uint32_t baseSector, uint32_t
}
// partition should have at least one free page
- if (mFreePageList.empty()) {
+ if (!partition->get_readonly() && mFreePageList.empty()) {
return ESP_ERR_NVS_NO_FREE_PAGES;
}
Is your feature request related to a problem?
I'd like to use a readonly NVS partition to provide factory data. The NVS generation tool insists on having at least 3 pages of 4096 bytes (0x3000). IMHO the extra pages are only necessary for writing data to the NVS.
I cut down the generated NVS image to 4096 bytes and flashed it to the partition (type data, subtype nvs), nvs_tool.py can read this cut-down version, but nvs_open_from_partition() fails with error ESP_ERR_NVS_NO_FREE_PAGES.
A readonly NVS partition could ignore the missing empty pages from my point of view.
Describe the solution you'd like.
The runtime code in nvs_flash should ignore missing empty pages for read-only partitions.
Describe alternatives you've considered.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered: