7.3.4.1 Peripheral Transfer Requests
By default peripherals issue a Single Request (SREQ) when any data is present. For peripherals with a data buffer or FIFO this occurs
any time the FIFO is not empty. Uppon receving an SREQ the LDMA will perform one DMA transfer and stop till another request is
made.
It is generally more efficent to wait for a peripheral to accumulate data and transfer in a burst. This both reduces overhead of the DMA
engine and allows EM2 peripherals to save power by using the LDMA less often. To enable this set the IGNORESREQ bit in the
LDMA_CHx_CTRL register (or descriptor) which will cause the LDMA to ignore SREQ's and wait for a full Request (REQ) signal. When
the REQ is received the entire descriptor will be executed. For most peripherals with a FIFO the REQ signal is set when the FIFO is full,
or a predetermined threshold has been reached. See the individual peripheral chapters for more information.
7.3.5 Managing Transfer Errors
LDMA transfer errors are normally managed using interrupts. Software should clear the ERROR flag in the bit in the LDMA_IF register
and enable error interrupts by setting the ERROR bit in the LDMA_IEN register before initiating a DMA transfer
The LDMA interrupt handler should check the ERROR flag bit in the LDMA_IF register. If the ERROR flag bit is set, it should then read
the CHERROR field in the LDMA_STATUS register to determine the errant channel. The interrupt handler should reset the channel and
clear the ERROR flag bit in the LDMA_IF register before returning.
7.3.6 Arbitration
While multiple channels are configured simultaneously the LDMA engine can only be actively copying data for one channel at a time.
Arbitration determines which channel is being serviced at any point in time. The LDMA will choose a channel through arbitration, trans-
fer BLOCK_SIZE elements of that channel and then arbitrate again choosing another channel to service. This allows high priority chan-
nels to be serviced while lower priority channels are in the middle of a transfer.
7.3.6.1 Arbitration Priority
There are two modes in determining priority when the controller arbitrates: fixed priority and round robin priority.
In fixed priority mode, channel 0 has the highest priority. As the channel number increases, the priority decreases. When the LDMA
controller is idle or when a transfer completes, the highest priority channel with an active request is granted the transfer. This mode
guarantees smallest latency for the highest priority requesters. It is best suited for systems where peak bandwidth is well below LDMA
controller’s maximum ability to serve. The drawback of this mode is the possibility of starvation for lowest priority requesters.
In the round robin priority mode, each active requesting channel is serviced in the order of priority. A late arriving request on a higher
priority channel will not get serviced until the next round. This mode minimizes the risk of starving low-priority latency-tolerant reques-
ters. The drawback of this mode is higher risk of starving low-latency requesters.
The NUMFIXED field in the LDMA_CTRL register determines which channels are fixed priority and which are round robin. Channels
lower than NUMFIXED are fixed priority while those above it are round robin. A value of 0x0 implies all channels are round robin. A
value of 0x4 implies channels 0 through 3 are fixed priority and 4 through 7 are round robin. A value of 7 implies that channels 0
through 6 are fixed and channel 7 is round robin. This is functionally equivilent to having 8 fixed priority channels.
Fixed priority channels always take priority over round robin. As long as NUMFIXED is greater than 0, there is a possibility that a higher
priority channel can starve the remaining channels.
To address the drawbacks of using fixed priority or round robin priority the LDMA implements the concept of arbitration slots. This al-
lows for channels to have high bandwidth and low latency while preventing starvation of latency tollerant low priority channels.
Each channel has a two bit ARBSLOT field in its LDM_CHx_CFG register. This field only applies to channels marked as round robin
(determined by NUMFIXED). The channels in the same arbitration slot are treated equally with round robin scheduling. Channels
marked with a higher arbitration slot will get serviced more frequently. By default all channels are placed in arbitration slot 1.
Every time the channels in slot 1 get serviced the channels in slot 2 get servicd twice, thoes in slot 4 get serviced 4 times, and thoes in
slot 8 get serviced 7 times. The specific arbitration allocation can be seen by the following table. The highest arbitration slot is serviced
every other arbitration cycle, allowing for low latency response. If there are no requests from channels in arbitration slot then that slot is
immediately skipped.
EFM32JG1 Reference Manual
LDMA - Linked DMA Controller
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 103