cancel
Showing results for 
Search instead for 
Did you mean: 

ADC initialization uses wrong constant for internal path

NPaqu.1
Associate

The following line of code is generated by CubeMX v6.14.0.202502271554 for a STM32G070RBTx using FW Package v1.6.2:

LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_AWD_CH_VREFINT_REG|LL_ADC_AWD_CH_TEMPSENSOR_REG);

The constants used are for the Analog Watchdog in ADC_CFGR1 and have no relation to the internal path configuration in ADC_CCR.  This can configure the wrong internal paths and change the ADC clock prescaler.

As stated in the function description, the constants should be one of the following:

  * @PAram  PathInternal This parameter can be a combination of the following values:
  *         @arg @ref LL_ADC_PATH_INTERNAL_NONE
  *         @arg @ref LL_ADC_PATH_INTERNAL_VREFINT
  *         @arg @ref LL_ADC_PATH_INTERNAL_TEMPSENSOR
  *         @arg @ref LL_ADC_PATH_INTERNAL_VBAT

 

Regards,

0 REPLIES 0