Skip to main content
samsamm777
Associate II
August 30, 2022
Solved

DMA not working on STM32F303RET6

I'm struggling to get DMA working on a PWM Timer. I've read just about everything i can, but not having any luck get it working.

Running this code.. produces a PWM signal as expected on the output.

TIM1->CCR1 = 50;
 HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);

However, when I swap the code to the following, all I get is a low signal. It never produces a PWM at all. My expectation is that it should do. I have my scope on single shot, and triggered correctly.

pwmData[0] = 0;
 pwmData[1] = 10;
 pwmData[2] = 20;
 pwmData[3] = 30;
 pwmData[4] = 40;
 pwmData[5] = 50;
 pwmData[6] = 60;
 pwmData[7] = 70;
 pwmData[8] = 80;
 pwmData[9] = 90;
 HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *)pwmData, 10);

 I have DMA setup for the timer0693W00000Su6y6QAB.png

This topic has been closed for replies.
samsamm777
samsamm777Best answer
Associate II
August 31, 2022

So I rebuilt the entire project from scratch, and its now working.

2 replies

waclawek.jan
Super User
August 30, 2022

Red out and check/post content of TIM and DMA registers.

​

JW​

samsamm777
samsamm777AuthorBest answer
Associate II
August 31, 2022

So I rebuilt the entire project from scratch, and its now working.