diff options
Diffstat (limited to 'platforms/arm_atsam/flash.mk')
| -rw-r--r-- | platforms/arm_atsam/flash.mk | 11 |
1 files changed, 11 insertions, 0 deletions
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 | ||
| 6 | MDLOADER_CLI ?= mdloader | ||
| 7 | |||
| 8 | define EXEC_MDLOADER | ||
| 9 | $(MDLOADER_CLI) --first --download $(BUILD_DIR)/$(TARGET).bin --restart | ||
| 10 | endef | ||
| 11 | |||
| 12 | mdloader: bin | ||
| 13 | $(call EXEC_MDLOADER) | ||
| 14 | |||
| 6 | flash: bin | 15 | flash: bin |
| 7 | ifneq ($(strip $(PROGRAM_CMD)),) | 16 | ifneq ($(strip $(PROGRAM_CMD)),) |
| 8 | $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD) | 17 | $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD) |
| 18 | else ifeq ($(strip $(ARM_ATSAM)),SAMD51J18A) | ||
| 19 | $(UNSYNC_OUTPUT_CMD) && $(call EXEC_MDLOADER) | ||
| 9 | else | 20 | else |
| 10 | $(PRINT_OK); $(SILENT) || printf "$(MSG_FLASH_ARCH)" | 21 | $(PRINT_OK); $(SILENT) || printf "$(MSG_FLASH_ARCH)" |
| 11 | endif | 22 | endif |
