Skip to main content
MArdi.1
Visitor II
June 7, 2022
Solved

CubeMx sometimes generates initialization calls in the wrong order for ADC and DMA

  • June 7, 2022
  • 1 reply
  • 797 views

When trying to configure ADC with DMA in CubeMx, the code generation for the calls to the initialization functions sometimes end up in the wrong order, in my case, the call for MX_DMA_Init was placed after the call to MX_ADC1_Init which made the adc reading fail. To fix it, I reseted the peripheral configurations for ADC and DMA in CubeMx and configured them again, this led to the correct order being generated.

It seems that the order of the steps you take to configure the peripherals can sometimes lead to a wrong code generation. This was tested on STM32CubeIDE 1.9.0 which is the last version at the moment of this post.

This topic has been closed for replies.
Best answer by waclawek.jan

This is a bug recurring for years now. For latest development see end of this thread (below "More answers", if you don't see such, reload).

JW

1 reply

waclawek.jan
waclawek.janBest answer
Super User
June 7, 2022

This is a bug recurring for years now. For latest development see end of this thread (below "More answers", if you don't see such, reload).

JW