I'm working on a low-power application with data storage on a microSD card. In the interest of minimizing power consumption, I'm planning to buffer data to RAM before writing, and I suspect that the optimal buffer size would be an integer multiple of the flash block size in the SD card, as this would minimize/eliminate high-power/slow block erase/rewrites. Unfortunately, I've had little to no success finding any info about flash block sizes in SD cards; the best I've found is that they apparently range from 16Kb to 2Mb. Naturally, being a consumer product, manufacturer tech details are practically nonexistent. Is there some esoteric command in the SD spec or something I can use to determine flash block size? Is this approach unnecessary/overkill/otherwise pointless?

Whoops, found it: SECTOR_SIZE (erase sector size) in the CSD register.

So I guess a followup is whether or not it's useful to sector-align writes for power saving purposes, but at the very least I'll probably be able to measure that.

  • \$\begingroup\$ Use the official SD formatting tool and see what block size it uses for your card, and then use the same size if you re-format: sdcard.org/downloads/formatter \$\endgroup\$
    – endolith
    Nov 19, 2021 at 2:12

1 Answer 1


By aligning your block writes with the flash card blocks you might increase the write speed since you'll only be writing one block rather than two or more, and thus decrease the amount of time the card has to be powered. Further, one flash block write will consume less power than the two that would be required if you wrote across a boundary.

However your greatest power savings will be in communicating with the card as fast as possible so you can power it for as short a period of time as possible.

Even though a flash block write consumes quite a bit of power, communicating slowly with the card and leaving it powered during communications will eat quite a bit more if you don't speed up communications.

  • \$\begingroup\$ When writing to an SD card, are there separate status bits to indicate "I'm done enough with the last write to accept another command" versus "I'm done enough with the last write that I can be safely powered down"? \$\endgroup\$
    – supercat
    Jul 24, 2012 at 22:33
  • \$\begingroup\$ @supercat I don't recall, but that's a good question for the SD spec. \$\endgroup\$
    – Adam Davis
    Jul 25, 2012 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.