cancel
Showing results for 
Search instead for 
Did you mean: 

adc fails to initialize

mo_krauti
Associate III

Board: stm32h753zi nucleo

Firmware & CubeMX: latest version

I have configured the adc to continous conversion and DMA output. The initialization fails in main.c in HAL_ADC_INIT. I stepped through the HAL lib and saw that LL_ADC_IsInternalRegulatorEnabled returns the HAL_ERROR.

The docstring of this function says

  /* Verification that ADC voltage regulator is correctly enabled, whether    */
  /* or not ADC is coming from state reset (if any potential problem of       */
  /* clocking, voltage regulator would not be enabled).                       */
  if (LL_ADC_IsInternalRegulatorEnabled(hadc->Instance) == 0UL)

I do not find any documents online which describe how the clock frequency of the adc should be set up. Could you please give me a hint.

5 REPLIES 5
AScha.3
Super User

You set the adc clock in clock tree ->

AScha3_0-1748274126240.png

and then choose in adc settings...

AScha3_1-1748274217362.png

+ in ds see the limits :

AScha3_2-1748274380844.png

 

 

If you feel a post has answered your question, please click "Accept as Solution".
mo_krauti
Associate III

Thank you for your answer.

In which document is this ADC table? I looked into the RM, PM and Nucleo 144 UM.

Also I tried different clock inputs (80, 64, 32, 16 MHz) but the error still occors.

>In which document is this ADC table?

in ds , as i wrote. 

AScha3_0-1748329732868.png

 

+

>but the error still occors.

To be true: i never seen this problem...but i dont have the H753 , i use H743 ; ( but its same chip , DIE450 );

So : if you get no warnings, when you  "generate code" , then maybe a problem with the Cube/lib version;

i run IDE1.18.1 , +  STM32CubeH7 Firmware Package V1.12.1 / 06-December-2024

Try update, if yours is old.

If you feel a post has answered your question, please click "Accept as Solution".
mo_krauti
Associate III

I also use STM32CubeH7 Firmware Package V1.12.1 and CubeMX v6.14.1

I do not get any warnings. I tried lowering the clock speed to 4MHz, but the error still occurs.

Did you any tests for ADC ok or not?

I would try: 

Set in Cube ADC for a simple conversion: just one rank, on a channel, no dma, no oversampling, no continuous mode, just plain basic default settings.

Set ADC clock to any medium frequency for your vos range and core speed, maybe 20 MHz.

After init call ADC calibration,

Then call Hal ADC conversion in blocking mode...and tell , what comes out.

If you feel a post has answered your question, please click "Accept as Solution".