2019-12-14 03:31 AM
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.
2019-12-15 04:31 AM
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
2019-12-16 02:21 AM
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 Accept as Solution on the reply which solved your issue or answered your question.