2020-03-26 01:06 AM
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.
2020-03-26 09:08 AM
Hello @CortexFriend ,
Thank you for your reported issue. This is raised internally for correction.
Best Reaards,
Imen
2020-03-27 12:35 AM
Hello Imen,
thanks for the feedback. Can you give a very rough estimate for the next G0 firmware release?
Best Regards,
CF