2024-11-14 06:20 AM
Hi,
Looks like the HAL driver for the STM32f7xx ADC is missing a case for using the software start of the ADC2 peripheral in the HAL_ADC_Start_IT function.
Starting from line 1128:
else
{
/* if instance of handle correspond to ADC1 and no external trigger present enable software conversion of regular channels */
if((hadc->Instance == ADC1) && ((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET))
{
/* Enable the selected ADC software conversion for regular group */
hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART;
}
/* if dual mode is selected, ADC3 works independently. */
/* check if the mode selected is not triple */
if( HAL_IS_BIT_CLR(ADC->CCR, ADC_CCR_MULTI_4) )
{
/* if instance of handle correspond to ADC3 and no external trigger present enable software conversion of regular channels */
if((hadc->Instance == ADC3) && ((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET))
{
/* Enable the selected ADC software conversion for regular group */
hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART;
}
}
I think ADC2 should also be considered in this function. In fact, it is not mentioned anywhere in this driver...
Solved! Go to Solution.
2024-11-14 07:06 AM - edited 2024-11-14 07:10 AM
Hello,
It's considered at this line:
Condition: No ADC multimode configured.
Knowing that in multimode ADC1 is the master.
2024-11-14 07:06 AM - edited 2024-11-14 07:10 AM
Hello,
It's considered at this line:
Condition: No ADC multimode configured.
Knowing that in multimode ADC1 is the master.
2024-11-14 07:47 AM
You are right, I accidentally enabled the multi mode by writing too large a value to CCR->ADCPRE...
Thanks