Skip to content

Commit

Permalink
Add st-flash flash target (qmk#9964)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sigprof authored and drashna committed Sep 30, 2020
1 parent 94e676d commit 2cc3563
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tmk_core/chibios.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2cc3563

Please sign in to comment.