Skip to main content
PÖste.1
Associate II
December 14, 2019
Question

CubeMX USART1 with DMA, LL driver inits DMA streams before enabling DMA CLK

  • December 14, 2019
  • 2 replies
  • 1117 views

I have had a problem getting DMA TX for USART1 to work, no errors, stream gets enabled nut nothing is transferred, stream never complets. I am using LL driver for USART1.

I finally found the problem is that generated usart.c code inits DMA without enabling the CLK. Init of DMA is done after USART1. Eventually I found the "hidden" up/down arrows in CubeMX (scroll down the window) and could move call to MX_DMA_Init() up before other peripherals.

I am note sure if CubeMX is supposed to leave such detals to the user - I would not misssed it not using CubeMX but one assumes CubeMX has the brains to handle this dependency, or?

I have CubeMX 5.4.0 and STM32F413 MCU.

This topic has been closed for replies.

2 replies

PHryn
Associate III
December 15, 2019

I can confirm this bug on stm32g4.

MX_DMA_Init should be right after MX_GPIO_Init.

Propably it can affect all cubemx dma code generator.

Regards,

Pawel

Amel NASRI
Technical Moderator
December 16, 2019

Hello,

Similar problems are already tracked in https://community.st.com/s/question/0D50X0000Bmob3uSQA.

The fix will be available in next STM32CubeMX release.

Best Regards,

Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.