diff options
author | Drashna Jaelre <drashna@live.com> | 2019-08-20 15:39:24 -0700 |
---|---|---|
committer | Florian Didron <fdidron@users.noreply.github.com> | 2019-09-05 16:15:42 +0900 |
commit | f82d2aedb5f1ce0409f9d54b49c25663debdd12f (patch) | |
tree | 257b80594db5f440fba134e8b5ec0872d5710c38 /tmk_core/chibios.mk | |
parent | 6512732a31f5db266be39a07eb01fd3711dfbe9e (diff) |
Add a universal flash command for cli (#6224)
* Add universal flash command
* Add bootloader info to I:C boards
* Add support for ATSAM
* Add messages for flash target
* Message cleanup
* Add USB ASP Flashing target
* Make usbasp target more universal
* Add phoney target for usbasp
* Clarify error message when bootloader isn't matched
Diffstat (limited to 'tmk_core/chibios.mk')
-rw-r--r-- | tmk_core/chibios.mk | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 4aebb47762..eee520467d 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -234,9 +234,12 @@ qmk: $(BUILD_DIR)/$(TARGET).bin zip $(TARGET).qmk -urj $(BUILD_DIR)/$(TARGET).json printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk -dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter +define EXEC_DFU_UTIL $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin +endef +dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter + $(call EXEC_DFU_UTIL) ifneq ($(strip $(TIME_DELAY)),) TIME_DELAY = $(strip $(TIME_DELAY)) @@ -253,7 +256,7 @@ dfu-util-wait: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter done; \ echo "Flashing $(TARGET).bin" ;\ sleep 1 ;\ - $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin + $(call EXEC_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 @@ -268,7 +271,24 @@ ifndef TEENSY_LOADER_CLI endif endif -teensy: $(BUILD_DIR)/$(TARGET).hex cpfirmware sizeafter +define EXEC_TEENSY $(TEENSY_LOADER_CLI) -mmcu=$(MCU_LDSCRIPT) -w -v $(BUILD_DIR)/$(TARGET).hex +endef + +teensy: $(BUILD_DIR)/$(TARGET).hex cpfirmware sizeafter + $(call EXEC_TEENSY) bin: $(BUILD_DIR)/$(TARGET).bin sizeafter + $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; + + +flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter +ifeq ($(strip $(BOOTLOADER)),dfu) + $(call EXEC_DFU_UTIL) +else ifeq ($(strip $(MCU_FAMILY)),KINETIS) + $(call EXEC_TEENSY) +else ifeq ($(strip $(MCU_FAMILY)),STM32) + $(call EXEC_DFU_UTIL) +else + $(PRINT_OK); $(SILENT) || printf "$(MSG_FLASH_BOOTLOADER)" +endif |