feat(scripts): add MCU flash tool with TUI, JSON, and headless modes#194
Open
gmmcosta15 wants to merge 6 commits intodevfrom
Open
feat(scripts): add MCU flash tool with TUI, JSON, and headless modes#194gmmcosta15 wants to merge 6 commits intodevfrom
gmmcosta15 wants to merge 6 commits intodevfrom
Conversation
Adds flash_mcus.sh — a Bash tool for flashing Klipper firmware to all supported Blocks printer MCUs. Supports an interactive TUI, --list-json for JSON output, --flash / --flash-all for headless use, and --force to bypass version checks. Flash methods: CAN via Katapult, USB Katapult, BOOTSEL/picoboot, STM32 DFU. UUID auto-discovery from printer.cfg; live firmware version query from Moonraker API; auto-starts Klipper/Moonraker if stopped. Bundles mcu_config/ files for EBB CAN (STM32G0B1), Eddy Duo (RP2040), and Octopus (STM32H723) with their Katapult bootloader counterparts. Adds curl and jq to system-dependencies.json (required by flash_mcus.sh).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Select the type:
This Pull Request adds:
scripts/flash_mcus.sh— a Bash MCU flasher for Blocks 3D printers--list-json,--flash <name>,--flash-all) designed for PyQt6 panel integrationprinter.cfg; live firmware version query from Moonraker APIcurlandjqtosystem-dependencies.jsonMotivation
Flashing Klipper firmware to the printer's MCUs (Octopus Pro, EBB-36 toolhead, Eddy Duo probe) has historically been a fully manual process: building firmware with make menuconfig, determining the right flash transport for each board (CAN via Katapult, STM32 DFU, RP2040 BOOTSEL), looking up CAN UUIDs from printer.cfg, and invoking the right tool in the right order with the added constraint that the CAN bridge MCU (Octopus) must be flashed last or it drops can0 mid-session.
This is error-prone, time-consuming, and a significant source of friction during printer firmware updates. It also blocks building a future GUI panel in BlocksScreen: the UI needs a way to discover MCU state (detected, current version, needs update) and trigger flashing without re-implementing all of this logic in Python.
Future work