This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NVS restrictions

Hi , 

I need to store strings in flash and came  across the NVS. I referred to the example in samples/subsys/nvs and was able to do the nvs operation.

The following are my observations :

(1) the minimum sector_size , i can use is 4096 

(2) Maximum flash size I can use is 24576 (4096 bytes of 6 sectors or 8192 bytes of 3 sector. )

(3) At a time I can write to max of 700 bytes. 

(1) is the minimum sector size and maximum flash size predefined somewhere in the KConfig ? Can we modify ?

(2) Why is the nvs_write is limited to 700 bytes. beyond that , I get the error "Usage Fault". Not sure why ?

With regards,

Saravanan.

  • Hi Saravanan

    1. According to the NVS documentation, the SECTOR_SIZE can be edited as long as you set it to be a multiple of the flash erase page size and a power of 2, so it needs to be a multiple of the page size. 

    2. Is there an error code to the "Usage Fault" error you're getting. What other byte sizes have you tried when you get this error?

    Best regards,

    Simon

Related