12. DMA request multiplexer (DMAMUX)

12.1 Introduction

A peripheral indicates a request for DMA transfer by setting its DMA request signal. The DMA request is pending until it is served by the DMA controller that generates a DMA acknowledge signal, and the corresponding DMA request signal is deasserted.

In this document, the set of control signals required for the DMA request/acknowledge protocol is not explicitly shown or described, and it is referred to as DMA request line.

The DMAMUX request multiplexer enables routing a DMA request line between the peripherals and the DMA controllers of the product. The routing function is ensured by a programmable multi-channel DMA request line multiplexer. Each channel selects a unique DMA request line, unconditionally or synchronously with events from its DMAMUX synchronization inputs. The DMAMUX may also be used as a DMA request generator from programmable events on its input trigger signals.

The number of DMAMUX instances and their main characteristics are specified in Section 12.3.1 .

The assignment of DMAMUX request multiplexer inputs to the DMA request lines from peripherals and to the DMAMUX request generator outputs, the assignment of DMAMUX request multiplexer outputs to DMA controller channels, and the assignment of DMAMUX synchronizations and trigger inputs to internal and external signals depend on the product implementation, and are detailed in Section 12.3.2 .

12.2 DMAMUX main features

12.3 DMAMUX implementation

12.3.1 DMAMUX instantiation

DMAMUX is instantiated with the hardware configuration parameters listed in the following table.

Table 53. DMAMUX instantiation

FeatureDMAMUX
Number of DMAMUX output request channels14
Number of DMAMUX request generator channels4
Number of DMAMUX request trigger inputs26
Number of DMAMUX synchronization inputs26
Number of DMAMUX peripheral request inputs89 (STM32L4Rxxx and STM32L4Sxxx devices)
90 (STM32L4P5xx and STM32L4Q5xx devices)

12.3.2 DMAMUX mapping

The mapping of resources to DMAMUX is hardwired.

DMAMUX is used with DMA1 and DMA2:

Table 54. DMAMUX: assignment of multiplexer inputs to resources
(STM32L4Rxxx and STM32L4Sxxx devices)

DMA request MUX inputResourceDMA request MUX inputResourceDMA request MUX inputResource
1dmamux_req_gen044TIM1_CH387DFSDM1_FLT1
2dmamux_req_gen145TIM1_CH488DFSDM1_FLT2
3dmamux_req_gen246TIM1_UP89DFSDM1_FLT3
4dmamux_req_gen347TIM1_TRIG90DCMI
5ADC148TIM1_COM91AES_IN
6DAC1 (1)49TIM8_CH192AES_OUT
7DAC2 (2)50TIM8_CH293HASH_IN
8TIM6_UP51TIM8_CH394Reserved
9TIM7_UP52TIM8_CH495Reserved
10SPI1_RX53TIM8_UP96Reserved
11SPI1_TX54TIM8_TRIG97Reserved
12SPI2_RX55TIM8_COM98Reserved
13SPI2_TX56TIM2_CH199Reserved
14SPI3_RX57TIM2_CH2100Reserved
15SPI3_TX58TIM2_CH3101Reserved
16I2C1_RX59TIM2_CH4102Reserved
17I2C1_TX60TIM2_UP103Reserved
18I2C2_RX61TIM3_CH1104Reserved
19I2C2_TX62TIM3_CH2105Reserved
20I2C3_RX63TIM3_CH3106Reserved
21I2C3_TX64TIM3_CH4107Reserved
22I2C4_RX65TIM3_UP108Reserved
23I2C4_TX66TIM3_TRIG109Reserved
24USART1_RX67TIM4_CH1110Reserved
25USART1_TX68TIM4_CH2111Reserved
26USART2_RX69TIM4_CH3112Reserved
27USART2_TX70TIM4_CH4113Reserved
28USART3_RX71TIM4_UP114Reserved
29USART3_TX72TIM5_CH1115Reserved
30UART4_RX73TIM5_CH2116Reserved
31UART4_TX74TIM5_CH3117Reserved
32UART5_RX75TIM5_CH4118Reserved
33UART5_TX76TIM5_UP119Reserved
34LPUART1_RX77TIM5_TRIG120Reserved
35LPUART1_TX78TIM15_CH1121Reserved
36SAI1_A79TIM15_UP122Reserved

