Best strategy for SD-Card write access?

25 Mar 2012

Hello there,

I'm going to use a SD-card for logging purposes. I'm asking myself how to do this the right way, because I know flash-ram has many, but limited write cycles, so if I'd write only about 20-30 bytes in append mode over and over, the card is stressed more than neccessary, because it's a block-oriented device and every time a block of 512 bytes gets written.

To get started I just began to collect data in block sizes of 512bytes, it gets written when this buffer is full. This might not work the way it's intended because the file-system itself will need additional data to link these blocks to the corresponding file? Does someone know how many bytes should be written to have the best "lifetime performance", assuming my unit has to stay many years in place (and still working...)?

Or are there buffering functions in the file-system itself?

Thanks for reading, Michael