Skip to content

tmc: upstream catchup#883

Open
rogerlz wants to merge 19 commits intomainfrom
klipper-pr-7193
Open

tmc: upstream catchup#883
rogerlz wants to merge 19 commits intomainfrom
klipper-pr-7193

Conversation

@rogerlz
Copy link
Copy Markdown
Contributor

@rogerlz rogerlz commented May 4, 2026

Cherry-picks the TMC catchup chain that brings Kalico's TMC drivers up to date with upstream Klipper, culminating in TMC2240 StealthChop (SG4) sensorless homing support.

Upstream commits included (in cherry-pick / merge order):

Kalico-side commits on top:

  • test/test_tmc_homing.py: baseline unit tests (15) covering the TMCVirtualPinHelper save/restore round trip and Kalico's home_current switching logic, so the homing refactor cannot silently regress.
  • homing.py first-home finally now restores run current on failure (was only resetting accel; failed sensorless homing left the stepper at home_current until the next successful home).

rogerlz and others added 19 commits May 5, 2026 00:42
Add unit tests covering the save/restore invariant of TMCVirtualPinHelper
(pwmthrs, tcoolthrs, thigh, en_pwm_mode, diag_pin_field) and the Kalico
home_current switching logic in BaseTMCCurrentHelper. Establishes a
baseline so the upstream TMC cleanup/refactor PRs (#7154, #7193) cannot
silently regress the behavior.

Signed-off-by: Rogerio Goncalves <rogerlz@gmail.com>
Currently TMC spi just drop the data that could be useful.
Export that data.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Reported by @poernahi.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This register is readable and contains the overvoltage and overtemp
threshold settings.

Signed-off-by: Hendrik Poernama <poernahi@gmail.com>
Code movement only; no code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move shutdown checking from _do_enable() and _dos_disable() to new
enable_disable_cb().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's possible for a motor disable request to occur while processing a
previous motor enable.  Use a reactor mutex to ensure the two events
are processed serially.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The event handler is registered with an incorrect event name, causing the handler to never be called.

Signed-off-by: Maksim Bolgov maksim8024@gmail.com
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Upstream Klipper does not use Ruff; cherry-picks into Kalico need a
format pass to match the project style (double quotes, line wrapping,
blank lines between class members). This commit applies ruff-format
over the files touched by the #6592/#6987/#7154/#7159/#7193 sync.

Signed-off-by: Rogerio Goncalves <rogerlz@gmail.com>
If the first homing_move() raises (e.g. endstop never triggers during
sensorless homing), the first try/finally only resets acceleration and
leaves the stepper at home_current. The subsequent restore on
success/second-home never executes, so the printer runs with
home_current instead of run_current until the next successful home.

Mirror the existing pattern from the second-home finally (restore both
accel and current) so the failure path is symmetric.

Signed-off-by: Rogerio Goncalves <rogerlz@gmail.com>
@rogerlz rogerlz force-pushed the klipper-pr-7193 branch from 910aaad to c6bea9f Compare May 4, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants