cancel
Showing results for 
Search instead for 
Did you mean: 

ModusToolbox Bluetooth SDK

New Contributor II

According to the page 15 of the document found in the following URL, CYW20819 has "defragmentation" algorithm that runs during chip boot-up.

https://raw.githubusercontent.com/iotexpert/WBT101/master/labmanual/English/PDF/WBT101-02-Peripheral...

Could anyone answer the following questions?

(1) What risks are there if we turn the power off during defrag?

(2)How can we change the size allocated to NVRAM?

    "The BSP typically allocates 4 kB to 8 kB for the NVRAM, but it is user-modifiable."

(3)How long is it take to complete the defrag at a maximum?

(4)Can I have a estimation that how many data can be wrriten until running the defrag?

(5)Are more documents about the defrag available?

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi ToKo_4602001​,

As mentioned in the NVRAM section of the manual you pointed at, to stop the wearing out of the memory, internally moving of the data is done, which is called as Wear Leveling Scheme of memory. User is only accessible to VSID & not the physical address. So in actual, user don't know the exact memory location where data is being stored. This is done by firmware internally, user do not have control on it.

Following are my answers to your queries:

1. As explained above, it might happen that user keep on accessing a particular memory sector/block and remaining part of memory remains untouched, This will affect the lifecycle of memory, therefore defragmentation is necessary. This is taken care internally to Firmware where there will be a mechanism to restore the data or keep it safe if power failure occurs during defragmentation.

2. You can store data upto max 8kB using APIs wiced_hal_write_nvram , not above that

3. Firmware takes care of it, we are not sure about the timings, need to check.

4. 5. We cannot disclose much information about firmware to customers. We don't have any other documentation available regarding this.

One doubt, what is your application? I mean you need not worry about the data being written before or after defragmentation, user data won't be lost in any case. If you could let us know more about your use case, we can help more precisely.

Some articles for understanding Wear leveling of memory:

https://www.macronix.com/Lists/ApplicationNote/Attachments/1869/AN033_Ap%20Note%20for%20Wear%20Level... 

https://en.wikipedia.org/wiki/Wear_leveling

View solution in original post

2 Replies
Moderator
Moderator

Hi ToKo_4602001​,

As mentioned in the NVRAM section of the manual you pointed at, to stop the wearing out of the memory, internally moving of the data is done, which is called as Wear Leveling Scheme of memory. User is only accessible to VSID & not the physical address. So in actual, user don't know the exact memory location where data is being stored. This is done by firmware internally, user do not have control on it.

Following are my answers to your queries:

1. As explained above, it might happen that user keep on accessing a particular memory sector/block and remaining part of memory remains untouched, This will affect the lifecycle of memory, therefore defragmentation is necessary. This is taken care internally to Firmware where there will be a mechanism to restore the data or keep it safe if power failure occurs during defragmentation.

2. You can store data upto max 8kB using APIs wiced_hal_write_nvram , not above that

3. Firmware takes care of it, we are not sure about the timings, need to check.

4. 5. We cannot disclose much information about firmware to customers. We don't have any other documentation available regarding this.

One doubt, what is your application? I mean you need not worry about the data being written before or after defragmentation, user data won't be lost in any case. If you could let us know more about your use case, we can help more precisely.

Some articles for understanding Wear leveling of memory:

https://www.macronix.com/Lists/ApplicationNote/Attachments/1869/AN033_Ap%20Note%20for%20Wear%20Level... 

https://en.wikipedia.org/wiki/Wear_leveling

View solution in original post

New Contributor II

Thank you for your answer.

> what is your application?

Our application is a general-purpose Bluetooth module that may be used to mobile printers, the remote control, portable electronic products, and so on.

Our customer's products with our module are battery-operated. So power may be disconnected unexpectedly.

Out existing product (with other vendor's LSI) has DEFRAG algorithm too and many times we have experienced defects that are caused with disconnecting power during DEFRAG.

So some customer avoid issuing the commands that writes data to NVRAM.

According to your comment "there will be a mechanism to restore the data or keep it safe if power failure occurs during defragmentation", serious problem (f.e. mandatry operating parameter values are disappear from NVRAM) will not occur. However If you have any additional notes with warrant attention, I would appreciate it if you could tell me.

Regards,

0 Likes
Reply