Add direct firmware flashing from mpflash flash --file/--url with inference and interactive fallback#83
Open
Copilot wants to merge 1 commit into
Open
Add direct firmware flashing from mpflash flash --file/--url with inference and interactive fallback#83Copilot wants to merge 1 commit into
mpflash flash --file/--url with inference and interactive fallback#83Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
[WIP] Add ability to flash firmware directly from file or URL
Add direct firmware flashing from May 9, 2026
mpflash flash --file/--url with inference and interactive fallback
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
- Coverage 75.58% 73.87% -1.72%
==========================================
Files 54 54
Lines 3023 3173 +150
Branches 488 525 +37
==========================================
+ Hits 2285 2344 +59
- Misses 618 707 +89
- Partials 120 122 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Implemented direct firmware flashing via `--file` and `--url` options in the CLI. - Enhanced parameter inference for ESP32 boards and variants from firmware paths. - Added error handling for unsupported UF2-capable ports. - Updated tests to cover new direct flashing functionality and ensure correct behavior. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
16708aa to
02017b5
Compare
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.
This change enables flashing firmware directly from a local file or URL, without requiring a prior
addstep into the firmware database. It also infers target metadata from the path/URL and falls back to interactive selection when inference is incomplete (especially ESP32 variant cases).CLI surface update
flash:--file/-ffor local firmware binaries--url/-ufor remote firmware binaries-Fto avoid-fcollision.Direct firmware flow (no DB pre-registration)
cli_flashthat:port,board, andvariantfrom source hintsFirmwareobject to each flash task instead of requiring downloaded DB entries--serial,--port,--board,--variant, bootloader/retry flags, etc.) continue to apply.Inference + prompt behavior
?).URL download and lifecycle handling
finally, including flash-error paths.Targeted test coverage for new behavior
Example usage:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/micropython/micropython/home/REDACTED/work/mpflash/mpflash/.venv/bin/pytest pytest tests/cli/test_cli_flash.py(http block)REDACTED, pid is -1(http block)If you need me to access, download, or install something from one of these locations, you can either: