2025-03-03 10:09 AM - edited 2025-03-04 8:35 AM
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.
2025-04-29 8:33 AM
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.