Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Add :flash target for UF2 bootloaders #16525

Merged
merged 1 commit into from Mar 7, 2022

Conversation

KarlK90
Copy link
Member

@KarlK90 KarlK90 commented Mar 4, 2022

Description

Add :flash target for UF2 bootloaders using the --deploy cli flag of the uf2conv.py util, which automatically scans for valid mounted UF2 bootloaders and flashes the UF2 file. Depends on microsoft/uf2#61 to filter out the error messages if the drive could not be found.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna
Copy link
Member

drashna commented Mar 7, 2022

Can confirm this works on macOS. However, output is ... not great.

 Trying again every 0.5s (Ctrl+C to cancel)Converting to uf2, output size: 172032, start address: 0x2000
No drive to deploy.
.Converting to uf2, output size: 172032, start address: 0x2000
No drive to deploy.
.Converting to uf2, output size: 172032, start address: 0x2000
No drive to deploy.
.Converting to uf2, output size: 172032, start address: 0x2000
No drive to deploy.
.Converting to uf2, output size: 172032, start address: 0x2000
No drive to deploy.

Assuming linked PR fixes that.

@KarlK90
Copy link
Member Author

KarlK90 commented Mar 7, 2022

Yes, exactly. You can try the change yourself. It is very small. After that it should work as expected.

@tzarc tzarc requested a review from a team March 7, 2022 09:46
@tzarc
Copy link
Member

tzarc commented Mar 7, 2022

Realistically the rp2040 lines should probably move to the RP2040 PR, though.

@KarlK90 KarlK90 force-pushed the feature/add-uf2-flash-target branch from 8d7bcfe to 00a1778 Compare March 7, 2022 10:02
@github-actions github-actions bot added the python label Mar 7, 2022
@KarlK90
Copy link
Member Author

KarlK90 commented Mar 7, 2022

Realistically the rp2040 lines should probably move to the RP2040 PR, though.

Done that, I also included an update of the uf2conv.py util with the PR to the uf2 repo already included. Although it is not merged at this point, but I don't see a reason why this should not be merged. So this is fine?

@tzarc
Copy link
Member

tzarc commented Mar 7, 2022

Done that, I also included an update of the uf2conv.py util with the PR to the uf2 repo already included. Although it is not merged at this point, but I don't see a reason why this should not be merged. So this is fine?

Ah, I did the same in the ChibiOS 21.11.1 merge. Probably the same version, now.

...using the --deploy cli flag of the uf2conv.py util, which automatically
scans for valid mounted UF2 bootloaders and flashes the UF2 file.

This also updates the uf2conv.py tools to the lastest state with a patch
to the error() function to print to stderr by default. This is also PRed
to the regular microsoft uf2 repo.
@KarlK90 KarlK90 force-pushed the feature/add-uf2-flash-target branch from 00a1778 to 6a251d8 Compare March 7, 2022 10:09
@KarlK90
Copy link
Member Author

KarlK90 commented Mar 7, 2022

Pretty much, only the error line was changed. Great that the ChibiOS merge has landed.

@tzarc
Copy link
Member

tzarc commented Mar 7, 2022

Cool, good stuff.

@KarlK90
Copy link
Member Author

KarlK90 commented Mar 7, 2022

The failing check is a python lint in the vendor provided uf2conv python file. So probably won't fix.

@drashna drashna merged commit 2bface8 into qmk:develop Mar 7, 2022
waffle87 pushed a commit to waffle87/qmk_firmware that referenced this pull request Mar 23, 2022
0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants