cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX issue for STM32F1 ADC-DMA code

ivainc
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru
1 REPLY 1
TDK
Guru

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".