Lifetime of flash memory?

doesn’t flash memory have a limited lifetime when it comes to rewriting?
I have a few sansa clip+'s that have broken NAND.
I’m not familiar with the flash memory used in the ArduBoy, and no doubt it will take a lot of rewrites before it’s damaged, but it’s still something worth taking into account, no?

Yes, flash has a limited number of write cycles with Atmel spec’ing, according to the datasheet, to something like 100,000 (and usually chip manufacturers give pretty conservative estimates) and 25 year data retention at 85C and 100 years at 25C for 1ppm (likely these values are extrapolated from probabilistic models and mtbf estimates).

So writing 10 games a day would give an expected life of a little over 27 years before you’d expect to see corruption. Now this isn’t to say you would never see any corruption due to flash wear before this time in any random atmega32u4 but most chips should be fine (failure rates have a gaussian distribution, a “bathtub” shape with the majority ~85% meeting specs and half the rest failing early and the other half of the rest out-living the specs).

1 Like

If you’re playing games you don’t have to worry too much.
(Unless you’re switching them multiple times a day, every day.)

If you’re developing games it’s more of a concern.

I don’t know what the flash chips that will be used for the flash expansion would have as a write limit,
but the Arduboy’s progmem is rated for ~10,000 writes.

I crunched the numbers once and if that were an exact number then writing 20-30 times a day (every day) would give the flash chip about 1 year before it stopped working.
Fortunately that figure is a lower bound, not an average,
but it’s still something to keep in mind.

According to the Winbond W25Q128FV datasheet:

– More than 100,000 erase/program cycles
– More than 20-year data retention

In which case the chip should outlast the Arduboy’s CPU, which is both ironic and amusing.

All of this talk of running out of flash cycles is bound to scare off new users, please understand it is extremely and highly unlikely that you will ever encounter this problem.

All flash memory has limited write cycles, including the memory in your phone, your SD card in your camera, and likley the hard drive on your laptop. How often do you worry about exhausting the erase/write cycles on that hardware?

I’m getting tired of seeing any time flash memory mentioned that we have to bring up the same discussion of write cycles. You’ve made you’re point you can stop your rabble rousing.

1 Like

All of these have wear leveling. The Arduboy doesn’t. However, your point is taken.

1 Like

All those also write very fequently to flash and so do the built in controllers that manage the wear leveling. With Arduboy the only time when there is something written is when you update/change the game.

Fun fact: The color Tamagotchi’s use flash almost like RAM and have no wear leveling. I haven’t seen one dying yet because of worn out flash memory.

1 Like

I’m sorry if I helped open an old wound, I just wanted to respond to @CH23 and let him know that flash wear is basically a non-issue for the average user by giving him some figures from the datasheet.

I’m sorry i never meant for this to scare off people, it was a genuine question i had.

and I thank you, seems like the arduboy will outlive most of my other modern electronics, even with flashing new bootloaders and games occasionally.

Personally I worry enough to have moved most of my programs and regularly written files off my SSD and onto my HDD (including %TEMP% and %APPDATA%).

I don’t do this because I think it’s going to suddenly die on me (though that’s always a possibility),
but because I want to do as much as possible to extend its life for as long as possible.

Also as @MLXXXp pointed out, most of the more common uses of flash memory have a wear levelling mechanism.
(I would presume only the cheapest of SD cards wouldn’t use wear levelling,
but you can never be entirely sure - ‘Counterfeit’/‘fake’ SD cards are a thing.)

Also I did say people who are just playing games don’t have to worry.

It’s developers who can end up flashing 10 times in an hour over several hours for whom it is more of a concern.

Some developers have taken to using the emulator for development for this and other reasons.

I’m not saying it’s something people have to be paranoid about,
but I’m saying if you’re a developer you should be aware of the facts so you can decide whether or not it’s a cause for concern for you personally.

Part of that is due to a lot of modern programs not being written with the details of the actual hardware in mind - they just treat all files as an abstract concept and don’t concern themselves with things like wear levelling and sequential write speed vs random access write speed.
(Though most file APIs using a ‘seek’-oriented model means most files end up being accessed sequentially anyway.)

