cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 won't calibrate using STMCubeMX v6.13.0

dbrooks
Associate II

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.

1 REPLY 1
Amel NASRI
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.