Skip to main content
Associate
July 7, 2023
Question

STM32G050 DMA problem

  • July 7, 2023
  • 4 replies
  • 1478 views

I use STM32G050C8T6 DMA for the timer PWM. For the IDE I use STM32CubeIDE. Also in my code block have usart 2 comunication line.

Timer PWM work with DMA interrupt. DMA and DMAMUX configuration generated by CubeIDE. 

When I start the code and if I use the USART2  , UART_WaitOnFlagUntilTimeout it calls HAL_DMA_IRQHandler.

The other problem; code generates  hardfault after the __HAL_DMA_DISABLE(hdma) in HAL_DMA_Start_IT when I use Timer PWM with DMA and I use USART2 at the same time.

This topic has been closed for replies.

4 replies

ST Employee
July 7, 2023

Hello @ENESK, thank you for posting, 

Try assigning higher priority to DMA for the timer PWM DMA request over the usart2 DMA request using the DMAMUX configuration. 

Or, you can also use separate DMA channels for the PWM and usart2 to avoid any interference between DMA transfers. 

Hope that helps!

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.
ENESKAuthor
Associate
July 7, 2023

Thank you for your answer

But I already tried this and also I dont use usart2 with DMA. DMA only works with TIM1 but still usart2 line triggers DMA interrupt.

ENESKAuthor
Associate
July 7, 2023

Thank you for your answer but I already tried this and also I dont use usart2 with DMA. DMA only works with TIM1 but still usart2 line triggers DMA interrupt.

ENESKAuthor
Associate
July 10, 2023

@Sarra.S  

Thank you for your answer

But I already tried this and also I dont use usart2 with DMA. DMA only works with TIM1 but still usart2 line triggers DMA interrupt.