aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/chibios.mk
diff options
context:
space:
mode:
authorSergey Vlasov <sigprof@gmail.com>2020-08-12 18:53:53 +0300
committerJames Young <18669334+noroadsleft@users.noreply.github.com>2020-08-29 14:30:02 -0700
commitd00ac5dfb6388957d51f2666d8bd223bd3529151 (patch)
tree6bdb94a82495c115be91dd2019edcc179a5401da /tmk_core/chibios.mk
parentea43bc8972d254e75062ac20472b156fd3d92ddc (diff)
downloadqmk_firmware-d00ac5dfb6388957d51f2666d8bd223bd3529151.tar.gz
qmk_firmware-d00ac5dfb6388957d51f2666d8bd223bd3529151.zip
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/chibios.mk')
-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 4e8abc9be..a218488a1 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -318,12 +318,14 @@ ifneq ("$(SERIAL)","")
318endif 318endif
319 319
320ST_LINK_ARGS ?= 320ST_LINK_ARGS ?=
321ST_FLASH_ARGS ?=
321 322
322# List any extra directories to look for libraries here. 323# List any extra directories to look for libraries here.
323EXTRALIBDIRS = $(RULESPATH)/ld 324EXTRALIBDIRS = $(RULESPATH)/ld
324 325
325DFU_UTIL ?= dfu-util 326DFU_UTIL ?= dfu-util
326ST_LINK_CLI ?= st-link_cli 327ST_LINK_CLI ?= st-link_cli
328ST_FLASH ?= st-flash
327 329
328define EXEC_DFU_UTIL 330define EXEC_DFU_UTIL
329 until $(DFU_UTIL) -l | grep -q "Found DFU"; do\ 331 until $(DFU_UTIL) -l | grep -q "Found DFU"; do\
@@ -357,6 +359,9 @@ dfu-util-split-right: dfu-util
357st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter 359st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
358 $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst 360 $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
359 361
362st-flash: $(BUILD_DIR)/$(TARGET).hex sizeafter
363 $(ST_FLASH) $(ST_FLASH_ARGS) --reset --format ihex write $(BUILD_DIR)/$(TARGET).hex
364
360 365
361# Autodetect teensy loader 366# Autodetect teensy loader
362ifndef TEENSY_LOADER_CLI 367ifndef TEENSY_LOADER_CLI