For our project, we have started using the NVRAM to store configuration. While developping, I didn't took care of the size of the data that can be written to a single section.
According to the wiced_hal_nvram.h API (wiced_hal_write_nvram), the maximum data length that can be written is 255 bytes. The actual content that I write is 372 bytes and I get no errors, neither while writting (written length returned by the wiced_hal_write_nvram call is correct, and the p_result value is 0), neither while reading back the section content.
We made a test using two contiguous sections (writing the first section with a 372 bytes long known pattern, then write the second section with an other pattern, readback the two sections and check the content). It appears that there's no problems using more than 255 bytes...
I also read on an other thread that the NVRAM is internnaly managed in a way that it handle wear leveliing, so the test above might not show a problem if the two contiguous sections are in fact away in real NVRAM memory space.
Can you tell me if the 255 bytes limitation is the real one that we should respect (I see that the 20819 is using section 500bytes sections).
I checked the FW code. The max length for the nvram write operation is 600 bytes. There should be no problem if you write 372 bytes.
Can you also confirm that one VS section is therefore 600 bytes long and that there is no risk of data corruption if one section is used with 600 bytes, and other sections are also used. I mean that if the section is in fact 255 bytes long, maybe that writing 600 bytes is ok from the firmware point of view, but in the VS memory space, the exceeding bytes might be overwritten when the firmware is going to write the next memory location in the VS memory space.
Do you think there will be an API update to correct this value ? We are going to add a macro in our code to check the size of the NVRAM content before writing but for other customers, it could be important to know this.
The write operation will check the next available write position. I didn't see a specific update plan for this API.