mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-18 20:42:24 +00:00
adding flash (jlink)
This commit is contained in:
parent
e49efde730
commit
d56e7fd913
@ -112,6 +112,10 @@ $(BUILD)/$(BOARD)-firmware.bin: $(BUILD)/$(BOARD)-firmware.elf
|
|||||||
@echo CREATE $@
|
@echo CREATE $@
|
||||||
@$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
|
@$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
|
||||||
|
|
||||||
|
$(BUILD)/$(BOARD)-firmware.hex: $(BUILD)/$(BOARD)-firmware.elf
|
||||||
|
@echo CREATE $@
|
||||||
|
@$(OBJCOPY) -O ihex $^ $@
|
||||||
|
|
||||||
# We set vpath to point to the top of the tree so that the source files
|
# We set vpath to point to the top of the tree so that the source files
|
||||||
# can be located. By following this scheme, it allows a single build rule
|
# can be located. By following this scheme, it allows a single build rule
|
||||||
# to be used to compile all .c files.
|
# to be used to compile all .c files.
|
||||||
@ -139,6 +143,20 @@ $(BUILD)/obj/%.o: %.S
|
|||||||
@echo AS $(notdir $@)
|
@echo AS $(notdir $@)
|
||||||
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
|
@$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
# Flash binary using Jlink
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
JLINKEXE = JLink.exe
|
||||||
|
else
|
||||||
|
JLINKEXE = JLinkExe
|
||||||
|
endif
|
||||||
|
|
||||||
|
flash: $(BUILD)/$(BOARD)-firmware.hex
|
||||||
|
@echo halt > $(BUILD)/$(BOARD).jlink
|
||||||
|
@echo loadfile $^ >> $(BUILD)/$(BOARD).jlink
|
||||||
|
@echo go >> $(BUILD)/$(BOARD).jlink
|
||||||
|
@echo exit >> $(BUILD)/$(BOARD).jlink
|
||||||
|
#$(JLINKEXE) -device stm32f407vg -if swd -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
|
||||||
|
|
||||||
size: $(BUILD)/$(BOARD)-firmware.elf
|
size: $(BUILD)/$(BOARD)-firmware.elf
|
||||||
-@echo ''
|
-@echo ''
|
||||||
@$(SIZE) $<
|
@$(SIZE) $<
|
||||||
|
@ -41,7 +41,6 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# flash target using on-board stlink or jlink
|
# flash target using on-board stlink
|
||||||
flash: $(BUILD)/$(BOARD)-firmware.elf
|
flash-stlink: $(BUILD)/$(BOARD)-firmware.elf
|
||||||
$(STM32Prog) --connect port=swd --write $< --go
|
$(STM32Prog) --connect port=swd --write $< --go
|
||||||
#JLinkExe
|
|
Loading…
x
Reference in New Issue
Block a user