Table 54. DMAMUX: assignment of multiplexer inputs to resources (STM32L4Rxxx and STM32L4Sxxx devices) (continued)

DMA request MUX inputResourceDMA request MUX inputResourceDMA request MUX inputResource
37SAI1_B80TIM15_TRIG123Reserved
38SAI2_A81TIM15_COM124Reserved
39SAI2_B82TIM16_CH1125Reserved
40OCTOSPI183TIM16_UP126Reserved
41OCTOSPI284TIM17_CH1127Reserved
42TIM1_CH185TIM17_UP--
43TIM1_CH286DFSDM1_FLT0--
  1. 1. DAC channel 1.
  2. 2. DAC channel 2.

Table 55. DMAMUX: assignment of multiplexer inputs to resources (STM32L4P5xx and STM32L4Q5xx devices)

DMA request MUX inputResourceDMA request MUX inputResourceDMA request MUX inputResource
1dmamux_req_gen044TIM1_CH287DFSDM1_FLT0
2dmamux_req_gen145TIM1_CH388DFSDM1_FLT1
3dmamux_req_gen246TIM1_CH489Reserved
4dmamux_req_gen347TIM1_UP90Reserved
5ADC148TIM1_TRIG91DCMI_PSSI
6ADC249TIM1_COM92AES_IN
7DAC1 (1)50TIM8_CH193AES_OUT
8DAC2 (2)51TIM8_CH294HASH_IN
9TIM6_UP52TIM8_CH395Reserved
10TIM7_UP53TIM8_CH496Reserved
11SPI1_RX54TIM8_UP97Reserved
12SPI1_TX55TIM8_TRIG98Reserved
13SPI2_RX56TIM8_COM99Reserved
14SPI2_TX57TIM2_CH1100Reserved
15SPI3_RX58TIM2_CH2101Reserved
16SPI3_TX59TIM2_CH3102Reserved
17I2C1_RX60TIM2_CH4103Reserved
18I2C1_TX61TIM2_UP104Reserved
19I2C2_RX62TIM3_CH1105Reserved
20I2C2_TX63TIM3_CH2106Reserved
21I2C3_RX64TIM3_CH3107Reserved

Table 55. DMAMUX: assignment of multiplexer inputs to resources (STM32L4P5xx and STM32L4Q5xx devices) (continued)

DMA request MUX inputResourceDMA request MUX inputResourceDMA request MUX inputResource
22I2C3_TX65TIM3_CH4108Reserved
23I2C4_RX66TIM3_UP109Reserved
24I2C4_TX67TIM3_TRIG110Reserved
25USART1_RX68TIM4_CH1111Reserved
26USART1_TX69TIM4_CH2112Reserved
27USART2_RX70TIM4_CH3113Reserved
28USART2_TX71TIM4_CH4114Reserved
29USART3_RX72TIM4_UP115Reserved
30USART3_TX73TIM5_CH1116Reserved
31UART4_RX74TIM5_CH2117Reserved
32UART4_TX75TIM5_CH3118Reserved
33UART5_RX76TIM5_CH4119Reserved
34UART5_TX77TIM5_UP120Reserved
35LPUART1_RX78TIM5_TRIG121Reserved
36LPUART1_TX79TIM15_CH1122Reserved
37SAI1_A80TIM15_UP123Reserved
38SAI1_B81TIM15_TRIG124Reserved
39SAI2_A82TIM15_COM125Reserved
40SAI2_B83TIM16_CH1126Reserved
41OCTOSPI184TIM16_UP127Reserved
42OCTOSPI285TIM17_CH1--
43TIM1_CH186TIM17_UP--
  1. 1. DAC channel 1.
  2. 2. DAC channel 2.

Table 56. DMAMUX: assignment of trigger inputs to resources (STM32L4Rxxx and STM32L4Sxxx devices)

Trigger inputResourceTrigger inputResource
0EXTI LINE016dmamux_evt0
1EXTI LINE117dmamux_evt1
2EXTI LINE218dmamux_evt2
3EXTI LINE319dmamux_evt3
4EXTI LINE420LPTIM1_OUT
5EXTI LINE521LPTIM2_OUT
6EXTI LINE622DSI Tearing Effect

Table 56. DMAMUX: assignment of trigger inputs to resources
(STM32L4Rxxx and STM32L4Sxxx devices) (continued)

