Other Parts Discussed in Thread: SYSCONFIG
I've got a board that has some pre-existing regions that I'd like to continue to manage manually in NVS (they don't change often, and are easy to manage) and would like to dedicate a section of the offchip storage to a SPIFFS -
The example in the spiffexternal looks like it is set up to use
SPIFFSNVS_config
Which takes a parameter of the NVS region - which looks like it takes in the index of a pre-defined NVS region (in the example it takes in the entire offchip memory defined in the board) - diving into that code I see that it takes the entire NVS region and starts at offset zero of the region when it configures the spiffs config:
/* Initialize SPIFFS configuration structure using the following: */
fsConfig->phys_size = nvsAttrs.regionSize;
fsConfig->phys_addr = 0; /* Beginning of NVS region */
My current NVS region is defined as the entire offchip flash (isn't modified at all) and in the code care is taken to be smart about the offsets that are used to avoid overwriting things in regions it shouldn't (such as application code overwriting the OAD image, etc) -
It seems I have two options -
1. I create a second NVS config that has the offset and region size that I care about, and then pass that to the (unmodified) SPIFFSNVS_config method
2. I modify the SPIFFSNVS_config to make use of my existing NVS region but take in an offset and size parameter so I can have the SPIFFS
Is it a problem to have multiple overlapping NVS configs? I could split my existing one into three regions (since the part I want to use for SPIFFS is in the middle of the existing one) or I could continue with the large one and then have another one that's a subset of it configured alongside it.
I was leaning towards option #2, but if it's not a problem to have multiple overlapping NVS regions then option #1 doesn't seem too bad
Am I on the right track with this? Is there a better way to have part of the off-chip flashed used with SPIFFS while some of it is still managed manually?