Purpose
sdcard sd mode write process
Description
- Make sure sdcard is under "transfer state", if the sdcard is under other state, host will send Cmd12 to stop the current operation and to transit sdcard to "stand-by state".
- Host sends Cmd13 to check sdcard's status, to make sure sdcard is "ready-for-data".
- Host sends Cmd25 to do multiple blocks write, the address here is different between high capacity sdcard and normal sdcard, the address of SDHC is equal to the block number, while normal sdcard's address is equal to block number times 512.
Write Optimization
- To optimize the write multiple blocks, try to keep the sdcard in the "rcv state" as long as possible. after send WRITE_MULTIPLE_BLOCK command, set the block number in the MCI_BLKR as 0, each time a new write start, do not re-send the WRITE_MULTIPLE_BLOCK command, just re-configure the PDC. In this case, host does not have to send STOP_TRANSMISSION to transfer the sdcard's state and the performance is optimized.
- MoveToTransferState will check the state of the sdcard, and send STOP_TRANSMISSION if need to transfer state. Normally this function is called between the state tranfer.
- ContinuousWrite will be called if WRITE_MULTIPLE_BLOCK already been sent and this function will not re-send the write command, but will re-configure PDC accordingly.