Lev Voronov 19ca09d6ee stm32: only calibrate each n32g45x adc block once
gpio_adc_setup() enabled and calibrated an adc block every time one of
its channels was configured.  The n32g455 puts PA0 and PA1 on the same
block, so configuring the second pin recalibrated an adc that was
already running: from then on that block could no longer complete a
conversion for the newly added channel, and the mcu spent its time
polling an adc that never signalled completion.

On a FlashForge AD5M toolhead this left the hotend thermistor reading
0C while the mcu busy time reported in the periodic stats grew by more
than a factor of two.

Enable the clock of the block that is actually needed rather than all
four, and use that clock enable bit to tell whether the block still
needs to be initialised, the way stm32/adc.c uses is_enabled_pclock().

Signed-off-by: Lev Voronov <minicx@disroot.org>
2026-09-28 13:04:28 -04:00
2026-09-18 22:31:31 -04:00

Welcome to the Klipper project!

Klipper

https://www.klipper3d.org/

The Klipper firmware controls 3d-Printers. It combines the power of a general purpose computer with one or more micro-controllers. See the features document for more information on why you should use the Klipper software.

Start by installing Klipper software.

Klipper software is Free Software. See the license or read the documentation. We depend on the generous support from our sponsors.

S
Description
Klipper is a 3d-printer firmware
Readme GPL-3.0
341 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 94.9%
Python 3.2%
Jupyter Notebook 1.5%
C++ 0.2%