Writing to MCU flash

Jan 24, 2019 106 Replies

gnuarm wrote

Well, I am not much into arguing for the sake of arguing. Sure there are many warnings for everything, including glowballworming. I have had a harddisk fail simply because I dropped those, the FLASH based memory cards dropped many times did survive. I have seen optical media fail on write (I always run a compare against the source), likely dust particles, and older ones that had mold spots in those that I returned. I have seen writes to SDcard with 'dd' fail on verification in read-back, but to many other 'on the border' things happening to blame the card (card images are a different matter). I have never seen a data record fail to SDcard in my designs.

That all means very little, but the mechanical strength, weight, speed (no seek times), low power use, makes these cards a first choice between those media.

You stated that sequentially writing to FLASH was dangerous, I hope I made it clear to you and everybody else that is bull. Every OS also does that.

It's simple.

I've never said that. My point is that Flash is not reliable. Rely on it at your own risk.

Yes, it is.

Rick C.

+-+ Get 6 months of free supercharging +-+ Tesla referral code -
formatting link

You neither understood when writing that how an OS works, nor how the SDcard's internals work. I hope you do now, else read that link again:

formatting link
For SDcards the bad blocks management is in the card.

You are making my case. I didn't say anything about "sequentially writing to FLASH was dangerous".

I didn't say anything about how an "operating system" works. Or do I misunderstand what "OS" means? As usual, you read what you want to read.

Try opening your mind to understand what I meant, not what you want my words to mean.

Rick C.

++- Get 6 months of free supercharging ++- Tesla referral code -
formatting link

Read your own text that I quoted again.

Better even study the link.

wrote in news:q2slt3$emn$1 @gioia.aioe.org:

Exactly... and that ALWAYS invisible to even the 'file system' placed within a 'volume' partitioned onto the 'drive'. The internals always have space set aside for re-assignment of storage space such that from the perspective of a given file system, there is no such event as a bad write or 'bad block' to be bypassed or circumnavigated. There is also no such animal as file fragmentation. Incrementally updated files always get full rewrites of the entire file or the space for the incremental update is contiguous with the existing file location.

Don't believe such an unqualified statement. Flash has limited erase/rewrite cycles (and humans have limited lifetime, too). But 'reliable' depends on usage, and a WORM disk (write-once-read-mainly) is very useful, and exemplifies good practices for Flash devices. WORM disk is good for 1 write cycle. Flash devices are good for ten-thousand-to-millions. Moore's law would suggest Flash is decades more advanced than WORM.

If used like in a camera (write but usually not overwrite when picture taking, erase only when the user takes action to free space) Flash is totally reliable. Until the year 2300, my few-days-between handling of the useful snapshot device won't expose me to any real risk.

Some filesystem actions, though, like defragmenting, journaling, registry maintenance, will inevitably overwrite in a thoughtless and uncontrolled manner. Designing a Flash disk to look like a rotating-rust disk was a perilous decision, and few if any OS controls were really ready for the shift.

So, a busy data center might easily see Flash devices failing, because of the nature of the traffic through those disks. A savvy use of the resource can avoid the problem, and let's hope the walled enclaves of OS gnomes are aware and active enough to fit the Flash resource into our boxes without overstressing its minor weaknesses.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required