cancel
Showing results for 
Search instead for 
Did you mean: 

DMA settings for timer channels in pwm mode

zeboss49
Associate III

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 4
TDK
Super User

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".
zeboss49
Associate III

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

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".
zeboss49
Associate III

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.