cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G031F8P6 VREFINT reading zero during DMA conversion while VSENSE working correctly.

Dunk
Associate II

Using DMA to read 3 ADC channels. IN0, VSENSE & VREFINT all enabled in CUBEMX. First 2 channels read as expected but for VREFINT it seems to always read zero. Am I missing a setting in the CUBEMX?

2 REPLIES 2
mƎALLEm
ST Employee

Hello,

1- What if you change the ranking by swapping VSENSE and VREFINT ranks?

2- Check if VREFEN bit is set in ADC_CCR register. From the reference manual:

screenshot.png

I know you are using CubeMx to generate the code, but we need to ensure the code is well generated as well.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Dor_RH
ST Employee

Hello @Dunk,

Could you try to have a look at the ADC_MultiChannelSingleConversion example: Link(here)

It contains an .ioc file that will be helpful for your application.

I hope my answer has helped you. When your question is answered, please select this topic as the solution that answered you, as it will help others find that answer faster.

Thanks for your contribution.

Dor_RH