13. High-performance direct memory access controller (HPDMA)

13.1 HPDMA introduction

The high-performance direct memory access (HPDMA) controller is a bus master and system peripheral.

The HPDMA is used to perform programmable data transfers between memory-mapped peripherals, and/or memories via linked-lists, upon the control of an off-loaded CPU.

13.2 HPDMA main features

combined with programmable signed address offsets between successive blocks, at a second 2D/repeated block level, for a reduced set of channels (see Section 13.3.1 )

13.3 HPDMA implementation

13.3.1 HPDMA channels

A given HPDMA channel x is implemented with the following features and intended use.

To make the best use of the HPDMA performance, the following table lists some general recommendations, allowing the user to select and allocate a channel, given its implemented FIFO size and the requested HPDMA transfer.

Table 100. Implementation of HPDMA1 channels

Channel xHardware parametersFeatures
dma_fifo_size[x]dma_addressing[x]
x = 0 to 1130Channel x (x = 0 to 11) is implemented with:
  • – a FIFO of 16 bytes, 4 words, 2 double-words
  • – fixed/contiguously incremented addressing
These channels can be used for HPDMA transfers between an APB or AHB peripheral, an AHB/AXI SRAM, or CPU TCM.
x = 12 to 1551Channel x (x = 12 to 15) is implemented with:
  • – a FIFO of 64 bytes, 8 double-words
  • – 2D addressing
These channels can be also used for HPDMA transfers, including AXI external memories.

13.3.2 HPDMA in low-power modes

The HPDMA wake-up feature is implemented in the device low-power modes as per the table below.

Table 101. HPDMA1 in low-power modes

FeatureLow-power modes
Wake-upHPDMA1 in Sleep mode

13.3.3 HPDMA requests

An HPDMA request from a peripheral can be assigned to a HPDMA channel x, via REQSEL[4:0] in HPDMA_CxTR2, provided that SWREQ = 0.

The HPDMA requests mapping is specified in the table below.

Table 102. Programmed HPDMA1 request

HPDMA_CxTR2.REQSEL[4:0]Selected HPDMA request
0jpeg_rx_dma
1jpeg_tx_dma
2xspi1_rx_dma
3xspi2_rx_dma
4spi3_rx_dma
5spi3_tx_dma
6spi4_rx_dma
7spi4_tx_dma
8adc1_dma
9adc2_dma
10adf1_flt0_dma
11uart4_rx_dma
12uart4_tx_dma
13uart5_rx_dma
14uart5_tx_dma
15uart7_rx_dma
16uart7_tx_dma
17lptim2_ic1_dma
18lptim2_ic2_dma
19lptim2_ue_dma

13.3.4 HPDMA block requests

Some HPDMA requests must be programmed as a block request, and not as a burst request. Then BREQ in HPDMA_CxTR2 must be set for a correct HPDMA execution of the requested peripheral transfer at the hardware level.

Table 103. Programmed HPDMA1 request as a block request

HPDMA block requests
lptim2_ue_dma

13.3.5 HPDMA channels with peripheral early termination

An HPDMA channel, if implemented with this feature, can support the early termination of the data transfer from the peripheral which does also support this feature.

Table 104. HPDMA1 channel with peripheral early termination

HPDMA channel x with peripheral early termination
x = 15

This HPDMA support is activated when the channel x is programmed with HPDMA_CxTR2.PFREQ = 1. Then, the peripheral itself can initiate and request a data transfer completion, before the HPDMA has transferred the whole block (see Section 13.4.14 for more details).

Table 105. Programmed HPDMA request with peripheral early termination

Programmed HPDMA channel x request with peripheral early termination
jpeg_tx_dma

13.3.6 HPDMA triggers

An HPDMA trigger can be assigned to an HPDMA channel x, via TRIGSEL[5:0] in HPDMA_CxTR2, provided that TRIGPOL[1:0] defines a rising or a falling edge of the selected trigger (TRIGPOL[1:0] = 01 or TRIGPOL[1:0] = 10).

Table 106. Programmed HPDMA1 trigger

HPDMA_CxTR2.TRIGSEL[5:0]Selected HPDMA trigger
0dcmpp_p0frame_evt
1dcmip_p0hsync_evt
2dcmpp_p0line_evt
3dcmpp_p0vsync_evt
4dma2d_ctc
5dma2d_tc

Table 106. Programmed HPDMA1 trigger (continued)

HPDMA_CxTR2.TRIGSEL[5:0]Selected HPDMA trigger
6dma2d_tw
7jpeg_eoc_trg
8jpeg_ifnf_trg
9jpeg_ift_trg
10jpeg_ofne_trg
11jpeg_oft_trg
12lcd_li
13gpu2d_gp_flag0
14gpu2d_gp_flag1
15gpu2d_gp_flag2
16gpu2d_gp_flag3
17gftxim_evt3
18gftxim_evt2
19gftxim_evt1
20gftxim_evt0
21gpdma1_ch0_tc
22gpdma1_ch1_tc
23gpdma1_ch2_tc
24gpdma1_ch3_tc
25gpdma1_ch4_tc
26gpdma1_ch5_tc
27gpdma1_ch6_tc
28gpdma1_ch7_tc
29gpdma1_ch8_tc
30gpdma1_ch9_tc
31gpdma1_ch10_tc
32gpdma1_ch11_tc
33gpdma1_ch12_tc
34gpdma1_ch13_tc
35gpdma1_ch14_tc
36gpdma1_ch15_tc
37hpdma1_ch0_tc
38hpdma1_ch1_tc
39hpdma1_ch2_tc
40hpdma1_ch3_tc
Table 106. Programmed HPDMA1 trigger (continued)
HPDMA_CxTR2.TRIGSEL[5:0]Selected HPDMA trigger
41hpdma1_ch4_tc
42hpdma1_ch5_tc
43hpdma1_ch6_tc
44hpdma1_ch7_tc
45hpdma1_ch8_tc
46hpdma1_ch9_tc
47hpdma1_ch10_tc
48hpdma1_ch11_tc
49hpdma1_ch12_tc
50hpdma1_ch13_tc
51hpdma1_ch14_tc
52hpdma1_ch15_tc

13.4 HPDMA functional description

13.4.1 HPDMA block diagram

Figure 108. HPDMA block diagram

HPDMA block diagram showing internal components and external interfaces.

The block diagram illustrates the internal architecture and external connections of the HPDMA controller. The main HPDMA block contains several functional units:

External inputs on the left include DMA requests, DMA triggers, DMA clock, and a stop DMA channel in debug mode signal. External outputs on the right include DMA channel interrupt, DMA channel transfer complete (hpdma_chx_tc), DMA channel state (vs privilege), DMA illegal event (vs privilege), and DMA clock request. A note at the bottom indicates that (1) refers to the device implementation table for the number of channels. The identifier MSv66926V2 is shown in the bottom right corner.

HPDMA block diagram showing internal components and external interfaces.

13.4.2 HPDMA channel state and direct programming without any linked-list

After an HPDMA reset, an HPDMA channel x is in idle state. When the software writes 1 into the HPDMA_CxCR.EN enable control bit, the channel takes into account the value of the different channel configuration registers (HPDMA_CxXXX), switches to the active/non-idle state, and starts to execute the corresponding requested data transfers.

After enabling/starting an HPDMA channel transfer by writing 1 into HPDMA_CxCR.EN, an HPDMA channel interrupt on a complete transfer notifies the software that the HPDMA channel is back in idle state (EN is then deactivated by hardware), and that the channel is ready to be reconfigured then enabled again.

The figure below illustrates this HPDMA direct programming without any linked-list (HPDMA_CxLLR = 0).

Figure 109. HPDMA channel direct programming without linked-list (HPDMA_CxLLR = 0)

Flowchart of HPDMA channel direct programming without linked-list (HPDMA_CxLLR = 0).
graph TD; subgraph Idle; A[Initialize DMA channel
(keeping DMA_CxLLR[31:0] = 0)]; B[Reconfigure DMA channel
(keeping DMA_CxLLR[31:0] = 0)]; end; A --> C[Enable DMA channel]; B --> C; C --> D{Valid user setting?}; subgraph Active; D -- N --> E[Setting USEF = 1
Disabling DMA channel]; D -- Y --> F[Executing the data transfer
from the register file]; F --> G{No transfer error?}; G -- N --> H[Setting DTEF = 1
Disabling DMA channel]; G -- Y --> I[Setting TCF = 1
Disabling DMA channel]; end; E --> J((End)); H --> J; I --> J;

The flowchart illustrates the HPDMA channel direct programming process without a linked-list. It starts with the channel in an 'Idle' state, where the DMA channel is initialized or reconfigured, keeping DMA_CxLLR[31:0] = 0. The channel is then enabled. The state changes to 'Active'. A decision is made: 'Valid user setting?'. If 'No' (N), the channel is disabled by setting USEF = 1. If 'Yes' (Y), the data transfer is executed from the register file. Another decision is made: 'No transfer error?'. If 'No' (N), the channel is disabled by setting DTEF = 1. If 'Yes' (Y), the channel is disabled by setting TCF = 1. All three disabling paths lead to the 'End' state.

Flowchart of HPDMA channel direct programming without linked-list (HPDMA_CxLLR = 0).

13.4.3 HPDMA channel suspend and resume

The software can suspend on its own a channel still active, with the following sequence:

  1. 1. The software writes 1 into the HPDMA_CxCR.SUSP bit.
  2. 2. The software polls the suspended flag HPDMA_CxSR.SUSPF until SUSPF = 1, or waits for an interrupt previously enabled by writing 1 to HPDMA_CxCR.SUSPIE. Wait for the channel to be effectively in suspended state means wait for the completion of any ongoing HPDMA transfer over its master ports. Then the software can observe, in a steady state, any read register or bitfield that is hardware modifiable.

Note: An ongoing HPDMA transfer can be a data transfer (a source/destination burst transfer,) or a link transfer for the internal update of the linked-list register file from the next linked-list item.

  1. 3. The software safely resumes the suspended channel by writing 0 to HPDMA_CxCR.SUSP.

Figure 110. HPDMA channel suspend and resume sequence

Flowchart illustrating the HPDMA channel suspend and resume sequence. The sequence starts with 'Channel state = Active'. It branches into two paths: 'Suspend the DMA channel (write 1 to CxCR.SUSP)' and 'or'. Both paths lead to a decision diamond 'SUSPF=1?'. If 'N' (No), it loops back to the 'Active' state. If 'Y' (Yes), it transitions to 'Channel state = Suspended and Idle'. From there, it goes to 'Receiving suspended interrupt', then 'Resume the DMA channel (write 0 to CxCR.SUSP)', and finally returns to 'Channel state = Active'.
graph TD; subgraph Active [Channel state = Active]; A1[Suspend the DMA channel<br/>(write 1 to CxCR.SUSP)]; A2[or]; end; A1 --> D{SUSPF=1?}; A2 --> D; D -- N --> A1; D -- Y --> Suspended [Channel state = Suspended and Idle]; subgraph Suspended; S1[Receiving suspended interrupt]; S2[Resume the DMA channel<br/>(write 0 to CxCR.SUSP)]; end; S1 --> S2; S2 --> Active2[Channel state = Active];

MSV62627V1

Flowchart illustrating the HPDMA channel suspend and resume sequence. The sequence starts with 'Channel state = Active'. It branches into two paths: 'Suspend the DMA channel (write 1 to CxCR.SUSP)' and 'or'. Both paths lead to a decision diamond 'SUSPF=1?'. If 'N' (No), it loops back to the 'Active' state. If 'Y' (Yes), it transitions to 'Channel state = Suspended and Idle'. From there, it goes to 'Receiving suspended interrupt', then 'Resume the DMA channel (write 0 to CxCR.SUSP)', and finally returns to 'Channel state = Active'.

Note: A suspend and resume sequence does not impact the HPDMA_CxCR.EN bit. Suspending a channel (transfer) does not suspend a started trigger detection.

13.4.4 HPDMA channel abort and restart

Alternatively, like for aborting a continuous HPDMA transfer with a circular buffering or a double buffering, the software can abort, on its own, a still active channel with the following sequence:

  1. 1. The software writes 1 into the HPDMA_CxCR.SUSP bit.
  2. 2. The software polls suspended flag HPDMA_CxSR.SUSPF until SUSPF = 1, or waits for an interrupt previously enabled by writing 1 to HPDMA_CxCR.SUSPIE. Wait for the channel to be effectively in suspended state means wait for the completion of any ongoing HPDMA transfer over its master port.
  3. 3. The software resets the channel by writing 1 to HPDMA_CxCR.RESET. This causes the reset of the FIFO, the reset of the channel internal state, the reset of the HPDMA_CxCR.EN bit, and the reset of the HPDMA_CxCR.SUSP bit.
  4. 4. The software safely reconfigures the channel. The software must reprogram hardware-modified HPDMA_CxBR1, HPDMA_CxSAR, and HPDMA_CxDAR.
  1. 5. In order to restart the aborted then reprogrammed channel, the software enables it again by writing 1 to the HPDMA_CxCR.EN bit.

Figure 111. HPDMA channel abort and restart sequence

Flowchart of HPDMA channel abort and restart sequence
graph TD
    subgraph State1 [Channel state = Active]
        S1[Suspend the DMA channel
(write 1 to CxCR.SUSP)] D1{SUSPF=1?} S1 --> D1 D1 -- N --> S1 end S1 --> State2 [Channel state = Suspended
(and Idle)] subgraph State2 I1[Receiving suspended
interrupt] R1[Reset the DMA channel
(write 1 to CxCR.RESET)] I1 --> R1 end R1 --> State3 [Channel state = Idle] subgraph State3 Re[Reconfigure the DMA channel] En[Enable the DMA channel] Re --> En end En --> State4 [Channel state = Active]

The flowchart illustrates the sequence for aborting and restarting an HPDMA channel. It begins with the channel in an 'Active' state. The first step is to 'Suspend the DMA channel (write 1 to CxCR.SUSP)'. A decision point follows: 'SUSPF=1?'. If 'No' (N), the process loops back to the suspension step. If 'Yes' (Y), the channel enters a 'Suspended (and Idle)' state. In this state, the software receives a 'suspended interrupt' and then 'Resets the DMA channel (write 1 to CxCR.RESET)'. Following the reset, the channel enters an 'Idle' state. In this state, the software will 'Reconfigure the DMA channel' and then 'Enable the DMA channel'. Finally, the channel returns to an 'Active' state.

Flowchart of HPDMA channel abort and restart sequence

MSv62628V1

13.4.5 HPDMA linked-list data structure

Alternatively to the direct programming mode, a channel can be programmed by a list of transfers, known as a list of linked-list items (LLI). Each LLI is defined by its data structure.

For a channel x, the base address in memory of the data structure of a next LLI n+1 is the sum of the following:

The data structure for each LLI can be specific.

A linked-list data structure is addressed following the value of UT1, UT2, UB1, USA, UDA, and ULL bits, plus UB2 and UT3 when present, in HPDMA_CxLLR.

In linked-list mode, each HPDMA linked-list register (HPDMA_CxTR1, HPDMA_CxTR2, HPDMA_CxBR1, HPDMA_CxSAR, HPDMA_CxDAR or HPDMA_CxLLR,

plus HPDMA_CxTR3 or HPDMA_CxBR2 when present) is conditionally and automatically updated from the next linked-list data structure in the memory, following the current value of HPDMA_CxLLR that was conditionally updated from the linked-list data structure of the previous LLI.

Caution: The user must program the pointer to the next linked-list data structure (HPDMA_CxLLR[15:0]) not to exceed the 64-Kbyte addressable space defined by the link base address register (HPDMA_CxLBAR). The complete linked-list data structure must be included in the 64-Kbyte addressable space.

Static linked-list data structure

For example, when the update bits (UT1, UT2, UB1, USA, UDA, and ULL, plus UB2 and UT3 when present) in HPDMA_CxLLR are all asserted, the linked-list data structure in the memory is maximal with:

Figure 112. Static linked-list data structure (all Uxx = 1) of a linear addressing channel x

Diagram illustrating the static linked-list data structure for a linear addressing channel x. The diagram shows the DMA register file and the memory from the link base address DMA_CxLBAR. The DMA register file contains the Channel x linked-list register file (LLI0) with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. The DMA_CxLLR register points to the next LLI (LLI1) in memory. The memory contains LLI1 and LLI2, each with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. The DMA_CxLLR register in LLI1 points to LLI2. The DMA_CxLLR register in LLI2 points to the next LLI. The diagram also shows the Channel x other registers, Other channels registers, and Global registers in the DMA register file. The condition 'All Uxx=1' is indicated for the registers in the LLIs.

The diagram illustrates the static linked-list data structure for a linear addressing channel x. On the left, the DMA register file is shown, containing the Channel x linked-list register file (LLI 0 ) with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. Below this are Channel x other registers, Other channels registers, and Global registers. On the right, the memory from the link base address DMA_CxLBAR is shown, containing LLI 1 and LLI 2 . Each LLI contains registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. The DMA_CxLLR register in LLI 0 points to LLI 1 , and the DMA_CxLLR register in LLI 1 points to LLI 2 . The condition 'All Uxx=1' is indicated for the registers in the LLIs.

Diagram illustrating the static linked-list data structure for a linear addressing channel x. The diagram shows the DMA register file and the memory from the link base address DMA_CxLBAR. The DMA register file contains the Channel x linked-list register file (LLI0) with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. The DMA_CxLLR register points to the next LLI (LLI1) in memory. The memory contains LLI1 and LLI2, each with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. The DMA_CxLLR register in LLI1 points to LLI2. The DMA_CxLLR register in LLI2 points to the next LLI. The diagram also shows the Channel x other registers, Other channels registers, and Global registers in the DMA register file. The condition 'All Uxx=1' is indicated for the registers in the LLIs.
Figure 113. Static linked-list data structure (all Uxx = 1) of a 2D addressing channel x Diagram of static linked-list data structure for a 2D addressing channel x. It shows the DMA register file and memory from link base address DMA_CxLBAR. The DMA register file contains Channel x linked-list register file (LLI0) with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, DMA_CxTR3, DMA_CxBR2, and DMA_CxLLR. An arrow labeled 'All Uxx=1' points from DMA_CxLLR to the first LLI in memory. The memory contains LLI1 and LLI2. LLI1 contains the same registers as LLI0. An arrow labeled 'All Uxx=1' points from DMA_CxLLR in LLI1 to the start of LLI2. LLI2 also contains the same registers. An arrow points from DMA_CxLLR in LLI2 to the right, indicating the next LLI. The diagram also shows Channel x other registers, Other channels registers, and Global registers in the DMA register file. The identifier MSv63645V1 is at the bottom right.

