Preferences freeEntries() returns same number regardless of partition size. #11400
Closed
1 task done
Labels
Status: Awaiting triage
Issue is waiting for triage
Board
ESP32 Dev Module
Device Description
I am using the official ESP32 Dev Module with a 4MB flash.
Hardware Configuration
None
Version
v2.0.17
IDE Name
VSCode
Operating System
macOS
Flash frequency
40Mhz
PSRAM enabled
yes
Upload speed
115200
Description
I have been using the prefs library with a custom partition table for a while now using a nvs partition named 'nvs' with size 0x5000.
I needed a larger parition, so have created a new partition table where i have a second nvs partition named 'nvs2' with a size 0x40000.
I have attached both tables for your reference.
partitions_custom_old.csv
partitions_custom.csv
Earlier I used to initialize the prefs using:
bool flagSuccess = prefs.begin("w2", false);
I now initialize as follows:
bool flagSuccess = prefs.begin("w2", false, "nvs2");
The issue is that after initializing if I call the prefs.freeEntries() function, in BOTH cases it returns the same number of free entries: about 630.
I tested both by first doing a full clean in platformio and then erasing the flash of the device.
The number 630 is what is reported on the first boot up (after erasing the flash and loading the firmware) using the following code:
size_t entriesAvailable = prefs.freeEntries(); Serial.print("SETTINGS_DEBUG: Entries available: "); Serial.println(entriesAvailable);
I am not able to figure out why the much larger 'nvs2' is still leading to the same amount of free entries.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: