Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

ITSYBITSY M4 Question relating to NVM
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ITSYBITSY M4 Question relating to NVM

by FriehoffT on Thu Mar 19, 2020 9:04 am

I downloaded the datasheet of the GD25Q16C chip from GigaDevice.
My question relates to the write cycle count.
In this datasheet, they talk about: "Minimum 100,000 Program/Erase Cycles "
Is there anyone having experiences when and how failures start to happen,
how to detect them and are there ways to extend the cycle times.
I do not need many individual values to be stored but I want to store data there
frequently and over long periodes of times...
Are these cycles meant for the whole chip?
Or "block", "sector", "page" ?
I could easily switch after 100.000 write cycles to another "block", "sector" or "page" for storing the data,
If it would be cycles per page this would offer 819,200,000 cycles until to be expected failure..
Anyway how can someone "detect" a failure?

Thomas

FriehoffT
 
Posts: 12
Joined: Wed Sep 11, 2019 7:30 am

Re: ITSYBITSY M4 Question relating to NVM

by adafruit_support_mike on Tue Mar 24, 2020 5:47 am

FriehoffT wrote:Is there anyone having experiences when and how failures start to happen,

Flash memory is made from mosfets with a 'buried gate'.. a small layer of metal completely surrounded by insulation.. and another gate that partially overlaps the buried one. If you apply enough voltage to the outer gate, electrons can jump through the insulation to the buried gate via quantum tunneling. Once that happens, the electrons can remain trapped in the buried gate for as much as a hundred years before they jump out again on their own.

The electrical charge on the buried gate partially controls the mosfet, making it easier or harder to turn on with the exposed gate. The logic that reads Flash tests the mosfets with voltages low enough to avoid changing the charge trapped on the buried gate.

Quantum tunneling is a statistical process, so the amount of charge that jumps into or out of the buried gate is somewhat random. Over time, the random errors can add up to an amount of charge that can't be zeroed by a standard erase cycle, or can't be set to 1 with a standard write cycle.

To avoid having some bits change more often than others, any data going to Flash memory goes through a 'whitening' system that has a 50% chance of changing each bit in the storage array. Over time, all of the bits in a given page of memory are erased and set about the same number of times.

As further protection, 8 bits of data may be stored in 12 or more cells of the physical array, using self-correcting error codes. Even if one bit in a group stops responding, the error checking system can reconstruct its correct value from the other ones. You can create self-correcting codes that can reconstruct the correct value even if N bits of input are wrong, but the number of bits you have to store increases with the number of errors you want to tolerate.

The 100k erase-write cycle limit measures the probability of having more than N errors in the storage array. The exact time will be random, but people who've tested microcontroller Flash memory have usually seen the first error at about 10% higher than the specified limit. The errors show up as reading a value that's different from the one you stored.

FriehoffT wrote:are there ways to extend the cycle times.

No. Anything that would fix bits stuck on 1 would make bits stuck on 0 even worse, and vice versa.

FriehoffT wrote:Are these cycles meant for the whole chip? Or "block", "sector", "page" ?

The limits apply to each page of storage (64 bytes IIRC). If you run through 100k cycles on the first page, the second page will be good for the next 100k cycles.

If you don't need to store a lot of data, I'd suggest FRAM instead of using the Flash:

https://www.adafruit.com/product/1895
https://www.adafruit.com/product/1897

It's faster, has a life cycle about ten million times longer than Flash, and doesn't need to worry about pages.

adafruit_support_mike
 
Posts: 61014
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.