cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5 + PWM + DMA

nicolas
Senior II

I'm able to generate a simple PWM signal but I wasn't able to generate arbitrary waveform with DMA (HAL_TIM_DMABurst_MultiWriteStart).

How should be configured the DMA ?

Is there an example that use PWM with DMA on STM32U5 ?

13 REPLIES 13

I have already tried this (__HAL_TIM_CLEAR_FLAG(&htim1, TIM_FLAG_UPDATE);) and it didn't help.

Hello @nicolas 

Did you check the example below and compare with your code :

STM32CubeU0/Projects/NUCLEO-U083RC/Examples/TIM/TIM_DMABurst at main · STMicroelectronics/STM32CubeU0 · GitHub

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om

It doesn't help me because it use HAL_TIM_DMABurst_WriteStart() instead of HAL_TIM_DMABurst_MultiWriteStart() and the STM32U0 use DMA instead of GPDMA.

Looks like RCR and CCR1 are preloaded and my config was using an ARR not preloaded.

With a preloaded ARR, my ARR values doesn't need to be shifted.

htim.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;