Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ OBJCOPY := $(PREFIX)-objcopy
OBJDUMP := $(PREFIX)-objdump
GDB := $(PREFIX)-gdb
STFLASH = $(shell which st-flash)
DFU_UTIL = $(shell which dfu-util)
STYLECHECK := /checkpatch.pl
STYLECHECKFLAGS := --no-tree -f --terse --mailback
STYLECHECKFILES := $(shell find . -name '*.[ch]')
Expand Down Expand Up @@ -153,6 +154,7 @@ list: $(BINARY).list

images: $(BINARY).images
flash: $(BINARY).flash
dfu: $(BINARY).dfu

# Either verify the user provided LDSCRIPT exists, or generate it.
ifeq ($(strip $(DEVICE)),)
Expand Down Expand Up @@ -258,6 +260,15 @@ else
$(*).elf
endif

ifeq ($(VID),)
ifeq ($(PID),)
VID := 1209
PID := db42
endif
endif
%.dfu: %.bin
@printf " DFU $(*).bin\n"
$(Q)$(DFU_UTIL) -d $(VID):$(PID) -D $(*).bin
.PHONY: images clean stylecheck styleclean elf bin hex srec list

-include $(OBJS:.o=.d)