Skip to main content
Associate III
November 10, 2025
Question

DMA settings for timer channels in pwm mode

  • November 10, 2025
  • 4 replies
  • 252 views

Hello,

when enabling DMA for a Timer channel in PWM mode, the transfer direction is set to Memory to Peripheral.

This s very questionnable.

Is it a deliberate choice or a bug?

It does not make sense to select Peripheral to Memory for the DMA channel as it is used to wrtie to the device.

I fell in the trap several time, wasting time to look up for an issue in my code...

Very boring.

STM32 device is STM32F429, CubeIDE version 1.19.0 (same problem with all versions since I started using CubeIDE a couple of years before.)

 

4 replies

TDK
Super User
November 10, 2025

This allows the PWM duty cycle to be changed. That seems the only sensible option here. Intentional and not a bug.

 

Why should it go from peripheral to memory? Are you perhaps looking for input capture mode instead?

"If you feel a post has answered your question, please click ""Accept as Solution""."
zeboss49Author
Associate III
November 11, 2025

Hello,

let me make things clear,

I know that the right direction is Memory to Peripheral.

My questionning was about CubeIDe which set the direction as Peripheral to Memory, requiring a change to make things work properly.

TDK
Super User
November 11, 2025

Please include your IOC file that demonstrates the problem.

 

> when enabling DMA for a Timer channel in PWM mode, the transfer direction is set to Memory to Peripheral

> My questionning was about CubeIDe which set the direction as Peripheral to Memory

So which one is it?

"If you feel a post has answered your question, please click ""Accept as Solution""."
zeboss49Author
Associate III
November 11, 2025

Hello,

I created a skeleton project with only a Timer channel as PWM with DMA.

Please, find as attachments both a screen shot of CubeIDE and the IOC file.