GD32F20x User Manual
655
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.
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 CMD61 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.
24.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 Transfer state and respond with the ADDRESS_OUT_OF_RANGE
bit set.
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...