Trigger inputResourceTrigger inputResource
7EXTI LINE723DSI End of refresh
8EXTI LINE824DMA2D End of Transfer
9EXTI LINE925LTDC Line interrupt
10EXTI LINE1026Reserved
11EXTI LINE1127Reserved
12EXTI LINE1228Reserved
13EXTI LINE1329Reserved
14EXTI LINE1430Reserved
15EXTI LINE1531Reserved

Table 57. DMAMUX: assignment of trigger inputs to resources
(STM32L4P5xx and STM32L4Q5xx devices)

Trigger inputResourceTrigger inputResource
0EXTI LINE016dmamux_evt0
1EXTI LINE117dmamux_evt1
2EXTI LINE218dmamux_evt2
3EXTI LINE319dmamux_evt3
4EXTI LINE420LPTIM1_OUT
5EXTI LINE521LPTIM2_OUT
6EXTI LINE622Reserved
7EXTI LINE723Reserved
8EXTI LINE824DMA2D End of Transfer
9EXTI LINE925LTDC Line interrupt
10EXTI LINE1026Reserved
11EXTI LINE1127Reserved
12EXTI LINE1228Reserved
13EXTI LINE1329Reserved
14EXTI LINE1430Reserved
15EXTI LINE1531Reserved

Table 58. DMAMUX: assignment of synchronization inputs to resources
(STM32L4Rxxx and STM32L4Sxxx devices)

Sync. inputResourceSync. inputResource
0EXTI LINE016dmamux_evt0
1EXTI LINE117dmamux_evt1
2EXTI LINE218dmamux_evt2

Table 58. DMAMUX: assignment of synchronization inputs to resources (STM32L4Rxxx and STM32L4Sxxx devices) (continued)

Sync. inputResourceSync. inputResource
3EXTI LINE319dmamux_evt3
4EXTI LINE420LPTIM1_OUT
5EXTI LINE521LPTIM2_OUT
6EXTI LINE622DSI Tearing Effect
7EXTI LINE723DSI End of refresh
8EXTI LINE824DMA2D End of Transfer
9EXTI LINE925LTDC Line interrupt
10EXTI LINE1026Reserved
11EXTI LINE1127Reserved
12EXTI LINE1228Reserved
13EXTI LINE1329Reserved
14EXTI LINE1430Reserved
15EXTI LINE1531Reserved

Table 59. DMAMUX: assignment of synchronization inputs to resources (STM32L4P5xx and STM32L4Q5xx devices)

Sync. inputResourceSync. inputResource
0EXTI LINE016dmamux_evt0
1EXTI LINE117dmamux_evt1
2EXTI LINE218dmamux_evt2
3EXTI LINE319dmamux_evt3
4EXTI LINE420LPTIM1_OUT
5EXTI LINE521LPTIM2_OUT
6EXTI LINE622Reserved
7EXTI LINE723Reserved
8EXTI LINE824DMA2D End of Transfer
9EXTI LINE925LTDC Line interrupt
10EXTI LINE1026Reserved
11EXTI LINE1127Reserved
12EXTI LINE1228Reserved
13EXTI LINE1329Reserved
14EXTI LINE1430Reserved
15EXTI LINE1531Reserved

12.4 DMAMUX functional description

12.4.1 DMAMUX block diagram

Figure 32 shows the DMAMUX block diagram.

Figure 32. DMAMUX block diagram