That said, some programs will actually load the file into RAM and just modify the data in RAM for a while before deciding when it’s a good time to flush.
(I.e. memory mapped files.)

I think I remember reading some OSes do this naturally,
but I can’t remember where I read that or what the details were.

Why not? What’s wrong with wanting to keep something working for as long as possible?

But isn’t the SSD going to last few decades with any kind of abuse? how stingy are you trying to squeeze few cents from it :rofl: :rofl:

An ssd’s lifetime highly depends on temperature, what type of data is generally written, and write frequency. Most mlc flash drives (multi-level cell, which the majority of the high capacity drives use) have endurance only in the 10K range, but with wear leveling and real time compression/decompression that is extended to maybe 100K+. However if you are writing large files of largely incompressible data (such a high res video for editing) then this would be the worst case and could cut drive life my multiple orders of magnitude. Using slc (single level cell) grants a huge boost in reliability and lifetime but costs much more as you fit less memory into a single chip and thus need more chips to get the same amount of memory as an mlc.

… this is getting kinda off topic, so we may want to either split this off or get back on topic

1 Like

I decided to split the whole section off.

I can’t be bothered to contiue debating this because I have more important things to be doing,
but the last thing I’ll say:

What might be just a few cents to you is quite a bit of money for me.

1 Like

Worrying about this stuff is at the expense of your own quality of life.

I used to go out of my way to protect and accommodate lifeless electronics instead of just using them naturally, and now I have a drawer of great-condition devices that few care about anymore. Hardware like this usually fades because the community moves on to something else and the world changes, not because you used it too hard. And if something does fail while you still have an interest in it, chances are it will be something altogether different than what you expected, just because there are so many other things that could break or go bad over time.

Don’t be afraid to flash as many games and dev builds as you have time to enjoy, nothing lasts forever! :slight_smile:

1 Like

Yep, it’s like that expensive set of china plates your family never uses because they are waiting for a special occasion that never comes. I’d rather get some fun and use out of an item than have it sit in a drawer. At the same time though if I am designing something I take the time to think about making things as robust and reliable as possible so the end user doesn’t have to worry about it. As an end user, I still take care of my stuff as much as I can, but not at the expense of utility.

1 Like

Here is an analog for cars:

If you drive your car like a normal person, and change your oil correctly, you never have to worry about your piston rings going bad. How often do you think about your piston rings when you start your car? Probably not often.

If you drive your car in a professional race, I gaurantee you are always thinking about your piston rings.

In this example, changing your oil correctly is making sure you aren’t executing any code that is running in a loop erasing or writing memory unintentionally and someone who is developing code non stop is like a race car driver.

For the average user, it is not important to worry about this stuff, because as long as you are doing normal things with it, you won’t ever run into a problem. For the “power user” or someone who is trying to push the device to it’s limits or doing development in ways that is non standard, it is important to know that flash writes are a consumable resource in practice not only in theory.



Nice example.

Personally, I don’t really care.
Now this can probably tell you why:

I use my laptop every day. For the past 6 months this computer is using the same SSD. (with everything on it)
My Samsung SSD (256GB) is designed to have 150TB (written) before dying.
I just checked, and the Magician Software says:

This laptop is already 7 years old. Even if it is completely new it means that the drive will probably fail after 150(TB) / 0.5(TB)*6(month)*1(year)/12(months)= 150 years.
For Arduboy, think this:
Say you save your game 10 times everyday. (reasonable)
You have 10,000 writes.
That is 10,000(writes)*1(day)/10(writes)*1(year)/365(days) = 2.73(years)
Also, I will GUARANTEE you that you won’t be playing it everyday.
Say you play 5 days out of 7. No. 4 days out of 7.
2.73 years / (4(days) / 7 (days)) = 4.79(years)
NOT to mention that you also have the simulator(both online and offline), it easily lasts 4 years.
I doubt you don’t change your laptop by then. Or if you can still find it by then.

Thinking twice, I don’t see why must it be EEPROM. It can be RAM, you know.
The SRAM. Or the Static Random Access Memory.
Because the rechargeable battery is still inside. Since SRAM don’t use a lot of electricity, this will probably last long. AND Static Random Access Memory is LIGHTNING fast (CPU cache)
It’s expensive, however.

1 Like