summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorSergey Vlasov <sigprof@gmail.com>2020-08-12 18:53:53 +0300
committerDrashna Jael're <drashna@live.com>2020-09-30 03:21:33 -0700
commit2cc35632ed419f34c783c34fe347b67780f5e51c (patch)
tree07de12df7b5c69eeab33fe3e12a43f0a8f8dc1d5 /tmk_core
parent94e676d05b4b7b434eceb378d53b62845c30e84e (diff)
Add `st-flash` flash target (#9964)
* Add `st-flash` flash target Add support for flashing the firmware via the `st-flash` utility from the STLink Tools package (https://github.com/stlink-org/stlink). * Add `st-flash` to the `qmk flash -b` output
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 4e8abc9be6..a218488a19 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -318,12 +318,14 @@ ifneq ("$(SERIAL)","")
endif
ST_LINK_ARGS ?=
+ST_FLASH_ARGS ?=
# List any extra directories to look for libraries here.
EXTRALIBDIRS = $(RULESPATH)/ld
DFU_UTIL ?= dfu-util
ST_LINK_CLI ?= st-link_cli
+ST_FLASH ?= st-flash
define EXEC_DFU_UTIL
until $(DFU_UTIL) -l | grep -q "Found DFU"; do\
@@ -357,6 +359,9 @@ dfu-util-split-right: dfu-util
st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
$(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
+st-flash: $(BUILD_DIR)/$(TARGET).hex sizeafter
+ $(ST_FLASH) $(ST_FLASH_ARGS) --reset --format ihex write $(BUILD_DIR)/$(TARGET).hex
+
# Autodetect teensy loader
ifndef TEENSY_LOADER_CLI