2021-11-09 01:09 PM
Hi there!
I have configured an STM32L432KC Nucleo board in STM32CubeIDE, with UART2 and TIM2 using DMA. The generated code doesn't set up these DMAs correctly. The root cause is that their MX_<peripheral>_Init() calls precede the MX_DMA1_Init(), and the MspInit() of these two peripherals initialize DMA channels at a time when the RCC clock for the DMA isn't enabled. The project setup is available here for reproducing the problem: https://github.com/benedekkupper/ProntoInfrared/tree/bc8280e38ce5fb5fe04d3c918bf8fa2542a05964
Solved! Go to Solution.
2021-11-16 09:17 AM
This was fixed and regressed recently again. See https://community.st.com/s/question/0D50X0000Bmob3uSQA/dma-not-working-in-cubemx-generated-code-order-of-initialization
In the mean time, you can reorder the functions in CubeMX. See UM1718 STM32CubeMX for STM32 configuration and initialization C code generation section 4.9.3 Advanced Settings Tab: Ordering initialization function calls on page 139.
2021-11-16 03:48 AM
Hi @Ben K ,
Thanks for sharing your experience.
Unfortunately, this is a known issue faced with STM32CubeMX 6.3.
Our STM32CubeMX team is already aware about it. A fix should be available in next revision of the tool (we expect it to be available soon).
-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.
2021-11-16 09:17 AM
This was fixed and regressed recently again. See https://community.st.com/s/question/0D50X0000Bmob3uSQA/dma-not-working-in-cubemx-generated-code-order-of-initialization
In the mean time, you can reorder the functions in CubeMX. See UM1718 STM32CubeMX for STM32 configuration and initialization C code generation section 4.9.3 Advanced Settings Tab: Ordering initialization function calls on page 139.