Page 1 of 1
SaveUserParameters():effect upon NVRAM lifetime
Posted: Fri Oct 29, 2010 10:37 am
by k1mgy
My application wants to make somewhat heavy use of the 8K user parameter block (SB70LC) - meaning writing some data to it every 5 minutes or so to store such things as memory status, runtime, caution/warning messages so something will be left if things crash and we need to answer the ever-present aspersion: "WTF!"
However, I am a little concerned as to the memory technology. If NAND, is it Single or Multi-level cell technology? And is there any wear leveling involved?
It would also be better to have the ability to address a specific address within the User Parameter Block allocation, rather than read the whole thing and write it back each time it's used. I think this, in particular (and if it's NAND), would tend to kill it.
Anyone have thoughts/experience on this, perhaps a pointer to improve the read/write to the block, and any other thoughts to share?
(I am sorry to have nothing of any import to inject just yet into conversations here, but as experience with NetBurner grows I suspect you'll get something out of my hide eventually).
Re: SaveUserParameters():effect upon NVRAM lifetime
Posted: Fri Oct 29, 2010 10:56 am
by rnixon
I don't know what the max writes are, but lets say its a typical 100k. If you write the same location every 5 min, and my math is correct, thats less than 1 year of writes.
You can control where writes occur by manipulating the structure you are writing to the area, that would help, but lets say you need at least 10 years of writes. In that case one solution is an external ram part with a capacitor backup (to avoid using a battery). That way you have unlimited writes and backup for 90 days if power goes out. I've used these as a data bus peripheral, but maybe they have an I2C or SPI version. These parts also have built-in power fail protection.
You could also try using the on-chip EFFS, which does wear leveling, but again, in my opinion, your writes are too frequent for flash. Others may disagree.
You may have noticed a thread here a few days ago about writing to the saveuserparam section and power failures. In light of just that thread alone you would be looking for an alternative method, especially given that this is specifically for failures.
Re: SaveUserParameters():effect upon NVRAM lifetime
Posted: Fri Oct 29, 2010 11:18 am
by Chris Ruff
Two possibilities:
1. send a packet to some server somewhere every 5 minutes.
2. compact your "packet" of debug data and burn it into high flash end-to-end. use two 64k segments and ping pong them as you fill each to the top. I do this successfully for various length packets and it works great. when you fill one of the buffers shift to the other one and when the other one is full erase the first one and shift to it and so on. if your packet is 10 bytes you can fit some 6 thousand debug packers into one 64k segment
Chris
Re: SaveUserParameters():effect upon NVRAM lifetime
Posted: Fri Oct 29, 2010 5:48 pm
by lgitlitz
The Flash on this part has a guaranteed endurance of 10,000 cycles and a typical endurance of 100,000 cycles. Chris gave good advice on writing to the flash. Nor flash must also erase an entire sector but can write single bytes at a time. Basically every time you erase(0->1 sector only) it is another cycle but you can write(1->0 byte addressable) as much as you want. You should keep incrementing the data writes until you reach the end of the sector then do a full erase. This will only count as a single cycle but you will utilize the entire sector instead of just wearing out the beginning. You should make the data as small as possible. You can also increase the size of the user parameter space to use all of the unused flash:
http://www.netburner.com/downloads/ndk/ ... torage.pdf