Add ‘program’ make target using fwtool

This commit is contained in:
fruchti 2023-09-23 14:08:27 +02:00
parent 1ac489e1b1
commit e5e4e07546

View file

@ -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: