-
Notifications
You must be signed in to change notification settings - Fork 1k
STM32G071/081 Analog Pin Mapping Errors #736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @steenerson |
Fixes stm32duino#736 Signed-off-by: Frederic Pillon <[email protected]>
I've made a PR to fix issue with |
Great news and progress, thanks! |
Fixes stm32duino#736 Signed-off-by: Frederic Pillon <[email protected]>
Fixes stm32duino#736 Signed-off-by: Frederic Pillon <[email protected]>
Hi @steenerson The STM32G0 ADC has a new feature on sequencer: can be set to "not fully configurable "legacy mode (for compatibility with STM32F0 and L0) or "fully configurable" (new mode). The new sequencer fully configurable is more flexible but it has the drawback to manage channels only in range [0-14]. That's why PB11/12 (ADC_IN15/16) and also PC4/5 was not functional. |
Ah that makes sense, thanks! It's easy to setup in CubeMX/IDE but it's proving a bit over my head in Arduino, I found a function in the HAL driver that looks like it might be made for this, but adding it to setup isn't working - it compiles without errors but doesn't change pin behavior or the output of GetSequencerConfigurable: LL_ADC_REG_SetSequencerConfigurable(ADC1, LL_ADC_REG_SEQ_FIXED); I'll keep working at it, but do you have any hints to get it working? |
In CubeMX , there is an issue with |
Sorry about that, I missed the commit you added to #737 yesterday and was trying to set 'not fully configurable' on my own. I can confirm that all analog pins on the updated nucleo-g071 variant are now reading as expected, and on my custom board all 16 analog pins and the internal channels are working as expected too. Thank you very much for the fix! |
Welcome |
Describe the bug
Several ADC pins report incorrect values on STM32G0x1 series boards, I have tried separate hardware with G071RBT6 and G081RBT6 and both exhibit similar issues. On my Nucleo-G071RB board, 3 are not working correctly:
PB11/A4 - always returns 0
PB12/A5 - sketches performing analogRead of PB12 seem to be reading physical pin PA0 instead of PB12. Continuity tests with multimeter match the schematic - PB12 is physically connected to socket A5 and they are not shorted to PA0. With the board completely unplugged from power/peripherals I measure 10-15Mohm between PA0 and PB12, leading me to believe it is a software issue and not hardware.
PB0/D10 - similarly, sketches reading PB0 seem to be reading physical pin PB10.
On a board I made with a STM32G081RBT6 and a custom variant, I'm attempting to use all 16 analog pins and at least 4 are reading incorrectly - PB11, PB12, PC4 and PC5 readings don’t match the measured voltage on the pin. The variant I made has all of the analog pins in variant.h and variant.cpp in the same order as in the PinMap_ADC section of PeripheralPins.c, which seems to make PB0 work correctly compared to the Nucleo board, but PB11/PB12/PC4/PC5 haven’t worked in any order I’ve tried.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Plugging 3.3V into PB0, PB11 and PB12 will cause them to read 3.3V (4095), but instead they read .5-1v with high variability, as if floating.
Plugging 3.3V into PA0 and PB10 will only cause those pins to read 3.3V, but instead each causes 2 pins to read 3.3V.
Screenshots
Desktop (please complete the following information):
Board (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: