mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-24 16:43:39 +00:00
add flash target for stm32 board using stm32cubeprogammger cli
This commit is contained in:
parent
57d069981f
commit
0ff7d609f0
@ -95,6 +95,8 @@ SRC_S := $(SRC_S:.S=.s)
|
||||
OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o))
|
||||
OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=.o))
|
||||
|
||||
# Set all as default goal
|
||||
.DEFAULT_GOAL := all
|
||||
all: $(BUILD)/$(BOARD)-firmware.bin size
|
||||
|
||||
OBJ_DIRS = $(sort $(dir $(OBJ)))
|
||||
@ -108,7 +110,7 @@ $(BUILD)/$(BOARD)-firmware.elf: $(OBJ)
|
||||
|
||||
$(BUILD)/$(BOARD)-firmware.bin: $(BUILD)/$(BOARD)-firmware.elf
|
||||
@echo CREATE $@
|
||||
$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
|
||||
@$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
|
||||
|
||||
# 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
|
||||
|
@ -25,3 +25,10 @@ INC += \
|
||||
|
||||
VENDOR = st
|
||||
CHIP_FAMILY = stm32f4
|
||||
|
||||
# Path to STM32 Cube Programmer CLI
|
||||
STM32Prog = STM32_Programmer_CLI
|
||||
|
||||
# flash target to download
|
||||
flash: $(BUILD)/$(BOARD)-firmware.elf
|
||||
$(STM32Prog) --connect port=swd --write $< --go
|
||||
|
Loading…
x
Reference in New Issue
Block a user