STM32G4 ADC DMA fails when MX_ADC1_Init is called before MX_DMA_Init
I have setup ADC1 on an STM32G4 in scan mode where the start of conversions is initiated by a timer. I have also setup the DMA in circular mode and configured it such that the ADC results are transferred to an array every time the scan conversion completes. The code generated by CubeMX calls the MX_ADC1_Init() before MX_DMA_Init(). In this order, the DMA doesn't update my array values. However, when I change the order of initialization so that MX_DMA_Init() is called beore MX_ADC1_Init(), everything seems to work fine. I looked in the code briefly, but couldn't figure out why the order of initialization matters. It is also problematic because I have to manually change the order of initialization every time I regenerate code using CubeMX.