GD32F10x User Manual
556
following Multiple Block Write operation faster compared to the same operation without
preceding ACMD23. The host will use this command to define how many number of write
blocks are going to be send in the next write operation.
Steps involved in a single-block or multiple-block write are:
1. Write the data size in bytes in the SDIO_DATALEN register.
2. Write the block size in bytes (BLKSZ) in the SDIO_DATACTL register; the host sends data
in blocks of size BLKSZ.
3. Program SDIO_CMDAGMT register with the data address to which data should be written.
4. Program the SDIO_CMDCTL register. For SD memory and MMC cards, use CMD24 for a
single-block write and CMD25 for a multiple-block write. For SD I/O cards, use CMD53 for
both single-block and multiple-block transfers. For CE-ATA, first use CMD60 to write the ATA
task file, then use CMD61 to write the data. After writing to the CMD register, host starts
executing a command, when the command is sent to the bus, the CMDRECV flag is set.
5. Write data to SDIO_FIFO.
6. Software should look for data error interrupts. If required, software can terminate the data
transfer by sending the STOP command (CMD12).
7. When a DTEND interrupt is received, the data transfer is over. For an open-ended block
transfer, if the byte count is 0, the software must send the STOP command. If the byte count
is not 0, then upon completion of a transfer of a given number of bytes, the host should send
the STOP command.
19.6.4.
Single block or multiple block read
Block read is block oriented data transfer. The basic unit of data transfer is a block whose
maximum size is defined in the CSD (READ_BL_LEN), it is always 512 bytes. If
READ_BL_PARTIAL(in the CSD) is set, smaller blocks whose starting and ending address
are entirely contained within 512 bytes boundary may be transmitted.
CMD17 (READ_SINGLE_BLOCK) initiates a block read and after completing the transfer, the
card returns to the Transfer state. CMD18 (READ_MULTIPLE_BLOCK) starts a transfer of
several consecutive blocks. CRC is appended to the end of each block, ensuring data transfer
integrity.
Block Length set by CMD16 can be set up to 512 bytes regardless of READ_BL_LEN.
Blocks will be continuously transferred until a STOP_TRANSMISSION command (CMD12) is
issued. The stop command has an execution delay due to the serial command transmission.
The data transfer stops after the end bit of the stop command.
When the last block of user area is read using CMD18, the host should ignore
OUT_OF_RANGE error that may occur even the sequence is correct.
Summary of Contents for GD32F10 Series
Page 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Page 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Page 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Page 427: ...GD32F10x User Manual 427 value ...
Page 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...