cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 [ADC-LL]: Some bugs in stm32g0xx_ll_adc.c

CortexFriend
Associate II

I think, there are some bugs in stm32g0xx_ll_adc.c.

In the function LL_ADC_REG_Init() is the statement "LL_ADC_REG_SetSequencerLength(ADCx, ADC_REG_InitStruct->SequencerLength) [line 713] outside of the parentheses.

I think, it should be inside the last one [move it two lines up], because the sequencer length could only be written if LL_ADC_REG_SEQ_FIXED is not set.

Setting the length in fixed sequencer mode modifies the channel selection because of the the dual mode useage of register ADC_CHSELR.

---------------------------

Another problem in the same context:

CubeMX generates a statement like LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_CHANNEL_VREFINT|LL_ADC_CHANNEL_TEMPSENSOR) if you add the two internal channels (Vref and temperature) to the ADC sequence.

I think, the parameters for the function call are wrong.

It works with LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_INTERNAL_VREFINT|LL_ADC_PATH_INTERNAL_TEMPSENSOR).

Please see the difference between LL_ADC_CHANNEL and LL_ADC_PATH.

2 REPLIES 2
Imen.D
ST Employee

Hello @CortexFriend​ ,

Thank you for your reported issue. This is raised internally for correction.

Best Reaards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
CortexFriend
Associate II

Hello Imen,

thanks for the feedback. Can you give a very rough estimate for the next G0 firmware release?

Best Regards,

CF