Skip to content

Commit 635be0a

Browse files
author
Zachary Crockett
committed
Merge pull request particle-iot#323 from spark/feature/dfu-suffix
Add DFU suffix to .bin file
2 parents d6b985d + 8d62c8d commit 635be0a

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

build/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ applications/
44
*.elf
55
*.bin
66
*.map
7-
*.hex
7+
*.hex
8+
*.dfu

build/makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ hex: $(TARGETDIR)$(TARGET).hex
172172

173173
# Program the core using dfu-util. The core should have been placed
174174
# in bootloader mode before invoking 'make program-dfu'
175-
program-dfu: $(TARGETDIR)$(TARGET).bin
175+
program-dfu: $(TARGETDIR)$(TARGET).dfu
176176
@echo Flashing using dfu:
177177
$(DFU) -d 1d50:607f -a 0 -s 0x08005000:leave -D $<
178178

@@ -200,6 +200,11 @@ size: $(TARGETDIR)$(TARGET).elf
200200
$(OBJCOPY) -O binary $< $@
201201
@echo
202202

203+
# Create a DFU file from bin file
204+
%.dfu: %.bin
205+
@cp $< $@
206+
$(DFUSUFFIX) -v 1d50 -p 607f -a $@
207+
203208
$(TARGETDIR)$(TARGET).elf : check_external_deps $(ALLOBJ)
204209
@echo Building target: $@
205210
@echo Invoking: ARM GCC C++ Linker

build/tools.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ AR = $(GCC_PREFIX)ar
88
OBJCOPY = $(GCC_PREFIX)objcopy
99
SIZE = $(GCC_PREFIX)size
1010
DFU = dfu-util
11+
DFUSUFFIX = dfu-suffix
1112
CURL = curl
1213

1314
RM = rm -f

0 commit comments

Comments
 (0)