
GD32F403xx User Manual
543
SDIO_DATACTL[8] = 1) and data direction is from card to SD I/O (SDIO_DATACTL[1] = 1),
the DSM directly moves from Idle to Read Wait. In Read Wait the DSM drives SDIO_DAT[2]
to 0 af ter 2 SDIO_CLK clock cycles. In this state, when you set the RWSTOP bit
(SDIO_DATACTL[9]), the DSM remains in Wait for two more SDIO_CLK clock cycles to drive
SDIO_DAT[2] to 1 f or one clock cycle. The DSM then starts waiting again until it receives data
f rom the card. The DSM will not start a Read Wait interval while receiving a block even if
Read Wait start is set: the Read Wait interval will start af ter the CRC is received. The
RWSTOP bit has to be cleared to start a new Read Wait operation. During the Read Wait
interval, the SDIO can detect SD I/O interrupts on SDIO_DAT[1].
SD I/O suspend/resume operation
Within a multi-function SD I/O or a Combo card, there are multiple devices (I/O and memory)
that share access to the SD bus. In order to allow the sharing of access to the host among
multiple devices, SD I/O and combo cards can implement the op tional concept of
suspend/resume. If a card supports suspend/resume, the host may temporarily halt a data
transf er operation to one function or memory (suspend) in order to f ree the bus f or a higher
priority transfer to a dif ferent f unction or memory. Once this higher-priority transfer is
completed, the original transfer is re-started where it left off (resume).
Figure 20-14. Function2 read cycle inserted during function1 multiple read cycle
shows
a condition where the first suspend request is not immediately accepted. The host then
checks the status of the request with a read and determines that the bus has now been
released (BS=0). At this time, a read to f unction 2 is started. Once that single block read is
completed, the resume is issued to function, causing the data transfer to resume (DF=1).
Figure 20-14. Function2 read cycle inserted during function1 multiple read cycle
CMD
DAT
Read n blocks
CMD(1)
RES
P(1)
CMD52(RAW)
BR=1,BS=1
CMD52(R)
BS=0
Read 1 block
CMD(2)
RES
P(1)
CMD52(RAW)
FS=1,DF=1
Data
Fn1
Data
Fn2
Data
Fn1
Suspend to
function1 is not
accepted
Check status,
bus suspended
Read n blocks to
function 1
Read 1 blocks to
function 2
Resume to
function 1
When the host sends data to the card, the host can suspend the write operation. The
SDIO_CMDCTL[11] bit is set and indicates to the CSM that the current command is a suspend
command. The CSM analyzes the response and when the response is received from the card
(suspend accepted), it acknowledges the DSM that goes Idle after receiving the CRC token
of the current block.
To suspend a read
operation, the DSM waits in the WaitR state, when the function to be
suspended sends a complete packet just bef ore stopping the data transaction. The
application should continue reading receive FIFO until the FIFO is empty, and the DSM goes
Idle state automatically.
Interrupts
In order to allow the SD I/O card to interrupt the host, an interrupt function is added to a pin