Figure 32. DMAMUX block diagram. The diagram shows the internal architecture of the DMAMUX block. At the top, a 32-bit AHB bus connects to an AHB slave interface, which provides the dmamux_hclk signal. The main DMAMUX block contains several sub-components: a Request generator on the left with channels 0 to n (labeled DMAMUX_RGC0CR to DMAMUX_RGCnCR), which output signals dmamux_req_genx; a Request multiplexer on the right with channels 0 to m (labeled DMAMUX_C0CR to DMAMUX_CmCR), which output signals dmamux_req_outx; and a Sync block in the center. The Request generator outputs are connected to the Request multiplexer via a bus labeled dmamux_reqx. The Request multiplexer also receives DMA requests from peripherals (labeled dmamux_req_inx) and from the Request generator. The Sync block receives inputs from the Request multiplexer and the Interrupt interface. The Interrupt interface outputs an interrupt signal (labeled dmamux_ovr_it). The Sync block also outputs DMA channel events (labeled dmamux_evt). Control registers are shown at the bottom left, with inputs for Trigger inputs (labeled dmamux_trgx) and Synchronization inputs (labeled dmamux_syncx). The diagram is labeled MSV39745V1 at the bottom right.
Figure 32. DMAMUX block diagram. The diagram shows the internal architecture of the DMAMUX block. At the top, a 32-bit AHB bus connects to an AHB slave interface, which provides the dmamux_hclk signal. The main DMAMUX block contains several sub-components: a Request generator on the left with channels 0 to n (labeled DMAMUX_RGC0CR to DMAMUX_RGCnCR), which output signals dmamux_req_genx; a Request multiplexer on the right with channels 0 to m (labeled DMAMUX_C0CR to DMAMUX_CmCR), which output signals dmamux_req_outx; and a Sync block in the center. The Request generator outputs are connected to the Request multiplexer via a bus labeled dmamux_reqx. The Request multiplexer also receives DMA requests from peripherals (labeled dmamux_req_inx) and from the Request generator. The Sync block receives inputs from the Request multiplexer and the Interrupt interface. The Interrupt interface outputs an interrupt signal (labeled dmamux_ovr_it). The Sync block also outputs DMA channel events (labeled dmamux_evt). Control registers are shown at the bottom left, with inputs for Trigger inputs (labeled dmamux_trgx) and Synchronization inputs (labeled dmamux_syncx). The diagram is labeled MSV39745V1 at the bottom right.

DMAMUX features two main sub-blocks: the request line multiplexer and the request line generator.

The implementation assigns:

12.4.2 DMAMUX signals

Table 60 lists the DMAMUX signals.

Table 60. DMAMUX signals

Signal nameDescription
dmamux_hclkDMAMUX AHB clock
dmamux_req_inxDMAMUX DMA request line inputs from peripherals
dmamux_trgxDMAMUX DMA request triggers inputs (to request generator sub-block)
dmamux_req_genxDMAMUX request generator sub-block channels outputs
dmamux_reqxDMAMUX request multiplexer sub-block inputs (from peripheral requests and request generator channels)
dmamux_syncxDMAMUX synchronization inputs (to request multiplexer sub-block)
dmamux_req_outxDMAMUX requests outputs (to DMA controllers)
dmamux_evt_xDMAMUX events outputs
dmamux_ovr_itDMAMUX overrun interrupts

12.4.3 DMAMUX channels

A DMAMUX channel is a DMAMUX request multiplexer channel that may include, depending on the selected input of the request multiplexer, an additional DMAMUX request generator channel.

A DMAMUX request multiplexer channel is connected and dedicated to one single channel of DMA controller(s).

Channel configuration procedure

Follow the sequence below to configure both a DMAMUX x channel and the related DMA channel y:

  1. 1. Set and configure completely the DMA channel y, except enabling the channel y.
  2. 2. Set and configure completely the related DMAMUX y channel.
  3. 3. Last, activate the DMA channel y by setting the EN bit in the DMA y channel register.

12.4.4 DMAMUX request line multiplexer

The DMAMUX request multiplexer with its multiple channels ensures the actual routing of DMA request/acknowledge control signals, named DMA request lines.

Each DMA request line is connected in parallel to all the channels of the DMAMUX request line multiplexer.

A DMA request is sourced either from the peripherals or from the DMAMUX request generator.

The DMAMUX request line multiplexer channel x selects the DMA request line number as configured by the DMAREQ_ID field in the DMAMUX_CxCR register.

Note: The null value in the field DMAREQ_ID corresponds to no DMA request line selected.

Caution: A same non-null DMAREQ_ID must not be programmed to different x and y DMAMUX request multiplexer channels (via DMAMUX_CxCR and DMAMUX_CyCR), except if application guarantees that the two connected DMA channels are not simultaneously active.

On top of the DMA request selection, the synchronization mode and/or the event generation may be configured and enabled, if required.

Synchronization mode and channel event generation

Each DMAMUX request line multiplexer channel x can be individually synchronized by setting the synchronization enable (SE) bit in the DMAMUX_CxCR register.

DMAMUX has multiple synchronization inputs. The synchronization inputs are connected in parallel to all the channels of the request multiplexer.

The synchronization input is selected via the SYNC_ID field in the DMAMUX_CxCR register of a given channel x.

When a channel is in this synchronization mode, the selected input DMA request line is propagated to the multiplexer channel output, once is detected a programmable rising/falling edge on the selected input synchronization signal, via the SPOL[1:0] field of the DMAMUX_CxCR register.

