Direct memory access controller (DMA) RM0402
214/1163 RM0402 Rev 6
9.3.17 Summary of the possible DMA configurations
The table below summarizes the different possible DMA configurations. The forbidden
configurations are highlighted in gray in the table.
9.3.18 Stream configuration procedure
The following sequence must be followed to configure a DMA stream x (where x is the
stream number):
1. If the stream is enabled, disable it by resetting the EN bit in the DMA_SxCR register,
then read this bit in order to confirm that there is no ongoing stream operation. Writing
this bit to 0 is not immediately effective since it is actually written to 0 once all the
current transfers are finished. When the EN bit is read as 0, this means that the stream
is ready to be configured. It is therefore necessary to wait for the EN bit to be cleared
before starting any stream configuration. All the stream dedicated bits set in the status
register (DMA_LISR and DMA_HISR) from the previous data block DMA transfer must
be cleared before the stream can be re-enabled.
2. Set the peripheral port register address in the DMA_SxPAR register. The data is moved
from/ to this address to/ from the peripheral port after the peripheral event.
3. Set the memory address in the DMA_SxMA0R register (and in the DMA_SxMA1R
register in the case of a double-buffer mode). The data is written to or read from this
memory after the peripheral event.
4. Configure the total number of data items to be transferred in the DMA_SxNDTR
register. After each peripheral event or each beat of the burst, this value is
decremented.
5. Select the DMA channel (request) using CHSEL[2:0] in the DMA_SxCR register.
6. If the peripheral is intended to be the flow controller and if it supports this feature, set
the PFCTRL bit in the DMA_SxCR register.
7. Configure the stream priority using the PL[1:0] bits in the DMA_SxCR register.
8. Configure the FIFO usage (enable or disable, threshold in transmission and reception)
Table 37. Possible DMA configurations
DMA transfer
mode
Source Destination
Flow
controller
Circular
mode
Transfer
type
Direct
mode
Double-
buffer mode
Peripheral-to-
memory
AHB
peripheral port
AHB
memory port
DMA Possible
single Possible
Possible
burst Forbidden
Peripheral
Forbidden
single Possible
Forbidden
burst
Forbidden
Memory-to-
peripheral
AHB
memory port
AHB
peripheral port
DMA Possible
single Possible
Possible
burst
Forbidden
Peripheral Forbidden
single Possible
Forbidden
burst Forbidden
Memory-to-
memory
AHB
peripheral port
AHB
memory port
DMA only
Forbidden
single
Forbidden Forbidden
burst