Page 1 of 1

SPIFFS Preferences and a file open simultaneously?

Posted: Sat May 18, 2024 9:07 pm
by thomasx
Hi

I am using SPIFFS with Preferences and files. Can I have a Preferences storage and a file open at the same time? Or do I need to close the Preference storage before I open a file, and vice versa?

Re: SPIFFS Preferences and a file open simultaneously?

Posted: Mon May 20, 2024 7:29 am
by pacucha42
Hi @thomasx,
I assume you are referring to the Preferences library for Arduino (https://docs.espressif.com/projects/ard ... ences.html). If so, there should be no interference between SPIFFS partitions and the Preferences, as the latter runs over the NVS (https://docs.espressif.com/projects/esp ... flash.html).

Regarding multiple files in the SPIFFS filesystem - yes, legal option

Please let me know if you need more help

Re: SPIFFS Preferences and a file open simultaneously?

Posted: Mon May 20, 2024 9:18 pm
by thomasx
Hi

Great, thanks!

Another question then.

If I erase and init NVS using

Code: Select all

nvs_flash_erase();
nvs_flash_init();
will files stored in SPIFF, be erased, or will they remain?

Re: SPIFFS Preferences and a file open simultaneously?

Posted: Tue May 21, 2024 1:32 am
by ESP_Sprite
Yes, they will remain. NVS and SPIFFS are independent of eachother; for instance, they use different partition types.