First of all I'm working with a Folger Tech Prusa i3 kit, if that makes a difference. Also I believe the Arduino is a Mega 2560.

I know somewhere in the back of my head that electrically programmable ROM like what must be on the Arduino board storing the firmware degrades a little, each time you write to it. Right now I'm trying to calibrate away another print problem, and I think I need to modify the firmware yet again, which I've already done several times. So I'm starting to worry about how many times I can do that.

Well, once I remembered the acronym "EEPROM", and after a little googling, I came across this, Arduino - EEPROM, which says that it can handle 100k cycles, so I think I'm onto the answer, but the problem is I'm not sure if a cycle is an entire file being uploaded? Wouldn't it be a single blip of data? And if so how many cycles would the average Marlin file consume?

I also found this:

but I'd be very surprised if I've uploaded to it more than 2000 times

on Mega2560 bricked? not detected, DFU failing, indicating that the answer might be as low as 2000.

Also, this:

Failure modes

There are two limitations of stored information; endurance, and data retention.

During rewrites, the gate oxide in the floating-gate transistors gradually accumulates trapped electrons. The electric field of the trapped electrons adds to the electrons in the floating gate, lowering the window between threshold voltages for zeros vs ones. After sufficient number of rewrite cycles, the difference becomes too small to be recognizable, the cell is stuck in programmed state, and endurance failure occurs. The manufacturers usually specify the maximum number of rewrites being 1 million or more.[5]

During storage, the electrons injected into the floating gate may drift through the insulator, especially at increased temperature, and cause charge loss, reverting the cell into erased state. The manufacturers usually guarantee data retention of 10 years or more.[6]

from Wikipedia: EEPROM - Failure Modes, indicating the answer might be into the millions.

At this point I'm just wondering if an expert might see this and relieve my angst...

  • $\begingroup$ The AT Mega2560 has internal flash storage, but it helps to look at external flash devices for information. There are several different grades of external flash devices. Some can be flashed only a very small number of times, and from these parts the 2000 number may come. Other, higher-grade parts can be reflashed a million times. In my work, we usually see ratings of 10,000 for low-cost parts and 100,000 for higher-cost parts. For integrated flash, there may not be such a range of price and lifetime, since it would complicate the manufacturer's testing and distribution channel. $\endgroup$
    – cmm
    Apr 18, 2019 at 13:40

2 Answers 2


The EEPROM is not where the program itself is stored, what's relevant for your question is the flash. The flash in the ATmega2560 is rated for 10,000 cycles (i.e. you can reprogram it at least 10,000 times).

  • $\begingroup$ A "cycle" for flash storage is not the writing but is the erasing. When Flash is written, it must first be erased. The erase process stresses the device, and over many cycles leads to several failure modes. Writing data into the erased part is more benign. Thus, it doesn't matter how big the program is. "Re-Flashing" starts with an erase cycle, followed by as many programming cycles as necessary. $\endgroup$
    – cmm
    Apr 18, 2019 at 13:36

The AVR has SRAM for variables (what is usually called RAM), it has EEPROM for non volatile variables and it has flash for the executable code. (Harvard Architecture!)

For re-flashing the firmware neither SRAM nor EEPROM write rates are important, but the Flash rates are. The flash write rates are in the region of 100 thousand to a million so that should not be a problem.

The article you linked also states that he did not more than 2000 rewrites and therefore should be fine. I can only agree. A few thousand re-flashes is no problem. Once you get closer to 100 thousand you can start to worry.

Flash bits can only be written from 1 to 0. Erasing the flash writes all bits to 1. Erasing can only be done on a flash page (size is device dependent but usually a multiple of 512).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .