Skip to main content
CortexFriend
Associate
March 26, 2020
Question

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

  • March 26, 2020
  • 2 replies
  • 836 views

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.

This topic has been closed for replies.

2 replies

Technical Moderator
March 26, 2020

Hello @CortexFriend​ ,

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

Best Reaards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
CortexFriend
Associate
March 27, 2020

Hello Imen,

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

Best Regards,

CF