FIFO Buffer Overflow and Underflow
During normal data transfer conditions, FIFO buffer overflow and underflow does not occur. However, if
there is a programming error, a FIFO buffer overflow or underflow can result. For example, consider the
following scenarios.
†
For transmit:
†
• PBL=4
†
• TX watermark = 1
†
For these programming values, if the FIFO buffer has only one location empty, the DMA attempts to read
four words from memory even though there is only one word of storage available. This results in a FIFO
Buffer Overflow interrupt.
†
For receive:
†
• PBL=4
†
• RX watermark = 1
†
For these programming values, if the FIFO buffer has only one location filled, the DMA attempts to write
four words, even though only one word is available. This results in a FIFO Buffer Underflow interrupt.
†
The driver must ensure that the number of bytes to be transferred, as indicated in the descriptor, is a multiple
of four bytes. For example, if the
bytcnt
register = 13, the number of bytes indicated in the descriptor
must be rounded up to 16 because the length field must always be a multiple of four bytes.
†
PBL and Watermark Levels
This table shows legal PBL and FIFO buffer watermark values for internal DMA controller data transfer
operations.
†
Table 11-8: PBL and Watermark Levels
†
TX/RX FIFO Buffer Watermark Value
PBL (Number of transfers)
greater than or equal to 1
1
greater than or equal to 4
4
greater than or equal to 8
8
greater than or equal to 16
16
greater than or equal to 32
32
greater than or equal to 64
64
greater than or equal to 128
128
greater than or equal to 256
256
Fatal Bus Error Scenarios
A fatal bus error occurs due to an error response through the master interface. This error is a system error,
so the software driver must not perform any further setup on the controller. The only recovery mechanism
from such scenarios is to perform one of the following tasks:
†
Altera Corporation
SD/MMC Controller
11-13
FIFO Buffer Overflow and Underflow
cv_54011
2013.12.30