ESP32-S3 NVS not working correctly
Posted: Sun Jan 15, 2023 8:33 pm
I've recently switched from an ESP32-C3 to and ESP32-S3 on my custom board and now the NVS storage is broken?
In setup() I'm calling:
This works fine. No errors.
Somewhere later I'm calling:
This gives following errors:
The keys apparently don't exist although I saved them in setup().
This all worked perfectly fine on ESP32-C3.
I'm using PlatformIO in VSCode and arduino as the framework.
In setup() I'm calling:
Code: Select all
Preferences Flash;
if(Flash.begin(NVS_CONFIG_DIR))
{
Flash.putInt(NVS_CONFIG_TYPE_KEY, 2);
Flash.putString(NVS_CONFIG_NAME_KEY, "ESP32-S3-01");
Flash.end();
}
Somewhere later I'm calling:
Code: Select all
Preferences Flash;
uint8_t Buf[128];
if(Flash.begin(NVS_CONFIG_DIR, true))
{
int Length = Flash.getString(NVS_CONFIG_NAME_KEY, (char*)&Buf[0], 128);
int Type = Flash.getInt(NVS_CONFIG_TYPE_KEY);
Flash.end();
}
Code: Select all
[ 2464][E][Preferences.cpp:460] getString(): nvs_get_str len fail: Testt NOT_FOUND
[ 2465][V][Preferences.cpp:388] getInt(): nvs_get_i32 fail: Type NOT_FOUND
This all worked perfectly fine on ESP32-C3.
I'm using PlatformIO in VSCode and arduino as the framework.