Bug in the generated code from STM32CubeMX V 6.3.0 using ADC and DMA: Needs manual change
I am using the following settings:
STM32 CubeMX version 6.3.0
Microcontroller: STM32L4P5ZGTxP
Enabled peripherals:
ADC1:
- SCAN mode: disabled
- CONT and DISCONT mode disabled
- Continuous DMA requests enabled
- Using EXTI 11 to run
DMA1 channel 1:
- Circular mode
- Memory word increments
- No DMA synchronization requests
When I generated the code (checked for both Keil and Cube IDE), the initialization part of the main looked like this:
...
MX_GPIO_Init();
MX_ADC1_Init();
MX_DMA_Init();
...The ADC runs, and if the interrupts are set, you'll get the interrupts. But the DMA callback routine is never entered.
When I changed the order to first initialize the DMA, and then the ADC1, the problem was solved.
I would like to see if anyone can confirm this, or is it due to something else (possibly?).