Additionally, there is a programmable DMA request counter, internally to the DMAMUX request multiplexer, which may be used for the channel request output generation and also possibly for an event generation. An event generation on the channel x output is enabled through the EGE bit (event generation enable) of the DMAMUX_CxCR register.

As shown in Figure 34 , upon the detected edge of the synchronization input, the pending selected input DMA request line is connected to the DMAMUX multiplexer channel x output.

Note: If a synchronization event occurs while there is no pending selected input DMA request line, it is discarded. The following asserted input request lines is not connected to the DMAMUX multiplexer channel output until a synchronization event occurs again.

From this point on, each time the connected DMAMUX request is served by the DMA controller (a served request is deasserted), the DMAMUX request counter is decremented. At its underrun, the DMA request counter is automatically loaded with the value in NBREQ field of the DMAMUX_CxCR register and the input DMA request line is disconnected from the multiplexer channel x output.

Thus, the number of DMA requests transferred to the multiplexer channel x output following a detected synchronization event, is equal to the value in NBREQ field, plus one.

Note: The NBREQ field value shall only be written by software when both synchronization enable bit SE and event generation enable EGE bit of the corresponding multiplexer channel x are disabled.

Figure 33. Synchronization mode of the DMAMUX request line multiplexer channel

Timing diagram for Figure 33 showing synchronization mode. The diagram includes five signal lines: Selected dmamux_reqx, dmamux_syncx, dmamux_req_outx, DMA request counter, and dmamux_evtx. The Selected dmamux_reqx line shows multiple pulses. The dmamux_syncx line is a single pulse that synchronizes the input requests. The dmamux_req_outx line shows the output requests, which are the input requests synchronized with the syncx line. The DMA request counter is a counter that counts down from 4 to 0, then reloads to 4. The dmamux_evtx line is a pulse that occurs when the counter reaches zero. Annotations include: 'Selected DMA request line transferred to the output', 'DMA requests served', 'DMA request pending', 'Not pending', 'Synchronization event Input DMA request line connected to output', and 'DMA request counter underrun DMA request counter auto-reload to NBREQ Input DMA request line disconnected from output'.

Example: DMAMUX_CCRx configured with: NBREQ=4, SE=1, EGE=1, SPOL=01 (rising edge)

MSv41974V1

Timing diagram for Figure 33 showing synchronization mode. The diagram includes five signal lines: Selected dmamux_reqx, dmamux_syncx, dmamux_req_outx, DMA request counter, and dmamux_evtx. The Selected dmamux_reqx line shows multiple pulses. The dmamux_syncx line is a single pulse that synchronizes the input requests. The dmamux_req_outx line shows the output requests, which are the input requests synchronized with the syncx line. The DMA request counter is a counter that counts down from 4 to 0, then reloads to 4. The dmamux_evtx line is a pulse that occurs when the counter reaches zero. Annotations include: 'Selected DMA request line transferred to the output', 'DMA requests served', 'DMA request pending', 'Not pending', 'Synchronization event Input DMA request line connected to output', and 'DMA request counter underrun DMA request counter auto-reload to NBREQ Input DMA request line disconnected from output'.

Figure 34. Event generation of the DMA request line multiplexer channel

Timing diagram for Figure 34 showing event generation. The diagram includes six signal lines: Selected dmamux_reqx, dmamux_req_outx, DMA request counter, SE, EGE, and dmamux_evtx. The Selected dmamux_reqx line shows multiple pulses. The dmamux_req_outx line shows the output requests. The DMA request counter is a counter that counts down from 3 to 0, then reloads to 3. The SE line is a single pulse that occurs when the counter reaches zero. The EGE line is a single pulse that occurs when the counter reaches zero. The dmamux_evtx line is a pulse that occurs when the counter reaches zero. Annotations include: 'Selected DMA request line transferred to the output', 'DMA request pending', 'Not pending', and 'DMA request counter reaches zero Event is generated on the output DMA request counter auto-reloads with NBREQ value'.

Example with: DMAMUX_CCRx configured with: NBREQ=3, SE=0, EGE=1

MSv41975V1

