Merge pull request #2150 from kkitayam/flash-jlink-for-windows

Fix flash-jlink target to work on Windows command prompt
This commit is contained in:
Ha Thach 2023-07-18 22:33:57 +07:00 committed by GitHub
commit e3d4385280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,19 +99,16 @@ endif
JLINK_IF ?= swd
# Jlink script
define jlink_script
halt
loadfile $^
r
go
exit
endef
export jlink_script
$(BUILD)/$(BOARD).jlink: $(BUILD)/$(PROJECT).hex
@echo halt > $@
@echo loadfile $^ >> $@
@echo r >> $@
@echo go >> $@
@echo exit >> $@
# Flash using jlink
flash-jlink: $(BUILD)/$(PROJECT).hex
@echo "$$jlink_script" > $(BUILD)/$(BOARD).jlink
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
flash-jlink: $(BUILD)/$(BOARD).jlink
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $<
# Flash STM32 MCU using stlink with STM32 Cube Programmer CLI
flash-stlink: $(BUILD)/$(PROJECT).elf