From e5e4e07546e8937e13533aecd8f23fb646a8dbf6 Mon Sep 17 00:00:00 2001 From: fruchti Date: Sat, 23 Sep 2023 14:08:27 +0200 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=98program=E2=80=99=20make=20target?= =?UTF-8?q?=20using=20fwtool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stm32f103t8u6/makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/stm32f103t8u6/makefile b/stm32f103t8u6/makefile index 543e931..268ada9 100644 --- a/stm32f103t8u6/makefile +++ b/stm32f103t8u6/makefile @@ -108,10 +108,20 @@ incrementalbuild: $(BUILD_TARGETS) $(Q)$(SIZE) $(BUILD_DIR)/$(PROJECT).elf @echo "$(CURRENT_BUILD_CONFIG)" > $(BUILD_DIR)/build_config.txt -.PHONY: program -program: $(BUILD_DIR)/$(PROJECT).bin +.PHONY: program program_fwtool program_stlink +program: program_fwtool + +program_stlink: $(BUILD_DIR)/$(PROJECT).bin @#if ps -e | grep openocd ; then arm-none-eabi-gdb -batch -x flash.gdb ; else st-flash --reset write $(BUILD_DIR)/$(PROJECT).bin 0x8000000 ; fi - st-flash --reset write $(BUILD_DIR)/$(PROJECT).bin 0x08000800 + @echo " PG $@" + $(Q)st-flash --reset write $(BUILD_DIR)/$(PROJECT).bin 0x08000800 + +program_fwtool: ../fwtool/target/release/fwtool $(BUILD_DIR)/$(PROJECT).bin + @echo " PG $(BUILD_DIR)/$(PROJECT).bin" + $(Q)$< flash $(BUILD_DIR)/$(PROJECT).bin + +../fwtool/target/release/fwtool: + cd ../fwtool && CC= CFLAGS= cargo build --release .PHONY: clean clean: