Skip to main content
ivainc
Associate III
Feb 6, 2022 11:07 PM UTC
Solved

STM32CubeMX issue for STM32F1 ADC-DMA code

The simple proj is attached to show the wrong code generation for ADC-DMA peripheral.

To fix this issue two lines must be changed as below.

 /* Initialize all configured peripherals */

 MX_GPIO_Init();

 MX_ADC1_Init(); // ERROR!!! RCC CLK NOT YET ENABLED!

 MX_DMA_Init(); // MOVE THIS LINE BEFORE MX_ADC1_Init();

Are you can suggest other fix?

This topic has been closed for replies.
TDK
TDKBest answer
Feb 7, 2022 12:21 AM UTC

https://community.st.com/s/question/0D53W00001EzCmCSAV/mxdmainit-order-in-the-mainc-file-generated-by-stm32cubemx-how-to-fix

"If you feel a post has answered your question, please click ""Accept as Solution""."

1 reply

TDK
TDKBest answer
Feb 7, 2022 12:21 AM UTC
"If you feel a post has answered your question, please click ""Accept as Solution""."