Skip to main content
NTosi
Associate III
March 20, 2020
Question

Why CUBEMX is generating in wrong sequence the init functions?

  • March 20, 2020
  • 3 replies
  • 726 views

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.

This topic has been closed for replies.

3 replies

Amel NASRI
ST Technical Moderator
April 2, 2020

Hello @NTosi​ ,

Are you using STM32CubeMX V5.6?

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Khouloud ZEMMELI
ST Employee
April 8, 2020

​Hello @NTosi​ ,

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

Best Regards,

Khouloud

Khouloud ZEMMELI
ST Employee
April 8, 2020

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