2020-01-13 08:22 AM
Board: NUCLEO-F446RE, STM32F446RE
CubeMX: 5.4.0
If you configure ADC1 with DMA, some configuration code for the DMA is placed into the ADC configuration code (stm32f4xx_hal_msp.c, line 152: if (HAL_DMA_Init(&hdma_adc1) != HAL_OK)).
But in the generated main.c, the DMA clock is switched on after this function is called, i.e. the function MX_DMA_Init() is called after MX_ADC1_Init(). So the configuration of the DMA is not applied, as the DMA is not clocked yet.
A workaround is to swap MX_DMA_Init and MX_ADC1_Init everytime you re-generate the code in CubeMX.
2020-01-14 12:55 AM
Please check whether you still have this problem with CubeMX 5.5.0.
2020-01-23 02:45 AM
I also experienced this problem. A workaround which does not require you to change the code every time is described here: