This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SIMPLELINK-CC13XX-CC26XX-SDK: Splitting offchip flash memory, managing some manually with NVS and some with SPIFFS

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 


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? 

  • Hi,

    Thank you for reaching out.

    To be honest, the configurations you are intending to use are not as thoroughly tested as the more "usual" ones.

    In general, having overlapping regions should not be a problem. SysConfig will raise a warning (that can be disabled) but the code generation should occurs properly. Of course, having overlapping regions forces you to be extra-carefull to avoid conflicts - but you seem well aware of this :)

    In summary, either option should be fine. Thorough testing from your side is strongly recommended.

    Best regards,

  • Yeah it's not normal. It's an older project I inherited that predates sysconfig, so that's part of why I don't just make another nvs region (it might take me forever to find where to do it)