Skip to main content
Associate II
March 3, 2025
Question

STM32H7 won't calibrate using STMCubeMX v6.13.0

CubeMX-generated code gets stuck on HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED) using IDE v1.17.0 and FreeRTOS.

RTOS is using SystemCoreClock. HAL Tick is using TIM17 with a priority = 14 (Higher than SysTick Timer.)

Made AdcTask highest priority task. Ran ADC_Disable(&hadc1) to make sure ADC was disabled. All required GPIO Port Timers have been enabled. Not using DMA. I can't see any relevant difference between my code and the examples.

If I skip Calibration and then:

   ADC_Enable(&hadc1);

   HAL_ADC_Start(&hadc1);

   HAL_ADC_PollForConversion(&hadc1, 10)

The ADC enables and starts, but times out at the Poll. This could be a different issue, but it may also be an indicator of why it wont calibrate. ADC is configure to Scan 4 channels with EOS.

All other GPIO, UART, I2C, Timers work as expected.

A response would be appreciated.

This topic has been closed for replies.

1 reply

Amel NASRI
ST Technical Moderator
April 29, 2025

Hi @dbrooks ,

- Can you try to increase the timeout value for ADC calibration? Does it help?

- What about the configuration without FreeRTOS: do you face the same issue?

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.