diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py
index f8eae1cf6..c926df631 100644
--- a/klippy/extras/tmc.py
+++ b/klippy/extras/tmc.py
@@ -371,6 +371,7 @@ class TMCCommandHelper:
             logging.info("TMC %s failed to init: %s", self.name, str(e))
     # get_status information export
     def get_status(self, eventtime=None):
+        cpos = None
         if self.stepper is not None and self.mcu_phase_offset is not None:
             cpos = self.stepper.mcu_to_commanded_position(self.mcu_phase_offset)
         res = {'mcu_phase_offset': self.mcu_phase_offset,