Thread Safety of NVS on one core and SPIFFS on another

GeorgeWBush
Posts: 2
Joined: Sun Oct 29, 2023 5:06 pm

Thread Safety of NVS on one core and SPIFFS on another

Postby GeorgeWBush » Sun Oct 29, 2023 8:33 pm

I am currently programming a NimBLE based BLE datalogger. NimBLE utilizes the NVS api to store data into the NVS partition of my flash. This is a seperated partition to my SPIFFS (I believe technically it is LittleFS at this point?) filesystem.

NimBLE is run on core 2, while my main application, which uses SPIFFS, runs solely on core 1.

My question is; Could the fact, that I am using NVS on another thread and therefore the possibility of concurrent read/write calls to the flash cause any issues? Or are the thread safety mechanisms between the two filesystems?

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

Re: Thread Safety of NVS on one core and SPIFFS on another

Postby ESP_Sprite » Mon Oct 30, 2023 1:20 am

NVS doesn't have an underlying filesystem; it's its own journaling file system type storage. The flash block drivers are re-entrant, so you shouldn't have to worry about multiple tasks doing things to the flash.

Who is online

Users browsing this forum: No registered users and 388 guests