Timing diagram for Figure 34 showing event generation. The diagram includes six signal lines: Selected dmamux_reqx, dmamux_req_outx, DMA request counter, SE, EGE, and dmamux_evtx. The Selected dmamux_reqx line shows multiple pulses. The dmamux_req_outx line shows the output requests. The DMA request counter is a counter that counts down from 3 to 0, then reloads to 3. The SE line is a single pulse that occurs when the counter reaches zero. The EGE line is a single pulse that occurs when the counter reaches zero. The dmamux_evtx line is a pulse that occurs when the counter reaches zero. Annotations include: 'Selected DMA request line transferred to the output', 'DMA request pending', 'Not pending', and 'DMA request counter reaches zero Event is generated on the output DMA request counter auto-reloads with NBREQ value'.

If EGE is enabled, the multiplexer channel generates a channel event, as a pulse of one AHB clock cycle, when its DMA request counter is automatically reloaded with the value of the programmed NBREQ field, as shown in Figure 33 and Figure 34 .

Note: If EGE is enabled and NBREQ = 0, an event is generated after each served DMA request.

Note: A synchronization event (edge) is detected if the state following the edge remains stable for more than two AHB clock cycles.

Upon writing into DMAMUX_CxCR register, the synchronization events are masked during three AHB clock cycles.

Synchronization overrun and interrupt

If a new synchronization event occurs before the request counter underrun (the internal request counter programmed via the NBREQ field of the DMAMUX_CxCR register), the synchronization overrun flag bit SOFx is set in the DMAMUX_CSR status register.

Note: The request multiplexer channel x synchronization must be disabled (DMAMUX_CxCR.SE = 0) at the completion of the use of the related channel of the DMA controller. Else, upon a new detected synchronization event, there is a synchronization overrun due to the absence of a DMA acknowledge (that is, no served request) received from the DMA controller.

The overrun flag SOFx is reset by setting the associated clear synchronization overrun flag bit CSOFx in the DMAMUX_CFR register.

Setting the synchronization overrun flag generates an interrupt if the synchronization overrun interrupt enable bit SOIE is set in the DMAMUX_CxCR register.

12.4.5 DMAMUX request generator

The DMAMUX request generator produces DMA requests following trigger events on its DMA request trigger inputs.

The DMAMUX request generator has multiple channels. DMA request trigger inputs are connected in parallel to all channels.

The outputs of DMAMUX request generator channels are inputs to the DMAMUX request line multiplexer.

Each DMAMUX request generator channel x has an enable bit GE (generator enable) in the corresponding DMAMUX_RGxCR register.

The DMA request trigger input for the DMAMUX request generator channel x is selected through the SIG_ID (trigger signal ID) field in the corresponding DMAMUX_RGxCR register.

Trigger events on a DMA request trigger input can be rising edge, falling edge or either edge. The active edge is selected through the GPOL (generator polarity) field in the corresponding DMAMUX_RGxCR register.

Upon the trigger event, the corresponding generator channel starts generating DMA requests on its output. Each time the DMAMUX generated request is served by the connected DMA controller (a served request is deasserted), a built-in (inside the DMAMUX request generator) DMA request counter is decremented. At its underrun, the request generator channel stops generating DMA requests and the DMA request counter is automatically reloaded to its programmed value upon the next trigger event.

Thus, the number of DMA requests generated after the trigger event is GNBREQ + 1.

Note: The GNBREQ field value must be written by software only when the enable GE bit of the corresponding generator channel x is disabled.

There is no hardware write protection.

A trigger event (edge) is detected if the state following the edge remains stable for more than two AHB clock cycles.

Upon writing into DMAMUX_RGxCR register, the trigger events are masked during three AHB clock cycles.

Trigger overrun and interrupt

If a new DMA request trigger event occurs before the DMAMUX request generator counter underrun (the internal counter programmed via the GNBREQ field of the DMAMUX_RGxCR register), and if the request generator channel x was enabled via GE, then the request trigger event overrun flag bit OFx is asserted by the hardware in the status DMAMUX_RGSR register.

Note: The request generator channel x must be disabled (DMAMUX_RGxCR.GE = 0) at the completion of the usage of the related channel of the DMA controller. Else, upon a new detected trigger event, there is a trigger overrun due to the absence of an acknowledge (that is, no served request) received from the DMA.

The overrun flag OFx is reset by setting the associated clear overrun flag bit COFx in the DMAMUX_RGCFR register.

Setting the DMAMUX request trigger overrun flag generates an interrupt if the DMA request trigger event overrun interrupt enable bit OIE is set in the DMAMUX_RGxCR register.

