From 6c836fc898ece72904b08c3c1d719d5b1562037f Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 5 Mar 2025 06:06:29 -0500 Subject: [PATCH] flashtool: don't allow MCU mismatches Raise a FlashError if Katapult's MCU does not match the MCU detected in klipper.bin. If a user wants to flash a binary built for a different they can rename klipper.bin, which will bypass detection. Signed-off-by: Eric Callahan --- scripts/flashtool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/flashtool.py b/scripts/flashtool.py index b5d9d93..2fa2b3c 100755 --- a/scripts/flashtool.py +++ b/scripts/flashtool.py @@ -301,9 +301,9 @@ class CanFlasher: if self.klipper_dict is not None: bin_mcu = self.klipper_dict.get("config", {}).get("MCU", "") if bin_mcu and bin_mcu != mcu_type: - output_line( - "WARNING: MCU returned by Katapult does not match MCU" - "stored in klipper.bin.\n" + raise FlashError( + "MCU returned by Katapult does not match MCU" + "identified in klipper.bin.\n" f"Katapult MCU: {mcu_type}\n" f"Klipper Binary MCU: {bin_mcu}" )