Interrupt And Error Handling - Altera Cyclone V Device Handbook

Hide thumbs Also See for Cyclone V:
Table of Contents

Advertisement

11-60

Interrupt and Error Handling

• Choose a block size that is a multiple of 4 (the number of bytes per FIFO location), and less than 4096
(1024 FIFO locations). For example, a block size of 3072 bytes is legal, because 3072 / 4 = 768 FIFO
locations.
• For DMA mode, choose the size so that block size is a multiple of the size. For example size = 128, where
block size%size = 0.
• Set the rx_wmark field = size – 1. For example, the rx_wmark field = 128 – 1 = 127.
• Because block size > ½ FifoDepth, set the cardrdthreshold field to the block size. For example, the
cardrdthreshold field = 3072 bytes.
Figure 11-13: FIFO Buffer content when Card Read Threshold is set to 768
Read Data
to Host
Interrupt and Error Handling
This section describes how to use interrupts to handle errors. On power-on or reset, interrupts are disabled
(the int_enable bit in the ctrl register is set to 0), and all the interrupts are masked (the intmask
register default is 0). The controller error handling includes the following types of errors:
• Response and data timeout errors For response time-outs, the host software can retry the command.
For data time-outs, the controller has not received the data start bit from the card, so software can either
retry the whole data transfer again or retry from a specified block onwards. By reading the contents of
the tcbcnt register later, the software can decide how many bytes remain to be copied (read).
• Response errors Set to 1 when an error is received during response reception. If the response received
is invalid, the software can retry the command.
• Data errors Set to 1 when a data receive error occurs. Examples of data receive errors:
• Data CRC
• Start bit not found
• End bit not found
These errors can be occur on any block. On receipt of an error, the software can issue an SD/SDIO STOP
or SEND_IF_COND command, and retry the command for either the whole data or partial data.
• Hardware locked error Set to 1 when the controller cannot load a command issued by software. When
software sets the start_cmd bit in the cmd register to 1, the controller tries to load the command. If
the command buffer already contains a command, this error is raised, and the new command is discarded,
requiring the software to reload the command.
Altera Corporation
256 FIFO Locations
Unfilled During One
Block Read
One Block of Data Filled 768 FIFO Locations
Block Size = cardrdthreshold = 768
FIFO Depth = 1,024
SIZE = 128
FIFO Locations
Data Read
from Card
rx_wmark = 127
FIFO Locations
SD/MMC Controller
Send Feedback
cv_54011
2013.12.30

Advertisement

Table of Contents
loading

Table of Contents