Skip to main content
etheory
Senior
Apr 10, 2022 12:20 PM UTC
Question

How to use the DMA Request Synchronization in STM32CubeIDE

Hi there!

I am trying to create a lock-step synchronization between a timer that updates GPIO and a dac.

As you can see from the below, the GPIO leads the DAC transitions by 1 cycle, and that's not what I want:

0693W00000LxUW4QAN.png 

My setup is as follows.

TIM8 generates a TRGO that drives the DAC1 DMA.

I also have a TIM8_UP DMA Request created through the DMA System Configuration.

The problem is that the TIM8_UP and TIM8_TRGO events are not synchronous, and differ by one cycle.

FYI I am using a Nucleo STM32G431KB.

I was trying to use the DMA Request Synchronization Settings to ensure the two different signals (DMA and GPIO) are exactly synchronous, but I cannot get it to work.

How could I do this through STM32CubeIDE?

I also noticed that there is no TIM8_TRGO DMA Request signal available. The datasheets are pretty difficult to search on this topic also and provide no additional clues that I could find.

Thank you.

This topic has been closed for replies.

3 replies

TDK
Apr 10, 2022 9:44 PM UTC

Consider using a different event such as TIM8_CC1 instead of TIM8_UP where you can set the CCRx value to change the relative timing.

"If you feel a post has answered your question, please click ""Accept as Solution""."
etheory
etheoryAuthor
Senior
Apr 11, 2022 1:49 AM UTC

Thanks @TDK​, I appreciate the suggestion, but I don't want to change the relative timing, I just want a lock-step signal with the DAC DMA, and I don't seem to be able to do that, since I can't seem to define DMA synchronization to ensure synchronous transfer.

TDK
Apr 11, 2022 2:04 AM UTC
If they’re one cycle off, you can adjust CCRx by one to get them in lock step. That would achieve what you want, as far as I can see.
"If you feel a post has answered your question, please click ""Accept as Solution""."