Wednesday 23 July 2014

sd - MicroSD flash block size


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.



Answer



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.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...