Concern about too many firmware rewrites to internal flash?

I’m tinkering around with the flipper a bunch, updating to latest release, trying out other 3rd party firmware versions, etc…

However a concern I have is with the fundamental nature of flash memory. It only has so many writes before it’s ability to rewrite breaks down.

How much concern should I have about cooking the internal memory by flashing back and forth too many times between official, 3rd party and custom firmwares?

P.s.
When you have dozens/hundreds of GB and rarely use 100% capacity, it’s a rare issue in the case of SSDs or w/e. However seeing as how internal flash of FlipperZ is a tiny 1MB and likely rewritten in entirety, every time it’s flashed, this seems to me like a genuine concern.

Thanks. See u on the Flip side!

1 Like

Your concern is valid.

The Flipper is using the flash. I think even more than a mobile phone. At first.

As long as your flipper is not your main pentesting tool and your card is not a cheap one, you should be fine… Some day the card will die, the more you are rewrite the card, the faster the D-day will come.

I have thought about this at the beginning and started with a 32GB SanDisk Ultra. At first I’ve reflashed up to 5 times a day. Try every firmware, just build a suitable setup. Than it got quieter, I just saved some dumps. But the analysis is performed mostly external, only some smaller files where regularly written on the card.
At some point I started to write/debug/improve some Programms. At this time they where in the firmware, not modules. I started to flash more times a day, again.

At this point I thought I should buy a cheaper 8 to 16 GB card for this kind of project… But never did it.

My mobile changes 200mb to 3gb music a month (on card, I don’t like streaming). Maybe it is even more used?

My main strategy is: never have your data only on card/usb. Have ever a full backup at another system. If you don’t need the backup, good. If you need it, good too.

1 Like

Thanks for the reply and input!

However, I think you misunderstand (or maybe I do) but I’m not concerned about the SD Card dying, those are a dime a dozen and if it dies, I can just plop in a new one.

My concern is with the onboard flash memory (1MB) chip, inside the Flipper Zero. This is tiny and not replaceable.

For example, if I reflash in DFU mode, doesn’t the 1MB chip get rewritten? Won’t this be a problem in the long term? Particularly, as you mentioned prolly happens a bunch when you first get it… cuz haxoring. ;D

Thanks!

1 Like

Okay, you are absolutely right, I have not thought about the internal flash… But I can’t change anything here, so it is okay for me.

At this time the firmware is under heavy development, some day there will only be one update a month or so. And after Firmware 1.0, do we even need every version?

Even if I focused on the wrong space, I think the outcome is the same, without the backups :slight_smile:

1 Like

STM32WB55xx datasheet
Table 66. “Flash memory endurance and data retention”
“Endurance TA = –40 to +105 °C 10 kcycles”

I beleive 10k of cycles is enough to test custom firmwares.

1 Like

Most flash type memory has tens of thousands of rewrites or more. To put that into perspective, I have never had any other non-volatile embedded memory fail due to what you are asking, in many, many years of tinkering.

Im still waiting for Macronix’s “self-healing” flash chips :face_with_peeking_eye:

I’ve cooked stuff but it’s been applications doing heavy writes to flash.

In my opinion, this seems like huge design flaw. Storage can be overwritten several times a day under normal use.

@LupusE How are official releases relevant? Flipper is widely used to compile and run your own apps etc. No new release today, but I have already rewritten the card several times toady.

@BadgerA I have Turris Omnia router and there were issues with people running custom apps (which is pretty much why you use it) and unintentionally killing internal storage. So I am already familiar with this issue.

I am also not sure how much internal application write on the flash by itself?

Btw, this is reason, Raspberry Pi primarily uses Micro SD cards no internal flash.

The RPI CM4 line are frequently used in commercial applications where they see abuse beyond what most private consumers would do. Accept for the lite model they all have internal flash. I use many micro controllers with internal flash as well. They run 24x7 no problem. Many have for years and I have not had a single failure. I believe my Flipper will be outdated long before it fails due to memory writes. The failures I’ve had were all external flash memory like SD cards and I was abusing them beyond intended purposes.

Running 24x7 is completely besides the point, how many writes are done is what matters. And commercial application where they are abused? Sure, but they fail. For example recent Tesla issue:

Raspberry Pi OSs are fine-tuned to limit the number of writes.

In short: I am able to put all my dynamic files (.ir, .sub .txt, .fap, …) on the SD card. I need to flash the firmware on the internal storage.

Some times I need to compile my own firmware to extend the functionality, and than I need to reinstall on the internal flash 3 to 10 times a day. Or more, because I am a lousy C programmer.
But this is within a week or two or three. not the (more precise: my) regular use case.

Only my opinion, nobody needs to agree.
The Flipper Zero is done. It was a project, and now the product is ready. I don’t think a change this big will be implemented. Maybe some day in the Flipper Zero.Two …
So, it was nice to think about it, I’ll go on.

1 Like

I challenge you to lousy C programmer duel! Worst programmer wins. :laughing:

1 Like

I’ve already thought about a custom universal remote, that is showing the last 3 or 5 IR codes while just increase command by one.
Or is able to set bookmarks, as I saw the ‘safe last Number’ in Barcode generator …
Timeline til next Halloween? :wink:

Perhaps then you should have asked if the Flipper firmware was fine tuned.

The Tesla is an extreme comparison yet the MCU issue is still a small problem. I think the article may prove my point more then yours. A Tesla is a device you expect decades of use from and possibly makes many Gigabytes of writes. My devices running and logging events 24x7 is a much more appropriate comparison to a Flipper.

As mentioned above, the MCU is designed to withstand at least 10K write cycles, and in reality the actual number usually is much higher (10K is the guaranteed minimum). With the flash being 1 Megabyte in size, this means that we can write at least 10 Gigabytes to the MCU before we risk any data loss. Additionally, the firmware doesn’t take up the whole flash storage, and even that doesn’t usually get re-written, only the changed parts do.

In normal operation with the SD card inserted, the Flipper only stores the state of your dolphin (mood, level, etc.) on the internal storage. Without the SD card, all the keys you’ve saved are stored in the internal flash storage as well. All of those files are typically tiny (a few kilobytes at most), so memory degradation is not a real concern. The surrounding hardware of the device will probably break much faster than the MCU’s flash storage (for example, the battery’s lifespan is just a few years due to how Lithium batteries work). There’s also no logging to the internal storage (be it the flash or the SD card), and there are no “constant” write tasks in general.

In addition to that, one of our developers still uses a Flipper from a test batch from more than a year ago (before the first production units were shipped), flashing it tens of times daily, and has yet to see any memory degradation.

TLDR You don’t need to worry about it.

2 Likes