I have a Lego Mindstorms NXT 2.0, which I'm tinkering around with, writing a custom firmware for. I just want to know if repeated flashing could damage the flash memory.
LEGO Mindstorms all use flash storage which does have a limited number of write cycles, so the answer is technically yes in some capacity, but it's probably not something you need to worry about.
A LEGO Mindstorms NXT 2.0 uses a Atmel AT91SAM7S256 microcontroller. This board has 256 KB flash memory, which is roughly the size of the latest firmware image.
According to the datasheet for this board, it should be good for 10,000 write cycles.
- 256 Kbytes of Internal High-speed Flash, Organized in 1024 Pages of 256 Bytes
- Single Cycle Access at Up to 30 MHz in Worst Case Conditions
- Prefetch Buffer Optimizing Thumb Instruction Execution at Maximum Speed
- Page Programming Time: 4 ms, Including Page Auto-erase, Full Erase Time: 10 ms
- 10,000 Write Cycles, 10-year Data Retention Capability, Sector Lock Capabilities, Flash Security Bit
- Fast Flash Programming Interface for High Volume Production
10,000 is actually quite a bit, and would take a very long time to reach intentionally, even if you automated it to run 24/7.
I'm not sure how fast you physically can flash the firmware, but if you did it once every 10 minutes 24/7, it would take you almost 70 days to reach that limit.
If you flashed it a still-unrealistic 10 times per-day, it would take you 1000 days to reach that limit.
And of-course, if you did it once per-day, it would take you over 27 years.
In practice, I think it's much more likely some other hardware component will fail first.
I've found a very old NXTasy thread that answers this question definitively.
Flemming Bundgaard, from LEGO, ran two or three test-to-failure runs with my NXTTools utility repeatedly setting the brick into firmware download mode and downloading the standard NXT firmware to the brick. In each of his tests the brick failed, if I recall correctly, after ~7000-8000 iterations. There is no doubt that if you put your NXT into boot mode somewhere in the neighborhood of 8000 times your brick will no longer accept a new firmware download. You can test this yourself if you like using NXTTools undocumented iteration count switch and a brick running on an external power supply. Each iteration takes about 30 seconds so the test will run for ~67 hours. Of course, your brick could have a different lock bit lifespan than Flemming's bricks had. It is also worth pointing out that if you reflash or reset your NXT once a day 365 days a year it will probably take you almost 22 years to wear out your lock bits. If you do it 10 times a day, everyday, then your brick should last 2.2 years.