Hi Wolfgang,

Works like a charm --  use READ_BL_LEN for calculating the card size,
but just use 512 bytes blocks for I/O .

Thanks,
Steve

On 21/02/2007, at 7:27 AM, Wolfgang Mües wrote:

Hi Bob,

On Montag, 19. Februar 2007, Bob Furber wrote:
Hi Wolfgang,

please note that ALL SD cards have 512 bytes blocksize. All I/O is
in 512 Byte blocks.

The blocksize of 1KByte which is reported for 2GB cards is ONLY to
compute the capacity of the card.

Good stuff!

Does this mean that if the csd.c_size read from the card should be
doubled on 2GB cards? Then the 2GB card can be treated by the
software exactly as if it were a 1GB card, but, with twice as many
blocks?

Use the official formula for calculating the size in bytes for the SD
card:

C_SIZE (Device Size)—This parameter is used to compute the card
capacity (does not include security protected area). The memory
capacity of the card is computed from the entries C_SIZE, C_SIZE_MULT
and READ_BL_LEN as follows:
         memory capacity = BLOCKNR * BLOCK_LEN

         Where:
         BLOCKNR    = (C_SIZE+1) * MULT
         MULT           = 2^C_SIZE_MULT+2      (C_SIZE_MULT < 8)
         BLOCK_LEN = 2^READ_BL_LEN        (READ_BL_LEN < 12)
Therefore, the maximum capacity which can be coded is 4096*512*2048 =
4 GBytes. Example: A four MByte card with BLOCK_LEN = 512 can be
coded with C_SIZE_MULT = 0 and C_SIZE = 2047.

As you can see, if you want to code 2 GByte you MUST use a BLOCK_LEN of
1024. 4 GByte must use BLOCK_LEN of 2048.

But for doing the actual I/O, all SD cards are using 512 byte sectors.
Don't use BLOCK_LEN or READ_BL_LEN for this!

The little information that I have found indicates that the SDHC
(High Capacity) has not yet caught on

There _is_ a first data sheet for SDHC cards available from transcend.
_AND_ I assume that for SDHC cards, the argument of read/write commands is not the position in units of bytes, but in units of 512 bytes. So it
should be possible to extend linux SD drivers to SDHC right now.

regards

Wolfgang
--
Das Leben kann nur rückwärts verstanden,
muß aber vorwärts gelebt werden.
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev



--
WorkWare Systems Pty Ltd
W: www.workware.net.au
P: 0434 921 300
F: 07 3102 9221
E: [EMAIL PROTECTED]


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to