The diagram illustrates the static linked-list data structure for a 2D addressing channel x. On the left, the DMA register file is shown, containing the Channel x linked-list register file (LLI 0 ) with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, DMA_CxTR3, DMA_CxBR2, and DMA_CxLLR. Below this are Channel x other registers, Other channels registers, and Global registers. An arrow labeled "All Uxx=1" points from the DMA_CxLLR register in LLI 0 to the first LLI in memory. On the right, the memory from link base address DMA_CxLBAR is shown, containing LLI 1 and LLI 2 . Each LLI contains the same registers as LLI 0 . An arrow labeled "All Uxx=1" points from the DMA_CxLLR register in LLI 1 to the start of LLI 2 . An arrow points from the DMA_CxLLR register in LLI 2 to the right, indicating the next LLI. The identifier MSv63645V1 is at the bottom right.

Diagram of static linked-list data structure for a 2D addressing channel x. It shows the DMA register file and memory from link base address DMA_CxLBAR. The DMA register file contains Channel x linked-list register file (LLI0) with registers DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, DMA_CxTR3, DMA_CxBR2, and DMA_CxLLR. An arrow labeled 'All Uxx=1' points from DMA_CxLLR to the first LLI in memory. The memory contains LLI1 and LLI2. LLI1 contains the same registers as LLI0. An arrow labeled 'All Uxx=1' points from DMA_CxLLR in LLI1 to the start of LLI2. LLI2 also contains the same registers. An arrow points from DMA_CxLLR in LLI2 to the right, indicating the next LLI. The diagram also shows Channel x other registers, Other channels registers, and Global registers in the DMA register file. The identifier MSv63645V1 is at the bottom right.

Dynamic linked-list data structure

Alternatively, the memory organization for the full list of LLIs can be compacted with specific data structure for each LLI.

If UT1 = 0 and UT2 = 1, the link address offset of HPDMA_CxLLR points to the updated value of HPDMA_CxTR2, instead of HPDMA_CxTR1 which is not to be modified (see Figure 114 ).

Example: if UT1 = UB1 = USA = 0, and if UT3 = UB2 = 0 when channel x is with 2D addressing, and if UT2 = UDA = ULL = 1, the next LLI does not contain an (updated) value for HPDMA_CxTR1, nor HPDMA_CxBR1, nor HPDMA_CxSAR, nor HPDMA_CxTR3, nor HPDMA_CxBR2 when channel x is with 2D addressing. The next LLI contains an updated value for HPDMA_CxTR2, HPDMA_CxDAR, and HPDMA_CxLLR, as shown in Figure 115 .

Figure 114. HPDMA dynamic linked-list data structure of linear addressing channel x

Figure 114: HPDMA dynamic linked-list data structure of linear addressing channel x. The diagram shows two linked-list items, LLI_n and LLI_{n+1}. LLI_n is a vertical stack of registers: DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. An arrow labeled 'All Uxx = 1' points to the LLI_n box. An arrow from the DMA_CxLLR field of LLI_n points to the LLI_{n+1} box. This arrow is annotated with 'UT1 = UB1 = USA = 0' and 'UT2 = UDA = ULL = 1'. LLI_{n+1} is a smaller vertical stack containing: DMA_CxTR2, DMA_CxDAR, and DMA_CxLLR. A dashed arrow points from the DMA_CxLLR field of LLI_{n+1} towards the right, indicating a potential next link. The identifier MSv62630V1 is at the bottom right.
Figure 114: HPDMA dynamic linked-list data structure of linear addressing channel x. The diagram shows two linked-list items, LLI_n and LLI_{n+1}. LLI_n is a vertical stack of registers: DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. An arrow labeled 'All Uxx = 1' points to the LLI_n box. An arrow from the DMA_CxLLR field of LLI_n points to the LLI_{n+1} box. This arrow is annotated with 'UT1 = UB1 = USA = 0' and 'UT2 = UDA = ULL = 1'. LLI_{n+1} is a smaller vertical stack containing: DMA_CxTR2, DMA_CxDAR, and DMA_CxLLR. A dashed arrow points from the DMA_CxLLR field of LLI_{n+1} towards the right, indicating a potential next link. The identifier MSv62630V1 is at the bottom right.

Figure 115. HPDMA dynamic linked-list data structure of a 2D addressing channel x

Figure 115: HPDMA dynamic linked-list data structure of a 2D addressing channel x. The diagram shows two linked-list items, LLI_n and LLI_{n+1}. LLI_n is a vertical stack of registers: DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, DMA_CxTR3, DMA_CxBR2, and DMA_CxLLR. An arrow labeled 'All Uxx = 1' points to the LLI_n box. An arrow from the DMA_CxLLR field of LLI_n points to the LLI_{n+1} box. This arrow is annotated with 'UT1 = UB1 = USA = 0', 'UT3 = UB2 = 0', and 'UT2 = UDA = ULL = 1'. LLI_{n+1} is a smaller vertical stack containing: DMA_CxTR2, DMA_CxDAR, and DMA_CxLLR. A dashed arrow points from the DMA_CxLLR field of LLI_{n+1} towards the right. The identifier MSv63646V1 is at the bottom right.
Figure 115: HPDMA dynamic linked-list data structure of a 2D addressing channel x. The diagram shows two linked-list items, LLI_n and LLI_{n+1}. LLI_n is a vertical stack of registers: DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, DMA_CxTR3, DMA_CxBR2, and DMA_CxLLR. An arrow labeled 'All Uxx = 1' points to the LLI_n box. An arrow from the DMA_CxLLR field of LLI_n points to the LLI_{n+1} box. This arrow is annotated with 'UT1 = UB1 = USA = 0', 'UT3 = UB2 = 0', and 'UT2 = UDA = ULL = 1'. LLI_{n+1} is a smaller vertical stack containing: DMA_CxTR2, DMA_CxDAR, and DMA_CxLLR. A dashed arrow points from the DMA_CxLLR field of LLI_{n+1} towards the right. The identifier MSv63646V1 is at the bottom right.

13.4.6 Linked-list item transfer execution

An LLI n transfer is the sequence of:

  1. 1. a data transfer: the HPDMA executes the data transfer as described by the HPDMA internal register file (this data transfer can be void/null for LLI 0 ).
  2. 2. a conditional link transfer: the HPDMA automatically and conditionally updates its internal register file by the data structure of the next LLI n+1 , as defined by the HPDMA_CxLLR value of the LLI n .

Note: The initial data transfer, as defined by the internal register file (LLI 0 ), can be null (HPDMA_CxBR1.BNDT[15:0] = 0 and HPDMA_CxTR2.PFREQ = 0), provided that UB1 is set in HPDMA_CxLLR (meaning there is a non-null data transfer described by the next LLI 1 in the memory to be executed).

Depending on the intended HPDMA use, an HPDMA channel x can be executed as described by the full linked-list (run-to-completion mode, HPDMA_CxCR.LSM = 0), or can be programmed for a single execution of a LLI (link step mode, HPDMA_CxCR.LSM = 1), as described in the next sections.

13.4.7 HPDMA channel state and linked-list programming in run-to-completion mode

When HPDMA_CxCR.LSM = 0 (in full-list execution mode, execution of the full sequence of LLIs, named run-to-completion mode), an HPDMA channel x is initially programmed, started

by writing 1 to HPDMA_CxCR.EN, and after completed at channel level.
The channel transfer is:

HPDMA_CxLLR[31:0] = 0 is the condition of a linked-list based channel completion, and means the following:

The channel may never be completed when HPDMA_CxLLR.LSM = 0:

At the regular data transfer completion at a block level, HPDMA_CxBR1.BNDT[15:0] = 0 and HPDMA_CxBR1.BRC[10:0] = 0 (if present). Alternatively, a block transfer may be early completed by a peripheral (such as an I3C in Rx mode), and then BNDT[15:0] is not null (see Section 13.4.14 for more details).

In the typical run-to-completion mode, the allocation of an HPDMA channel, including its fine programming, is done once during the HPDMA initialization. In order to have a reserved data communication link and HPDMA service during run-time, for continuously repeated transfers (from/to a peripheral respectively to/from memory or for memory-to-memory transfers). This reserved data communication link can consist of a channel, or the channel can be shared and a repeated transfer consists of a sequence of LLIs.

Figure 116 depicts the HPDMA channel execution and its registers programming in run-to-completion mode.

Note: Figure 116 is not intended to illustrate how often a TCEF can be raised, depending on the programmed value of TCEM[1:0] in HPDMA_CxTR2. It can be raised at (each) block completion, at (each) 2D block completion, at (each) LLI completion, or only at channel completion. In run-to-completion mode, whatever is the value of TCEM[1:0], at the channel completion, the hardware always set TCEF = 1 and disables the channel.

In Figure 116 , BNDT \( \neq \) 0 is the typical condition for starting the first data transfer. This condition becomes (BNDT \( \neq \) 0 and PFREQ = 1) if the peripheral requests a data transfer with early termination (see Section 13.3.5 ).

Figure 116. HPDMA channel execution and linked-list programming in run-to-completion mode (HPDMA_CxCR.LSM = 0) Flowchart of HPDMA channel execution and linked-list programming in run-to-completion mode.
graph TD; subgraph Idle; A[Initialize DMA channel] --> B[Enable DMA channel]; B --> C{Valid user setting?}; C -- N --> D[Setting USEF = 1<br/>Disabling DMA channel]; D --> E[Reconfigure DMA channel]; E --> A; C -- Y --> F{BNDT ≠ 0?}; F -- N --> G[No transfer error?]; F -- Y --> H[Executing once the data transfer from the register file]; H --> G; G -- N --> I[Setting DTEF = 1<br/>Disabling DMA channel]; G -- Y --> J{LLR ≠ 0?}; J -- N --> K[Setting TCF = 1<br/>Disabling DMA channel]; J -- Y --> L[Loading next LLI<br/>into the register file]; L --> M{No transfer error?}; M -- N --> N1[Setting ULEF = 1<br/>Disabling DMA channel]; M -- Y --> O{Valid user setting?}; O -- N --> N2[Setting USEF = 1<br/>Disabling DMA channel]; O -- Y --> K; end; subgraph Active; C; F; H; G; J; L; M; O; K; N1; N2; end; K --> P{End}; N1 --> P; N2 --> P; I --> P;

The flowchart illustrates the execution and linked-list programming of an HPDMA channel in run-to-completion mode. It is divided into two main states: 'Channel state = Idle' and 'Channel state = Active'.

Channel state = Idle:

Channel state = Active:

Flowchart of HPDMA channel execution and linked-list programming in run-to-completion mode.

MSv62631V1

Run-time inserting a \( LLI_n \) via an auxiliary channel, in run-to-completion mode

The start of the link transfer of the \( LLI_{n-1} \) (start of the \( LLI_n \) loading) can be conditioned by the occurrence of a trigger, when programming the following bitfields of HPDMA_CxTR2 in the data structure of the \( LLI_{n-1} \) :

Another auxiliary channel y can be used to store the channel x \( LLI_n \) in the memory, and to generate a transfer complete event hpdma_chy_tc. By selecting this event as the input trigger of the link transfer of the \( LLI_{n-1} \) of the channel x, the software can pause the primary channel x after its \( LLI_{n-1} \) data transfer, until it is indeed written the \( LLI_n \) .

Figure 117 depicts such a dynamic elaboration of a linked-list of a primary channel x, via another auxiliary channel y.

Caution: This use case is restricted to an application with an \( LLI_{n-1} \) data transfer that does not need a trigger. The triggering mode of this \( LLI_{n-1} \) is used to load the next \( LLI_n \) .

Figure 117. Inserting a\( LLI_n \) with an auxiliary HPDMA channel y Sequence diagram showing the insertion of a new LLI_n into a DMA primary channel x using an auxiliary channel y. The diagram involves three lifelines: DMA primary channel x, DMA auxiliary channel y, and CPU. The sequence starts with DMA primary channel x executing LLI_{n-2} data transfer, followed by loading LLI_{n-1} with specific trigger settings. Then, DMA primary channel x executes LLI_{n-1} data transfer, which generates a 'Transfer complete interrupt' to the CPU. The CPU responds by building a new LLI_n and configuring channel y. DMA auxiliary channel y then executes a data transfer (memcpy of new LLI_n), which generates a 'dma_chy_tc' signal to DMA primary channel x. Finally, DMA primary channel x loads the new LLI_n and executes LLI_n data transfer, followed by loading LLI_{n+1}.
sequenceDiagram
    participant DMA as DMA primary channel x
    participant CPU as CPU
    participant Aux as DMA auxiliary channel y

    Note left of DMA: LLI_{n-2} transfer
    DMA->>DMA: Executing LLI_{n-2} data transfer
    Note left of DMA: LLI_{n-1} transfer
    DMA->>DMA: Loading LLI_{n-1} (with DMA_CxTR2: TRIGM[1:0] = 10, TRIGPOL[1:0] = 01, TRIGSEL = dma_chy_tc and TCEM[1:0] = 01)
    Note left of DMA: LLI_n transfer
    DMA->>DMA: Executing LLI_{n-1} data transfer
    DMA->>CPU: Transfer complete interrupt
    Note right of CPU: Build new LLI_n, Configure channel Y
    Note right of Aux: Executing data transfer (Memcpy of new LLI_n)
    Aux->>DMA: dma_chy_tc
    Note left of DMA: LLI_{n+1} transfer
    DMA->>DMA: Loading new LLI_n
    DMA->>DMA: Executing LLI_n data transfer
    DMA->>DMA: Loading LLI_{n+1}
  

MSv62632V2

Sequence diagram showing the insertion of a new LLI_n into a DMA primary channel x using an auxiliary channel y. The diagram involves three lifelines: DMA primary channel x, DMA auxiliary channel y, and CPU. The sequence starts with DMA primary channel x executing LLI_{n-2} data transfer, followed by loading LLI_{n-1} with specific trigger settings. Then, DMA primary channel x executes LLI_{n-1} data transfer, which generates a 'Transfer complete interrupt' to the CPU. The CPU responds by building a new LLI_n and configuring channel y. DMA auxiliary channel y then executes a data transfer (memcpy of new LLI_n), which generates a 'dma_chy_tc' signal to DMA primary channel x. Finally, DMA primary channel x loads the new LLI_n and executes LLI_n data transfer, followed by loading LLI_{n+1}.

13.4.8 HPDMA channel state and linked-list programming in link step mode

When \( HPDMA\_CxCR.LSM = 1 \) (in link step execution mode, single execution of one \( LLI \) ), a channel transfer is executed and completed after each single execution of a \( LLI \) , including its (conditional) data transfer and its (conditional) link transfer.

An HPDMA channel transfer can be programmed at an \( LLI \) level, started by writing 1 into \( HPDMA\_CxCR.EN \) , and after completed at \( LLI \) level:

2D/repeated block level (BRC[10:0]+1), and the incrementing/decrementing mode for address offsets.

Note: If an LLI is recursive (pointing to itself as a next LLI, either HPDMA_CxLLR.ULL = 1 and HPDMA_CxLLR.LA[15:2] is updated with the same value, or HPDMA_CxLLR.ULL = 0), a channel in link step mode is completed after each repeated single execution of this LLI.

At the regular data transfer completion at a block level, HPDMA_CxBR1.BNDT[15:0] = 0 and HPDMA_CxBR1.BRC[10:0] = 0 (if present). Alternatively, a block transfer can be early completed by a peripheral (such as an I3C in Rx mode), and then BNDT[15:0] is not null (see Section 13.4.14 for more details).

The link step mode can be used to elaborate dynamically LLIs in memory during run-time. The software can be facilitated by using a static data structure for any \( LLI_n \) (all update bits of HPDMA_CxLLR have a static value, \( LLI_n.LLR.LA = LLI_{n-1}.LLR.LA + \text{constant} \) ).

Figure 118 depicts the HPDMA channel execution mode, and its programming in link step mode.

Note: Figure 118 is not intended to illustrate how often a TCEF can be raised, depending on the programmed value of TCEM[1:0] in HPDMA_CxTR2. It can be raised at (each) block completion, at (each) 2D block completion, at (each) LLI completion, or only at the last LLI data transfer completion. In link step mode, the channel is disabled after each single execution of a LLI, and depending on the value of TCEM[1:0] a TCEF is raised or not.

In Figure 118 , BNDT ≠ 0 is the typical condition for starting the first data transfer. This condition becomes BNDT ≠ 0 and PFREQ = 1 if the peripheral requests a data transfer with early termination (see Section 13.3.5 ).

Figure 118. HPDMA channel execution and linked-list programming in link step mode (HPDMA_CxCR.LSM = 1)

Flowchart of HPDMA channel execution and linked-list programming in link step mode. The process starts in 'Channel state = Idle' with 'Initialize DMA channel' and 'Enable DMA channel'. It then enters 'Channel state = Active', checking for 'Valid user setting?', 'BNDT ≠ 0?', 'No transfer error?', 'LLR ≠ 0?', and 'Valid user setting?'. It includes steps for 'Executing once the data transfer from the register file' and 'Loading next LLI into the register file'. Error handling includes 'Setting USEF = 1', 'Setting DTEF = 1', 'Setting ULEF = 1', and 'Setting TCF = 1' to disable the channel. The process ends at 'End' and loops back to 'Reconfigure DMA channel'.
graph TD; subgraph Idle [Channel state = Idle]; Init[Initialize DMA channel] --> Enable[Enable DMA channel]; end; Enable --> Active; subgraph Active [Channel state = Active]; Valid1{Valid user setting?}; BNDT{BNDT ≠ 0?}; Exec[Executing once the data transfer from the register file]; NoError1{No transfer error?}; LLR{LLR ≠ 0?}; ExecNext[Loading next LLI into the register file]; NoError2{No transfer error?}; Valid2{Valid user setting?}; USEF1[Setting USEF = 1<br/>Disabling DMA channel]; DTEF[Setting DTEF = 1<br/>Disabling DMA channel]; ULEF[Setting ULEF = 1<br/>Disabling DMA channel]; TCF[Setting TCF = 1<br/>Disabling DMA channel]; USEF2[Setting USEF = 1<br/>Disabling DMA channel]; End[/End/]; Init --> Valid1; Valid1 -- Y --> BNDT; BNDT -- Y --> Exec; BNDT -- N --> USEF1; Exec --> NoError1; NoError1 -- N --> DTEF; NoError1 -- Y --> LLR; LLR -- Y --> ExecNext; LLR -- N --> TCF; ExecNext --> NoError2; NoError2 -- N --> ULEF; NoError2 -- Y --> Valid2; Valid2 -- Y --> TCF; Valid2 -- N --> USEF2; TCF --> End; USEF1 --> End; DTEF --> End; ULEF --> End; USEF2 --> End; End --> Reconfig[Reconfigure DMA channel]; Reconfig --> Init;
Flowchart of HPDMA channel execution and linked-list programming in link step mode. The process starts in 'Channel state = Idle' with 'Initialize DMA channel' and 'Enable DMA channel'. It then enters 'Channel state = Active', checking for 'Valid user setting?', 'BNDT ≠ 0?', 'No transfer error?', 'LLR ≠ 0?', and 'Valid user setting?'. It includes steps for 'Executing once the data transfer from the register file' and 'Loading next LLI into the register file'. Error handling includes 'Setting USEF = 1', 'Setting DTEF = 1', 'Setting ULEF = 1', and 'Setting TCF = 1' to disable the channel. The process ends at 'End' and loops back to 'Reconfigure DMA channel'.

