19.4.2.4 Transfer Descriptors
Together with the channel configurations, the
transfer descriptors determine how a block transfer is executed. Before a DMA channel is
enabled (CHCTRLA.ENABLE is set to ‘1’) and receives a transfer trigger, its
first transfer descriptor must be initialized and marked as valid (BTCTRL.VALID). The first
transfer descriptor defines the first block transfer of a transaction.
All transfer descriptors must reside in SRAM. The addresses stored in the Descriptor Memory Section Base Address (BASEADDR) and Write-Back Memory Section Base Address (WRBADDR) registers indicate where the DMAC can locate the descriptor memory section and the write-back memory section.
The descriptor memory section is where the DMAC expects to find the first transfer descriptors for all DMA channels. Because BASEADDR points only to the first transfer descriptor of channel 0 (see Figure 19-3), all first transfer descriptors must be stored in a contiguous memory section and ordered by channel number. Refer to the Linked Descriptors section for more details.
The write-back memory section is where the DMAC stores transfer descriptors for ongoing block transfers. WRBADDR points to the ongoing transfer descriptor of channel 0. All ongoing transfer descriptors are stored in a contiguous memory section and ordered by channel number. The figure below shows an example of linked descriptors on DMA channel 0. Refer to the Linked Descriptors section for additional details.
The size of the descriptor and write-back memory sections depends on the highest-numbered enabled DMA channel, N, as shown below:
To optimize memory usage, use the lowest-numbered DMA channels whenever all channels are not required.
The descriptor and write-back memory sections can be implemented either as two separate memory sections or as a shared memory section (BASEADDR = WRBADDR). Using separate sections allows the same transaction for a channel to be repeated without modifying the first transfer descriptor. Using a shared section reduces SRAM usage and also reduces the latency between fetching the first descriptor of a transaction and executing the first beat transfer.
