Skip to main content
Associate
September 25, 2023
Solved

STM32G431 - ADC + DMA using HAL not working

  • September 25, 2023
  • 3 replies
  • 3589 views

Hi,

I am trying to make the ADC + DMA work a STM32G431CBT6 using STM32CubeIDE and the HAL library. I am used to making it work on other families like the STM32f103 etc.. However, here, when I program the processor using the debug mode and watch the content of my adc/dma buffer, all the values are at 4095 (maximum) and stay like this... 

Has anyone an idea on how to make this work? or any suggestions based on my code?

Please find my code and CubeMX settings in the following images.

 

Thanks in advance,

 

 

Best answer by merdouille

Thanks a lot for your advice @Issamos!

I have found the issue btw: the ADC'S were totally saturated due to a misuse of VREF. I was used to work with other MCUs that did it differently (F1 , F3, etc). So , always check your reference voltage settings and Connections!

3 replies

Associate
September 25, 2023

CaptureA.JPG

CaptureB.JPG

CaptureC.JPG

Issamos
Lead III
September 25, 2023

Hello @merdouille 

Try to use one of those 2 ready to use projects.

Best regards.

II

merdouilleAuthorAnswer
Associate
September 27, 2023

Thanks a lot for your advice @Issamos!

I have found the issue btw: the ADC'S were totally saturated due to a misuse of VREF. I was used to work with other MCUs that did it differently (F1 , F3, etc). So , always check your reference voltage settings and Connections!

Issamos
Lead III
September 27, 2023

Happy to know that your problem has been solved. If so, close the topic by choosing a best answer.

Best regards.

II