SDHC "allocation unit" vs. 64KB for write efficiency?

OP #1695422
Rate this post
• ▲ useful
▼ not useful
Hello all,

My SD card driver works great with both SD and SDHC cards except I need 
it to be as energy efficient as possible when writing.  So, I am 
carefully aligning my storage format to match the erase/write boundaries 
associated with the NAND flash built into the cards.

The SD and Toshiba specification say to use the card's "allocation unit" 
(typically 4 MB) for erase efficiency in SDHC cards.  Further, they say 
that for SDHC cards the "sector size" field in the CSD is always set to 
127 (64KB) regardless and is meaningless for erase-boundary 
determination.

BUT!!!  Later the same Toshiba specification says, oh by the way, notice 
that the "sector size" field says 64KB and your efficiency will be much 
better if you start writing on 64KB boundaries.

Augh!!!

Questions:

1.  Does the SDHC 4 MB "allocation unit" really mean anything at all to 
normal card operation?  Is there any reason to pay the slightest 
attention to it?

2.  OK, for certain Toshiba cards the Toshiba documentation tells us 
that 64KB is a magic number for write boundaries.  Can one depend on 
64KB being the magic number for all SDHC cards from all manufacturers? 
It is not provided in any of the card information fields, unless you 
count "sector size", which the SD documentation expressly says one 
should ignore!

Thanks for any wisdom out there!

Reply

A question of your own? This thread is over 16 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.