2023-04-28 05:17 AM - edited 2023-11-20 06:51 AM
Hi,
I notice that CubeMx allow choose 16-bit resolution but STM32L476 has range from 6 to 12 bit.
When I generate code I can't compile it:
Moreover in datasheet we read on page 1:
but it's only one information about mystic 16-bit resolution :D
Solved! Go to Solution.
2023-04-28 06:10 AM
Pleas look at my first post. CubeMx generate ADC_RESOLUTION_16B that not exist in ADC header for this board .
2023-04-28 05:46 AM
Well, we are talking about a 12-bit ADC with hardware oversampling.
In the generated code you will find at the very bottom: hadc1.Init.OversamplingMode = DISABLE;, which is set by the CubeMX setting in "ADC_Regular_ConversionMode". You will get 16bit oversampling when enabled.
Does it answer your question?
Regards
/Peter
2023-04-28 05:54 AM
I don't think so. CubeMx should not generate code that you can't compile it
2023-04-28 05:57 AM
What does the ability to compile have to do with 16-bit oversampling?
Can't you compile the code?
Do you know how 16-bit oversampling works?
2023-04-28 06:10 AM
Pleas look at my first post. CubeMx generate ADC_RESOLUTION_16B that not exist in ADC header for this board .
2023-04-28 06:26 AM
Oh, sorry, I hadn't read the post carefully enough. You are right, the option ADC_RESOLUTION_16B must not appear or be selectable here.
Thank you for your contribution!
Regards
/Peter
@Sara BEN HADJ YAHYA
2023-05-02 02:47 AM
Hello All,
Issue confirmed and an internal ticket (ID 150960) is submitted in order to fix this.
(PS: ID 150960 is an internal tracking number and is not accessible or usable by customers).
Thank you for your contribution.
Imen