MSv62633V1

During run-time, the software can defer the elaboration of the \( LLI_{n+1} \) (and next LLIs), until/after the HPDMA executed the transfer from the \( LLI_{n-1} \) and loaded the \( LLI_n \) from the memory, as shown in the figure below.

Figure 119. Building \( LLI_{n+1} \) : HPDMA dynamic linked-lists in link step mode

Sequence diagram showing the interaction between a DMA Channel and a CPU for adding a new LLI in link step mode.

LSM = 1 with 2-stage linked-list programming:
DMA executes \( LLI_{n-1} \) and loads \( LLI_n \) while CPU builds \( LLI_{n+1} \)

sequenceDiagram
    participant DMA Channel
    participant CPU
    Note right of DMA Channel: LSM = 1 with 2-stage linked-list programming: DMA executes LLI_{n-1} and loads LLI_n while CPU builds LLI_{n+1}
    DMA Channel->>DMA Channel: LLI_{n-2} transfer
    DMA Channel->>CPU: Transfer complete interrupt
    CPU->>DMA Channel: Enable DMA channel
    Note left of DMA Channel: LLI_{n-1} transfer
    DMA Channel->>DMA Channel: Executing LLI_{n-1} data transfer
    DMA Channel->>DMA Channel: Loading LLI_n
    DMA Channel->>CPU: Transfer complete interrupt
    CPU->>DMA Channel: Build and store LLI_{n+1}
    CPU->>DMA Channel: Enable DMA channel
    DMA Channel->>DMA Channel: LLI_n transfer
    Note right of DMA Channel: MSv62634V1

The diagram illustrates the sequence of events for adding a new \( LLI_{n+1} \) in link step mode. It starts with a box indicating that LSM = 1 with 2-stage linked-list programming, where the DMA executes \( LLI_{n-1} \) and loads \( LLI_n \) while the CPU builds \( LLI_{n+1} \) . The sequence begins with the DMA Channel performing an \( LLI_{n-2} \) transfer. Upon completion, a 'Transfer complete interrupt' is sent to the CPU. The CPU responds with 'Enable DMA channel'. The DMA Channel then performs the \( LLI_{n-1} \) transfer, which includes 'Executing \( LLI_{n-1} \) data transfer' and 'Loading \( LLI_n \) '. Another 'Transfer complete interrupt' is sent to the CPU. The CPU then performs 'Build and store \( LLI_{n+1} \) ' and 'Enable DMA channel'. Finally, the DMA Channel performs the \( LLI_n \) transfer. The diagram is labeled with 'MSv62634V1' in the bottom right corner.

Sequence diagram showing the interaction between a DMA Channel and a CPU for adding a new LLI in link step mode.

In this link step mode, during run-time, the software can build and insert a new \( LLI_{n'} \) , after the HPDMA executed the transfer from the \( LLI_{n-1} \) , and loaded a formerly elaborated \( LLI_n \) from the memory by overwriting directly the linked-list register file with the new \( LLI_{n'} \) , as shown in Figure 120.

Figure 120. Replace with a new \( LLI_n \) , in register file in link step mode

Sequence diagram showing DMA channel and CPU interaction. The DMA channel executes LLI transfers and loads the next LLI, triggering interrupts. The CPU responds by building and overwriting the LLI register file and re-enabling the DMA channel.

LSM = 1 with 1-stage linked-list programming:
Overwriting the (pre)loaded \( LLI_n \) linked-list register file with
a new \( LLI_n \) ' directly in linked-list register file.
DMA executes \( LLI_{n-1} \) and load \( LLI_n \) , then CPU builds and overwrites \( LLI_n \) '

sequenceDiagram
    participant DMA as DMA channel
    participant CPU as CPU

    Note over DMA: LLI_{n-1} transfer
    DMA->>DMA: Executing LLI_{n-1} data transfer
    DMA->>DMA: Loading LLI_n
    DMA->>CPU: Transfer complete interrupt
    Note over CPU: Build LLI_n' and overwrite linked-list register file
    Note over CPU: Enable DMA channel
    
    Note over DMA: LLI_n' transfer
    DMA->>DMA: Executing LLI_n' data transfer
    DMA->>DMA: Loading LLI_{n+1}'
    DMA->>CPU: Transfer complete interrupt
    Note over CPU: Build LLI_{n+1}'' and overwrite linked-list register file
    Note over CPU: Enable DMA channel

    Note over DMA: LLI_{n+1}'' transfer
    DMA->>CPU: Transfer complete interrupt
Sequence diagram showing DMA channel and CPU interaction. The DMA channel executes LLI transfers and loads the next LLI, triggering interrupts. The CPU responds by building and overwriting the LLI register file and re-enabling the DMA channel.

MSV62635V1

