Skip to main content
Explorer II
March 31, 2024
Solved

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

  • March 31, 2024
  • 1 reply
  • 3030 views

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)?

 

    This topic has been closed for replies.

    1 reply

    GOnkelinxAuthor
    Explorer II
    March 31, 2024

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