cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G030: HAL_ADCEx_Calibration_Start() fails with compiler options greater than "-O0"

GOnkelinx
Associate II

Hi,



I use a STM32G030. 
The application works fine when we compile it with option -O0 (no optimize).
It fails when we using the function HAL_ADCEx_Calibration_Start() for the calibration of the ADC.

This function returns the fail at the follow location:

GOnkelinx_0-1711877902822.png


The calibration is started as follow:

HAL_ADC_Stop(hdlr->pHadc);

HAL_ADCEx_Calibration_Start(hdlr->pHadc);

Why returns this function an error only when the compiler option is greater than -O0?
Now when the functions returns an error the function/ADC is locked.
Is this normal or should be not there for the return __HAL_UNLOCK(hadc)?

 

1 ACCEPTED SOLUTION
2 REPLIES 2

Thanks, the workaround works.
Why it not updated in the HAL library yet?