How long will the mbed 'disk' last?

06 Apr 2010 . Edited: 06 Apr 2010

Hi all,

This may be a silly question and not apply to the mbed system at all because technology has moved on since 28F010 FLASH chips, but I've also had one of my memory sticks stop working before so I thought I'd ask anyway :-)

How many times can we write new data to the mbed 'disk' system before it wears out? And I suppose a second question would be how best to write to the mbed 'disk'? At the moment I'm using 'putc' to write a single 'char' at a time, does this count as doing more writes than writing chunks of say 1000 'char's or bytes at a time, is there an optimal 'chunk' size or doesn't it make any difference?

(I ask because I think I've damaged the 28F010 chips in my ECU by sending 262144 (0x40000) erase pulses to them due to a bug :-( )

Sophie x

09 Apr 2010

Hi Sophie,

Most FLASH memory is quoted at around 100k erase/write cycles, including the SPI flash part we use to store the filesystem, so that is quite a lot of reading and writing. Perhaps if you are doing an application that is really hammering a filesystem, it might be a good idea to transition over to using an SD card or external FLASH part anyway, as it is becoming a core part of your application.

Sophie Dexter wrote:
how best to write to the mbed 'disk'? At the moment I'm using 'putc' to write a single 'char' at a time, does this count as doing more writes than writing chunks of say 1000 'char's or bytes at a time, is there an optimal 'chunk' size or doesn't it make any difference?
The stdio implementation will usually buffer things anyway for exactly this reason, so whilst you are doing a number of small writes, it'll only write out the buffer to disk in a larger block. It isn't guaranteed to (setup, stdio lib etc), so whilst I wouldn't worry too much, if it is natural in your application to fwrite() a block it might be a good idea.

Simon

10 Apr 2010

Hi Simon,

Thanks for your comprehensive explanation :-) I'll look into using the fwrite() function (which I didn't know about before) and maybe using an SD card too. Time to Google some more...

Sophie x