cancel
Showing results for 
Search instead for 
Did you mean: 

ADC_DMA_Transfer example on NUCLEO-U575ZI-Q board failure to go through

hguan
Associate III

I am loading and running example "ADC_DMA_Transfer" on NUCLEO-U575ZI-Q board but failed go through on function call

MX_ADC4_Init();

Step into this function, the software trapped in the ADC calibration process.

if (HAL_ADCEx_Calibration_Start(&hadc4, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)

{

Error_Handler();

}

 

The software failed to start calibration and then tangled in Error_Handler() permanently.

I searched through the early post but didn't find right solution.

Any thought on this issue? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
hguan
Associate III

Hi, I found the issue, it is related to my hardware board. After I fixed the hardware (on power section) the ADC is working fine.

Appreciate your help.

View solution in original post

3 REPLIES 3
FBL
ST Employee

Hello @hguan 

Could you check which kind of errors do you get from HAL? Is it linked to configuration/DMA error?

Could you share more details to reproduce the error?

Dump errors from registers view as well to make sure they are linked properly. 

 

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.


I'm out of offce with limited access to my emails.
Happy New Year!
hguan
Associate III

Thank you for your quick response.

The dead loop happened during function call of HAL_ADCEx_Calibration_Start(...) within

stm32u5xx_hal_adc_ex.c.

 

Inside the HAL_ADCEx_Calibration_Start(...), it calls LL_ADC_IsCalibrationOnGoing(...)

 

/* Wait for calibration completion */

while (LL_ADC_IsCalibrationOnGoing(hadc->Instance) != 0UL)

{

wait_loop_index++;

if (wait_loop_index >= ADC_CALIBRATION_TIMEOUT)

{

/* Update ADC state machine to error */

ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_BUSY_INTERNAL, HAL_ADC_STATE_ERROR_INTERNAL);

 

__HAL_UNLOCK(hadc);

 

return HAL_ERROR;

}

}

 

The function LL_ADC_IsCalibrationOnGoing(...) always return non-zero value:

READ_BIT(ADCx->CR, ADC_CR_ADCAL) = 0x80000000

Once the timeout reaches ADC_CALIBRATION_TIMEOUT, it returns HAL_ERROR to the caller and then the software hungs up in the

Error_Handler().

 

The hardware board in my test is using STM32U575VIT6Q, not the evaluation board NUCLEO-U575ZI-Q.

 

 

hguan
Associate III

Hi, I found the issue, it is related to my hardware board. After I fixed the hardware (on power section) the ADC is working fine.

Appreciate your help.