Run-time replacing an \( LLI_n \) with a new \( LLI_{n'} \) in link step mode (in the memory)

The software can build and insert a new \( LLI_{n'} \) and \( LLI_{n+1'} \) in the memory, after HPDMA executed the transfer from the \( LLI_{n-1} \) , and loaded a formerly elaborated \( LLI_n \) from the memory, by overwriting partly the linked-list register file (HPDMA_CxBR1.BNDT[15:0] to be null, and HPDMA_CxLLR to point to new \( LLI_{n'} \) ) as shown in Figure 121.

Figure 121. Replace with a new \( LLI_{n'} \) and \( LLI_{n+1'} \) in memory in link step mode (option 1) Sequence diagram showing the interaction between a DMA Channel and a CPU to replace an LLI_n with new LLI_{n'} and LLI_{n+1'} in link step mode. The process involves the DMA executing LLI_{n-1}, the CPU building new LLIs, and the DMA then executing the new LLIs.

LSM = 1 with 1-stage linked-list programming:
Overwriting the (pre)loaded \( LLI_n \) linked-list register file with a new \( LLI_{n'} \) and \( LLI_{n+1'} \) in memory and overwrite partly linked-list register file
(DMA_CxBR1.BNDT = 0 and DMA_CxLLR to point to new \( LLI_{n'} \) )
DMA executes \( LLI_{n-1} \) and load \( LLI_n \) then CPU builds ( \( LLI_{n'} \) and \( LLI_{n+1'} \) ) and overwrite (BR1 and LLR)

sequenceDiagram
    participant DMA Channel
    participant CPU

    Note left of DMA Channel: LLI_{n-1} transfer
    rect rgb(255, 255, 255)
    DMA Channel->>DMA Channel: Executing LLI_{n-1} data transfer
    DMA Channel->>DMA Channel: Loading LLI_n
    end
    DMA Channel-->>CPU: Transfer complete interrupt
    
    Note right of CPU: Build LLI_{n'} and LLI_{n+1'} in memory
    Note right of CPU: Write DMA_CxBR1.BNDT = 0
Write DMA_CxLLR to point to new LLI_{n'} Note right of CPU: Enable DMA channel Note left of DMA Channel: LLI_{n'} transfer rect rgb(255, 255, 255) DMA Channel->>DMA Channel: Loading LLI_{n'} end DMA Channel-->>CPU: Transfer complete interrupt Note right of CPU: Enable DMA channel Note left of DMA Channel: LLI_{n+1'} transfer rect rgb(255, 255, 255) DMA Channel->>DMA Channel: Executing LLI_{n+1'} data transfer DMA Channel->>DMA Channel: Loading LLI_{n+1'} end DMA Channel-->>CPU: Transfer complete interrupt

MSV62636V1

Sequence diagram showing the interaction between a DMA Channel and a CPU to replace an LLI_n with new LLI_{n'} and LLI_{n+1'} in link step mode. The process involves the DMA executing LLI_{n-1}, the CPU building new LLIs, and the DMA then executing the new LLIs.

Other software implementations exist. Meanwhile the HPDMA executes the transfer from the \( LLI_{n-1} \) and loads a formerly elaborated \( LLI_n \) from the memory (or even earlier), the software can do the following:

  1. 1. Disable the NVIC for not being interrupted by the interrupt handling.
  2. 2. Build a new \( LLI_{n'} \) and a new \( LLI_{n+1'} \) .
  3. 3. Enable again the NVIC for the channel interrupt (transfer complete) notification.

The software in the interrupt handler for \( LLI_{n-1} \) is then restricted to overwrite HPDMA_CxBR1.BNDT[15:0] to be null and HPDMA_CxLLR to point to new \( LLI_{n'} \) , as shown in the figure below.

Figure 122. Replace with a new \( LLI_{n'} \) and \( LLI_{n+1'} \) in memory in link step mode (option 2)

Sequence diagram showing DMA channel and CPU interaction for LLI replacement. The DMA executes LLI_{n-1} and loads LLI_n. Upon transfer complete interrupt, the CPU disables NVIC, builds new LLIs, enables NVIC, writes to DMA registers, and enables the DMA channel. The DMA then loads the new LLI_{n'} and continues with LLI_{n+1'}.

LSM = 1 with 1-stage linked-list programming:
Overwriting the (pre)loaded \( LLI_n \) linked-list register file by building new \( LLI_{n'} \) and \( LLI_{n+1'} \) in memory while disabling (temporary) channel interrupt at NVIC level, and overwriting DMA_CxBR1.BNDT = 0 and DMA_CxLLR to point to new \( LLI_{n'} \)
DMA executes \( LLI_{n-1} \) and loading \( LLI_n \) while CPU builds ( \( LLI_{n'} \) and \( LLI_{n+1'} \) ), then CPU overwrites (BR1 and LLR)

sequenceDiagram
    participant DMA as DMA channel
    participant CPU as CPU

    Note left of DMA: LLI_{n-1} transfer
    rect rgb(255, 255, 255)
    DMA->>DMA: Executing LLI_{n-1} data transfer
    DMA->>DMA: Loading LLI_n
    end
    DMA-->>CPU: Transfer complete interrupt

    rect rgb(255, 255, 255)
    CPU->>CPU: Disable NVIC DMA irq channel
    CPU->>CPU: Build LLI_{n'} & LLI_{n+1'} in memory
    CPU->>CPU: Enable NVIC DMA irq channel
    CPU->>CPU: Write DMA_CxBR1.BNDT = 0
Write DMA_CxLLR to point to new LLI_{n'} CPU->>CPU: Enable DMA channel end Note left of DMA: LLI_{n'} transfer rect rgb(255, 255, 255) DMA->>DMA: Loading LLI_{n'} end DMA-->>CPU: Transfer complete interrupt rect rgb(255, 255, 255) CPU->>CPU: Enable DMA channel end Note left of DMA: LLI_{n+1'} transfer rect rgb(255, 255, 255) DMA->>DMA: Executing LLI_{n+1'} data transfer DMA->>DMA: Loading LLI_{n+1'} end DMA-->>CPU: Transfer complete interrupt

MSv62637V1

Sequence diagram showing DMA channel and CPU interaction for LLI replacement. The DMA executes LLI_{n-1} and loads LLI_n. Upon transfer complete interrupt, the CPU disables NVIC, builds new LLIs, enables NVIC, writes to DMA registers, and enables the DMA channel. The DMA then loads the new LLI_{n'} and continues with LLI_{n+1'}.

13.4.9 HPDMA channel state and linked-list programming

The software can reconfigure a channel when the channel is disabled (HPDMA_CxCR.EN = 0), and update the execution mode (HPDMA_CxCR.LSM) to change from/to run-to-completion mode to/from link step mode.

In any execution mode, the software can:

In link step mode, the software can clear LSM after each a single execution of any LLI, during \( LLI_{n-1} \) .

Figure 123 shows the overall and unified HPDMA linked-list programming, whatever is the execution mode.

Note: Figure 123 is not intended to illustrate how often a TCEF can be raised, depending on the programmed value of TCEM[1:0] in HPDMA_CxTR2. It can be raised at (each) block completion, at (each) 2D block completion, at (each) LLI completion, or only at the last LLI data transfer completion. In run-to-completion mode, whatever is the value of TCEM[1:0], at the channel completion the hardware always set TCEF = 1 and disables the channel. In link step mode, the channel is disabled after each single execution of a LLI, and depending on the value of TCEM[1:0] a TCEF is raised or not.

In Figure 123 , BNDT ≠ 0 is the typical condition for starting the first data transfer. This condition becomes BNDT ≠ 0 and PFREQ = 1 if the peripheral requests a data transfer with early termination (see Section 13.3.5 ).

Figure 123. HPDMA channel execution and linked-list programming

Flowchart of HPDMA channel execution and linked-list programming. It starts with 'Channel state = Idle', followed by 'Initialize DMA channel' and 'Enable DMA channel'. Then it enters 'Channel state = Active' loop. Decisions include 'Valid user setting?', 'BNDT ≠ 0?', 'No transfer error?', 'LLR ≠ 0?', 'Loading next LLI into the register file', 'No transfer error?', 'Valid user setting?', and 'LSM = 1?'. Actions include 'Executing once the data transfer from the register file', 'Setting USEF = 1 Disabling DMA channel', 'Setting DTEF = 1 Disabling DMA channel', 'Setting ULEF = 1 Disabling DMA channel', 'Setting TCF = 1 Disabling DMA channel', and 'Reconfigure DMA channel'. The process ends at 'End'.
graph TD; subgraph Idle [Channel state = Idle]; Init[Initialize DMA channel] --> Enable[Enable DMA channel]; Enable --> Active; end; subgraph Active [Channel state = Active]; Valid1{Valid user setting?}; BNDT{BNDT ≠ 0?}; Exec[Executing once the data transfer from the register file]; NoError1{No transfer error?}; LLR{LLR ≠ 0?}; Load[Loading next LLI into the register file]; NoError2{No transfer error?}; Valid2{Valid user setting?}; LSM{LSM = 1?}; End[/End/]; Usef1[Setting USEF = 1 Disabling DMA channel]; Dtef[Setting DTEF = 1 Disabling DMA channel]; Ulef[Setting ULEF = 1 Disabling DMA channel]; Tcf[Setting TCF = 1 Disabling DMA channel]; Reconfig[Reconfigure DMA channel]; Init --> Valid1; Valid1 -- Y --> BNDT; Valid1 -- N --> Usef1; BNDT -- Y --> Exec; BNDT -- N --> NoError1; Exec --> NoError1; NoError1 -- Y --> LLR; NoError1 -- N --> Dtef; LLR -- Y --> Load; LLR -- N --> Valid2; Load --> NoError2; NoError2 -- Y --> Valid2; NoError2 -- N --> Ulef; Valid2 -- Y --> LSM; Valid2 -- N --> Usef1; LSM -- Y --> Tcf; LSM -- N --> End; Tcf --> End; Usef1 --> Reconfig; Dtef --> Reconfig; Ulef --> Reconfig; Reconfig --> Init;
Flowchart of HPDMA channel execution and linked-list programming. It starts with 'Channel state = Idle', followed by 'Initialize DMA channel' and 'Enable DMA channel'. Then it enters 'Channel state = Active' loop. Decisions include 'Valid user setting?', 'BNDT ≠ 0?', 'No transfer error?', 'LLR ≠ 0?', 'Loading next LLI into the register file', 'No transfer error?', 'Valid user setting?', and 'LSM = 1?'. Actions include 'Executing once the data transfer from the register file', 'Setting USEF = 1 Disabling DMA channel', 'Setting DTEF = 1 Disabling DMA channel', 'Setting ULEF = 1 Disabling DMA channel', 'Setting TCF = 1 Disabling DMA channel', and 'Reconfigure DMA channel'. The process ends at 'End'.

MSv62638V1

13.4.10 HPDMA FIFO-based transfers

There is a single transfer operation mode: the FIFO mode. There are FIFO-based transfers. Any channel x is implemented with a dedicated FIFO whose size is defined by dma_fifo_size[x] (see Section 13.3.1 for more details).

HPDMA burst

A programmed transfer at the lowest level is an HPDMA burst.

An HPDMA burst is a burst of data received from the source, or a burst of data sent to the destination. A source (and destination) burst is programmed with a burst length by SBL_1[5:0] (respectively DBL_1[5:0]), and with a data width defined by SDW_LOG2[1:0] (respectively DDW_LOG2[1:0]) in HPDMA_CxTR1.

The addressing mode after each data (named beat) of an HPDMA burst is defined by SINC and DINC in HPDMA_CxTR1, for source and destination respectively: either a fixed addressing or an incremented addressing with contiguous data.

The start and next addresses of an HPDMA source/destination burst (defined by HPDMA_CxSAR and HPDMA_CxDAR) must be aligned with the respective data width.

The table below lists the main characteristics of an HPDMA burst.

Table 107. Programmed HPDMA source/destination burst

SAP/DAP
(allocated port)
SDW_LOG2[1:0]
DDW_LOG2[1:0]
Data width
(bytes)
SINC/DINCSBL_1[5:0]
DBL_1[5:0]
Burst length
(data/ beats)
Next data/
beat address
Next burst addressesBurst address alignment
0: AXI
1: AHB
0010 (fixed)n = 0 to 63 (1)n+1+ 0+ 01
0122
1044
1188
0: AXI
1: AHB
0011
(contiguously incremented)
+ 1+ (n + 1)1
012+ 2+ 2 *
(n + 1)
2
104+ 4+ 4 *
(n + 1)
4
0: AXI118+ 8+ 8 *
(n + 1)
8
0: AHB11forbidden user setting, causing USEF generation and none burst to be issued.

1. When S/DBL_1[5:0] = 0, burst is of length 1. Then burst can be also named as single.

The next burst address in the above table is the next source/destination default address pointed by HPDMA_CxSAR or HPDMA_CxDAR, once the programmed source/destination burst is completed. This default value refers to the fixed/contiguously incremented address.

HPDMA burst with 2D addressing

When the channel has additional 2D addressing feature, this default value refers to the value without taking into account the two programmed incremented or decremented offsets. These two additional offsets (with a null default value) are applied:

Then, a 2D/repeated block can be addressed with a first programmed address jump after each completed burst, and with a second programmed address jump after each block, as depicted by Figure 124 with a 2D destination buffer.

Figure 124. Programmed 2D addressing

Diagram of programmed 2D addressing showing memory structure with bursts, blocks, and address jumps (DAO, BRDAO).

The diagram illustrates the memory addressing scheme for HPDMA. On the left, a 'Memory-mapped Peripheral' contains a 'Data Register' (32b wide) with fixed addressing (SINC=0). The 'Cx_SAR' register points to this register. An arrow indicates data transfer from the register to 'Memory'. In memory, the 'Cx_DAR' register is used to address data. The memory is organized into 'Bursts' (each containing 'Data n ' and 'Data n-1 ' - 32b wide) and 'Blocks'. Address jumps are indicated by '+ DAO' (after each burst) and '+ BRDAO' (after each block). A 'Restore Cx_DAR' arrow points from the bottom of the memory back to the 'Cx_DAR' register. The diagram shows 'Block 0 ', 'Block k ' (labeled as '2D/repeated block LLI L '), and 'Block K-1 '. Each block contains multiple bursts, with the last burst in a block being 'Burst J-1 '.

Programmable address jumps 1) after burst and 2) after block.
Example:
burst: I * words (DBL_1=I-1; DDW_LOG2='b10)
block: J * bursts (BNDT=J*I*4)
LLI: K * blocks (BRC=K-1)

MSv63674V1

Diagram of programmed 2D addressing showing memory structure with bursts, blocks, and address jumps (DAO, BRDAO).

HPDMA FIFO-based burst

In FIFO-mode, a transfer generally consists of two pipelined and separated burst transfers:

HPDMA source burst

The requested source burst transfer to the FIFO can be scheduled as early as possible over the allocated port, depending on the current FIFO level versus the programmed burst size (when the FIFO is ready to get one new burst from the source):

\[ \text{when FIFO level} \leq 2^{\text{dma\_fifo\_size}[x]} - (\text{SBL\_1}[5:0]+1) * 2^{\text{SDW\_LOG2}[1:0]} \]

where:

Based on the channel priority (HPDMA_CxCR.PRIO[1:0]), this ready FIFO-based source transfer is internally arbitrated versus the other requested and active channels.

HPDMA destination burst

The requested destination burst transfer from the FIFO can be scheduled as early as possible over the allocated port, depending on the current FIFO level versus the programmed burst size (when the FIFO is ready to push one new burst to the destination):

\[ \text{when FIFO level} \geq (\text{DBL\_1}[5:0]+1) * 2^{\text{DDW\_LOG2}[1:0]} \]

where:

Based on the channel priority, this ready FIFO-based destination transfer is internally arbitrated versus the other requested and active channels.

HPDMA burst versus source block size, 1- or 4-Kbyte address boundary and FIFO size

The programmed source/destination HPDMA burst is implemented with an AHB/AXI burst as is, unless one of the following conditions is met:

singles or bursts of lower length, in order to transfer exactly the source block size, without any user constraint.

In any case, the HPDMA keeps ensuring source/destination data (and address) integrity without any user constraint. The current FIFO level (software readable in HPDMA_CxSR) is compared to and updated with the effective transfer size, and the HPDMA re-arbitrates between each AHB/AXI single or burst transfer, possibly modified.

Based on the channel priority, each single or burst of a lower burst size versus the programmed burst, is internally arbitrated versus the other requested and active channels.

Note: In linked-list mode, the HPDMA read transfers related to the update of the linked-list parameters from the memory to the internal HPDMA registers, are scheduled over the link allocated port, as programmed by HPDMA_CxCR.LAP.

HPDMA data handling: byte-based reordering, packing/unpacking, padding/truncation, sign extension, and left/right alignment

The data handling is controlled by HPDMA_CxTR1. The source/destination data width of the programmed burst is byte, half-word, word, or double-word, as per SDW_LOG2[1:0] and DDW_LOG2[1:0] (see Table 108 ).

The user can configure the data handling between transferred data from the source and transfer to the destination. More specifically, programmed data handling is orderly performed with:

  1. 1. Byte-based source reordering
    • – If SBX = 1 and if the source data width is a word or a double-word (for AXI source bus, SAP = 0), the two bytes of the unaligned half-word at the middle of each source data word are exchanged.
  2. 2. Data-width conversion by packing, unpacking, padding, or truncation, if destination data width is different than the source data width, depending on PAM[1:0]:
    • – If destination data width > source data width, the post SBX source data is either right-aligned and padded with 0s, or sign extended up to the destination data width, or is FIFO queued and packed up to the destination data width.
    • – If destination data width < source data width, the post SBX data is either right-aligned and left-truncated down to the destination data width, or is FIFO queued and unpacked and streamed down to the destination data width.
  1. 3. Byte-based destination re-ordering:
    • – If DBX = 1 and if the destination data width is not a byte, the two bytes are exchanged within the aligned post PAM[1:0] half-words.
    • – If DHX = 1 and if the destination data width is neither a byte nor a half-word, the two aligned half-words are exchanged within the aligned post PAM[1:0] words.
    • – If DWX = 1 and if the destination data width is a double-word and if the selected destination port (via DAP) is 64-bit capable, the two aligned words are exchanged within aligned (post PAM[1:0]) double-words.

Note: Left-alignment with 0s-padding can be achieved by programming both a right-alignment with a 0s-padding, and a destination byte-based re-ordering.

The table below lists the possible data handling from the source to the destination.

Table 108. Programmed data handling

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
00ByteB 7 ,B 6 ,B 5 ,B 4 ,B 3 ,B 2 ,B 1 ,B 0x00BytexxxB 7 ,B 6 ,B 5 ,B 4 ,B 3 ,B 2 ,B 1 ,B 0
01Half-word00 (RA, 0P) (3)(4)0x0B 3 ,0B 2 ,0B 1 ,0B 0
1B 3 0,B 2 0,B 1 0,B 0 0
01 (RA, SE) (3)(4)0SB 3 ,SB 2 ,SB 1 ,SB 0
1B 3 S,B 2 S,B 1 S,B 0 S
1x (PACK)0B 7 B 6 ,B 5 B 4 ,B 3 B 2 ,B 1 B 0
1B 6 B 7 ,B 4 B 5 ,B 2 B 3 ,B 0 B 1
10Word00 (RA, 0P) (3)(4)00x000B 1 ,000B 0
100B 1 0,00B 0 0
010B 1 00,0B 0 00
1B 1 000,B 0 000
01 (RA, SE) (3)(4)00SSSB 1 ,SSSB 0
1SSB 1 S,SSB 0 S
1x (PACK)00SB 1 SS,SB 0 SS
1B 1 SSS,B 0 SSS
1x (PACK)00B 7 B 6 B 5 B 4 ,B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 ,B 2 B 3 B 0 B 1
1x (PACK)01B 5 B 4 B 7 B 6 ,B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 ,B 0 B 1 B 2 B 3

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
00ByteB 7 ,B 6 ,B 5 ,B 4 ,B 3 ,B 2 ,B 1 ,B 0x11 (5)Double-word00 (RA, 0P) (3)(4)0000000000B 0
1000000B 0 0
0100000B 0 00
10000B 0 000
001000B 0 0000
100B 0 00000
010B 0 000000
1B 0 0000000
01 (RA, SE) (3)(4)000SSSSSSSB 0
1SSSSSSSB 0 S
01SSSSSB 0 SS
1SSSSB 0 SSS
001SSSB 0 SSSS
1SSB 0 SSSSS
01SB 0 SSSSS
1B 0 SSSSSS
1x (PACK)000B 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 B 2 B 3 B 0 B 1
01B 5 B 4 B 7 B 6 B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 B 0 B 1 B 2 B 3
001B 3 B 2 B 1 B 0 B 7 B 6 B 5 B 4
1B 2 B 3 B 0 B 1 B 6 B 7 B 4 B 5
01B 1 B 0 B 3 B 2 B 5 B 4 B 7 B 6
1B 0 B 1 B 2 B 3 B 4 B 5 B 6 B 7

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
01Half-wordB 7 B 6 B 5 B 4 , B 3 B 2 B 1 B 0x00Byte00 (RA, LT) (3)xxB 6 ,B 4 ,B 2 ,B 0
01 (LA, RT) (3)B 7 ,B 5 ,B 3 ,B 1
1x (UNPACK)B 7 ,B 6 ,B 5 ,B 4 ,B 3 ,B 2 ,B 1 ,B 0
01Half-wordxx0B 7 B 6 ,B 5 B 4 ,B 3 B 2 ,B 1 B 0
1B 6 B 7 ,B 4 B 5 ,B 2 B 3 ,B 0 B 1
10Word00 (RA, 0P) (3)(4)00x00B 3 B 2 ,00B 1 B 0
1B 3 B 2 00,B 1 B 0 00
01B 2 B 3 00,B 0 B 1 00
100B 2 B 3 ,00B 0 B 1
01 (RA, SE) (3)(4)00SSB 3 B 2 ,SSB 1 B 0
1B 3 B 2 SS,B 1 B 0 SS
01B 2 B 3 SS,B 0 B 1 SS
1SSB 2 B 3 ,SSB 0 B 1
1x (PACK)00B 7 B 6 B 5 B 4 ,B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 ,B 2 B 3 B 0 B 1
01B 5 B 4 B 7 B 6 ,B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 ,B 0 B 1 B 2 B 3

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
01Half-wordB 7 B 6 B 5 B 4 , B 3 B 2 B 1 B 0x11 (5)Double-word00 (RA, 0P) (3)(4)000000000B 1 B 0
1000000B 0 B 1
010000B 1 B 0 00
10000B 1 B 0 00
00100B 1 B 0 0000
100B 0 B 1 0000
01B 1 B 0 000000
1B 0 B 1 000000
01 (RA, SE) (3)(4)-00SSSSSSB 1 B 0
1SSSSSSB 0 B 1
01SSSSB 1 B 0 SS
1SSSSB 1 B 0 SS
001SSB 1 B 0 SSSS
1SSB 0 B 1 SSSS
01B 1 B 0 SSSSSS
1B 0 B 1 SSSSSS
1x (PACK)000B 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 B 2 B 3 B 0 B 1
01B 5 B 4 B 7 B 6 B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 B 0 B 1 B 2 B 3
001B 3 B 2 B 1 B 0 B 7 B 6 B 5 B 4
1B 2 B 3 B 0 B 1 B 6 B 7 B 4 B 5
01B 1 B 0 B 3 B 2 B 5 B 4 B 7 B 6
1B 0 B 1 B 2 B 3 B 4 B 5 B 6 B 7

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
10WordB 7 B 6 B 5 B 4 ,
B 3 B 2 B 1 B 0
000Byte00 (RA, LT) (3)-B 12 ,B 8 ,B 4 ,B 0
01 (LA, RT) (3)-B 15 ,B 11 ,B 7 ,B 3
1x (UNPACK)xB 7 ,B 6 ,B 5 ,B 4 ,B 3 ,B 2 ,B 1 ,B 0
01Half-word00 (RA, LT) (3)0xxB 5 B 4 ,B 1 B 0
1B 4 B 5 ,B 0 B 1
01 (LA, RT) (3)0B 7 B 6 ,B 3 B 2
1B 6 B 7 ,B 2 B 3
1x (UNPACK)0B 7 B 6 ,B 5 B 4 ,B 3 B 2 ,B 1 B 0
1B 6 B 7 ,B 4 B 5 ,B 2 B 3 ,B 0 B 1
10Wordxx00B 7 B 6 B 5 B 4 ,B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 ,B 2 B 3 B 0 B 1
01B 5 B 4 B 7 B 6 ,B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 ,B 0 B 1 B 2 B 3

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
10WordB 7 B 6 B 5 B 4 , B 3 B 2 B 1 B 0011 (5)Double-word1x (PACK)000B 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 B 2 B 3 B 0 B 1
01B 5 B 4 B 7 B 6 B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 B 0 B 1 B 2 B 3
001B 3 B 2 B 1 B 0 B 7 B 6 B 5 B 4
1B 2 B 3 B 0 B 1 B 6 B 7 B 4 B 5
01B 1 B 0 B 3 B 2 B 5 B 4 B 7 B 6
1B 0 B 1 B 2 B 3 B 4 B 5 B 6 B 7
00 (RA, 0P) (3)(4)0000000B 3 B 2 B 1 B 0
10000B 2 B 3 B 0 B 1
010000B 1 B 0 B 3 B 2
10000B 0 B 1 B 2 B 3
001B 3 B 2 B 1 B 0 0000
1B 1 B 0 B 3 B 2 0000
01B 3 B 2 B 1 B 0 0000
1B 0 B 1 B 2 B 3 0000
01 (RA, SE) (3)(4)000SSSSB 3 B 2 B 1 B 0
1SSSSB 2 B 3 B 0 B 1
01SSSSB 1 B 0 B 3 B 2
1SSSSB 0 B 1 B 2 B 3
001B 3 B 2 B 1 B 0 SSSS
1B 1 B 0 B 3 B 2 SSSS
01B 3 B 2 B 1 B 0 SSSS
1B 0 B 1 B 2 B 3 SSSS

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
10WordB 7 B 6 B 5 B 4 ,
B 3 B 2 B 1 B 0
100Byte00 (RA, LT) (3)-B 12 ,B 8 ,B 4 ,B 0
01 (LA, RT) (3)-B 15 ,B 11 ,B 7 ,B 3
1x (UNPACK)xB 7 ,B 5 ,B 6 ,B 4 ,B 3 ,B 1 ,B 2 ,B 0
01Half-word00 (RA, LT) (3)0xxB 6 B 4 ,B 2 B 0
1B 4 B 6 ,B 0 B 2
01 (LA, RT) (3)0B 7 B 5 ,B 3 B 1
1B 5 B 7 ,B 1 B 3
1x (UNPACK)0B 7 B 5 ,B 6 B 4 ,B 3 B 1 ,B 2 B 0
1B 5 B 7 ,B 4 B 6 ,B 1 B 3 ,B 0 B 2
10Wordxx00B 7 B 5 B 6 B 4 ,B 3 B 1 B 2 B 0
1B 5 B 7 B 4 B 6 ,B 1 B 3 B 0 B 2
01B 6 B 4 B 7 B 5 ,B 2 B 0 B 3 B 1
1B 4 B 6 B 5 B 7 ,B 0 B 2 B 1 B 3

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
10WordB 7 B 6 B 5 B 4 , B 3 B 2 B 1 B 0111 (5)Double-word00 (RA, 0P) (3)(4)0000000B 3 B 1 B 2 B 0
10000B 4 B 3 B 0 B 2
010000B 2 B 0 B 3 B 1
10000B 0 B 2 B 1 B 3
001B 3 B 1 B 2 B 0 0000
1B 1 B 3 B 0 B 2 0000
01B 2 B 0 B 3 B 1 0000
1B 0 B 2 B 1 B 3 0000
01 (RA, SE) (3)(4)000SSSSB 3 B 1 B 2 B 0
1SSSSB 1 B 3 B 0 B 2
01SSSSB 2 B 0 B 3 B 1
1SSSSB 0 B 2 B 1 B 3
001B 3 B 1 B 2 B 0 SSSS
1B 1 B 3 B 0 B 2 SSSS
01B 2 B 0 B 3 B 1 SSSS
1B 0 B 2 B 1 B 3 SSSS
1x (PACK)000B 7 B 5 B 6 B 4 B 3 B 1 B 2 B 0
1B 5 B 7 B 4 B 6 B 1 B 3 B 0 B 2
01B 6 B 4 B 7 B 5 B 2 B 0 B 3 B 1
1B 4 B 6 B 5 B 7 B 0 B 2 B 1 B 3
001B 3 B 1 B 2 B 0 B 7 B 5 B 6 B 4
1B 1 B 3 B 0 B 2 B 5 B 7 B 4 B 6
01B 2 B 0 B 3 B 1 B 6 B 4 B 7 B 5
1B 0 B 2 B 1 B 3 B 4 B 6 B 5 B 7

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
11 (6)Double-wordB 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0000Byte00 (RA, LT) (3)-B 24 ,B 16 ,B 8 ,B 0
01 (LA, RT) (3)-B 31 ,B 23 ,B 15 ,B 7
1x (UNPACK)xB 7 ,B 6 ,B 5 ,B 4 ,B 3 ,B 2 ,B 1 ,B 0
01Half-word00 (RA, LT) (3)0xB 9 B 8 ,B 1 B 0
1B 8 B 9 ,B 0 B 1
01 (LA, RT) (3)0B 15 B 14 ,B 7 B 6
1B 14 B 15 ,B 6 B 7
1x (UNPACK)0B 7 B 6 ,B 5 B 4 ,B 3 B 2 ,B 1 B 0
1B 6 B 7 ,B 4 B 5 ,B 2 B 3 ,B 0 B 1
10Word00 (RA, LT) (3)00B 11 B 10 B 9 B 8 ,B 3 B 2 B 1 B 0
1B 10 B 11 B 8 B 9 ,B 2 B 3 B 0 B 1
01B 9 B 8 B 11 B 10 ,B 1 B 0 B 3 B 2
1B 8 B 9 B 10 B 11 ,B 0 B 1 B 2 B 3
01 (LA, RT) (3)00xB 15 B 14 B 13 B 12 ,B 7 B 6 B 5 B 4
1B 14 B 15 B 12 B 13 ,B 6 B 7 B 4 B 5
01B 13 B 12 B 15 B 14 ,B 5 B 4 B 7 B 6
1B 12 B 13 B 14 B 15 ,B 4 B 5 B 6 B 7
1x (UNPACK)00B 7 B 6 B 5 B 4 ,B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 ,B 2 B 3 B 0 B 1
01B 5 B 4 B 7 B 6 ,B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 ,B 0 B 1 B 2 B 3

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
11 (6)Double-wordB 7 B 6 B 5 B 4 B 3 B 2
B 1 B 0
011 (5)Double-wordxx000B 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0
1B 6 B 7 B 4 B 5 B 2 B 3 B 0 B 1
01B 5 B 4 B 7 B 6 B 1 B 0 B 3 B 2
1B 4 B 5 B 6 B 7 B 0 B 1 B 2 B 3
001B 3 B 2 B 1 B 0 B 7 B 6 B 5 B 4
1B 2 B 3 B 0 B 1 B 6 B 7 B 4 B 5
01B 1 B 0 B 3 B 2 B 5 B 4 B 7 B 6
1B 0 B 1 B 2 B 3 B 4 B 5 B 6 B 7
100Byte00 (RA, LT) (3)xxxB 24 ,B 16 ,B 8 ,B 0
01 (LA, RT) (3)B 31 ,B 23 ,B 15 ,B 7
1x (UNPACK)B 7 ,B 5 ,B 6 ,B 4 ,B 3 ,B 1 ,B 2 ,B 0
01Half-word00 (RA, LT) (3)0B 10 B 8 ,B 2 B 0
1B 8 B 10 ,B 0 B 2
01 (LA, RT) (3)0B 15 B 13 ,B 7 B 5
1B 13 B 15 ,B 5 B 7
1x (UNPACK)0B 7 B 5 ,B 6 B 4 ,B 3 B 1 ,B 2 B 0
1B 5 B 7 ,B 4 B 6 ,B 1 B 3 ,B 0 B 2

Table 108. Programmed data handling (continued)

SDW_LOG2 [1:0]Source dataSource data stream (1)SBXDDW_LOG2 [1:0]Destination dataPAM[1:0] (2)DBXDHXDWXDestination data stream (1)
11 (6)Double-wordB 7 B 6 B 5 B 4 B 3 B 2
B 1 B 0
110Word00 (RA, LT) (3)00xB 11 B 9 B 10 B 8 , B 3 B 1 B 2 B 0
1B 9 B 11 B 8 B 10 , B 1 B 3 B 0 B 2
01B 10 B 8 B 11 B 9 , B 2 B 0 B 3 B 1
1B 8 B 10 B 9 B 11 , B 0 B 2 B 1 B 3
01 (LA, RT) (3)00B 15 B 13 B 14 B 12 ,
B 7 B 5 B 6 B 4
1B 13 B 15 B 12 B 14 ,
B 5 B 7 B 4 B 6
01B 14 B 12 B 15 B 13 ,
B 6 B 4 B 7 B 5
1B 12 B 14 B 13 B 15 ,
B 4 B 6 B 5 B 7
1x (UNPACK)00B 7 B 5 B 6 B 4 , B 3 B 1 B 2 B 0
1B 5 B 7 B 4 B 6 , B 1 B 3 B 0 B 2
01B 6 B 4 B 7 B 5 , B 2 B 0 B 3 B 1
1B 4 B 6 B 5 B 7 , B 0 B 2 B 1 B 3
11 (5)Double-wordxx00B 7 B 5 B 6 B 4 B 3 B 1 B 2 B 0
1B 5 B 7 B 4 B 6 B 1 B 3 B 0 B 2
01B 6 B 4 B 7 B 5 B 2 B 0 B 3 B 1
1B 4 B 6 B 5 B 7 B 0 B 2 B 1 B 3
00B 3 B 1 B 2 B 0 B 7 B 5 B 6 B 4
1B 1 B 3 B 0 B 2 B 5 B 7 B 4 B 6
01B 2 B 0 B 3 B 1 B 6 B 4 B 7 B 5
1B 0 B 2 B 1 B 3 B 4 B 6 B 5 B 7
  1. 1. Data stream is timely ordered starting from the byte with the lowest index (B 0 ).
  2. 2. RA= right aligned, LA = left aligned, RT = right truncated, LT = left truncated, OP = zero bit padding up to the destination data width, SE = sign bit extended up to the destination data width.
  3. 3. RA= right aligned. LA = left aligned. RT = right truncated. LT = left truncated.
  4. 4. OP= zero-bit padding up to the destination data width. SE = sign bit extended up to the destination data width.
  5. 5. if DDW_LOG2[1:0] = 11 and if the selected destination port (via DAP) is 64-bit capable. If DDW_LOG2[1:0] = 11 and the selected destination port is not 64-bit capable, a user setting error (USEF) is reported.
  6. 6. if SDW_LOG2[1:0] = 11 and if the selected source port (via SAP) is 64-bit capable. If SDW_LOG2[1:0] = 11 and the selected source port is not 64-bit capable, a user setting error (USEF) is reported.

13.4.11 HPDMA transfer request and arbitration

HPDMA transfer request

As defined by HPDMA_CxTR2, a programmed HPDMA data transfer is requested with one of the following:

Caution: The user must not assign the same input hardware peripheral HPDMA request via HPDMA_CxTR.REQSEL[4:0] to two different channels, if at a given time this request is asserted by the peripheral, and each channel is ready to execute this requested data transfer. There is no user setting error reporting.

HPDMA transfer request for arbitration

A ready FIFO-based HPDMA source single/burst transfer (from the source address to the FIFO) to be scheduled over the allocated master port (HPDMA_CxTR1.SAP) is arbitrated based on the channel priority (HPDMA_CxCR.PRIO[1:0]) versus the other simultaneous requested HPDMA transfers to the same master port.

A ready FIFO-based HPDMA destination single/burst transfer (from the FIFO to the destination address) to be scheduled over the allocated master port (HPDMA_CxTR1.DAP) is arbitrated based on the channel priority (HPDMA_CxCR.PRIO[1:0]) versus the other simultaneous requested HPDMA transfers to the same master port.

An arbitrated HPDMA requested link transfer consists of one 32-bit read from the linked-list data structure in the memory to one of the linked-list registers (HPDMA_CxTR1, HPDMA_CxTR2, HPDMA_CxBR1, HPDMA_CxSAR, HPDMA_CxDAR, HPDMA_CxTR3, HPDMA_CxBR2 or HPDMA_CxLLR). Each 32-bit read from the memory is arbitrated with the same channel priority as for data transfers, in order to be scheduled over the allocated master port (HPDMA_CxCR.LAP).

Whatever the requested data transfer is programmed with a software request for a memory-to-memory transfer (HPDMA_CxTR2.SWREQ = 1), or with a hardware request (HPDMA_CxTR2.SWREQ = 0) for a memory-to-peripheral transfer or a peripheral-to-memory transfer and whatever is the hardware request type, re-arbitration occurs after each granted single/burst transfer.

When an hardware request is programmed from a destination peripheral (HPDMA_CxTR2.SWREQ = 0 and HPDMA_CxTR2.DREQ = 1), the first memory read of a (possibly 2D/repeated) block (the first ready FIFO-based source burst request), is gated by the occurrence of the corresponding and selected hardware request. This first read request

to memory is not taken into account earlier by the arbiter (not as soon as the block transfer is enabled and executable).

HPDMA arbitration

The HPDMA arbitration is directed from the 4-grade assigned channel priority (HPDMA_CxCR.PRIO[1:0]). The arbitration policy, as illustrated in Figure 125 , is defined by:

This traffic class is granted via a fixed-priority arbitration against any other low-priority traffic class. Within this class, requested single/burst transfers are round-robin arbitrated.

Each requested single/burst transfer within this class is round-robin arbitrated, with a weight that is monotonically driven from the programmed priority:

Figure 125. HPDMA arbitration policy

Diagram of HPDMA arbitration policy showing four queues (0, 1, 2, 3) with round-robin arbitration (RRA) leading to a fixed-priority arbitration (FPA) stage. Queue 3 is high priority, while queues 0, 1, and 2 are low priority.
graph LR
    P0[PRIO = 0] --> Q0[Queue 0 RRA]
    P1[PRIO = 1] --> Q0
    P1 --> Q1[Queue 1 RRA]
    P2[PRIO = 2] --> Q0
    P2 --> Q1
    P2 --> Q2[Queue 2 RRA]
    P3[PRIO = 3] --> Q3[Queue 3 RRA]
    
    Q0 --> RRA_Low[RRA Stage]
    Q1 --> RRA_Low
    Q2 --> RRA_Low
    
    RRA_Low --> FPA{FPA}
    Q3 --> FPA
    
    FPA -- High --> GR[Granted request]
    FPA -- Low --> GR

The diagram illustrates the HPDMA arbitration policy. On the left, four request sources are shown, each assigned a priority level via HPDMA_CxCR.PRIO:

These requests are distributed to four queues, each performing round-robin arbitration (RRA):

The outputs of the queues are then processed by a Fixed-Priority Arbiter (FPA):

The final output is the "Granted request".

RRA = round-robin arbitration, FPA = fixed-priority arbitration

MSV66927V1

Diagram of HPDMA arbitration policy showing four queues (0, 1, 2, 3) with round-robin arbitration (RRA) leading to a fixed-priority arbitration (FPA) stage. Queue 3 is high priority, while queues 0, 1, and 2 are low priority.

HPDMA arbitration and bandwidth

With this arbitration policy, the following is guaranteed:

The two following examples highlight that the weighted round-robin arbitration is driven by the programmed priorities:

The above computed bandwidth calculation is based on a theoretical input request, always active for any HPDMA clock cycle. This computed bandwidth from the arbiter must be weighted by the frequency of the request given by the application, that cannot be always active and may be quite much variable from one HPDMA client (example I2C at 400 kHz) to another one (PWM at 1 kHz) than the above x3 and x5 ratios.

In this example, when the master port bus bandwidth is not totally consumed by the time-sensitive queue 3, the residual bandwidth is such that 2.5 times less bandwidth is allocated to any request of priority 0 versus priority 1, and 5.5 times less bandwidth is allocated to any request of priority 0 versus priority 2.

More generally, assume that the following requests are present:

As \( B_{Q3} \) is the reserved bandwidth to time-sensitive requests, the bandwidth for each request L with priority 3 is:

The bandwidth for each non-time sensitive queue is:

The bandwidth for the set of requests with priority 0 is:

The bandwidth for each request i with priority 0 is:

The bandwidth for the set of requests with priority 1 and routed to queue 0 is:

The bandwidth for the set of requests with priority 1 and routed to queue 1 is:

The total bandwidth for the set of requests with priority 1 is:

The bandwidth for each request j with priority 1 is:

The bandwidth for the set of requests with priority 2 and routed to queue 0 is:

The bandwidth for the set of requests with priority 2 and routed to queue 1 is:

The bandwidth for the set of requests with priority 2 and routed to queue 2 is:

The total bandwidth for the set of requests with priority 2 is:

The bandwidth for each request k with priority 2 is:

Thus finally the maximum allocated residual bandwidths for any \( i, j, k \) non-time sensitive request are:

Consequently, the HPDMA arbiter can be used as a programmable weighted bandwidth limiter, for each queue and more generally for each request/channel. The different weights are monotonically resulting from the programmed channel priorities.

13.4.12 HPDMA triggered transfer

A programmed HPDMA transfer can be triggered by a rising/falling edge of a selected input trigger event, as defined by HPDMA_CxTR2.TRIGPOL[1:0] and HPDMA_CxTR2.TRIGSEL[5:0] (see Section 13.3.6 for the trigger selection).

The triggered transfer, as defined by the trigger mode in HPDMA_CxTR2.TRIGM[1:0], can be at LLI data transfer level, to condition the first burst read of a block, the first burst read of a 2D/repeated block (for channel \( x = 12 \) to \( 15 \) ), or each programmed burst read/write. The trigger mode can also be programmed to condition the LLI link transfer (see TRIGM[1:0] in HPDMA channel \( x \) transfer register 2 (HPDMA_CxTR2) for more details).

Trigger hit memorization and trigger overrun flag generation

The HPDMA monitoring of a trigger for a channel \( x \) is started when the channel is enabled/loading with a new active trigger configuration: rising or falling edge on a selected trigger (respectively TRIGPOL[1:0] = 01 or TRIGPOL[1:0] = 10).

The monitoring of this trigger is kept active during the triggered and uncompleted (data or link) transfer. If a new trigger is detected, this hit is internally memorized to grant the next transfer, as long as the defined rising/falling edge and TRIGSEL[5:0] are not modified, and the channel is enabled.

Transferring a next \( LLI_{n+1} \) , that updates HPDMA_CxTR2 with a new value for any of TRIGSEL[5:0] or TRIGPOL[1:0], resets the monitoring, trashing the possible memorized hit of the formerly defined \( LLI_n \) trigger.

Caution: After a first new trigger, \( hit_{n+1} \) is memorized. If another trigger \( hit_{n+2} \) is detected, and if the \( hit_n \) triggered transfer is still not completed, \( hit_{n+2} \) is lost and not memorized. A trigger overrun flag is reported (HPDMA_CxSR.TOF = 1) and an interrupt is generated if enabled (if HPDMA_CxCR.TOIE = 1). The channel is not automatically disabled by hardware due to a trigger overrun.

The figure below illustrates the trigger hit, memorization, and overrun in the configuration example with a block-level trigger mode and a rising edge trigger polarity.

Figure 126. Trigger hit, memorization and overrun waveform

Figure 126. Trigger hit, memorization and overrun waveform. This timing diagram shows the relationship between Channel state, Trigger, Peripheral request, DMA transfer, Trigger monitoring state, Trigger monitoring action, and Trigger overrun over time. The Channel state starts IDLE and becomes ACTIVE. The Trigger signal has rising edges. The Peripheral request is a periodic signal. The DMA transfer consists of three block transfers. The Trigger monitoring state shows Idle, Active (monitoring), and Active states. The Trigger monitoring action shows Hit and fire, Hit and memorize, Fire, Hit and memorize, Hit and trash, and Fire actions. The Trigger overrun signal is shown as a pulse. A legend at the bottom indicates: Hit and trash (pink), Hit and fire (or fire alone) (green), and Hit and memorize (yellow). The code MSV66923V1 is in the bottom right corner.
Figure 126. Trigger hit, memorization and overrun waveform. This timing diagram shows the relationship between Channel state, Trigger, Peripheral request, DMA transfer, Trigger monitoring state, Trigger monitoring action, and Trigger overrun over time. The Channel state starts IDLE and becomes ACTIVE. The Trigger signal has rising edges. The Peripheral request is a periodic signal. The DMA transfer consists of three block transfers. The Trigger monitoring state shows Idle, Active (monitoring), and Active states. The Trigger monitoring action shows Hit and fire, Hit and memorize, Fire, Hit and memorize, Hit and trash, and Fire actions. The Trigger overrun signal is shown as a pulse. A legend at the bottom indicates: Hit and trash (pink), Hit and fire (or fire alone) (green), and Hit and memorize (yellow). The code MSV66923V1 is in the bottom right corner.

Note: The user can assign the same input trigger event to different channels. This can be used to trigger different channels on a broadcast trigger event.

13.4.13 HPDMA circular buffering with linked-list programming

HPDMA circular buffering for memory-to-peripheral and peripheral-to-memory transfers, with a linear addressing channel

For a circular buffering, with a continuous memory-to-peripheral (or peripheral-to-memory) transfer, the software must set up a channel with half-transfer and complete-transfer event/interrupt generation (HPDMA_CxCR.HTIE = 1 and HPDMA_CxCR.TCIE = 1), in order to enable a concurrent buffer software processing.

LLI 0 is configured for the first block transfer with the linear addressing channel. A continuously-executed LLI 1 is needed to restore the memory source (or destination) start address for the memory-to-peripheral transfer (respectively the peripheral-to-memory). The HPDMA automatically reloads the initially programmed HPDMA_CxBR1.BNDT[15:0] when a block transfer is completed, and there is no need to restore HPDMA_CxBR1.

The figure below illustrates this programming with a linear addressing HPDMA channel and a source circular buffer.

Figure 127. HPDMA circular buffer programming: update of the memory start address with a linear addressing channel

Diagram illustrating HPDMA circular buffer programming. At the top, a block diagram shows 'Init/LLI0' and 'Restore SAR/LLI1' blocks within 'Channel x'. 'Init/LLI0' receives 'Reset' and 'Req=PERIPH_TX' signals and outputs 'Ht+ tcf'. 'Restore SAR/LLI1' receives 'Req=PERIPH_TX' and 'Ht+ tcf' signals and outputs 'Ht+ tcf'. Below, a 'Linked-list register file' contains 'LLI0' with fields: DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. An arrow points from 'DMA_CxLLR' to a 'Memory' block. The 'Memory' block contains 'LLI1' with 'DMA_CxSAR'. Text next to the arrow indicates 'CxLBA (LA = 0)', 'USA = 1', and 'others Uxx = 0'. The diagram is labeled 'MSv62640V1' in the bottom right.
Diagram illustrating HPDMA circular buffer programming. At the top, a block diagram shows 'Init/LLI0' and 'Restore SAR/LLI1' blocks within 'Channel x'. 'Init/LLI0' receives 'Reset' and 'Req=PERIPH_TX' signals and outputs 'Ht+ tcf'. 'Restore SAR/LLI1' receives 'Req=PERIPH_TX' and 'Ht+ tcf' signals and outputs 'Ht+ tcf'. Below, a 'Linked-list register file' contains 'LLI0' with fields: DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. An arrow points from 'DMA_CxLLR' to a 'Memory' block. The 'Memory' block contains 'LLI1' with 'DMA_CxSAR'. Text next to the arrow indicates 'CxLBA (LA = 0)', 'USA = 1', and 'others Uxx = 0'. The diagram is labeled 'MSv62640V1' in the bottom right.

Note:

With a 2D addressing channel, a single LLI can be used with \( HPDMA\_CxBR1.BRC[10:0] = 1 \) . The user can program a negative memory block address offset with \( HDMA\_CxBR2 \) and \( HDMA\_CxBR1 \) , in order to jump back to the memory source or destination start address.

If the circular buffering must be executed after some other transfers over the shared HPDMA channel x, the before-last \( LLI_{N-1} \) in the memory is needed to configure the first block transfer. The last \( LLI_N \) restores the memory source (or destination) start address in memory-to-peripheral transfer (respectively in peripheral-to-memory).

The figure below illustrates this programming with a linear addressing shared HPDMA channel, and a source circular buffer.

Figure 128. Shared HPDMA channel with circular buffering: update of the memory start address with a linear addressing channel

Diagram illustrating the shared HPDMA channel with circular buffering. The top part shows 'Channel X' with a sequence of Link Lists (LL): Init/LL0, LL1, ..., LLN-1, LLN. Green arrows labeled 'Req=PERIPH_TX' point to LLN-1 and LLN. Pink arrows labeled 'Ht+ tcf' point from LLN-1 and LLN to the Memory section. The Memory section shows two Link List structures. The left structure for LLN-2 contains DMA_Cx... (three times) and DMA_CxLLR. The right structure for LLN-1 contains DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. Arrows indicate that the DMA_CxLLR from LLN-2 points to the start of the LLN-1 structure, and the DMA_CxSAR from LLN-1 points back to the start of the LLN-2 structure. A note 'All Uxx=1' is present. At the bottom, it says 'USA = 1, others Uxx = 0 LA+ = 0xC' and 'MSV62641V1'.
Diagram illustrating the shared HPDMA channel with circular buffering. The top part shows 'Channel X' with a sequence of Link Lists (LL): Init/LL0, LL1, ..., LLN-1, LLN. Green arrows labeled 'Req=PERIPH_TX' point to LLN-1 and LLN. Pink arrows labeled 'Ht+ tcf' point from LLN-1 and LLN to the Memory section. The Memory section shows two Link List structures. The left structure for LLN-2 contains DMA_Cx... (three times) and DMA_CxLLR. The right structure for LLN-1 contains DMA_CxTR1, DMA_CxTR2, DMA_CxBR1, DMA_CxSAR, DMA_CxDAR, and DMA_CxLLR. Arrows indicate that the DMA_CxLLR from LLN-2 points to the start of the LLN-1 structure, and the DMA_CxSAR from LLN-1 points back to the start of the LLN-2 structure. A note 'All Uxx=1' is present. At the bottom, it says 'USA = 1, others Uxx = 0 LA+ = 0xC' and 'MSV62641V1'.

13.4.14 HPDMA transfer in peripheral flow-control mode

A peripheral with the peripheral flow-control mode feature can decide to early terminate an HPDMA block transfer, provided that the allocated channel is implemented with this feature (see Section 13.3.5 ).

If the related HPDMA channel x is also programmed in peripheral flow-control mode (HPDMA_CxTR2.PFREQ = 1):

In peripheral flow-control mode:

13.4.15 HPDMA privileged/unprivileged channel

Any channel x is a privileged or unprivileged hardware resource, as configured by a privileged agent via HPDMA_PRIVCFGR.PRIVx.

When a channel x is configured in a privileged state by a privileged agent, the following access control rules are applied:

When a channel is configured in a privileged (or unprivileged) state, the source and destination data transfers are privileged (respectively unprivileged) transfers over the AHB/AXI master port.

When a channel is configured in a privileged (or unprivileged) state and in linked-list mode, the loading of the next linked-list data structure from the HPDMA memory into its register file, is automatically performed with privileged (respectively unprivileged) transfers, via the HPDMA_CxCR.LAP allocated master port.

The HPDMA generates a privileged bus that reflects HPDMA_PRIVCFGR, to keep the other peripherals informed of the privileged/unprivileged state of each HPDMA channel x.

13.4.16 HPDMA error management

The HPDMA can manage and report to the user a transfer error, as follows, depending on the root cause.

Data transfer error

On a bus access (as an AHB/AXI single or a burst) to the source or the destination

On a tentative update of a HPDMA channel register from the programmed LLI in the memory:

User setting error

On a tentative execution of an HPDMA transfer with an unauthorized user setting:

13.5 HPDMA in debug mode

When the device enters debug mode (core halted), any channel x can be individually either continued (default) or suspended, depending on the programmable control bit in the DBGMCU module.

Note: In debug mode, HPDMA_CxSR.SUSPF is not altered by a suspension from the programmable control bit in the DBGMCU module. In this case, HPDMA_CxSR.IDLEF can be checked to know the completion status of the channel suspension.

13.6 HPDMA in low-power modes

Table 109. Effect of low-power modes on HPDMA

ModeDescription
SleepNo effect. HPDMA interrupts cause the device to exit Sleep mode.
Stop (1)The content of HPDMA registers is kept when entering Stop mode.
StandbyThe HPDMA is powered down, and must be reinitialized after exiting Standby mode.

1. Refer to Section 13.3.2 to know which Stop mode is supported.

13.7 HPDMA interrupts

There is one HPDMA interrupt line for each channel, and separately for each CPU (if several ones in the devices).

Table 110. HPDMA interrupt requests

Interrupt acronymInterrupt eventInterrupt enableEvent flagEvent clear method
HPDMA_CHxTransfer completeHPDMA_CxCR.TCIEHPDMA_CxSR.TCFWrites 1 to HPDMA_CxFR.TCF
Half transferHPDMA_CxCR.HTIEHPDMA_CxSR.HTFWrites 1 to HPDMA_CxFR.HTF
Data transfer errorHPDMA_CxCR.DTEIEHPDMA_CxSR.DTEFWrites 1 to HPDMA_CxFR.DTEF
Update link errorHPDMA_CxCR.ULEIEHPDMA_CxSR.ULEFWrites 1 to HPDMA_CxFR.ULEF
User setting errorHPDMA_CxCR.USEIEHPDMA_CxSR.USEFWrites 1 to HPDMA_CxFR.USEF
SuspendedHPDMA_CxCR.SUSPIEHPDMA_CxSR.SUSPFWrites 1 to HPDMA_CxFR.SUSPF
Trigger overrunHPDMA_CxCR.TOFIEHPDMA_CxSR.TOFWrites 1 to HPDMA_CxFR.TOF

An HPDMA channel x event can be:

Note: When a channel x transfer complete event occurs, the output signal hpdma_chx_tc is generated as a high pulse of one clock cycle.

An interrupt is generated following any xx event, provided that both:

TCF (transfer complete) and HTF (half transfer) events generation is controlled by HPDMA_CxTR2.TCEM[1:0] as follows:

A half-block transfer occurs when half of the source block size bytes (rounded-up integer of \( HPDMA\_CxBR1.BNDT[15:0] / 2 \) ) is transferred to the destination.

A half 2D/repeated block transfer occurs when half of the repeated blocks (rounded-up integer of \( (HPDMA\_CxBR1.BRC[10:0] + 1) / 2 \) ) is transferred to the destination.

See HPDMA channel x transfer register 2 (HPDMA_CxTR2) for more details.

Note: The interrupt mode must be used (not the polling mode) to be notified on a half transfer when the write data transaction has been completed over the AXI destination allocated port (written at the destination memory-mapped address), and not just before when has been issued, at HPDMA level, this AXI burst transaction.

A transfer error rises in one of the following situations:

The user must perform a debug session to correct the HPDMA channel programming versus the USEF root causes list (see Section 13.4.16 ).

A trigger overrun is described in Trigger hit memorization and trigger overrun flag generation .

13.8 HPDMA registers

The HPDMA registers must be accessed with an aligned 32-bit word data access.

13.8.1 HPDMA privileged configuration register (HPDMA_PRIVCFGR)

Address offset: 0x004

Reset value: 0x0000 0000

A write access to this register must be privileged. A read access can be privileged or unprivileged.

This register must be written when \( HPDMA\_CxCR.EN = 0 \) .

This register is read-only when \( HPDMA\_CxCR.EN = 1 \) .

This register must be programmed at a bit level, at the initialization/closure of a HPDMA channel ( \( HPDMA\_CxCR.EN = 0 \) ), to individually allocate any channel x to the privileged or unprivileged world.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
PRIV15PRIV14PRIV13PRIV12PRIV11PRIV10PRIV9PRIV8PRIV7PRIV6PRIV5PRIV4PRIV3PRIV2PRIV1PRIV0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 PRIVx : Privileged state of channel x (x = 15 to 0)

0: Unprivileged

1: Privileged

13.8.2 HPDMA configuration lock register (HPDMA_RCFGLOCKR)

Address offset: 0x008

Reset value: 0x0000 0000

This register can be written by a software agent with privileged attributes in order to individually lock, for example at boot time, the privileged attributes of any HPDMA channel/resource (to lock the setting of HPDMA_PRIVCFGR for any channel x at, for example at boot time).

A read access may be privileged or unprivileged.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
LOCK15LOCK14LOCK13LOCK12LOCK11LOCK10LOCK9LOCK8LOCK7LOCK6LOCK5LOCK4LOCK3LOCK2LOCK1LOCK0
rsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrs

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 LOCKx : Lock of the configuration of HPDMA_PRIVCFGR.PRIVx until a global HPDMA reset (x = 15 to 0)

This bit is cleared after reset and, once set, it cannot be reset until a global HPDMA reset.

0: privilege configuration of the channel x is writable.

1: privilege configuration of the channel x is not writable.

13.8.3 HPDMA masked interrupt status register (HPDMA_MISR)

Address offset: 0x0C

Reset value: 0x0000 0000

This is a read register.

This register contains the masked interrupt status bit MISx for each channel x. It is a logical OR of all the HPDMA_CxSR flags, each source flag being enabled by the corresponding HPDMA_CxCR interrupt enable bit.

Every bit is deasserted by hardware when writing 1 to the corresponding HPDMA_CxFCR flag clear bit.

This register can mix privileged and unprivileged information, depending on the privileged state of each channel HPDMA_PRIVCFGR.PRIVx. A privileged software can read the full interrupt status. An unprivileged software is restricted to read the status of unprivileged channels, other privileged bitfields returning zero.

31302928272625242322212019181716
ResResResResResResResResResResResResResResResRes
1514131211109876543210
MIS15MIS14MIS13MIS12MIS11MIS10MIS9MIS8MIS7MIS6MIS5MIS4MIS3MIS2MIS1MIS0
rrrrrrrrrrrrrrrr

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 MISx : Masked interrupt status of channel x (x = 15 to 0)

0: No interrupt occurred on channel x.

1: An interrupt occurred on channel x.

13.8.4 HPDMA channel x linked-list base address register (HPDMA_CxLBAR)

Address offset: 0x050 + 0x80 * x (x = 0 to 15)

Reset value: 0x0000 0000

This register must be written by a privileged software. It is either privileged readable or not, depending on the privileged state of the channel x HPDMA_PRIVCFG.R.PRIVx.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This channel-based register is the linked-list base address of the memory region, for a given channel x, from which the LLIs describing the programmed sequence of the HPDMA transfers, are conditionally and automatically updated.

This 64-Kbyte aligned channel x linked-list base address is offset by the 16-bit HPDMA_CxLLR register that defines the word-aligned address offset for each LLI.

31302928272625242322212019181716
LBA[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

Bits 31:16 LBA[31:16] : Linked-list base address of HPDMA channel x

Bits 15:0 Reserved, must be kept at reset value.

13.8.5 HPDMA channel x flag clear register (HPDMA_CxFCR)

Address offset: 0x05C+ 0x80 * x (x = 0 to 15)

Reset value: 0x0000 0000

This is a write register privileged or unprivileged, depending on the privileged state of the channel x (HPDMA_PRIVCFGR.PRIVx).

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.TOFSUSPFUSEFULEFDTEFHTFTCFRes.Res.Res.Res.Res.Res.Res.Res.
wwwwwww

Bits 31:15 Reserved, must be kept at reset value.

Bit 14 TOF : Trigger overrun flag clear

0: No effect

1: Corresponding TOF flag cleared

Bit 13 SUSPF : Completed suspension flag clear

0: No effect

1: Corresponding SUSPF flag cleared

Bit 12 USEF : User setting error flag clear

0: No effect

1: Corresponding USEF flag cleared

Bit 11 ULEF : Update link transfer error flag clear

0: No effect

1: Corresponding ULEF flag cleared

Bit 10 DTEF : Data transfer error flag clear

0: No effect

1: Corresponding DTEF flag cleared

Bit 9 HTF : Half-transfer flag clear

0: No effect

1: Corresponding HTF flag cleared

Bit 8 TCF : Transfer complete flag clear

0: No effect

1: Corresponding TCF flag cleared

Bits 7:0 Reserved, must be kept at reset value.

13.8.6 HPDMA channel x status register (HPDMA_CxSR)

Address offset: 0x060 + 0x80 * x (x = 0 to 15)

Reset value: 0x0000 0001

This is a read register, reporting the channel status.

This register is privileged or unprivileged, depending on the privileged state of the channel (HPDMA_PRIVCFGR.PRIVx).

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.FIFOL[8:0]
rrrrrrrrr
1514131211109876543210
Res.TOFSUSPFUSEFULEFDTEFHTFTCFRes.Res.Res.Res.Res.Res.Res.IDLEF
rrrrrrrr

Bits 31:25 Reserved, must be kept at reset value.

Bits 24:16 FIFOL[8:0] : Monitored FIFO level

Number of available write beats in the FIFO, in units of the programmed destination data width (see Section 13.8.8: HPDMA channel x transfer register 1 (HPDMA_CxTR1) DDW_LOG2[1:0], in units of bytes, half-words, words or double-words).

Note: After having suspended an active transfer, the user may need to read FIFOL[8:0], additionally to HPDMA_CxBR1.BDNT[15:0] and HPDMA_CxBR1.BRC[10:0], to know how many data have been transferred to the destination. Before reading, the user may wait for the transfer to be suspended (HPDMA_CxSR.SUSPF = 1).

Bit 15 Reserved, must be kept at reset value.

Bit 14 TOF : Trigger overrun flag

0: No trigger overrun event
1: A trigger overrun event occurred.

Bit 13 SUSPF : Completed suspension flag

0: No completed suspension event
1: A completed suspension event occurred.

Bit 12 USEF : User setting error flag

0: No user setting error event
1: A user setting error event occurred.

Bit 11 ULEF : Update link transfer error flag

0: No update link transfer error event
1: A master bus error event occurred while updating a linked-list register from memory.

Bit 10 DTEF : Data transfer error flag

0: No data transfer error event
1: A master bus error event occurred on a data transfer.

Bit 9 HTF : Half-transfer flag

0: No half-transfer event

1: A half-transfer event occurred.

A half-transfer event is either a half-block transfer or a half 2D/repeated block transfer, depending on the transfer complete event mode (HPDMA_CxTR2.TCEM[1:0]).

A half-block transfer occurs when half of the bytes of the source block size (rounded up integer of HPDMA_CxBR1.BNDT[15:0]/2) has been transferred to the destination.

A half 2D/repeated block transfer occurs when half of the repeated blocks (rounded up integer of (HPDMA_CxBR1.BRC[10:0]+1)/2)) has been transferred to the destination.

Bit 8 TCF : Transfer complete flag

0: No transfer complete event

1: A transfer complete event occurred.

A transfer complete event is either a block transfer complete, a 2D/repeated block transfer complete, a LLI transfer complete including the upload of the next LLI if any, or the full linked-list completion, depending on the transfer complete event mode (HPDMA_CxTR2.TCEM[1:0]).

Bits 7:1 Reserved, must be kept at reset value.

Bit 0 IDLEF : Idle flag

0: Channel not in idle state

1: Channel in idle state

This idle flag is deasserted by hardware when the channel is enabled (HPDMA_CxCR.EN = 1) with a valid channel configuration (no USEF to be immediately reported).

This idle flag is asserted after hard reset or by hardware when the channel is back in idle state (in suspended or disabled state).

13.8.7 HPDMA channel x control register (HPDMA_CxCR)

Address offset: 0x064 + 0x80 * x (x = 0 to 15)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of the channel x (HPDMA_PRIVCFGR.PRIVx).

This register is used to control a channel (activate, suspend, abort or disable it).

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.PRIO[1:0]Res.Res.Res.Res.LAPLSM
rwrwrwrw

1514131211109876543210
Res.TOIESUSPIEUSEIEULEIEDTEIEHTIETCIERes.Res.Res.Res.Res.SUSPRESETEN
rwrwrwrwrwrwrwrwwrw

Bits 31:24 Reserved, must be kept at reset value.

Bits 23:22 PRIO[1:0] : Priority level of the channel x HPDMA transfer versus others

Note: This bit must be written when EN = 0. This bit is read-only when EN = 1.

Bits 21:18 Reserved, must be kept at reset value.

Bit 17 LAP : Linked-list allocated port

This bit is used to allocate the master port for the update of the HPDMA linked-list registers from the memory.

Note: This bit must be written when EN = 0. This bit is read-only when EN = 1.

Bit 16 LSM : Link step mode

1: Channel executed once for the current LLI

First the (possible 1D/repeated) block transfer is executed as defined by the current internal register file until HPDMA_CxBR1.BNDT[15:0] = 0 and HPDMA_CxBR1.BRC[10:0] = 0, if present. Secondly the next linked-list data structure is conditionally uploaded from memory as defined by HPDMA_CxLLR. Then channel execution is completed.

Note: This bit must be written when EN = 0. This bit is read-only when EN = 1.

Bit 15 Reserved, must be kept at reset value.

Bit 14 TOIE : Trigger overrun interrupt enable

Bit 13 SUSPIE : cCompleted suspension interrupt enable

Bit 12 USEIE : User setting error interrupt enable

Bit 11 ULEIE : Update link transfer error interrupt enable

Bit 10 DTEIE : Data transfer error interrupt enable

Bit 9 HTIE : Half-transfer complete interrupt enable

Bit 8 TCIE : Transfer complete interrupt enable

Bits 7:3 Reserved, must be kept at reset value.

Bit 2 SUSP : Suspend

Writing 1 to RESET in this register causes the hardware to deassert this SUSP bit, whatever is written into this SUSP. Else:

Software must write 1 in order to suspend an active channel (a channel with an ongoing HPDMA transfer over its master ports).

The software must write 0 in order to resume a suspended channel, following the programming sequence detailed in Figure 110 .

0: Write: resume channel, read: channel not suspended

1: Write: suspend channel, read: channel suspended

Bit 1 RESET : Reset

This bit is write only. Writing 0 has no impact. Writing 1 implies the reset of the following: the FIFO, the channel internal state, SUSP and EN bits (whatever is written receptively in bit 2 and bit 0).

The reset is effective when the channel is in steady state, meaning one of the following:

- active channel in suspended state (HPDMA_CxSR.SUSPF = 1 and

HPDMA_CxSR.IDLEF = HPDMA_CxCR.EN = 1)

- channel in disabled state (HPDMA_CxSR.IDLEF = 1 and HPDMA_CxCR.EN = 0).

After writing a RESET, to continue using this channel, the user must explicitly reconfigure the channel including the hardware-modified configuration registers (HPDMA_CxBR1, HPDMA_CxSAR and HPDMA_CxDAR) before enabling again the channel (see the programming sequence in Figure 111 ).

0: No channel reset

1: Channel reset

Bit 0 EN : Enable

Writing 1 to RESET in this register causes the hardware to deassert this EN bit, whatever is written into this bit 0. Else:

This bit is deasserted by hardware when there is a transfer error (master bus error or user setting error) or when there is a channel transfer complete (channel ready to be configured, for example if LSM = 1 at the end of a single execution of the LLI).

Else, this bit can be asserted by software.

Writing 0 into this EN bit is ignored.

0: Write: ignored, read: channel disabled

1: Write: enable channel, read: channel enabled

13.8.8 HPDMA channel x transfer register 1 (HPDMA_CxTR1)

Address offset: 0x090 + 0x80 * x (x = 0 to 15)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of the channel x in HPDMA_PRIVCFGR.PRIVx.

This register controls the transfer of a channel x.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when the channel is completed. Then the hardware has de-asserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by HPDMA from the memory if HPDMA_CxLLR.UT1 = 1.

31302928272625242322212019181716
Res.DAPRes.DWXDHXDBXDBL_1[5:0]DINCRes.DDW_LOG2[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.SAPSBXPAM[1:0]Res.SBL_1[5:0]SINCRes.SDW_LOG2[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 DAP : Destination allocated port

This bit is used to allocate the master port for the destination transfer

0: Port 0 (AXI) allocated

1: Port 1 (AHB) allocated

Note: This bit must be written when EN = 0. This bit is read-only when EN = 1.

Bit 29 Reserved, must be kept at reset value.

Bit 28 DWX : Destination word exchange

If the destination data size is not a double-word, this bit is ignored.

If the destination data size is a double-word and if destination bus is AXI (DAP = 0):

0: No word-based exchanged within double-word

1: The two consecutive (post PAM) words are exchanged in each destination double-word.

Bit 27 DHX : Destination half-word exchange

If the destination data size is shorter than a word, this bit is ignored.

If the destination data size is a word or double-word and if destination bus is AXI (DAP = 0):

0: No half-word-based exchanged within word

1: The two consecutive (post PAM) half-words are exchanged in each destination word.

Bit 26 DBX : Destination byte exchange

If the destination data size is a byte, this bit is ignored.

If the destination data size is not a byte:

0: No byte-based exchange within half-word

1: The two consecutive (post PAM) bytes are exchanged in each destination half-word.

Bits 25:20 DBL_1[5:0] : Destination burst length minus 1, between 0 and 63

The burst length unit is one data named beat within a burst. If DBL_1[5:0] = 0, the burst can be named as single. Each data/beat has a width defined by the destination data width DDW_LOG2[1:0].

Note: If a burst transfer crossed a 1- or 4-Kbyte address boundary on respectively an AHB or AXI transfer, the HPDMA modifies and shortens the programmed burst into singles or bursts of lower length, to be compliant with the AHB/AXI protocol.

If the burst length exceeds 16 on an AHB transfer, or if the burst on an AXI transfer is both with fixed addressing (DINC = 0) and with a burst length which exceeds 16, the HPDMA modifies and shortens the programmed burst into bursts of lower length, to be compliant with the AHB or AXI protocol.

If a burst transfer is of length greater than the FIFO size of the channel x, the HPDMA modifies and shortens the programmed burst into singles or bursts of lower length, to be compliant with the FIFO size. Transfer performance is lower, with HPDMA re-arbitration between effective and lower singles/bursts, but the data integrity is guaranteed.

Bit 19 DINC : Destination incrementing burst

0: Fixed burst

1: Contiguously incremented burst

The destination address, pointed by HPDMA_CxDAR, is kept constant after a burst beat/single transfer, or is incremented by the offset value corresponding to a contiguous data after a burst beat/single transfer.

Bit 18 Reserved, must be kept at reset value.

Bits 17:16 DDW_LOG2[1:0] : Binary logarithm of the destination data width of a burst, in bytes

00: Byte

01: Half-word (2 bytes)

10: Word (4 bytes)

11: Double-word (8 bytes)

Note: A destination burst data width must be less or equal to the implemented data width of the allocated AXI/AHB destination port via the DAP bit (it is recommended to be equal for best performance). Otherwise a user setting error is reported and no transfer is issued.

A destination burst transfer must have an aligned destination i) address (HPDMA_CxDAR[2:0]), ii) address offset HPDMA_CxTR3.DAO[2:0] if present, with its destination data width (DDW_LOG2[2:0]). Otherwise a user setting error is reported and no transfer is issued.

When configured in packing mode (PAM[1] = 1 and destination data width different from source data width), a source block size must be a multiple of the destination data width (see HPDMA_CxBR1.BNDT[2:0] versus DDW_LOG2[1:0]). Else a user setting error is reported and none transfer is issued.

Bit 15 Reserved, must be kept at reset value.

Bit 14 SAP : Source allocated port

This bit is used to allocate the master port for the source transfer

0: Port 0 (AXI) allocated

1: Port 1 (AHB) allocated

Note: This bit must be written when EN = 0. This bit is read-only when EN = 1.

Bit 13 SBX : Source byte exchange within the unaligned half-word of each source word
If the source data width is shorter than a word, this bit is ignored.
If the source data width is a word or a double-word, and if source bus is AXI (SAP = 0):

Bits 12:11 PAM[1:0] : Padding/alignment mode

If DDW_LOG2[1:0] = SDW_LOG2[1:0]: if the data width of a burst destination transfer is equal to the data width of a burst source transfer, these bits are ignored.

Else, in the following enumerated values, the condition PAM_1 is when destination data width is higher than source data width, and the condition PAM_2 is when source data width is higher than destination data width.

Condition: PAM_1

00: Source data is transferred as right aligned, padded with 0s up to the destination data width

01: Source data is transferred as right aligned, sign extended up to the destination data width

10-11: Successive source data are FIFO queued and packed at the destination data width, in a left (LSB) to right (MSB) order (named little endian), before a destination transfer

Condition: PAM_2

00: Source data is transferred as right aligned, left-truncated down to the destination data width

01: Source data is transferred as left-aligned, right-truncated down to the destination data width

10-11: Source data is FIFO queued and unpacked at the destination data width, to be transferred in a left (LSB) to right (MSB) order (named little endian) to the destination

Note: If the transfer from the source peripheral is configured with peripheral flow-control mode (SWREQ = 0 and PFREQ = 1 and DREQ = 0), and if the destination data width > the source data width, packing is not supported.

Bit 10 Reserved, must be kept at reset value.

Bits 9:4 SBL_1[5:0] : Source burst length minus 1, between 0 and 63

The burst length unit is one data named beat within a burst. If SBL_1[5:0] = 0, the burst can be named as single. Each data/beat has a width defined by the destination data width SDW_LOG2[1:0].

Note: If a burst transfer crossed a 1- or 4-Kbyte address boundary on respectively an AHB or an AXI transfer, the HPDMA modifies and shortens the programmed burst into singles or bursts of lower length, to be compliant with the AHB protocol.

If the burst length exceeds 16 on a AHB transfer, or if the burst on a AXI transfer is both with fixed addressing (SINC = 0) and with a burst length which exceeds 16, the HPDMA modifies and shortens the programmed burst into singles or bursts of lower length, to be compliant with the FIFO size. Transfer performance is lower, with HPDMA re-arbitration between effective and lower singles/bursts, but the data integrity is guaranteed.

Bit 3 SINC : Source incrementing burst

0: Fixed burst

1: Contiguously incremented burst

The source address, pointed by HPDMA_CxSAR, is kept constant after a burst beat/single transfer or is incremented by the offset value corresponding to a contiguous data after a burst beat/single transfer.

Bit 2 Reserved, must be kept at reset value.

Bits 1:0 SDW_LOG2[1:0] : Binary logarithm of the source data width of a burst in bytes

00: Byte

01: Half-word (2 bytes)

10: Word (4 bytes)

11: Double-word (8 bytes)

Note: A source burst data width must be less or equal to the implemented data width of the allocated AXI/AHB source port via the SAP bit (it is recommended to be equal for best performance). Otherwise a user setting error is reported and no transfer is issued.

A source block size must be a multiple of the source data width (HPDMA_CxBR1.BNDT[2:0] versus SDW_LOG2[1:0]). Otherwise, a user setting error is reported and no transfer is issued.

A source burst transfer must have an aligned source i) address (HPDMA_CxSAR[2:0]), ii) address offset HPDMA_CxTR3.SAO[2:0] if present, with its source data width (SDW_LOG2[1:0]). Otherwise a user setting error is reported and no transfer is issued.

13.8.9 HPDMA channel x transfer register 2 (HPDMA_CxTR2)

Address offset: 0x094 + 0x80 * x (x = 0 to 15)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register controls the transfer of a channel x.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when the channel is completed (the hardware deasserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by HPDMA from the memory, if HPDMA_CxLLR.UT2 = 1.

31302928272625242322212019181716
TCEM[1:0]Res.Res.Res.Res.TRIGPOL[1:0]Res.Res.TRIGSEL[5:0]
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TRIGM[1:0]Res.PFREQBREQDREQSWREQRes.Res.Res.Res.REQSEL[4:0]
rwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 TCEM[1:0] : Transfer complete event mode

These bits define the transfer granularity for the transfer complete and half-transfer complete events generation.

00: At block level (when HPDMA_CxBR1.BNDT[15:0] = 0): The complete (and the half) transfer event is generated at the (respectively half of the) end of a block.

Note: If the initial LLI 0 data transfer is null/void (directly programmed by the internal register file with HPDMA_CxBR1.BNDT[15:0] = 0), then neither the complete transfer event nor the half-transfer event is generated.

01: if the channel is not 2D addressing capable: same as 00; if the channel is 2D addressing capable: at 2D/repeated block level, meaning when HPDMA_CxBR1.BRC[10:0] = 0 and HPDMA_CxBR1.BNDT[15:0] = 0), the complete (and the half) transfer event is generated at the end (respectively half of the end) of the 2D/repeated block.

Note: If the initial LLI 0 data transfer is null/void (directly programmed by the internal register file with HPDMA_CxBR1.BNDT[15:0] = 0), then neither the complete transfer event nor the half-transfer event is generated.

10: At LLI level: The complete transfer event is generated at the end of the LLI transfer, including the update of the LLI if any. The half-transfer event is generated at the half of the LLI data transfer (the LLI data transfer being a block transfer or a 2D/repeated block transfer for a 2D addressing capable channel), if any data transfer.

Note: If the initial LLI 0 data transfer is null/void (directly programmed by the internal register file with HPDMA_CxBR1.BNDT[15:0] = 0), then the half-transfer event is not generated, and the transfer complete event is generated when is completed the loading of the LLI 1 .

11: At channel level: The complete transfer event is generated at the end of the last LLI transfer. The half-transfer event is generated at the half of the data transfer of the last LLI. The last LLI updates the link address HPDMA_CxLLR.LA[15:2] to zero and clears all the HPDMA_CxLLR update bits (UT1, UT2, UB1, USA, UDA and ULL, plus UT3 and UB2 if present). If the channel transfer is continuous/infinite, no event is generated.

Bits 29:26 Reserved, must be kept at reset value.

Bits 25:24 TRIGPOL[1:0] : Trigger event polarity

These bits define the polarity of the selected trigger event input defined by TRIGSEL[5:0].

00: No trigger (masked trigger event)

01: Trigger on the rising edge

10: Trigger on the falling edge

11: Same as 00

Bits 23:22 Reserved, must be kept at reset value.

Bits 21:16 TRIGSEL[5:0] : Trigger event input selection

These bits select the trigger event input of the HPDMA transfer (as per Section 13.3.6 ), with an active trigger event if TRIGPOL[1:0] ≠ 00.

Bits 15:14 TRIGM[1:0] : Trigger mode

These bits define the transfer granularity for its conditioning by the trigger.

If the channel x is enabled (HPDMA_CxCR.EN asserted) with TRIGPOL[1:0] = 00 or 11, these TRIGM[1:0] bits are ignored.

Else, an HPDMA transfer is conditioned by at least one trigger hit:

00: at block level: the first burst read of each block transfer is conditioned by one hit trigger. This is also valid for a 2D addressing capable channel: for each block even if a 2D/repeated block is configured with HPDMA_CxBR1.BRC[10:0] \( \neq \) 0.

01: if the channel is not 2D addressing capable: same as 00; if the channel is 2D addressing capable: at 2D/repeated block level, meaning the first burst read of a 2D/repeated block transfer is conditioned by one hit trigger.

10: at link level: a LLI link transfer is conditioned by one hit trigger. The LLI data transfer (if any) is not conditioned.

11: at programmed burst level: If SWREQ = 1, each programmed burst read is conditioned by one hit trigger. If SWREQ = 0, each programmed burst that is requested by the selected peripheral, is conditioned by one hit trigger.

– If the peripheral is programmed as a source (DREQ = 0) of the LLI data transfer, each programmed burst read is conditioned.

– If the peripheral is programmed as a destination (DREQ = 1) of the LLI data transfer, each programmed burst write is conditioned. The first memory burst read of a (possibly 2D/repeated) block, also named as the first ready FIFO-based source burst, is gated by the occurrence of both the hardware request and the first trigger hit.

The HPDMA monitoring of a trigger for channel x is started when the channel is enabled/loading with a new active trigger configuration: rising or falling edge on a selected trigger (TRIGPOL[1:0] = 01 or respectively TRIGPOL[1:0] = 10).

The monitoring of this trigger is kept active during the triggered and uncompleted (data or link) transfer; and if a new trigger is detected then, this hit is internally memorized to grant the next transfer, as long as the defined rising or falling edge is not modified, and the TRIGSEL[5:0] is not modified, and the channel is enabled.

Transferring a next LLI n+1 that updates the HPDMA_CxTR2 with a new value for any of TRIGSEL[5:0] or TRIGPOL[1:0], resets the monitoring, trashing the memorized hit of the formerly defined LLI n trigger.

After a first new trigger hit n+1 is memorized, if another second trigger hit n+2 is detected and if the hit n triggered transfer is still not completed, hit n+2 is lost and not memorized. A trigger overrun flag is reported (HPDMA_CxSR.TOF = 1), and an interrupt is generated if enabled (HPDMA_CxCR.TOIE = 1). The channel is not automatically disabled by hardware due to a trigger overrun.

Note: When the source block size is not a multiple of the source burst size and is a multiple of the source data width, then the last programmed source burst is not completed and is internally shorten to match the block size. In this case, if TRIGM[1:0] = 11 and (SWREQ = 1 or (SWREQ = 0 and DREQ = 0)), the shortened burst transfer (by singles or/and by bursts of lower length) is conditioned once by the trigger.

When the programmed destination burst is internally shortened by singles or/and by bursts of lower length (versus FIFO size, versus block size, 1/4-Kbyte boundary address crossing maximum burst length versus AHB/AXI protocol): if the trigger is conditioning the programmed destination burst (if TRIGM[1:0] = 11 and SWREQ = 0 and DREQ = 1), this shortened destination burst transfer is conditioned once by the trigger.

Bit 13 Reserved, must be kept at reset value.

Bit 12 PFREQ : Hardware request in peripheral flow control mode

Important: If a given channel x is not implemented with this feature, this bit is reserved and PFREQ is not present (see Section 13.3.5 for the list of the implemented channels with this feature.

If the channel x is activated (HPDMA_CxCR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer), this bit is ignored. Else:

0: The selected hardware request is driven by a peripheral with a hardware request/acknowledge protocol in HPDMA control mode. The HPDMA is programmed with HPDMA_CxCBR1.BNDT[15:0] and this is internally used by the hardware for the block transfer completion.

1: The selected hardware request is driven by a peripheral with a hardware request/acknowledge protocol in peripheral control mode. The HPDMA block transfer can be early completed by the peripheral itself (see Section 13.3.5 for more details).

Note: In peripheral flow control mode, there are the following restrictions:

Bit 11 BREQ : Block hardware request

If the channel x is activated (HPDMA_CxCR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer), this bit is ignored. Else:

0: The selected hardware request is driven by a peripheral with a hardware request/acknowledge protocol at a burst level.

1: The selected hardware request is driven by a peripheral with a hardware request/acknowledge protocol at a block level (see Section 13.3.4 ).

Bit 10 DREQ : Destination hardware request

This bit is ignored if channel x is activated (HPDMA_CxCR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer). Else:

0: Selected hardware request driven by a source peripheral (request signal taken into account by the HPDMA transfer scheduler over the source/read port)

1: Selected hardware request driven by a destination peripheral (request signal taken into account by the HPDMA transfer scheduler over the destination/write port)

Note: If the channel x is activated (HPDMA_CxCR.EN is asserted) with SWREQ = 0 and PFREQ = 1 (peripheral hardware request with peripheral flow-control mode), any software assertion to this DREQ bit is ignored: in peripheral flow-control mode, only a peripheral-to-memory transfer is supported.

Bit 9 SWREQ : Software request

This bit is internally taken into account when HPDMA_CxCR.EN is asserted.

0: No software request. The selected hardware request REQSEL[4:0] is taken into account.

1: Software request for a memory-to-memory transfer. The default selected hardware request as per REQSEL[4:0] is ignored.

Bits 8:5 Reserved, must be kept at reset value.

Bits 4:0 REQSEL[4:0] : Hardware request selection

These bits are ignored if channel x is activated (HPDMA_CxCR.EN asserted) with SWREQ = 1 (software request for a memory-to-memory transfer). Else, the selected hardware request is internally taken into account as per Section 13.3.3 .

Caution: The user must not assign a same input hardware request (same REQSEL[4:0] value) to different active HPDMA channels (HPDMA_CxCR.EN = 1 and HPDMA_CxTR2.SWREQ = 0 for these channels). The HPDMA is not intended to hardware support the case of simultaneous enabled channels incorrectly configured with a same hardware peripheral request signal, and there is no user setting error reporting.

13.8.10 HPDMA channel x block register 1 (HPDMA_CxBR1)

Address offset: 0x098 + 0x80 * x (x = 0 to 11)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register controls the transfer of a channel x at a block level.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when channel x is completed (then the hardware has de-asserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer:

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
BNDT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 BNDT[15:0] : Block number of data bytes to transfer from the source

Block size transferred from the source. When the channel is enabled, this bitfield becomes read-only and is decremented, indicating the remaining number of data items in the current source block to be transferred. BNDT[15:0] is programmed in number of bytes, maximum source block size is 64 Kbytes -1.

Once the last data transfer is completed (BNDT[15:0] = 0):

Note: A non-null source block size must be a multiple of the source data width (BNDT versus HPDMA_CxTR1.SDW_LOG2). Else a user setting error is reported and no transfer is issued.

When configured in packing mode (HPDMA_CxTR1.PAM[1] = 1 and destination data width different from source data width), a non-null source block size must be a multiple of the destination data width (BNDT versus HPDMA_CxTR1.DDW_LOG2). Else a user setting error is reported and no transfer is issued.

13.8.11 HPDMA channel x alternate block register 1 (HPDMA_CxBR1)

Address offset: 0x098 + 0x80 * x (x = 12 to 15)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register controls the transfer of a channel x at a block level.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when channel x is completed (then the hardware has de-asserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer:

31302928272625242322212019181716
BRDDEC
C
BRSDDEC
C
DDECSDECRes.BRC[10:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
BNDT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bit 31 BRDDEC: Block repeat destination address decrement

0: At the end of a block transfer, the HPDMA_CxDAR register is updated by adding the programmed offset HPDMA_CxBR2.BRDAO to the current HPDMA_CxDAR value (current destination address)

1: At the end of a block transfer, the HPDMA_CxDAR register is updated by subtracting the programmed offset HPDMA_CxBR2.BRDAO from the current HPDMA_CxDAR value (current destination address)

Note: On top of this increment/decrement (depending on BRDDEC), HPDMA_CxDAR is in the same time also updated by the increment/decrement (depending on DDEC) of the HPDMA_CxTR3.DAO value, as it is usually done at the end of each programmed burst transfer.

Bit 30 BRSDDEC: Block repeat source address decrement

0: At the end of a block transfer, the HPDMA_CxSAR register is updated by adding the programmed offset HPDMA_CxBR2.BRSAO to the current HPDMA_CxSAR value (current source address)

1: At the end of a block transfer, the HPDMA_CxSAR register is updated by subtracting the programmed offset HPDMA_CxBR2.BRSAO from the current HPDMA_CxSAR value (current source address)

Note: On top of this increment/decrement (depending on BRSDDEC), HPDMA_CxSAR is in the same time also updated by the increment/decrement (depending on SDEC) of the HPDMA_CxTR3.SAO value, as it is done after any programmed burst transfer.

Bit 29 DDEC: destination address decrement

0: At the end of a programmed burst transfer to the destination, the HPDMA_CxDAR register is updated by adding the programmed offset HPDMA_CxTR3.DAO to the current HPDMA_CxDAR value (current destination address)

1: At the end of a programmed burst transfer to the destination, the HPDMA_CxDAR register is updated by subtracting the programmed offset HPDMA_CxTR3.DAO to the current HPDMA_CxDAR value (current destination address)

Bit 28 SDEC: source address decrement

0: At the end of a programmed burst transfer from the source, the HPDMA_CxSAR register is updated by adding the programmed offset HPDMA_CxTR3.SAO to the current HPDMA_CxSAR value (current source address)

1: At the end of a programmed burst transfer from the source, the HPDMA_CxSAR register is updated by subtracting the programmed offset HPDMA_CxTR3.SAO to the current HPDMA_CxSAR value (current source address)

Bit 27 Reserved, must be kept at reset value.

Bits 26:16 BRC[10:0] : Block repeat counter

This bitfield contains the number of repetitions of the current block (0 to 2047).

When the channel is enabled, this bitfield becomes read-only. After decrements, this bitfield indicates the remaining number of blocks, excluding the current one. This counter is hardware decremented for each completed block transfer.

Once the last block transfer is completed ( \( BRC[10:0] = BNDT[15:0] = 0 \) ):

Bits 15:0 BNDT[15:0] : Block number of data bytes to transfer from the source

Block size transferred from the source. When the channel is enabled, this bitfield becomes read-only and is decremented, indicating the remaining number of data items in the current source block to be transferred.

\( BNDT[15:0] \) is programmed in number of bytes, maximum source block size is 64 Kbytes -1.

Once the last data transfer is completed ( \( BNDT[15:0] = 0 \) ):

Note: A non-null source block size must be a multiple of the source data width (BNDT versus HPDMA_CxTR1.SDW_LOG2). Else a user setting error is reported and no transfer is issued.

When configured in packing mode ( \( HPDMA\_CxTR1.PAM[1] = 1 \) and destination data width different from source data width), a non-null source block size must be a multiple of the destination data width (BNDT versus HPDMA_CxTR1.DDW_LOG2). Else a user setting error is reported and no transfer is issued.

13.8.12 HPDMA channel x source address register (HPDMA_CxSAR)

Address offset: \( 0x09C + 0x80 * x \) ( \( x = 0 \) to \( 15 \) )

Reset value: \( 0x0000\ 0000 \)

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register configures the source start address of a transfer.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1, and continuously updated by hardware, in order to reflect the address of the next burst transfer from the source.

This register must be written when the channel is completed (then the hardware has deasserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by the HPDMA from the memory if HPDMA_CxLLR.USA = 1.

31302928272625242322212019181716
SA[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SA[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 SA[31:0] : Source address

This bitfield is the pointer to the address from which the next data is read.

During the channel activity, depending on the source addressing mode (HPDMA_CxTR1.SINC), this bitfield is kept fixed or incremented by the data width (HPDMA_CxTR1.SDW_LOG2[1:0]) after each burst source data, reflecting the next address from which data is read.

During the channel activity, this address is updated after each completed source burst, consequently to:

In linked-list mode, after a LLI data transfer is completed, this register is automatically updated by HPDMA from the memory, provided the LLI is set with HPDMA_CxLLR.USA = 1.

Note: A source address must be aligned with the programmed data width of a source burst (SA versus HPDMA_CxTR1.SDW_LOG2). Else, a user setting error is reported and no transfer is issued.

When the source block size is not a multiple of the source burst size and is a multiple of the source data width, the last programmed source burst is not completed and is internally shorten to match the block size. In this case, the additional HPDMA_CxTR3.SAO[12:0] is not applied.

13.8.13 HPDMA channel x destination address register (HPDMA_CxDAR)

Address offset: 0x0A0 + 0x80 * x (x = 0 to 15)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register configures the destination start address of a transfer.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1, and continuously updated by hardware, in order to reflect the address of the next burst transfer to the destination.

This register must be written when the channel is completed (then the hardware has deasserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by HPDMA from the memory if HPDMA_CxLLR.UDA = 1.

31302928272625242322212019181716
DA[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
DA[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 DA[31:0] : destination address

This bitfield is the pointer to the address from which the next data is written.

During the channel activity, depending on the destination addressing mode (HPDMA_CxTR1.DINC), this bitfield is kept fixed or incremented by the data width (HPDMA_CxTR1.DDW_LOG2[1:0]) after each burst destination data, reflecting the next address from which data is written.

During the channel activity, this address is updated after each completed destination burst, consequently to:

In linked-list mode, after a LLI data transfer is completed, this register is automatically updated by the HPDMA from the memory, provided the LLI is set with HPDMA_CxLLR.UDA = 1.

Note: A destination address must be aligned with the programmed data width of a destination burst (DA versus HPDMA_CxTR1.DDW_LOG2). Else, a user setting error is reported and no transfer is issued.

13.8.14 HPDMA channel x transfer register 3 (HPDMA_CxTR3)

Address offset: \( 0x0A4 + 0x80 * x \) ( \( x = 12 \) to \( 15 \) )

Reset value: \( 0x0000\ 0000 \)

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register controls the transfer of a channel x.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when the channel is completed (then the hardware has deasserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by the HPDMA from the memory if HPDMA_CxLLR.UT3 = 1.

31302928272625242322212019181716
Res.Res.Res.DAO[12:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210

1514131211109876543210
Res.Res.Res.SAO[12:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:29 Reserved, must be kept at reset value.

Bits 28:16 DAO[12:0] : Destination address offset increment

The destination address, pointed by HPDMA_CxDAR, is incremented or decremented (depending on HPDMA_CxBR1.DDEC) by this offset DAO[12:0] for each programmed destination burst. This offset is not including and is added to the programmed burst size when the completed burst is addressed in incremented mode (HPDMA_CxTR1.DINC = 1).

Note: A destination address offset must be aligned with the programmed data width of a destination burst (DAO versus HPDMA_CxTR1.DDW_LOG2). Else, a user setting error is reported and no transfer is issued.

Bits 15:13 Reserved, must be kept at reset value.

Bits 12:0 SAO[12:0] : Source address offset increment

The source address, pointed by HPDMA_CxSAR, is incremented or decremented (depending on HPDMA_CxBR1.SDEC) by this offset SAO[12:0] for each programmed source burst. This offset is not including and is added to the programmed burst size when the completed burst is addressed in incremented mode (HPDMA_CxTR1.SINC = 1).

Note: A source address offset must be aligned with the programmed data width of a source burst (SAO versus HPDMA_CxTR1.SDW_LOG2). Else a user setting error is reported and none transfer is issued.

When the source block size is not a multiple of the destination burst size and is a multiple of the source data width, then the last programmed source burst is not completed and is internally shorten to match the block size. In this case, the additional HPDMA_CxTR3.SAO[12:0] is not applied.

13.8.15 HPDMA channel x block register 2 (HPDMA_CxBR2)

Address offset: 0x0A8 + 0x80 * x (x = 12 to 15)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register controls the transfer of a channel x at a 2D/repeated block level.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when the channel is completed (then the hardware has deasserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by the HPDMA from the memory if HPDMA_CxLLR.UB2 = 1.

31302928272625242322212019181716
BRDAO[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
BRSAO[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 BRDAO[15:0] : Block repeated destination address offset

For a channel with 2D addressing capability, this bitfield is used to update (by addition or subtraction depending on HPDMA_CxBR1.BRDDEC) the current destination address (HPDMA_CxDAR) at the end of a block transfer.

Note: A block repeated destination address offset must be aligned with the programmed data width of a destination burst (BRDAO versus HPDMA_CxTR1.DDW_LOG2). Else a user setting error is reported and no transfer is issued.

BRDAO[15:0] must be set to 0 in peripheral flow-control mode (if HPDMA_CxTR2.PFREQ = 1).

Bits 15:0 BRSAO[15:0] : Block repeated source address offset

For a channel with 2D addressing capability, this bitfield is used to update (by addition or subtraction depending on HPDMA_CxBR1.BRSDEC) the current source address (HPDMA_CxSAR) at the end of a block transfer.

Note: A block repeated source address offset must be aligned with the programmed data width of a source burst (BRSAO versus HPDMA_CxTR1.SDW_LOG2). Else a user setting error is reported and no transfer is issued.

BRSAO[15:0] must be set to 0 in peripheral flow-control mode (if HPDMA_CxTR2.PFREQ = 1).

13.8.16 HPDMA channel x linked-list address register (HPDMA_CxLLR)

Address offset: \( 0x0CC + 0x80 * x \) ( \( x = 0 \) to \( 11 \) )

Reset value: \( 0x0000\ 0000 \)

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFGR.PRIVx).

This register configures the data structure of the next LLI in the memory and its address pointer. A channel transfer is completed when this register is null.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when the channel is completed (then the hardware has deasserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by the HPDMA from the memory if HPDMA_CxLLR.ULL = 1.

31302928272625242322212019181716
UT1UT2UB1USAUDARes.Res.Res.Res.Res.Res.Res.Res.Res.Res.ULL
rwrwrwrwrwrw
1514131211109876543210
LA[15:2]Res.Res.
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 UT1 : Update HPDMA_CxTR1 from memory

This bit controls the update of HPDMA_CxTR1 from the memory during the link transfer.

0: No HPDMA_CxTR1 update

1: HPDMA_CxTR1 update

Bit 30 UT2 : Update HPDMA_CxTR2 from memory

This bit controls the update of HPDMA_CxTR2 from the memory during the link transfer.

0: No HPDMA_CxTR2 update

1: HPDMA_CxTR2 update

Bit 29 UB1 : Update HPDMA_CxBR1 from memory

This bit controls the update of HPDMA_CxBR1 from the memory during the link transfer. If UB1 = 0 and if HPDMA_CxLLR ≠ 0, the linked-list is not completed.

HPDMA_CxBR1.BNDT[15:0] is then restored to the programmed value after data transfer is completed and before the link transfer.

0: No HPDMA_CxBR1 update from memory (HPDMA_CxBR1.BNDT[15:0] restored if any link transfer)

1: HPDMA_CxBR1 update

Bit 28 USA : Update HPDMA_CxSAR from memory

This bit controls the update of HPDMA_CxSAR from the memory during the link transfer.

0: No HPDMA_CxSAR update

1: HPDMA_CxSAR update

Bit 27 UDA : Update HPDMA_CxDAR register from memory

This bit is used to control the update of HPDMA_CxDAR from the memory during the link transfer.

0: No HPDMA_CxDAR update

1: HPDMA_CxDAR update

Bits 26:17 Reserved, must be kept at reset value.

Bit 16 ULL : Update HPDMA_CxLLR register from memory

This bit is used to control the update of HPDMA_CxLLR from the memory during the link transfer.

0: No HPDMA_CxLLR update

1: HPDMA_CxLLR update

Bits 15:2 LA[15:2] : Pointer (16-bit low-significant address) to the next linked-list data structure

If UT1 = UT2 = UB1 = USA = UDA = ULL = 0 and if LA[15:2] = 0, the current LLI is the last one. The channel transfer is completed without any update of the linked-list HPDMA register file.

Else, this bitfield is the pointer to the memory address offset from which the next linked-list data structure is automatically fetched from, once the data transfer is completed, in order to conditionally update the linked-list HPDMA internal register file (HPDMA_CxTR1, HPDMA_CxTR2, HPDMA_CxBR1, HPDMA_CxSAR, HPDMA_CxDAR, and HPDMA_CxLLR).

Caution: the user must program this pointer not to exceed the 64-Kbyte addressable space defined by the link base address register HPDMA_CxLBAR. The complete linked-list data structure must be included in the 64-Kbyte addressable space.

Note: The user must program the pointer to be 32-bit aligned. The two low-significant bits are write ignored.

Bits 1:0 Reserved, must be kept at reset value.

13.8.17 HPDMA channel x alternate linked-list address register (HPDMA_CxLLR)

Address offset: 0x0CC + 0x80 * x (x = 12 to 15)

Reset value: 0x0000 0000

This register is privileged or unprivileged, depending on the privileged state of channel x (HPDMA_PRIVCFG.PRIVx).

This register configures the data structure of the next LLI in the memory and its address pointer. A channel transfer is completed when this register is null.

This register must be written when HPDMA_CxCR.EN = 0.

This register is read-only when HPDMA_CxCR.EN = 1.

This register must be written when the channel is completed (then the hardware has deasserted HPDMA_CxCR.EN). A channel transfer can be completed and programmed at different levels: block, 2D/repeated block, LLI, or full linked-list.

In linked-list mode, during the link transfer, this register is automatically updated by the HPDMA from the memory if HPDMA_CxLLR.ULL = 1.

31302928272625242322212019181716
UT1UT2UB1USAUDAUT3UB2Res.Res.Res.Res.Res.Res.Res.Res.ULL
rwrwrwrwrwrwrwrw
1514131211109876543210
LA[15:2]Res.Res.
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 UT1 : Update HPDMA_CxTR1 from memory

This bit controls the update of HPDMA_CxTR1 from the memory during the link transfer.

0: No HPDMA_CxTR1 update

1: HPDMA_CxTR1 update

Bit 30 UT2 : Update HPDMA_CxTR2 from memory

This bit controls the update of HPDMA_CxTR2 from the memory during the link transfer.

0: No HPDMA_CxTR2 update

1: HPDMA_CxTR2 update

Bit 29 UB1 : Update HPDMA_CxBR1 from memory

This bit controls the update of HPDMA_CxBR1 from the memory during the link transfer.

If UB1 = 0 and if HPDMA_CxLLR ≠ 0, the linked-list is not completed.

HPDMA_CxBR1.BNDT[15:0] is then restored to the programmed value after data transfer is completed and before the link transfer.

0: No HPDMA_CxBR1 update from memory (HPDMA_CxBR1.BNDT[15:0] restored if any link transfer)

1: HPDMA_CxBR1 update

Bit 28 USA : Update HPDMA_CxSAR from memory

This bit controls the update of HPDMA_CxSAR from the memory during the link transfer.

0: No HPDMA_CxSAR update

1: HPDMA_CxSAR update

Bit 27 UDA : Update HPDMA_CxDAR register from memory

This bit is used to control the update of HPDMA_CxDAR from the memory during the link transfer.
0: No HPDMA_CxDAR update
1: HPDMA_CxDAR update

Bit 26 UT3 : Update HPDMA_CxTR3 from memory

This bit controls the update of HPDMA_CxTR3 from the memory during the link transfer.
0: No HPDMA_CxTR3 update
1: HPDMA_CxTR3 update

Bit 25 UB2 : Update HPDMA_CxBR2 from memory

This bit controls the update of HPDMA_CxBR2 from the memory during the link transfer.
0: No HPDMA_CxBR2 update
1: HPDMA_CxBR2 update

Bits 24:17 Reserved, must be kept at reset value.

Bit 16 ULL : Update HPDMA_CxLLR register from memory

This bit is used to control the update of HPDMA_CxLLR from the memory during the link transfer.
0: No HPDMA_CxLLR update
1: HPDMA_CxLLR update

Bits 15:2 LA[15:2] : Pointer (16-bit low-significant address) to the next linked-list data structure

If UT1 = UT2 = UB1 = USA = UDA = ULL = 0 and if LA[15:2] = 0, the current LLI is the last one. The channel transfer is completed without any update of the linked-list HPDMA register file.

Else, this bitfield is the pointer to the memory address offset from which the next linked-list data structure is automatically fetched from, once the data transfer is completed, in order to conditionally update the linked-list HPDMA internal register file (HPDMA_CxTR1, HPDMA_CxTR2, HPDMA_CxBR1, HPDMA_CxSAR, HPDMA_CxDAR and HPDMA_CxLLR).

Caution: the user must program this pointer not to exceed the 64-Kbyte addressable space defined by the link base address register HPDMA_CxLBAR. The complete linked-list data structure must be included in the 64-Kbyte addressable space.

Note: The user must program the pointer to be 32-bit aligned. The two low-significant bits are write ignored.

Bits 1:0 Reserved, must be kept at reset value.

13.8.18 HPDMA register map

Table 111. HPDMA register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x004HPDMA_PRIVCFGGRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PRIV15PRIV14PRIV13PRIV12PRIV11PRIV10PRIV9PRIV8PRIV7PRIV6PRIV5PRIV4PRIV3PRIV2PRIV1PRIV0
Reset value0000000000000000
0x008HPDMA_RCFGLOCKRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LOCK15LOCK14LOCK13LOCK12LOCK11LOCK10LOCK9LOCK8LOCK7LOCK6LOCK5LOCK4LOCK3LOCK2LOCK1LOCK0
Reset value0000000000000000

Table 111. HPDMA register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x00CHPDMA_MISRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MIS15MIS14MIS13MIS12MIS11MIS10MIS9MIS8MIS7MIS6MIS5MIS4MIS3MIS2MIS1MIS0
Reset value0000000000000000
0x010 - 0x04CReservedReserved
0x050 + 0x080 * x
(x = 0 to 15)
HPDMA_CxLBARLBA[31:16]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value0000000000000000
0x05C + 0x080 * x
(x=0 to 15)
HPDMA_CxFCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TOFSUSPFUSEFULEFDTEFHTFTCFRes.Res.Res.Res.Res.Res.Res.Res.
Reset value0000000
0x060 + 0x080 * x
(x=0 to 15)
HPDMA_CxSRRes.Res.Res.Res.Res.Res.Res.FIFOL[8:0]Res.TOFSUSPFUSEFULEFDTEFHTFTCFRes.Res.Res.Res.Res.Res.Res.IDLEF
Reset value00000001
0x064 + 0x080 * x
(x=0 to 15)
HPDMA_CxCRRes.Res.Res.Res.Res.Res.Res.Res.PRIO[1:0]Res.Res.Res.Res.Res.LAPLSMRes.TOIESUSPIEUSEIEULEIEDTEIEHTIETCIERes.Res.Res.Res.Res.Res.SUSPEN
Reset value0000000000000
0x090 + 0x080 * x
(x=0 to 15)
HPDMA_CxTR1Res.DAPRes.DWXDHXDBXDBL_1[5:0]DINCRes.DDW_LOG2[1:0]Res.Res.SAPSBXPAM[1:0]Res.SBL_1[5:0]SINCRes.SDW_LOG2[1:0]
Reset value000000000000000000000000000
0x094 + 0x080 * x
(x=0 to 15)
HPDMA_CxTR2TCEM[1:0]Res.Res.Res.Res.Res.TRIGPOL[1:0]Res.Res.TRIGSEL[5]Res.Res.TRIGSEL[4:0]Res.TRIGM[1:0]Res.Res.Res.PFREQBREQDREQSWREQRes.Res.Res.Res.Res.Res.Res.Res.REQSEL[4:0]Res.
Reset value000000000000000000
0x098 + 0x080 * x
(x=0 to 11)
HPDMA_CxBR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.BNDT[15:0]
Reset value000000000000000
0x098 + 0x080 * x
(x=12 to 15)
HPDMA_CxBR1BRDDECBRSDECDDECSDECRes.BRC[10:0]BNDT[15:0]
Reset value0000000000000000000000000000000
0x09C + 0x080 * x
(x=0 to 15)
HPDMA_CxSARSA[31:0]
Reset value00000000000000000000000000000000
0x0A0 + 0x080 * x
(x=0 to 15)
HPDMA_CxDARDA[31:0]
Reset value00000000000000000000000000000000
0x0A4 + 0x080 * x
(x=12 to 15)
HPDMA_CxTR3Res.Res.DAO[12:0]Res.Res.SAO[12:0]
Reset value0000000000000000000000000000
0x0A8 + 0x080 * x
(x=12 to 15)
HPDMA_CxBR2BRDAO[15:0]
Reset value00000000000000000000000000000000
0x0CC + 0x080 * x
(x=0 to 11)
HPDMA_CxLLRUT1UT2UB1USAUDARes.Res.Res.Res.Res.Res.Res.Res.Res.Res.ULLLA[15:2]
Reset value000000000000000000000
0x0CC + 0x080 * x
(x=12 to 15)
HPDMA_CxLLRUT1UT2UB1USAUDAUT3UB2Res.Res.Res.Res.Res.Res.Res.Res.ULLLA[15:2]
Reset value00000000000000000000000
Refer to Section 2.3: Memory organization for the register boundary addresses.