GD32F10x User Manual
557
If the host uses partial blocks whose accumulated length is not block aligned and block
misalignment is not allowed, the card shall detect a block misalignment at the beginning of
the first misaligned block, set the ADDRESS_ERROR error bit in the status register, abort
transmission and wait in the Data State for a stop command.
Steps involved in a single block or multiple block read 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 expects
data from the card in blocks of size BLKSZ each.
3. Program the SDIO_CMDAGMT register with the data address of the beginning of a data
read.
4. Program the SDIO_CMDCTL. For SD and MMC cards, using CMD17 for a single-block
read and CMD18 for a multiple-block read. For SD I/O cards, using CMD53 for both single-
block and multiple-block transfers. For CE-ATA, first using CMD60 to write the ATA task file,
then using CMD 61 to read the data. After writing to the CMD register, the host starts executing
the command, when the command is sent to the bus, the CMDRECV flag is set.
5. Software should look for data error interrupts. If required, software can terminate the data
transfer by sending a STOP command.
6. The software should read data from the FIFO and make space in the FIFO for receiving
more data.
7. When a DTEND interrupt is received, the software should read the remaining data in the
FIFO.
19.6.5.
Stream write and stream read (MMC only)
Stream write
Stream write (CMD20) starts the data transfer from the host to the card beginning from the
starting address until the host issues a stop command. If partial blocks are allowed (if CSD
parameter WRITE_BL_PARTIAL is set) the data stream can start and stop at any address
within the card address space, otherwise it shall start and stop only at block boundaries. Since
the amount of data to be transferred is not determined in advance, CRC cannot be used.
If the host provides an out of range address as an argument to CMD20, the card will reject
the command, remain in Tran state and respond with the ADDRESS_OUT_OF_RANGE bit
set.
Note that the stream write command works only on a 1 bit bus configuration (on DAT0). If
CMD20 is issued in other bus configurations, it is regarded as an illegal command.
In order to sustain data transfer in stream mode of the card, the time it takes to receive the
data (defined by the bus clock rate) must be less than the time it takes to program it into the
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 ...