aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-10-15 22:07:33 +0100
committerGitHub <noreply@github.com>2021-10-15 22:07:33 +0100
commit40bc5a81923d16f6c9c2a3a05616b8cb1859b01e (patch)
treeb96d55846bbdabe9b94d0cc96210b83c135f3d56
parentd7f69dc6203fde5d9be8394667e675ed1130b74c (diff)
downloadqmk_firmware-40bc5a81923d16f6c9c2a3a05616b8cb1859b01e.tar.gz
qmk_firmware-40bc5a81923d16f6c9c2a3a05616b8cb1859b01e.zip
Enable CLI flashing via mdloader (#14729)
* Enable CLI flashing via mdloader * remove flag * Update qmk flash help
-rw-r--r--docs/feature_userspace.md2
-rw-r--r--lib/python/qmk/cli/flash.py14
-rw-r--r--platforms/arm_atsam/flash.mk11
3 files changed, 21 insertions, 6 deletions
diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md
index 115ab7175..8c617fe33 100644
--- a/docs/feature_userspace.md
+++ b/docs/feature_userspace.md
@@ -252,4 +252,4 @@ Also, holding Shift will add the flash target (`:flash`) to the command. Holdin
252 252
253And for the boards that lack a shift key, or that you want to always attempt the flashing part, you can add `FLASH_BOOTLOADER = yes` to the `rules.mk` of that keymap. 253And for the boards that lack a shift key, or that you want to always attempt the flashing part, you can add `FLASH_BOOTLOADER = yes` to the `rules.mk` of that keymap.
254 254
255?> This should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely. And this doesn't support BootloadHID or mdloader. 255?> This should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely.
diff --git a/lib/python/qmk/cli/flash.py b/lib/python/qmk/cli/flash.py
index c2d9e09c6..28e48a410 100644
--- a/lib/python/qmk/cli/flash.py
+++ b/lib/python/qmk/cli/flash.py
@@ -18,17 +18,21 @@ def print_bootloader_help():
18 """Prints the available bootloaders listed in docs.qmk.fm. 18 """Prints the available bootloaders listed in docs.qmk.fm.
19 """ 19 """
20 cli.log.info('Here are the available bootloaders:') 20 cli.log.info('Here are the available bootloaders:')
21 cli.echo('\tavrdude')
22 cli.echo('\tbootloadhid')
21 cli.echo('\tdfu') 23 cli.echo('\tdfu')
24 cli.echo('\tdfu-util')
25 cli.echo('\tmdloader')
26 cli.echo('\tst-flash')
27 cli.echo('\tst-link-cli')
28 cli.log.info('Enhanced variants for split keyboards:')
29 cli.echo('\tavrdude-split-left')
30 cli.echo('\tavrdude-split-right')
22 cli.echo('\tdfu-ee') 31 cli.echo('\tdfu-ee')
23 cli.echo('\tdfu-split-left') 32 cli.echo('\tdfu-split-left')
24 cli.echo('\tdfu-split-right') 33 cli.echo('\tdfu-split-right')
25 cli.echo('\tavrdude')
26 cli.echo('\tBootloadHID')
27 cli.echo('\tdfu-util')
28 cli.echo('\tdfu-util-split-left') 34 cli.echo('\tdfu-util-split-left')
29 cli.echo('\tdfu-util-split-right') 35 cli.echo('\tdfu-util-split-right')
30 cli.echo('\tst-link-cli')
31 cli.echo('\tst-flash')
32 cli.echo('For more info, visit https://docs.qmk.fm/#/flashing') 36 cli.echo('For more info, visit https://docs.qmk.fm/#/flashing')
33 37
34 38
diff --git a/platforms/arm_atsam/flash.mk b/platforms/arm_atsam/flash.mk
index f31d4b4d9..8152610ce 100644
--- a/platforms/arm_atsam/flash.mk
+++ b/platforms/arm_atsam/flash.mk
@@ -3,9 +3,20 @@
3# Architecture or project specific options 3# Architecture or project specific options
4# 4#
5 5
6MDLOADER_CLI ?= mdloader
7
8define EXEC_MDLOADER
9 $(MDLOADER_CLI) --first --download $(BUILD_DIR)/$(TARGET).bin --restart
10endef
11
12mdloader: bin
13 $(call EXEC_MDLOADER)
14
6flash: bin 15flash: bin
7ifneq ($(strip $(PROGRAM_CMD)),) 16ifneq ($(strip $(PROGRAM_CMD)),)
8 $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD) 17 $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD)
18else ifeq ($(strip $(ARM_ATSAM)),SAMD51J18A)
19 $(UNSYNC_OUTPUT_CMD) && $(call EXEC_MDLOADER)
9else 20else
10 $(PRINT_OK); $(SILENT) || printf "$(MSG_FLASH_ARCH)" 21 $(PRINT_OK); $(SILENT) || printf "$(MSG_FLASH_ARCH)"
11endif 22endif