Electronic – Can the STM32G4’s DMA multiplexer (DMAMUX) be synchronized to a timer other than LPTIM

dmastm32

I’m working with an STM32G474RE chip, and I’m trying to use the synchronization feature of the DMA multiplexer to time when a DMA transfer to SPITX should occur. I’d like to have this timed synchronously to some other timer events.

Looking at the documentation, it appears like the options for synchronization signals come from EXTI 0-15, signals generated in the DMAMUX itself, or the LPTIM timer’s output.

DMAMUX synchronization inputs, as listed in the documentation

The LPTIM timer doesn’t have the same connections to the synchronization signals as the other timers (advanced, general, and basic), so I can’t use it to generate the needed signal. I suppose I could generate a waveform on a timer’s channel output, route that with a wire to another GPIO pin, and use that as a synchronization signal, but that is so unnecessarily wasteful and introduces the possibility of capacitance issues, etc.

It seems very odd that the DMAMUX peripheral would include the synchronization function, but use an implementation that excludes timers. Is there something that can be done? I’m writing my code using CMSIS, but if there’s a HAL example somebody can point to, I could analyze that.

Best Answer

I was able to find a solution to this that I’ll post here just in case somebody comes across this question. The EXTI channels that are available for trigger signals to the synchronization timing of the DMAMUX, or any peripheral that responds to EXTI, can be read while the pin is in output or alternate function mode. To get this timing, I was able to create a PWM signal in a compare channel of a timer, configure the timer’s enable register (TIMx_CCER) to route the signal to a pin, and then configure that pin to provide the signal for the related EXTI signal via the SYSCFG external interrupt configuration register (SYSCFG_EXTICRx). The synchronization signal will then work as described in the question, but without the need to route a wire between any pins.

Related Topic