SPIFFS Preferences and a file open simultaneously?

thomasx
Posts: 8
Joined: Sun Mar 17, 2024 10:07 pm

SPIFFS Preferences and a file open simultaneously?

Postby thomasx » Sat May 18, 2024 9:07 pm

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?

pacucha42
Posts: 31
Joined: Fri Mar 29, 2019 12:56 pm

Re: SPIFFS Preferences and a file open simultaneously?

Postby pacucha42 » Mon May 20, 2024 7:29 am

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

thomasx
Posts: 8
Joined: Sun Mar 17, 2024 10:07 pm

Re: SPIFFS Preferences and a file open simultaneously?

Postby thomasx » Mon May 20, 2024 9:18 pm

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?

ESP_Sprite
Posts: 9724
Joined: Thu Nov 26, 2015 4:08 am

Re: SPIFFS Preferences and a file open simultaneously?

Postby ESP_Sprite » Tue May 21, 2024 1:32 am

Yes, they will remain. NVS and SPIFFS are independent of eachother; for instance, they use different partition types.

Who is online

Users browsing this forum: Bing [Bot] and 69 guests