I’m working on a project where I have an ESP32 paired with a LoRa module to receive sensor data. I plan to store this data on a W25QXX SPI flash chip. My question is: Can I use SPIFFS to implement and manipulate a file system on the W25QXX flash chip for storing the sensor data?
Using SPIFFS directly on a W25QXX SPI flash chip for storing sensor data is not directly supported because SPIFFS (SPI Flash File System) is typically designed to work with the internal flash memory of ESP32, not external SPI flash chips like the W25QXX series.
Thanks,
what is the best way to implement a file system on W25QXX chip using an esp32 ?
you can achieve similar functionality by directly interfacing with the W25QXX chip using SPI commands and implementing your own file management logic. ESP32 has dedicated SPI pins (SCK, MISO, MOSI, and optionally CS) which you'll use to interface with the W25QXX chip.
A lot depends on what sort of file system you want?
Are you going to receive the sensor data and write it continuously to a large single file?
Do you want a new file every day, every hour etc?
How big a file do you think you would need? The W25Q devices can hold a lot of data.
How long would the project store the data for before it was retrieved?
I want a file every new day
A file would be no larger than 5 kb
I want to implement cyclic recording where the older files gets deleted automatically when storage is more than 75% full
Have a look at
There are some limitations with this library, but for what you want, I think it will be fine.
You need to create the empty files first. You could create 31 empty files each of say 32kb which would give you plenty of overhead on your 5Kb.
You could even create 365 empty files that size - depending on the W25Q device you have. All file are created "empty" and space allocated for them on the flash device. You simply open the file and write to it.
There is a file erase too but note that the actual file isn't erased (i.e. you don't get your space back) but it is marked empty for you to write to it again.
how about storing images,audio,gif etc
What do you think would be the problem(s) with these file types? They are all just files full of data.
i want to use file system .like littlefs and Spiff as external flash storage is that possible with w25qxx
Windbond W25Q32 SPI Flash chips , or equivalents, are very frequent as side Flash memory on boards with ESP32 (chip or module)
More and more ESP32xxx réferences have an SPI Flash in the chip
With the partition scheme you can choose % of Flash SPI left for SPIFFS (or now LIttleFS) and your datas
Some boards have a W25Q128 , W25Q256 or equivalent in the WROVER Module if 4MB is not enough for you...
[https://www.wemos.cc/en/latest/d32/d32_pro.html](https://www.wemos.cc/en/latest/d32/d32_pro.html)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.