summaryrefslogtreecommitdiff
path: root/examples/rules.mk
diff options
context:
space:
mode:
authorgsnxp <[email protected]>2020-02-17 13:06:44 -0800
committerGitHub <[email protected]>2020-02-17 13:06:44 -0800
commit616562a48aa1d8ce2f4ca71f6e780a8bec9fb5eb (patch)
tree709e6aaff866c54087d9fc0f6ee80270394ccda9 /examples/rules.mk
parent6b3eb5f17386d21b2b9f0bad2d1c06b73f07cb5f (diff)
parent0d3a7257f54db8b867be35d80b9c1fda85f656d3 (diff)
Merge pull request #1 from hathach/master
syncing to source repo
Diffstat (limited to 'examples/rules.mk')
-rw-r--r--examples/rules.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/rules.mk b/examples/rules.mk
index 8f0e415af..87c7e9649 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -109,7 +109,7 @@ size: $(BUILD)/$(BOARD)-firmware.elf
clean:
rm -rf $(BUILD)
-
+
# Flash binary using Jlink
ifeq ($(OS),Windows_NT)
JLINKEXE = JLink.exe
@@ -120,8 +120,13 @@ endif
# Flash using jlink
flash-jlink: $(BUILD)/$(BOARD)-firmware.hex
@echo halt > $(BUILD)/$(BOARD).jlink
+ @echo r > $(BUILD)/$(BOARD).jlink
@echo loadfile $^ >> $(BUILD)/$(BOARD).jlink
@echo r >> $(BUILD)/$(BOARD).jlink
@echo go >> $(BUILD)/$(BOARD).jlink
@echo exit >> $(BUILD)/$(BOARD).jlink
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
+
+# flash STM32 MCU using stlink with STM32 Cube Programmer CLI
+flash-stlink: $(BUILD)/$(BOARD)-firmware.elf
+ STM32_Programmer_CLI --connect port=swd --write $< --go