26.4.3.1.2 Modifying a Descriptor in a List
In order to add descriptors to a linked list, the following actions must be performed:
- Enable the Suspend interrupt for the DMA channel.
- Enable the DMA channel.
- Reserve memory space in SRAM to configure a new descriptor.
- Configure the new descriptor:
- Set the next descriptor address in the Next Descriptor Address (DESCADDR) register
- Set the destination address in the Block Transfer Destination Address (DSTADDR) register
- Set the source address in the Block Transfer Source Address (SRCADDR) register
- Configure the Block Transfer
Control (BTCTRL) register, including
- Optionally enable the Suspend block action
- Set the descriptor VALID bit
- Clear the VALID bit for the existing list and for the descriptor which has to be updated.
- Read Next Descriptor Address (DESCADDR)
register from the Write-Back memory.
- If the DMA has not already fetched
the descriptor which requires changes (i.e., DESCADDR is wrong):
- Update the Next Descriptor Address (DESCADDR) register location of the descriptor from the List
- Optionally clear the Suspend block action
- Set the descriptor VALID bit to '1'
- Optionally enable the Resume software command
- If the DMA is executing the same
descriptor as the one which requires changes:
- Set the Channel Suspend software command and wait for the Suspend interrupt
- Update the Next Descriptor Address (DESCADDR) register in the write-back memory
- Clear the interrupt sources and set the Resume software command
- Update the Next Descriptor Address (DESCADDR) register location of the descriptor from the List
- Optionally clear the Suspend block action
- Set the descriptor VALID bit to '1'
- If the DMA has not already fetched
the descriptor which requires changes (i.e., DESCADDR is wrong):
- Go to step 4 if needed.