12.5 DMAMUX interrupts

An interrupt can be generated upon:

For each case, per-channel individual interrupt enable, status and clear flag register bits are available.

Table 61. DMAMUX interrupts

Interrupt signalInterrupt eventEvent flagClear bitEnable bit
dmamuxovr_itSynchronization event overrun on channel x of the DMAMUX request line multiplexerSOFxCSOFxSOIE
Trigger event overrun on channel x of the DMAMUX request generatorOFxCOFxOIE

12.6 DMAMUX registers

Refer to the table containing register boundary addresses for the DMAMUX base address.

DMAMUX registers may be accessed per (8-bit) byte, (16-bit) half-word, or (32-bit) word. The address must be aligned with the data size.

12.6.1 DMAMUX request line multiplexer channel x configuration register (DMAMUX_CxCR)

Address offset: 0x000 + 0x04 * x (x = 0 to 13)

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.SYNC_ID[4:0]NBREQ[4:0]SPOL[1:0]SE
rwrwrwrwrwrwrwrwrwrwrwrwrw

1514131211109876543210
Res.Res.Res.Res.Res.Res.EGESOIERes.DMAREQ_ID[6:0]
rwrwrwrwrwrwrwrwrw

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

Bits 28:24 SYNC_ID[4:0] : Synchronization identification

Selects the synchronization input (see Table 58: DMAMUX: assignment of synchronization inputs to resources (STM32L4Rxxx and STM32L4Sxxx devices) and Table 59: DMAMUX: assignment of synchronization inputs to resources (STM32L4P5xx and STM32L4Q5xx devices) ).

Bits 23:19 NBREQ[4:0] : Number of DMA requests minus 1 to forward

Defines the number of DMA requests to forward to the DMA controller after a synchronization event, and/or the number of DMA requests before an output event is generated.

This field shall only be written when both SE and EGE bits are low.

Bits 18:17 SPOL[1:0] : Synchronization polarity

Defines the edge polarity of the selected synchronization input:

00: No event, i.e. no synchronization nor detection.

01: Rising edge

10: Falling edge

11: Rising and falling edges

Bit 16 SE : Synchronization enable

0: Synchronization disabled

1: Synchronization enabled

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

Bit 9 EGE : Event generation enable

0: Event generation disabled

1: Event generation enabled

Bit 8 SOIE : Synchronization overrun interrupt enable

0: Interrupt disabled

1: Interrupt enabled

Bit 7 Reserved, must be kept at reset value.

Bits 6:0 DMAREQ_ID[6:0] : DMA request identification

Selects the input DMA request. See the DMAMUX table about assignments of multiplexer inputs to resources.

12.6.2 DMAMUX request line multiplexer interrupt channel status register (DMAMUX_CSR)

Address offset: 0x080

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.SOF13SOF12SOF11SOF10SOF9SOF8SOF7SOF6SOF5SOF4SOF3SOF2SOF1SOF0
rrrrrrrrrrrrrr

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

Bits 13:0 SOF[13:0] : Synchronization overrun event flag

The flag is set when a synchronization event occurs on a DMA request line multiplexer channel x, while the DMA request counter value is lower than NBREQ.

The flag is cleared by writing 1 to the corresponding CSOFx bit in DMAMUX_CFR register.

12.6.3 DMAMUX request line multiplexer interrupt clear flag register (DMAMUX_CFR)

Address offset: 0x084

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.CSOF13CSOF12CSOF11CSOF10CSOF9CSOF8CSOF7CSOF6CSOF5CSOF4CSOF3CSOF2CSOF1CSOF0
wwwwwwwwwwwwww

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

Bits 13:0 CSOF[13:0] : Clear synchronization overrun event flag

Writing 1 in each bit clears the corresponding overrun flag SOFx in the DMAMUX_CSR register.

12.6.4 DMAMUX request generator channel x configuration register (DMAMUX_RGxCR)

Address offset: 0x100 + 0x04 * x (x = 0 to 3)

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.GNBREQ[4:0]GPOL[1:0]GE
rwrwrwrwrwrwrwrw

1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.OIERes.Res.Res.SIG_ID[4:0]
rwrwrwrwrwrw

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

Bits 23:19 GNBREQ[4:0] : Number of DMA requests to be generated (minus 1)

