2021-12-29 03:21 AM
Porting a working solution from STM32L031 to STM32G0B1 I try to configure ADC in CubeMX . It is a very simple, typical setup. 3 channels converted in "one shot" mode with DMA, triggered by slow 1Hz timer.
All I am getting is HAL_ADC_ErrorCallback(), state: HAL_ADC_STATE_REG_OVR, errorCode: HAL_ADC_ERROR_OVR.
Almost identical setup works great on STM32L031.
I am stuck and clueless. Please advise.
CubeMX is the latest 6.4, firmware package STM32Cube FW_G0 V1.5.0
Solved! Go to Solution.
2021-12-29 05:28 AM
Check the call order of MX_ADC1_Init() and MX_DMA_Init(). At least in software version this summer the code generated had these in the wrong order for a STM32G0 device.
2021-12-29 05:28 AM
Check the call order of MX_ADC1_Init() and MX_DMA_Init(). At least in software version this summer the code generated had these in the wrong order for a STM32G0 device.
2021-12-29 05:49 AM
Yep, that was the problem. DMA needs to be initialized first. It is a CubeMX bug.
Thank you!
2021-12-29 06:38 AM
To fix, in case you didn't see it: