What can cause HAL_ADCEx_Calibration_Start() to fail?
Here is the code snippet.
HAL_Delay(5000);
if (HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED) != HAL_OK)
{
print_debug_str("Did not calibrate right!");
}
else
{
char buf[32];
sprintf(buf,"Calibration Factor: %lu\r\n",ADC1->CALFACT);
print_debug_str(buf);
}if I let this run it fails.
If I put a break point on the
if (HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED) != HAL_OK)
and step over it works.
If I remove the HAL_Delay(5000) it does not work unless I put in a break. It will work (return HAL_OK) after the break even if I immediately tell it to continue and run where the delay is much less than 5 seconds.
I put in the delay because I thought it needed more time to settle down. That does not seem to be the case. I even tried to make the delay 15 seconds. It still will not return HAL_OK
Thanks for the response.
Kip