CYW20719 NVRAM Section size

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jbruneaux
Level 3
Level 3
25 sign-ins 10 replies posted 10 questions asked

Hi,

 

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).

 

Regards, Jerome

0 Likes
1 Solution
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

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.

View solution in original post

0 Likes
3 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

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.

0 Likes

Thank you.

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.

0 Likes

The write operation will check the next available write position. I didn't see a specific update plan for this API.

0 Likes