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

CLI: Teaching the CLI to flash binaries #16584

Merged
merged 30 commits into from
Aug 20, 2022
Merged

CLI: Teaching the CLI to flash binaries #16584

merged 30 commits into from
Aug 20, 2022

Conversation

Erovia
Copy link
Member

@Erovia Erovia commented Mar 8, 2022

Description

Update qmk flash to flash compiled binaries.
Supporting the following bootloaders:

  • Atmel DFU
  • Caterina
  • HalfKay/QMK HID
  • STM32 DFU
  • STM32duino
  • APM32 DFU
  • USBaspLoader
  • USBtinyISP

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).

@Erovia Erovia requested a review from a team March 8, 2022 17:49
@drashna drashna requested a review from a team March 8, 2022 18:01
@github-actions github-actions bot added the core label Mar 8, 2022
@drashna
Copy link
Member

drashna commented Mar 8, 2022

I've tested avr's dfu, stm32 dfu, caterina, and hid bootloader (halfkey, lufa hid) and can verify that they work on Windows and MacOS (Intel)

lib/python/qmk/flashers.py Show resolved Hide resolved
lib/python/qmk/constants.py Outdated Show resolved Hide resolved
lib/python/qmk/constants.py Outdated Show resolved Hide resolved
lib/python/qmk/constants.py Outdated Show resolved Hide resolved
lib/python/qmk/cli/flash.py Outdated Show resolved Hide resolved
lib/python/qmk/flashers.py Outdated Show resolved Hide resolved
lib/python/qmk/flashers.py Outdated Show resolved Hide resolved
lib/python/qmk/cli/doctor/linux.py Outdated Show resolved Hide resolved
lib/python/qmk/flashers.py Outdated Show resolved Hide resolved
lib/python/qmk/flashers.py Outdated Show resolved Hide resolved
lib/python/qmk/flashers.py Show resolved Hide resolved
lib/python/qmk/flashers.py Show resolved Hide resolved
lib/python/qmk/flashers.py Outdated Show resolved Hide resolved
@Erovia Erovia requested review from fauxpark and sigprof March 9, 2022 19:59
@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Jul 22, 2022
Erovia added 3 commits August 13, 2022 17:42
Check if 'hid_bootloader_cli' is available and use it as a fallback for
HalfKay.
@keyboard-magpie keyboard-magpie removed the stale Issues or pull requests that have become inactive without resolution. label Aug 13, 2022
lib/python/qmk/constants.py Show resolved Hide resolved
lib/python/qmk/flashers.py Show resolved Hide resolved
@tzarc tzarc requested review from sigprof and tzarc August 19, 2022 03:18
@spidey3
Copy link
Contributor

spidey3 commented Aug 19, 2022

Tested on Linux with boards using dfu-programmer

@tzarc
Copy link
Member

tzarc commented Aug 20, 2022

On Windows -- tested with:

  • 32U4 -- dfu-programmer -- iris/rev4
  • 32A -- usbasp -- coseyfannituti/mysterium
  • STM32G474 -- dfu-util -- tzarc/djinn/rev1

On Windows -- Failing:

  • GD32VF103 -- dfu-util -- handwired/onekey/sipeed_longan_nano
[nickb@nickb-desktop qmk_firmware]$ qmk flash handwired_onekey_sipeed_longan_nano_reset.bin
Flashing binary firmware...
Please reset your keyboard into bootloader mode now!
Press Ctrl-C to exit.

<class 'TypeError'>
☒ 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "E:/QMK_MSYS/mingw64/lib/python3.10/site-packages/milc/milc.py", line 528, in __call__
    return self.__call__()
  File "E:/QMK_MSYS/mingw64/lib/python3.10/site-packages/milc/milc.py", line 533, in __call__
    return self._subcommand(self)
  File "E:/qmk_firmware/lib/python/qmk/decorators.py", line 27, in wrapper
    return func(*args, **kwargs)
  File "E:/qmk_firmware/lib/python/qmk/decorators.py", line 47, in wrapper
    return func(*args, **kwargs)
  File "E:/qmk_firmware/lib/python/qmk/cli/flash.py", line 72, in flash
    err, msg = flasher(cli.args.mcu, cli.args.filename)
  File "E:/qmk_firmware/lib/python/qmk/flashers.py", line 188, in flasher
    _flash_dfu_util(details, file.name)
  File "E:/qmk_firmware/lib/python/qmk/flashers.py", line 155, in _flash_dfu_util
    if details[0] == '1eaf' and details[1] == '0003':
TypeError: 'NoneType' object is not subscriptable

@tzarc
Copy link
Member

tzarc commented Aug 20, 2022

And gd32v is now working.

tzarc and others added 3 commits August 20, 2022 12:12
@tzarc tzarc merged commit 5e2ffe7 into qmk:develop Aug 20, 2022
@evils evils mentioned this pull request Aug 21, 2022
14 tasks
nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
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.

8 participants