Memory addressing in eMMCs

embedded

I'm working for the first time on eMMCs and there's something not completely clear to me in their addressing system [explained in section 5.2 of JEDEC 5.0 standard]

JEDEC says that, depending on the size and the 30th OCR bit, you can have a byte access mode or a 512B sector access mode. So if I understood well in byte access mode the address structure starting from the most significant bits is:

write protected group-erase group-write block-single byte of interest

and the last bits express the memory position for a single byte inside a given write block while in the second:

write protected group-erase group-write block-512B sector

with the last bits identifying a single 512B sector

1) are them the right address structures? how does it work when I need just few bytes from a 512B sector [if partial retrieval is not supported of course]? it seems like if having to ask for an entire block discarding most of its data with a consequent great loss of time [a practical example with a fake address decoded in both ways would be very appreciated]
2) if the mechanism of taking the full block is right then who provides the offset for the bytes of interest once the whole sector is retrieved?

Thanks in advance to those who will try to help

Best Answer

how does it work when I need just few bytes from a 512B sector

You read the whole sector into a 512 byte buffer, and copy the bytes needed.

ask for an entire block discarding most of its data with a consequent great loss of time

You can re-use the buffer that you read above. Many accesses are in the same 512 byte block.

who provides the offset for the bytes of interest once the whole sector is retrieved?

That is the task of the file system. You don't need to write that part yourself - there are many open source implementations of various file systems.