10. DMA controller (DMA)
10.1 DMA introduction
Direct memory access (DMA) is used in order to provide high-speed data transfer between peripherals and memory as well as memory-to-memory. Data can be quickly moved by DMA without any CPU actions. This keeps CPU resources free for other operations.
The DMA has an arbiter to handle the priority between DMA requests.
10.2 DMA main features
- • Eight independently configurable channels (requests)
- • Each of the eight channels is connected to dedicated hardware DMA requests, software trigger is also supported on each channel. This configuration is done by software
- • Priorities between requests from channels of the DMA are software programmable (4 levels consisting of very high, high, medium, low) or hardware in case of equality (request 1 has priority over request 2, etc.)
- • Independent source and destination transfer size (byte, half word, word), emulating packing and unpacking. Source/destination addresses must be aligned on the data size
- • Support for circular buffer management
- • 3 event flags (DMA Half Transfer, DMA Transfer complete and DMA Transfer Error) logically ORed together in a single interrupt request for each channel
- • Memory-to-memory transfer (SRAM0/SRAM1)
- • Peripheral-to-memory and memory-to-peripheral, and peripheral-to-peripheral transfers
- • Access to SRAMs, APB0 and APB1 peripherals as source and destination
- • Programmable number of data to be transferred: up to 65536.
10.3 DMA functional description
The DMA controller performs a direct memory transfer by sharing the system bus with the other masters of the device. The DMA request may stop the CPU access to the system bus for some bus cycles, when the CPU and DMA are targeting the same destination (memory or peripheral). The bus matrix implements round-robin scheduling, thus ensuring at least half of the system bus bandwidth (both to memory and peripheral) for the CPU.
10.3.1 DMA transactions
After an event, the peripheral sends a request signal to the DMA controller. The DMA controller serves the request depending on the channel priorities. As soon as the DMA controller accesses the peripheral, an acknowledge is sent to the peripheral by the DMA controller. The peripheral releases its request as soon as it gets the acknowledge from the DMA controller. Once the request is deasserted by the peripheral, the DMA controller releases the acknowledge. If there are more requests, the peripheral can initiate the next transaction. In summary, each DMA transfer consists of three operations:
- • The loading of data from the peripheral data register or a location in memory addressed through an internal current peripheral/memory address register. The start address used for the first transfer is the base peripheral/memory address programmed in the DMA_CPARx or DMA_CMARx register
- • The storage of the data loaded to the peripheral data register or a location in memory addressed through an internal current peripheral/memory address register. The start address used for the first transfer is the base peripheral/memory address programmed in the DMA_CPARx or DMA_CMARx register
- • The post-decrementing of the DMA_CNDTRx register, which contains the number of transactions that has still to be performed.
10.3.2 Arbiter
The arbiter manages the channel requests based on their priority and launches the peripheral/memory access sequences.
The priorities are managed in two stages:
- • Software: each channel priority can be configured in the DMA_CCRx register. There are four levels:
- – Very high priority
- – High priority
- – Medium priority
- – Low priority
- • Hardware: if 2 requests have the same software priority level, the channel with the lowest number gets the priority versus the channel with the highest number. For example, channel 2 gets the priority over channel 4
10.3.3 DMA channels
Each channel can handle DMA transfer between a peripheral register located at a fixed address and a memory address. The amount of data to be transferred (up to 65535) is programmable. The register which contains the amount of data items to be transferred is decremented after each transaction.
Programmable data sizes
Transfer data sizes of the peripheral and memory are fully programmable through the PSIZE and MSIZE bits in the DMA_CCRx register.
Pointer incrementation
Peripheral and memory pointers can optionally be automatically post-incremented after each transaction depending on the PINC and MINC bits in the DMA_CCRx register. If incremented mode is enabled, the address of the next transfer is the address of the previous one incremented by 1, 2 or 4 depending on the chosen data size. The first transfer address is the one programmed in the DMA_CPARx/DMA_CMARx registers. During transfer operations, these registers keep the initially programmed value. The current transfer addresses (in the current internal peripheral/memory address register) are not accessible by software.
If the channel is configured in non circular mode, no DMA request is served after the last transfer (that is once the number of data items to be transferred has reached zero). In order to reload a new number of data items to be transferred into the DMA_CNDTRx register, the DMA channel must be disabled.
Note: If a DMA channel is disabled, the DMA registers are not reset. The DMA channel registers (DMA_CCRx, DMA_CPARx and DMA_CMARx) retain the initial values programmed during the channel configuration phase.
In circular mode, after the last transfer, the DMA_CNDTRx register is automatically reloaded with the initially programmed value. The current internal address registers are reloaded with the base address values from the DMA_CPARx/DMA_CMARx registers.
Channel configuration procedure
The following sequence should be followed to configure a DMA channelx (where x is the channel number).
- 1. Set the peripheral register address in the DMA_CPARx register. The data are moved from/to this address to/from the memory after the peripheral event.
- 2. Set the memory address in the DMA_CMARx register. The data are written to or read from this memory after the peripheral event.
- 3. Configure the total number of data to be transferred in the DMA_CNDTRx register. After each peripheral event, this value is decremented.
- 4. Configure the channel priority using the PL[1:0] bits in the DMA_CCRx register.
- 5. Configure data transfer direction, circular mode, peripheral and memory incremented mode, peripheral and memory data size, and interrupt after half and/or full transfer in the DMA_CCRx register.
- 6. Activate the channel by setting the ENABLE bit in the DMA_CCRx register.
As soon as the channel is enabled, it can serve any DMA request from the peripheral connected on the channel. Once half of the bytes are transferred, the half-transfer flag (HTIF) is set and an interrupt is generated if the half-transfer interrupt enable bit (HTIE) is set. At the end of the transfer, the transfer complete flag (TCIF) is set and an interrupt is generated if the transfer complete interrupt enable bit (TCIE) is set.
Circular mode
Circular mode is available to handle circular buffers and continuous data flows (e.g. ADC scan mode). This feature can be enabled using the CIRC bit in the DMA_CCRx register. When circular mode is activated, the number of data to be transferred is automatically reloaded with the initial value programmed during the channel configuration phase, and the DMA requests continue to be served.
Memory-to-memory mode
The DMA channels can also work without being triggered by a request from a peripheral. This mode is called memory-to-memory mode.
If the MEM2MEM bit in the DMA_CCRx register is set, then the channel initiates transfers as soon as it is enabled by software by setting the enable bit (EN) in the DMA_CCRx register. The transfer stops once the DMA_CNDTRx register reaches zero. Memory-to-memory mode may not be used at the same time as circular mode.
10.3.4 Programmable data width, data alignment and endians
When PSIZE and MSIZE are not equal, the DMA performs some data alignments as described in Table 25. Programmable data width and endian behavior (when PINC=MINC=1 and NDT=4).
Note that NDT means number of data items to transfer.
Table 25. Programmable data width and endian behavior (when PINC=MINC=1 and NDT=4)
| Port width | Source content | Transfer operation | Dest content |
|---|---|---|---|
| Src => Dest | addr / data | addr / data | |
| 8 => 8 | @0x0 / B0 | Read B0[7:0] @0x0 then write B0[7:0]@0x0 | @0x0 / B0 |
| @0x1 / B1 | Read B1[7:0] @0x1 then write B1[7:0] @0x1 | @0x1 / B1 | |
| @0x2 / B2 | Read B2[7:0] @0x2 then write B2[7:0] @0x2 | @0x2 / B2 | |
| @0x3 / B3 | Read B3[7:0] @0x3 then write B3[7:0] @0x3 | @0x3 / B3 | |
| 8 => 16 | @0x0 / B0 | Read B0[7:0] @0x0 then write 00B0[15:0] @0x0 | @0x0 / 00B0 |
| @0x1 / B1 | Read B1[7:0] @0x1 then write 00B1[15:0] @0x2 | @0x2 / 00B1 | |
| @0x2 / B2 | Read B2[7:0] @0x2 then write 00B2[15:0] @0x4 | @0x4 / 00B2 | |
| @0x3 / B3 | Read B3[7:0] @0x3 then write 00B3[15:0] @0x6 | @0x6 / 00B3 | |
| 8 => 32 | @0x0 / B0 | Read B0[7:0] @0x0 then write 000000B0[31:0] @0x0 | @0x0 / 000000B0 |
| @0x1 / B1 | Read B1[7:0] @0x1 then write 000000B1[31:0] @0x4 | @0x4 / 000000B1 | |
| @0x2 / B2 | Read B2[7:0] @0x2 then write 000000B2[31:0] @0x8 | @0x8 / 000000B2 | |
| @0x3 / B3 | Read B3[7:0] @0x3 then write 000000B3[31:0] @0xC | @0xC / 000000B3 | |
| 16 => 8 | @0x0 / B1B0 | Read B1B0[15:0] @0x0 then write B0[7:0] @0x0 | @0x0 / B0 |
| @0x2 / B3B2 | Read B3B2[15:0] @0x2 then write B2[7:0] @0x1 | @0x1 / B2 | |
| @0x4 / B5B4 | Read B5B4[15:0] @0x4 then write B4[7:0] @0x2 | @0x2 / B4 | |
| @0x6 / B7B6 | Read B7B6[15:0] @0x6 then write B6[7:0] @0x3 | @0x3 / B6 | |
| 16 => 16 | @0x0 / B1B0 | Read B1B0[15:0] @0x0 then write B1B0[15:0] @0x0 | @0x0 / B1B0 |
| @0x2 / B3B2 | Read B3B2[15:0] @0x2 then write B3B2[15:0] @0x2 | @0x2 / B3B2 | |
| @0x4 / B5B4 | Read B5B4[15:0] @0x4 then write B5B4[15:0] @0x4 | @0x4 / B5B4 | |
| @0x6 / B7B6 | Read B7B6[15:0] @0x6 then write B7B6[15:0] @0x6 | @0x6 / B7B6 | |
| 16 => 32 | @0x0 / B1B0 | Read B1B0[15:0] @0x0 then write 0000B1B0[31:0] @0x0 | @0x0 / 0000B1B0 |
| @0x2 / B3B2 | Read B3B2[15:0] @0x2 then write 0000B3B2[31:0] @0x4 | @0x4 / 0000B3B2 | |
| @0x4 / B5B4 | Read B5B4[15:0] @0x4 then write 0000B5B4[31:0] @0x8 | @0x8 / 0000B5B4 | |
| @0x6 / B7B6 | Read B7B6[15:0] @0x6 then write 0000B7B6[31:0] @0xC | @0xC / 0000B7B6 | |
| 32 => 8 | @0x0 / B3B2B1B0 | Read B3B2B1B0[31:0] @0x0 then write B0[7:0] @0x0 | @0x0 / B0 |
| @0x4 / B7B6B5B4 | Read B7B6B5B4[31:0] @0x4 then write B4[7:0] @0x1 | @0x1 / B4 | |
| @0x8 / BBBAB9B8 | Read BBBAB9B8[31:0] @0x8 then write B8[7:0] @0x2 | @0x2 / B8 | |
| @0xC/BFBEBDBC | Read BFBEBDBC[31:0] @0xC then write BC[7:0] @0x3 | @0x3 / BC |
| Port width | Source content | Transfer operation | Dest content |
|---|---|---|---|
| Src => Dest | addr / data | addr / data | |
| 32 => 16 | @0x0 / B3B2B1B0 | Read B3B2B1B0[31:0] @0x0 then write B1B0[15:0] @0x0 | @0x0 / B1B0 |
| @0x4 / B7B6B5B4 | Read B7B6B5B4[31:0] @0x4 then write B5B4[15:0] @0x2 | @0x2 / B5B4 | |
| @0x8 / BBBAB9B8 | Read BBBAB9B8[31:0] @0x8 then write B9B8[15:0] @0x4 | @0x4 / B9B8 | |
| @0xC/BFBEBDBC | Read BFBEBDBC[31:0] @0xC then write BDBC[15:0] @0x6 | @0x6 / BDBC | |
| 32 => 32 | @0x0 / B3B2B1B0 | Read B3B2B1B0[31:0] @0x0 then write B3B2B1B0[31:0] @0x0 | @0x0 / B3B2B1B0 |
| @0x4 / B7B6B5B4 | Read B7B6B5B4[31:0] @0x4 then write B7B6B5B4[31:0] @0x4 | @0x4 / B7B6B5B4 | |
| @0x8 / BBBAB9B8 | Read BBBAB9B8[31:0] @0x8 then write BBBAB9B8[31:0] @0x8 | @0x8 / BBBAB9B8 | |
| @0xC/BFBEBDBC | Read BFBEBDBC[31:0] @0xC then write BFBEBDBC[31:0] @0xC | @0xC/BFBEBDBC |
Addressing an AHB peripheral that does not support byte or halfword write operations
When the DMA initiates an AHB byte or halfword write operation, the data are duplicated on the unused lanes of the HWDATA[31:0] bus. So when the used AHB slave peripheral does not support byte or halfword write operations (when HSIZE is not used by the peripheral) and does not generate any error, the DMA writes the 32 HWDATA bits as shown in the two examples below:
- • To write the halfword “0xABCD”, the DMA sets the HWDATA bus to “0xABCDABCD” with HSIZE = HalfWord
- • To write the byte “0xAB”, the DMA sets the HWDATA bus to “0xABABABAB” with HSIZE = byte
Assuming that the AHB/APB bridge is an AHB 32-bit slave peripheral that does not take the HSIZE data into account, it transforms any AHB byte or halfword operation into a 32-bit APB operation in the following manner:
- • an AHB byte write operation of the data “0xB0” to 0x0 (or to 0x1, 0x2 or 0x3) is converted to an APB word write operation of the data “0xB0B0B0B0” to 0x0
- • an AHB halfword write operation of the data “0xB1B0” to 0x0 (or to 0x2) is converted to an APB word write operation of the data “0xB1B0B1B0” to 0x0
For instance, if you want to write the APB backup registers (16-bit registers aligned to a 32-bit address boundary), you must configure the memory source size (MSIZE) to “16-bit” and the peripheral destination size (PSIZE) to “32-bit”.
10.3.5 Error management
A DMA transfer error can be generated by reading from or writing to a reserved address space. When a DMA transfer error occurs during a DMA read or a write access, the faulty channel is automatically disabled through a hardware clear of its EN bit in the corresponding channel configuration register (DMA_CCRx). The channel transfer error interrupt flag (TEIF) in the DMA_IFR register is set and an interrupt is generated if the transfer error interrupt enable bit (TEIE) in the DMA_CCRx register is set.
10.3.6 Interrupts
An interrupt can be produced on a half-transfer, transfer complete or transfer error for each DMA channel. Separate interrupt enable bits are available for flexibility.
Table 26. DMA interrupt requests
| Interrupt event | Event flag | Enable control bit |
|---|---|---|
| Half-transfer | HTIF | HTIE |
| Transfer complete | TCIF | TCIE |
| Transfer error | TEIF | TEIE |
10.3.7 DMA request mapping
A DMAMUX is present in the STM32WB05xZ and allows selecting which requester is connected to which DMA channel. See Table 30. DMAMUX register map and reset values.
10.4 DMA registers
Refer to Section 1.5: Acronyms for a list of abbreviations used in register descriptions. The peripheral registers must be accessed by words (32-bit) only.
10.4.1 DMA interrupt status register (DMA_ISR)
Address offset: 0x000
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TEIF8 | HTIF8 | TCIF8 | GIF8 | TEIF7 | HTIF7 | TCIF7 | GIF7 | TEIF6 | HTIF6 | TCIF6 | GIF6 | TEIF5 | HTIF5 | TCIF5 | GIF5 |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| TEIF4 | HTIF4 | TCIF4 | GIF4 | TEIF3 | HTIF3 | TCIF3 | GIF3 | TEIF2 | HTIF2 | TCIF2 | GIF2 | TEIF1 | HTIF1 | TCIF1 | GIF1 |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| Bits 31:28 | Reserved, must be kept at reset value. |
| Bits 31, 27, 23, 19, 15, 11, 7, 3 | TEIFx:
Channel x transfer error flag (x = 1..8). This bit is set by hardware. It is cleared by software writing 1 to the corresponding bit in the DMA_IFCR register. 0: No transfer error (TE) on channel x 1: A transfer error (TE) occurred on channel x |
| Bits 30, 26, 22, 18, 14, 10, 6, 2 | HTIFx:
Channel x half transfer flag (x = 1..8). This bit is set by hardware. It is cleared by software writing 1 to the corresponding bit in the DMA_IFCR register. 0: No half transfer (HT) event on channel x 1: A half transfer (HT) event occurred on channel x |
| Bits 29, 25, 21, 17, 13, 9, 5, 1 | TCIFx:
Channel x transfer complete flag (x = 1..8). This bit is set by hardware. It is cleared by software writing 1 to the corresponding bit in the DMA_IFCR register. 0: No transfer complete (TC) event on channel x 1: A transfer complete (TC) event occurred on channel x |
| Bits 28, 24, 20, 16, 12, 8, 4, 0 | GIFx:
Channel x global interrupt flag (x = 1..8). This bit is set by hardware. It is cleared by software writing 1 to the corresponding bit in the DMA_IFCR register. 0: No TE, HT or TC event on channel x 1: A TE, HT or TC event occurred on channel x |
10.4.2 DMA interrupt flag clear register (DMA_IFCR)
Address offset: 0x004
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| CTEIF8 | CHTIF8 | CTCIF8 | CGIF8 | CTEIF7 | CHTIF7 | CTCIF7 | CGIF7 | CTEIF6 | CHTIF6 | CTCIF6 | CGIF6 | CTEIF5 | CHTIF5 | CTCIF5 | CGIF5 |
| w | w | w | w | w | w | w | w | w | w | w | w | w | w | w | w |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| CTEIF4 | CHTIF4 | CTCIF4 | CGIF4 | CTEIF3 | CHTIF3 | CTCIF3 | CGIF3 | CTEIF2 | CHTIF2 | CTCIF2 | CGIF2 | CTEIF1 | CHTIF1 | CTCIF1 | CGIF1 |
| w | w | w | w | w | w | w | w | w | w | w | w | w | w | w | w |
| Bits 31:28 | Reserved, must be kept at reset value. |
| Bits 31, 27, 23, 19, 15, 11, 7, 3 | CTEIFx:
Channel x transfer error clear (x = 1..8). This bit is set and cleared by software. 0: No effect 1: Clears the corresponding TEIF flag in the DMA_ISR register |
| Bits 30, 26, 22, 18, 14, 10, 6, 2 | CHTIFx:
Channel x half transfer clear (x = 1..8). This bit is set and cleared by software. 0: No effect 1: Clears the corresponding HTIF flag in the DMA_ISR register |
| Bits 29, 25, 21, 17, 13, 9, 5, 1 | CTCIFx:
Channel x transfer complete clear (x = 1..8). This bit is set and cleared by software. 0: No effect 1: Clears the corresponding TCIF flag in the DMA_ISR register |
| Bits 28, 24, 20, 16, 12, 8, 4, 0 | CGIFx:
Channel x global interrupt clear (x = 1..8). This bit is set and cleared by software. 0: No effect 1: Clears the GIF, TEIF, HTIF and TCIF flags in the DMA_ISR register |
10.4.3 DMA channel x configuration register (DMA_CCRx) (x = 1..8, where x = channel number)
Address offset: 0x008 + 0d20 × (channel number - 1)
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | MEM2 MEM | PL[1:0] | MSIZE[1:0] | PSIZE[1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |
| Bits 31:15 | Reserved, must be kept at reset value. |
| Bit 14 | MEM2MEM:
Memory-to-memory mode. This bit is set and cleared by software. 0: Memory-to-memory mode disabled 1: Memory-to-memory mode enabled |
| Bits 13:12 | PL[1:0]:
Channel priority level. These bits are set and cleared by software. 00: Low 01: Medium 10: High 11: Very high |
| Bits 11:10 | MSIZE[1:0]:
Memory size. These bits are set and cleared by software. 00: 8-bits 01: 16-bits 10: 32-bits 11: Reserved |
| Bits 9:8 | PSIZE[1:0]:
Peripheral size. These bits are set and cleared by software. 00: 8-bits 01: 16-bits 10: 32-bits 11: Reserved |
| Bit 7 | MINC:
Memory increment mode. This bit is set and cleared by software. 0: Memory increment mode disabled 1: Memory increment mode enabled |
| Bit 6 | PINC:
Peripheral increment mode. This bit is set and cleared by software. 0: Peripheral increment mode disabled 1: Peripheral increment mode enabled |
| Bit 5 | CIRC:
Circular mode. This bit is set and cleared by software. 0: Circular mode disabled 1: Circular mode enabled |
| Bit 4 | DIR:
Data transfer direction. This bit is set and cleared by software. |
| 0: Read from peripheral 1: Read from memory | |
| Bit 3 | TEIE:
Transfer error interrupt enable. This bit is set and cleared by software. 0: TE interrupt disabled 1: TE interrupt enabled |
| Bit 2 | HTIE:
Half transfer interrupt enable. This bit is set and cleared by software. 0: HT interrupt disabled 1: HT interrupt enabled |
| Bit 1 | TCIE:
Transfer complete interrupt enable. This bit is set and cleared by software. 0: TC interrupt disabled 1: TC interrupt enabled |
| Bit 0 | EN:
Channel enable. This bit is set and cleared by software. 0: Channel disabled 1: Channel enabled |
10.4.4 DMA channel x number of data register (DMA_CNDTRx) (x = 1..8, where x = channel number)
Address offset: 0x00C + 0d20 × (channel number - 1)
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| NDT[15:0] | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| Bits 31:16 | Reserved, must be kept at reset value. |
| Bits 15:0 | NDT[15:0]: Number of data to transfer. Number of data to be transferred (0 up to 65535). This register can only be written when the channel is disabled. Once the channel is enabled, this register is read-only, indicating the remaining bytes to be transmitted. This register decrements after each DMA transfer. Once the transfer is completed, this register can either stay at zero or be reloaded automatically by the value previously programmed if the channel is configured in auto-reload mode. If this register is zero, no transaction can be served whether the channel is enabled or not. |
10.4.5 DMA channel x peripheral address register (DMA_CPARx) (x = 1..8, where x = channel number)
Address offset: 0x010 + 0d20 × (channel number - 1)
Reset value: 0x0000 0000
This register must not be written when the channel is enabled.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| PA [31:16] | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| PA [15:0] | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| Bits 31:0 | PA[31:0]: Peripheral address. Base address of the peripheral data register from/to which the data is read/written. When PSIZE is 01 (16-bit), the PA[0] bit is ignored. Access is automatically aligned to a half-word address. When PSIZE is 10 (32-bit), PA[1:0] are ignored. Access is automatically aligned to a word address. |
10.4.6 DMA channel x memory address register (DMA_CMARx) (x = 1..8, where x = channel number)
Address offset: 0x014 + 0d20 × (channel number - 1)
Reset value: 0x0000 0000
This register must not be written when the channel is enabled.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| MA [31:16] | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| MA [15:0] | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| Bits 31:0 | MA[31:0]: Memory address. Base address of the memory area from/to which the data are read/written. When MSIZE is 01 (16-bit), the MA[0] bit is ignored. Access is automatically aligned to a half-word address. When MSIZE is 10 (32-bit), MA[1:0] are ignored. Access is automatically aligned to a word address. |
10.4.7 DMA register map
The following table gives the DMA register map and the reset values.
Table 27. DMA register map and reset values
| Offset | Register | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x000 | DMA_ISR | TEIF8 | HTIF8 | TCIF8 | GIF8 | TEIF7 | HTIF7 | TCIF7 | GIF7 | TEIF6 | HTIF6 | TCIF6 | GIF6 | TEIF5 | HTIF5 | TCIF5 | GIF5 | TEIF4 | HTIF4 | TCIF4 | GIF4 | TEIF3 | HTIF3 | TCIF3 | GIF3 | TEIF2 | HTIF2 | TCIF2 | GIF2 | TEIF1 | HTIF1 | TCIF1 | GIF1 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x004 | DMA_IFCR | CTEIF8 | CHTIF8 | CTCIF8 | CGIF8 | CTEIF7 | CHTIF7 | CTCIF7 | CGIF7 | CTEIF6 | CHTIF6 | CTCIF6 | CGIF6 | CTEIF5 | CHTIF5 | CTCIF5 | CGIF5 | CTEIF4 | CHTIF4 | CTCIF4 | CGIF4 | CTEIF3 | CHTIF3 | CTCIF3 | CGIF3 | CTEIF2 | CHTIF2 | CTCIF2 | CGIF2 | CTEIF1 | CHTIF1 | CTCIF1 | CGIF1 |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x008 | DMA_CCR1 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x00C | DMA_CNDTR1 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x010 | DMA_CPAR1 | PA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x014 | DMA_CMAR1 | MA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x01C | DMA_CCR2 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||||
| 0x020 | DMA_CNDTR2 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x024 | DMA_CPAR2 | PA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x028 | DMA_CMAR2 | MA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

| Offset | Register | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x030 | DMA_CCR3 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x034 | DMA_CNDTR3 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x038 | DMA_CPAR3 | PA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x03C | DMA_CMAR3 | MA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x044 | DMA_CCR4 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x048 | DMA_CNDTR4 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x04C | DMA_CPAR4 | PA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x050 | DMA_CMAR4 | MA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x054 | Reserved | ||||||||||||||||||||||||||||||||
| 0x058 | DMA_CCR5 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x05C | DMA_CNDTR5 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x060 | DMA_CPAR5 | PA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| Offset | Register | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x064 | DMA_CMAR5 | MA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x068 | Reserved | ||||||||||||||||||||||||||||||||
| 0x06C | DMA_CCR6 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x070 | DMA_CNDTR6 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x074 | DMA_CPAR6 | PA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x078 | DMA_CMAR6 | MA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x07C | Reserved | ||||||||||||||||||||||||||||||||
| 0x080 | DMA_CCR7 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x084 | DMA_CNDTR7 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
| 0x088 | DMA_CPAR7 | PA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x08C | DMA_CMAR7 | MA[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x090 | Reserved | ||||||||||||||||||||||||||||||||
| 0x094 | DMA_CCR8 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MEM2MEM | PL [1:0] | M SIZE [1:0] | PSIZE [1:0] | MINC | PINC | CIRC | DIR | TEIE | HTIE | TCIE | EN | |||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||


| Offset | Register | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x098 | DMA_CNDTR8 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | NDT[15:0] | |||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x09C | DMA_CPAR8 | PA[31:0] | ||||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
| 0x0A0 | DMA_CMAR8 | MA[31:0] | ||||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
| x0A4 to 0x31C | Reserved | |||||||||||||||||||||||||||||||||
Refer to Section 2.2.2: Memory map and register boundary addresses for the register boundary addresses.