Skip to content

Check cfloader inputs before entering boot loader#783

Merged
stefanthorstenson merged 10 commits intomasterfrom
stefan/779-trying-to-flash-using-cfloader
Feb 25, 2026
Merged

Check cfloader inputs before entering boot loader#783
stefanthorstenson merged 10 commits intomasterfrom
stefan/779-trying-to-flash-using-cfloader

Conversation

@stefanthorstenson
Copy link
Copy Markdown
Contributor

@stefanthorstenson stefanthorstenson commented Feb 24, 2026

Inputs to cfloader tool have not been sanitized and error-checked, which for example can put the Crazyflie in bootloader mode even though the input commands and arguments are incorrect.

  • Check cfloader inputs before entering boot loader, and exit on error
  • Clarify help prints

Fixes #779

@stefanthorstenson
Copy link
Copy Markdown
Contributor Author

Help section:
image

@stefanthorstenson
Copy link
Copy Markdown
Contributor Author

Checks that will now throw an error before entering bootloader mode:
image

image

@stefanthorstenson stefanthorstenson changed the title Check inputs before entering boot loader Check cfloader inputs before entering boot loader Feb 24, 2026
@ataffanel ataffanel requested a review from Copilot February 25, 2026 09:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the cfloader CLI to validate flash inputs earlier and improve the readability of the built-in help text, reducing the chance of entering bootloader operations with invalid parameters.

Changes:

  • Reworks --help/usage output into clearer “Actions” and “CRTP options” sections.
  • Validates flash inputs before bootloader operations (file existence and target requirement for non-.zip images).
  • Simplifies the flash execution path by removing redundant runtime checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cfloader/__init__.py Outdated
Comment thread src/cfloader/__init__.py Outdated
Comment thread src/cfloader/__init__.py
Comment thread src/cfloader/__init__.py Outdated
Copy link
Copy Markdown
Member

@ataffanel ataffanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most copilot's comments make sense. I added one note about file read-ability.

Great improvement otherwise!

Comment thread src/cfloader/__init__.py Outdated
Copy link
Copy Markdown
Member

@ataffanel ataffanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@stefanthorstenson stefanthorstenson merged commit e0b85c5 into master Feb 25, 2026
1 check passed
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.

Trying to flash using cfloader with non-existing file puts Crazyflie in booloader mode

3 participants