SPIFFS: how to create more then one partitions?
Posted: Mon Sep 16, 2019 6:52 pm
Hi,
I want to keep some sensitive data on different spiffs partition, so I can erase/reflash other partitions freele.
So, I have some questions about this.
1) How should partitions table looks like?
Right now I'm thinking about this format, but not sure about fields "Name" , "SubType" .
2) Does names in partition table realated somehow to actual partition name?
From IDF example I see this:
Does it neccessary to keep same names at base_path and Name/Subtype ?
3) Can I use different file prefixes to operate with different partitions?
Right now I'm operatin with files something like that:
For example, I want open file "list.txt" located on other partition.
Can I just do this:
Thanks in advance
I want to keep some sensitive data on different spiffs partition, so I can erase/reflash other partitions freele.
So, I have some questions about this.
1) How should partitions table looks like?
Right now I'm thinking about this format, but not sure about fields "Name" , "SubType" .
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x170000,
storage1, data, spiffs, 0x180000, 0x270000,
storage2, data, spiffs, 0x3F0000, 0x10000,
From IDF example I see this:
Code: Select all
esp_vfs_spiffs_conf_t conf = {
.base_path = "/spiffs",
.partition_label = NULL,
.max_files = 5,
.format_if_mount_failed = true
};
// Use settings defined above to initialize and mount SPIFFS filesystem.
// Note: esp_vfs_spiffs_register is an all-in-one convenience function.
esp_err_t ret = esp_vfs_spiffs_register(&conf);
3) Can I use different file prefixes to operate with different partitions?
Right now I'm operatin with files something like that:
Code: Select all
file = fopen("/spiffs/list.txt", "wb");
Can I just do this:
Code: Select all
file = fopen("/other_partition/list.txt", "wb");