Defines the number of DMA requests to be generated after a trigger event. The actual number of generated DMA requests is GNBREQ +1.

Note: This field must be written only when GE bit is disabled.

Bits 18:17 GPOL[1:0] : DMA request generator trigger polarity

Defines the edge polarity of the selected trigger input

00: No event, i.e. no trigger detection nor generation.

01: Rising edge

10: Falling edge

11: Rising and falling edges

Bit 16 GE : DMA request generator channel x enable

0: DMA request generator channel x disabled

1: DMA request generator channel x enabled

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

Bit 8 OIE : Trigger overrun interrupt enable

0: Interrupt on a trigger overrun event occurrence is disabled

1: Interrupt on a trigger overrun event occurrence is enabled

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

Bits 4:0 SIG_ID[4:0] : Signal identification

Selects the DMA request trigger input used for the channel x of the DMA request generator

12.6.5 DMAMUX request generator interrupt status register (DMAMUX_RGSR)

Address offset: 0x140

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OF3OF2OF1OF0
rrrr

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

Bits 3:0 OF[3:0] : Trigger overrun event flag

The flag is set when a new trigger event occurs on DMA request generator channel x, before the request counter underrun (the internal request counter programmed via the GNBREQ field of the DMAMUX_RGxCR register).

The flag is cleared by writing 1 to the corresponding COFx bit in the DMAMUX_RGCFR register.

12.6.6 DMAMUX request generator interrupt clear flag register (DMAMUX_RGCFR)

Address offset: 0x144

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.COF3COF2COF1COF0
wwww

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

Bits 3:0 COF[3:0] : Clear trigger overrun event flag

Writing 1 in each bit clears the corresponding overrun flag OFx in the DMAMUX_RGSR register.

12.6.7 DMAMUX register map

The following table summarizes the DMAMUX registers and reset values. Refer to the register boundary address table for the DMAMUX register base address.

Table 62. DMAMUX register map and reset values

OffsetRegister313029282726252423222120191817161514131211109876543210
0x000DMAMUX_C0CRRes.Res.Res.SYNC_ID[4:0]NBREQ[4:0]SPOL [1:0]SERes.Res.Res.Res.Res.EGESOIERes.DMAREQ_ID[6:0]
Reset value0000000000000000000000
0x004 to 0x034DMAMUX_C1CR to DMAMUX_C13CR... same as DMAMUX_C0CR ...
Reset value... same as DMAMUX_C0CR ...
0x038 - 0x07CReservedRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
0x080DMAMUX_CSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SOF13SOF12SOF11SOF10SOF9SOF8SOF7SOF6SOF5SOF4SOF3SOF2SOF1SOF0
Reset value00000000000000
0x084DMAMUX_CFRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CSOF13CSOF12CSOF11CSOF10CSOF9CSOF8CSOF7CSOF6CSOF5CSOF4CSOF3CSOF2CSOF1CSOF0
Reset value00000000000000

Table 62. DMAMUX register map and reset values (continued)

OffsetRegister313029282726252423222120191817161514131211109876543210
0x088 - 0x0FCReservedResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
0x100DMAMUX_RG0CRResResResResResResResResGNBREQ[4:0]GPOL [1:0]GEResResResResResResResResOIEResResResResSIG_ID[4:0]
Reset value0000000000000
0x104DMAMUX_RG1CRResResResResResResResResGNBREQ[4:0]GPOL [1:0]GEResResResResResResResResOIEResResResResSIG_ID[4:0]
Reset value0000000000000
0x108DMAMUX_RG2CRResResResResResResResResGNBREQ[4:0]GPOL [1:0]GEResResResResResResResResOIEResResResResSIG_ID[4:0]
Reset value0000000000000
0x10CDMAMUX_RG3CRResResResResResResResResGNBREQ[4:0]GPOL [1:0]GEResResResResResResResResOIEResResResResSIG_ID[4:0]
Reset value0000000000000
0x110 - 0x13CReservedResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
0x140DMAMUX_RGSRResResResResResResResResResResResResResResResResResResResResResResResResResResResResOF3OF2OF1OF0
Reset value0000
0x144DMAMUX_RGCFRResResResResResResResResResResResResResResResResResResResResResResResResResResResResCOF3COF2COF1COF0
Reset value0000
0x148 - 0x3FCReservedResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes

Refer to Section 2.2 on page 93 for the register boundary addresses.