cancel
Showing results for 
Search instead for 
Did you mean: 

Why CUBEMX is generating in wrong sequence the init functions?

NTosi
Associate III

Hi, I wanted to use DMA with ADC, I configured all parameters in CubeMX in STM32IDE but it did not work. I analysed that and the problem was in init functions. CUBEMX calls first the ADC_init function and later the DMA_init function. ADC_init configures also the DMA but the DMA's clock is not at this time enabled, so all the configuration will be discard.

I change manually the sequence of the init functions, first the DMA_init and after the ADC_init.

After this change everything is working properly.

3 REPLIES 3
Amel NASRI
ST Employee

Hello @NTosi​ ,

Are you using STM32CubeMX V5.6?

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

Khouloud ZEMMELI
ST Employee

​Hello @NTosi​ ,

Issue already detected and the fix will be available for the next CubeMX release.

Best Regards,

Khouloud

Khouloud ZEMMELI
ST Employee

If you created your project from the begining with 5.6 CubeMX version​, you will not face this issue,

Issue appears with the project already created with an older CubeMX version.

For the Moment it will be good if you  Create your project with the 5.6.0 version , else if you want to migrate your project  ( created with an other version less than 5.6) you need to change order in the advanced setting for only one time, and this will be working correctly with the next release (6.0.0)

regards,

Khouloud